584,842 active members*
4,110 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > Dynomotion/Kflop/Kanalog > Servo drive enable connections - KFlop/KAnalog connection?
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2011
    Posts
    30

    Servo drive enable connections - KFlop/KAnalog connection?

    I am using Yaskawa SGSH servo drives that have /S-ON pins for enabling / disabling.

    I am planning on wiring them in a circuit that cuts motor power to the drives (not control power). The E-Stop safety circuit is one N.O. contact in the motor power circuit along with servo drive ready (/S-RDY), alarm (ALM) and KAnalog SwitchEnableAll. So, motor power cannot be turned on until the safety relay is on (no E-Stop), all drives signal ready, there are no drive alarms and KAnalog's SwitchEnableAll (charge pump) is on. And, the motor power and enables turn off if any of these go off. Did I miss anything?

    Should I also wire them to be controlled by KFlop/KAnalog output(s) so the drives can be hardware disabled by software?
    If so, is there any advantage to wiring them each to a separate output?

    For what purposes / under what conditions would I disable the drives from the software?
    Does KMotionCNC have built in code that is configured to cause a drive (hardware) disable?

    I have not found any info explaining how / why software signals an axis hardware disable. But, it seems odd to even have drive enables if they are always on when the motor power is on.

    I do not want to leave out any bells and whistles.

    TIA

  2. #2
    Join Date
    May 2006
    Posts
    4043
    Hi Dave,

    It sounds to me like you have most things covered.

    It is often necessary to connect Amplifier enables to KFLOP/Kanalog so that KFLOP can enable/disable the amplifiers. Otherwise the only way to disable the servo loop is to set the DAC voltage to zero. But the slightest noise or offset may cause the axis to drift. So the only way to be certain the axis is fully off is to disable the amplifier.

    Obviously the advantage for individual enables is that single amplifiers can be enabled/disabled independently. If your system is ok with any fault on one axis disabling all the amplifiers then you could use a common signal.

    HTH
    Regards
    TK
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Nov 2011
    Posts
    30
    Thanks.

    I see: The software may have an axis set to Enabled = false so +-10V is not being sent / position is not being maintained... then the axis could drift from a bias or from noise.

    I see a watchdog.c example, will I need to add code in my watchdog loop to set the output bits according to the axis->Enables?

    I do not see an axis setting for an Enable bit output? Is there a plan to add one in the future to reduce the custom code needed?

    Thanks again.
    Dean

  4. #4
    Join Date
    Nov 2011
    Posts
    30
    I have allocated an FET switch output for each axis to sink the /S-ON (Enable) drive inputs. I removed them from the E-Stop Safety relay contacts.
    I also had to remove the /S-RDY outputs from enabling motor power to be switched on because these Yaskawa drives turn off /S-RDY when S-ON is off (drive disabled). So, now the motor power can be turned on if SwitchEnableAll is on, no Alarm on any drive and E-Stop is not active. Motor power gets switched off by SwitchEnableAll low, any drive alarm or E-Stop. KAnalog gets signaled on E-Stop and can issue an E-Stop (Another FET Switch).

    Now I have to figure out how I am going to drive Alarm Reset and the existing coolant and spindle relays because I do not have enough FET switch outputs left.
    It sure would be nice if KAnalog had 8 more 24V sinking outputs.

    I am not sure there is a question in this post. But, any comments are welcome.

    Thanks for your help.

  5. #5
    Join Date
    May 2006
    Posts
    4043
    Hi Dean,

    Winford makes a simple relay board that can be driven from LVTTL signals.

    Relay Board: TTL Logic Level Inputs, 4 SPDT 15A Relays - Winford Engineering

    Regards
    TK
    http://dynomotion.com

  6. #6
    Join Date
    Nov 2011
    Posts
    30
    I see a watchdog.c example, will I need to add code in my watchdog loop to set the output bits according to the axis->Enables?

  7. #7
    Join Date
    May 2006
    Posts
    4043
    Yes

    Regards
    TK
    http://dynomotion.com

  8. #8
    Join Date
    Nov 2011
    Posts
    30
    Tom.

    It seems that setting/clearing bits for Enable in a watchdog loop is a common task. I understand that it is simple code. But, it would be nice to have configuration settings for this task. That would highlight the need for drive enables and documenting the feature would provide help on the topic.
    I know it would have saved me a couple of hours.

    I do not know where it would fit in the Configuration dialog

    An interface like so would be nice:

    Enable Action |None,Clear,Set| Bit [ ]
    Where |..| represents a combobox drop down and [ ] is an edit box where the I/O bit would be entered.

    Adding EnableAction and EnableBit to CHAN would give the settings a home.

    Since I am a beginner with KFlop/KAnalog, I am probably missing some reason this is not a good idea.
    Perhaps the code would take too long to execute in the main program loop?

    I put together this example code. I have not tested it. It is just a quick attempt at the logic. There is probably something missing, a bug or a better way to achieve the same thing.
    It is obviously more complex that anything a user would need to write in their watchdog loop.

    I know it does not follow the other code naming conventions etc... old hobbits die hard.

    Code:
    #include "PC-DSP.h"
    #include "KMotionDef.h"
    
    // Or use enum
    #define ENABLE_ACTION_NONE  0
    #define ENABLE_ACTION_CLEAR 1
    #define ENABLE_ACTION_SET   2
    
    // It would be nice to have one of each of these in the CHAN structure
    int EnableAction[N_CHANNELS];  // CHAN.EnableAction
    int EnableBit[N_CHANNELS];     // CHAN.EnableBit
    
    int prevEnable[N_CHANNELS];
    BOOL prevEnableSet = FALSE;
    
    void SetStateEnableBit(int nChan)
    {
      int i;
      if (chan[nChan].Enable != prevEnable[nChan])
      {
        prevEnable[nChan] = chan[nChan].Enable;
        if (EnableAction[nChan] != ENABLE_ACTION_NONE) // (chan[nChan].EnableAction != ENABLE_ACTION_NONE) 
        {
          BOOL bTakeAction = TRUE;
          int nAction = EnableAction[nChan]; // chan[nChan].EnableAction; 
          int nBit = EnableBit[nChan];       // chan[nChan].EnableBit;
          if (chan[nChan].Enable) // When enabling we need to check if all axis with same settings (action, bit) are enabled. Disable always performs !Action
          {
            for (i = 0; i < N_CHANNELS; i++)
            {
              if ((i != nChan) && (EnableAction[i] == nAction) && (EnableBit[i] == nBit) && (!chan[i].Enable))   
               //((i != nChan) && (chan[i].EnableAction == nAction) && (chan[i].EnableBit == nBit) && (!chan[i].Enable)) 
              { // At least one Axis with same I/O Bit settings is not enabled yet - do not do anything
                // This makes Action only take place when the last channel with the same shared settings is enabled
                bTakeAction = FALSE;
                break;
              }
            }
          }
          if (bTakeAction)
          {
            BOOL bState = (BOOL)(nAction - 1);
            if (!chan[nChan].Enable) // disabling = !Action 
              bState = !bState;
            SetStateBit(nBit, bState);
          }
        }
      }
    }
    
    void CheckEnableBits()
    {
      int i = 0;
      if (!prevEnableSet)
      {
        for (i = 0; i < N_CHANNELS; i++)
        {
          prevEnable[i] = -1;
          // The below lines are temporary - the values would be set in the configuation code
          EnableAction[i] = ENABLE_ACTION_SET;
          EnableBit[i] = 152 + i;
        }
        prevEnableSet = TRUE;
      }
      for (i = 0; i < N_CHANNELS; i++)
      {
        SetStateEnableBit(i);
      }
    }
    Just a thought

Similar Threads

  1. My Kflop/Kanalog test bed
    By PEU in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 05-31-2013, 04:55 PM
  2. kflop/kanalog for retrofitting machine with glass scales
    By ihavenofish in forum Dynomotion/Kflop/Kanalog
    Replies: 20
    Last Post: 03-20-2013, 04:32 AM
  3. Retrofit old Cnc with kflop-kanalog
    By Scottburley in forum Dynomotion/Kflop/Kanalog
    Replies: 3
    Last Post: 02-23-2013, 12:49 AM
  4. KFlop + KAnalog hardware details
    By arvidj in forum Dynomotion/Kflop/Kanalog
    Replies: 6
    Last Post: 12-28-2012, 08:53 PM
  5. KFLOP+Kanalog Analog Velocity Servo tuning
    By bradodarb in forum Dynomotion/Kflop/Kanalog
    Replies: 9
    Last Post: 07-01-2012, 01:19 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •