Set Position, Velocity, and Torque Setpoints to an EtherCAT Drive Using NI SoftMotion

Updated Sep 26, 2022

Reported In

Hardware

  • AKD Series Servo Drive

Software

  • LabVIEW SoftMotion Module

Issue Details

I have a motion control system using NI SoftMotion and an EtherCAT drive such as the Kollmorgen EtherCAT AKD. How can I write position, velocity, or torque setpoints directly to the control loop of the drive?

Solution

The Advanced Kollmorgen Driver (AKD) Servo Drive is a smart servo drive that has many advanced control features. While the AKD can act as a simple amplifier, its advantage over analog control drives is that it can run its own position and velocity control loops. Using the AKD in Fieldbus mode allows the drive to receive position and velocity commands over EtherCAT from an EtherCAT master. 

Starting in SoftMotion 2013 SP1, support has been added to write velocity and torque setpoints to the EtherCAT AKD's internal control loops. These additional features can be accessed through new SoftMotion properties and methods. These properties and methods are available only for EtherCAT AKD and EtherCAT Plugin Axis types and only for SoftMotion 2013 SP1 and later.

New Axis Properties 
It can be accessed using a SoftMotion Axis Property Node. (Functions pallete >> Vision and Motion >> NI SoftMotion >> Property Node (NI SoftMotion)). Click on the Property Node and choose Axis Settings >> Axis Control Mode. This property can be used to change the control mode by which the drive is currently operating. There are four options: Automatic, Position, Velocity, and Torque. Check the Axis Settings: Axis Control Mode Property help page for more details.

The AKD will display o0 on its digital display when in position mode, o1 when in velocity mode, and o2 when in torque mode as shown in the image below.

New Axis Methods    
They can be accessed using a SoftMotion Axis Invoke Node (Functions pallete >> Vision and Motion >> NI SoftMotion >> Invoke Node (NI SoftMotion)). Click on the Invoke Node and choose Write. You will see the following methods.

Write Position Setpoint: This method will write a setpoint to the internal position control loop on the EtherCAT drive. 

Write Velocity Setpoint: This method will write a setpoint to the internal velocity control loop on the EtherCAT drive.

Write Torque Setpoint: This method will write a setpoint to the internal torque control loop on the EtherCAT drive.

Note: Writing any of these setpoints will erase the previous setpoint from memory on the EtherCAT drive. 

Note: These properties and methods also apply to SoftMotion Drive Interface axes for third-party EtherCAT drives that support Profile Torque and Profile Velocity mode. For a full list of supported EtherCAT slaves, check Using EtherCAT Motion Drives with NI Real-Time Controllers .

Additional Information

You can also know the setpoints in memory using the Read method. Click on the Invoke Node and choose Read. You will see the following methods.

Read Position: This method will return the position setpoint and feedback value from the EtherCAT drive. 

Read Velocity: This method will read the velocity setpoint and feedback value from the EtherCAT drive. 

Read Torque: This method will read the torque setpoint and feedback value from the EtherCAT drive. 

Important Considerations 
  • When you use these properties and methods to control the drive, SoftMotion's trajectory generation is bypassed and setpoints are written directly to the motion control loops on the drive. This is essentially the same as assigning a step change to the control. The only way to limit this motion would be to configure the AKD's internal acceleration, velocity, and torque limits using the drive's configuration software such as Kollmorgen WorkBench. Also, it is recommended to use Kollmorgen WorkBench to fine tune the response of the motion system specifically for the position and velocity control modes.
  • When operating in velocity or torque mode, the axis position is likely to drift from the position setpoint. If the system is commanded to return to position mode, the drive would calculate a large difference from the last position setpoint and would likely throw a fault. If this happens, you will need to explicitly disable the drive and clear faults before continuing. In order to avoid this entirely, it is highly recommended to reset the position before switching to position mode.
  • Do not use the Write Velocity Override with the Write Velocity Setpoint method. The Write Velocity Override method is for use with SoftMotion's Straight Line Moves which operate the drive Position Mode. It will have no observable affect in Velocity or Torque Mode, but will remain at its last commanded value when the system returns to Position Mode.
  • EtherCAT AKD SoftMotion Axes contain an additional axis property. When checked, this allows the controller to override the tuning setting that have previous been written to the AKD itself. This is often undesirable if you have already used Kollmorgen WorkBench to tune the motion system. Uncheck this box if you would like to use the tuning settings as defined in Kollmorgen WorkBench.
.
  • When using Torque or Velocity Mode, both the torque and velocity setpoints will return to zero upon hitting a limit switch. This does not happen when operating in Position Mode.