Drive logic
4 minute read
The drive logic runs one CiA402 state machine per axis. It switches each drive on and off through the drive’s control wordThe control word (object 0x6040) is how the controller commands a CiA402 drive: switch on, enable operation, switch off, acknowledge a fault. , tells it which mode to run in, and follows its state through the status wordThe status word (object 0x6041) is how a CiA402 drive reports its state: ready, switched on, operation enabled, fault. .
All parameters on this page are under root/DriveLogic/ and hold one value per axis.
Mode of operation
The mode of operation decides what the drive closes its own loop on, and so what the application sends it.
Cyclic synchronous position
The drive follows a target position and closes the position loop itself. The application sends a new position every cycle.
Cyclic synchronous velocity
The drive follows a target velocity. The application closes the position loop and sends a velocity every cycle.
Cyclic synchronous torque
The drive follows a target torque. The application closes the position and velocity loops and sends a torque every cycle.
By default every axis runs in CSP. In AGV applications the wheel axes run in CSV.
Choose a setpoint mode
The setpoint is what the application commands: a position, a velocity or a torque. Each combination of setpoint and drive mode has its own set-up; click one to open its guide.
All modes the drive logic knows
| Value | Mode |
|---|---|
| 1 | Profiled position |
| 2 | Velocity |
| 3 | Profiled velocity |
| 4 | Profiled torque |
| 6 | Homing |
| 7 | Interpolated position |
| 8 | Cyclic synchronous position (CSP) |
| 9 | Cyclic synchronous velocity (CSV) |
| 10 | Cyclic synchronous torque (CST) |
Any other value is passed to the drive unchanged, for a mode the drive manufacturer defines.
Change the mode in Desk
Warning
The axis control loops switch with the mode. Change it only while the axes are disabled.
-
Open Motorcortex Desk and connect to the controller.
-
In the Parameters panel, type
DriveLogic/driveModein Filter parameters…. -
Click the value field of
driveMode, type one mode per axis separated by spaces, and press Enter. For example,8 8 8 9 9 9runs the first three axes in CSP and the last three in CSV. To change one axis, expanddriveModeand write that channel.To give every axis the same mode, write the mode to
driveModeAllinstead. -
Press the save button at the top of the Parameters panel (tooltip Save parameter tree to server, or Ctrl+S). The controller loads the saved values after the configuration’s defaults, so the saved mode is the one it starts with.
Link the drive logic to the drive
The drive logic only reaches the drive through links in the EtherCAT configuration. Each axis needs three: two that carry the commands and the mode to the drive, and one that brings the drive’s state back.
The standard configurations already contain these links. Add them yourself only for a new drive: in the ECAT tool, link each entry to its parameter, using the channel of the axis. The first axis is channel 0, the second channel 1, and so on.

The Modes of operation entry of a drive, with its link to the drive logic.
Other drive logic parameters
| Parameter | What it does |
|---|---|
disableDrive |
Keeps the axis switched off and ignores its errors, for example for an axis that is not fitted. |
seqEnableOpId |
Holds the axis off until the axis with this number is enabled, so axes switch on one after another. 0 turns it off. |
timeoutSwitchOnSec, timeoutEnableOpSec, timeoutFaultAckSec, timeoutSwitchOffSec |
How long the state machine gives the drive to complete each step: switching on, enabling operation, acknowledging a fault and switching off. |
delayEnableOpSec |
A pause between switching the drive on and enabling operation. |
driveState, driveEnabled, driveHasError |
Read-only: where the state machine is, and whether the drive is enabled or in error. |
Next: Step 3: configure the axes.