Configuration and Commissioning
CODESYS SoftMotion Light configuration in CODESYS
Add a drive device to the device tree, for example your own EtherCAT Slave or CAN Slave device.
Below that, insert a CODESYS SoftMotion Light axis. Then click .
Open the added EtherCAT or CAN device in the editor (Accelnet module in the example).
Configure the process data (PDO) of the EtherCAT device or CAN device.
You should configure the process data so that "Status Word" and optionally also "Control Word" are transferred when changes occur. If the Control Word is not transferred via PDO, then it will be transferred via SDO as soon as it changes. For modular axes, you have to transmit the current position when using
MC_MoveAbsolute_SML
orMC_MoveRelative_SML
. You can transmit the current position synchronously or when a change occurs. If the position is transmitted when a change occurs, then you should configure a suitable Inhibit Time to prevent transmission from occurring too often. It is not necessary to transmit other objects via PDO.Example of a PDO configuration in the EtherCAT device editor:
Switch to the EtherCAT I/O Mapping tab. In Update variables, select the Activates 2 (always in bus cycle task) option.
Switch to the General tab.
For EtherCAT drives, it is not necessary to use distributed clocks. However, some drives may require them.
Tip
For CAN drives, you should activate heartbeat. As an alternative, you can activate the SYNC telegram if the current position is transmitted. In this case, heartbeat is not required. A third option is to use node guarding. The corresponding configuration is done on the General tab of the CANopen Slave.
Important
If neither a SYNC telegram, a heartbeat, nor node guarding is active, then cannot determine whether or not the drive is in the status "operational".
Open the CODESYS SoftMotion Light axis in the editor (SML_Drive_GenericDSP402 in the example).
The configuration is similar to a CODESYS SoftMotion Light axis (see the description for the SoftMotion device editor).
Set the following parameters on the SoftMotionLight tab:
General settings
Modulo: Modulo value [u] (modulo period) on.
Finite
Velocity ramp type: Determines the velocity profile.
Trapezoidal: Leads to a trapezoidal velocity profile (with constant acceleration in each segment)
Sin²: If supported by the drive, this setting leads to a velocity profile described by the sin² function (with a constant acceleration curve).
Scaling: Set the increments to the units in the application.
Here you define the factor for converting the integer positional values (Increments) into technical units (Units in application). The positional values were received by the drive and sent to the device. The technical unit is used by the IEC program. By setting the other parameters (Motor rotations, Gear input rotations, Gear output rotations), you can also include a gear box.
Invert direction: Causes the motor to receive the predefined values with inverted signs and therefore rotate in the opposite direction.
Switch to the EtherCAT I/O Mapping tab of the EtherCAT Slave. Check the automatically generated mapping of CODESYS SoftMotion Light parameters for addresses in the process memory. In certain exceptional cases, this mapping can be adapted manually.
If Automatic mapping is enabled, then the inputs and outputs of the EtherCAT slave are mapped automatically.
Commissioning
In online mode, information about status, communication, and errors are displayed on the SoftMotionLight tab of the drive.
To support commissioning, you can use the SML_StartupDrive
function block (SML_Basic.library
) and the VISU_SML_StartupDrive
visualization template (insert in a frame element of a visualization). In this way, you can easily access most of the CODESYS SoftMotion Light functions, such as Power
, Home
, MoveAbsolute
, MoveRelative
, and MoveVelocity
, as well as reading and writing parameters.