Skip to main content

Command: Add SoftMotion CiA402 Axis

Function: The command adds a general SoftMotion CiA402 axis below a fieldbus slave in the device tree.

Call: Project menu; context menu of a device object in the device tree

Requirement: In the device tree, a device is selected which supports this drive. Examples: EtherCAT slave or CAN slave.

CODESYS provides several dedicated drivers that support a servo drive model in particular. If a servo device drive is added to the device tree, then it automatically has a child device that represents the SoftMotion axis. A standard driver is used for communicating with the device. Therefore, you can use this command to support any servo drive that complies with the CODESYS implementation of CiA402. The way in which the drive works or not with the device depends on the implementation in the device itself. Experience has shown that different manufacturers have interpreted the standard differently, especially regarding error handling and limit switches. Therefore, there is no guarantee how the driver works or not with the device.

Note

The generic CiA402 driver supports up to 8 axes in case the device description of the drive does not specify a number. Otherwise, the number of axes defined in the device description is supported.

CANopen: The number of possible axes depends on the profiles of the logical devices in the EDS file (1000H object and 67FFH + X * 800H, where X = number of logical devices). For more details, see the CANopen CiA301 standard.

EtherCAT: The number of possible axes depends on the defined CiA402 channels (CoE DS402Channels) in the ESI file.

An adaptation of the EDS or ESI file needs to be done by the device manufacturer.

Objects used when commissioning

When commissioning, the following objects are accessed if they are supported by the device.

Object

Read/Write Access

(M)andatory

(O)ptional

Comment

0x1000:0

Read

M

The lower value has to be 402. Otherwise cancel.

0x1018:1

Read

O

0x1018:2

Read

O

0x1018:3

Read

O

0x1018:4

Read

O

0x6502:0

Read

O

0x605A:0

Read

O

0x60C2:1

Write

If parameter Set60C2 = TRUE

0x60C2:2

Write

If parameter Set60C2 = TRUE

0x6076:0

Read

O

Objects used during operation

The following objects are used during operation depending on the functions used:

0x603F:00, 0x6040:00, 0x6041:00, 0x6060:00, 0x6061:00, 0x6062:00, 0x6064:00, 0x606B:00, 0x606C:00, 0x6074:00, 0x6077:00, 0x6078:00, 0x607C:00, 0x60B1:00, 0x60B2:00,0x60B8:000x60B9:00, 0x60BA:00, 0x60BB:00, 0x60BC:00, 0x60BD:00, 0x60F4:00.

Advanced configuration

Important

You need to select the Show generic device configuration editors option in the Options – Device editor dialog so that the tab with the parameters is displayed.

You can use the following parameters to fine-tune the flow of the CiA402 state machine.

CiA402 Parameter

Description

_bImmediateDisabling

TRUE: When bRegulator is reset to FALSE, switches the status of the drive from Operation enabled directly to Switch on disabled.

FALSE: Switches the status via "Switched on" and "Ready to switch on", giving the drive the chance to execute a quickstop and handle the brake properly.

Note: If this option is set to FALSE, then the states for which immediate disabling is switched off can be fine-tuned with the bit mask _dwStatesImmediateDisabling.

_bForbidReenableDuringDisabling

Only relevant when _bImmediateDisabling = FALSE.

TRUE: The drive is disabled step-by-step until the drive signals to be in Ready to switch on before a new enable command is processed.

dwStatesImmediateDisabling

Only relevant when _bImmediateDisabling = FALSE.

Bit mask of the states for which immediate disabling is turned on.

  • Bit 0: Normal Operation

  • Bit 1: Quickstop

  • Bit 2: External Quickstop

  • Bit 3: Homing

Example: Assuming _bImmediateDisabling = FALSE, the value 2#0110 means that the immediate disabling is turned off only for the states "Normal Operation" and "Homing". For states “Quickstop" and "External Quickstop", immediate disabling is turned on.

_uiPreHomingWait

Number of cycles which the state machine waits in state PRE_HOMING before starting the homing process by setting bit 4 of the control word.

_uiPostHomingWait

Number of cycles which the state machine stays in HOMING_DONE before switching back to "Normal Operation".

_uiHomingMinCycles

Number of cycles at the beginning of HOMING, where the done bits (bit 10/12 of the status word) are ignored.

_uiWaitCyclesForStateSwitch

Number of cycles which the system waits until the drive has executed a state change command. If the drive fails, then the system will switch back to SWITCH_ON_DISABLED.

_bPreHomingWaitBit12Clear

TRUE: Wait in PRE_HOMING until bit 12 of the status word has been cleared by the drive before starting homing (before setting bit 4 of the control word).

Note that in any case, the state machine stays in PRE_HOMING for at least _uiPreHomingCycles.

_bCheckBit10PostHoming

TRUE: Switch to HOMING_DONE if bit 12 and bit 10 of the status word are both TRUE (as specified in CiA-402).

FALSE: Ignore bit 10; only use bit 12.

_bCheckOpMode

TRUE: Check if 0x6061 shows the value set in 0x6060 when enabling the axis.

FALSE: Omit this check and enable immediately after setting the operation mode.

_abyControllerMode

This ARRAY[0..7] OF BYTE contains the operation modes (object 0x6060) which correspond with AXIS_REF_SM3.byOperationMode. (index 0,3 = position; index 1 = velocity; index 2 = torque)

_bCheckBit12InPositionMode

TRUE: AxisIsReadyForMotion checks bit 12 in CSP or IP.

FALSE: AxisIsReadyForMotion does not check bit 12.

_bDoHaltWhenStopInterruptsHome

TRUE: When MC_Stop interrupts, abort homing with bit 8 of the control word.

FALSE: Do not set bit 8, but directly switch the operation mode.

_bCheckBit13InHomingMode

TRUE: In HOMING_ACTIVE, wStatusWord.13 = TRUE leads to errorstop and (depending on _bDoHaltWhenStopInterruptsHome) wControlWord.8 := TRUE.

_bSetControlBit4InCSP

TRUE: Set bit 4 of status word also in CSP mode. Some drives require this, although it is non-standard.

_uiHomingWaitListeningBits101213

In state HOMING_ACTIVE, do not listen to bits 10, 12, and 13 during this number of cycles from setting bit 4. (Some drives take some time to reset these bits).

_bRegulatorOnRequiresVoltageEnabled

Whether bit 4 of the status word (voltage enabled) needs to be TRUE so that bRegulatorRealState = TRUE (default value: FALSE).

_bDriveStartRequiresOperationEnabled

Whether bit 2 of the status word (operation enabled) needs to be TRUE so that bDriveStartRealState = TRUE (default value: TRUE).