Skip to main content

Drive Configuration

Configuration of the CODESYS SoftMotion Light drive

When using CODESYS SoftMotion Light, the following configuration settings are recommended for a drive:

  • The position units of the 16#607A, 16#607C, and 16#6064 objects should correspond to the encoder increments ([inc]) in order to achieve maximum precision. You can configure the scaling settings and gear factors on the SoftMotionLight tab.

  • The velocity units of the 16#6081 and 16#60FF objects should be configured as encoder increments per second ([inc/s]).

  • Acceleration units of the 16#6081 and 16#60FF objects should be configured as encoder increments per second ([inc/s]).

  • The drive response to a quickstop command (bit 2 in Control Word) should be configured as <Slow down on quick stop ramp and stay in "Quick Stop Active">.

  • The drive response to a halt command (bit 8 in Control Word) should be configured as <Slow down on quick stop ramp and stay in "Operation Enabled">.

    Note: If the drive supports the standard object 16#605D, then this is configured by CODESYS SoftMotion Light by writing the value 2 during initialization.

  • A suitable quickstop ramp should be configured.

Tip

Check with the test project included in the package whether your drive is appropriate for use with CODESYS SoftMotion Light.

Error diagnostics

. Failure analysis options:
  • Entries in the controller log.

  • Status of the fieldbus slave of the drive: A red symbol next to the fieldbus device in the device tree indicates a problem with the drive that is not specific to CODESYS SoftMotion Light. The drive cannot be switched to "Operational" mode. In this case, see the detailed status display or the device display.

  • Communication status of the CODESYS SoftMotion Light device: This is displayed in the editor of the CODESYS SoftMotion Light device on the SoftMotionLight tab in the Online field. It also appears in the monitoring window if you specify <DriveName.wCommunicationState> there. Status <100: Drive initialization not yet ended; Status >= 1000: Error; Status=100: Communication established.

  • strDriveInterfaceError and uiDriveInterfaceError variables: These variables are displayed in the editor of the CODESYS SoftMotion Light device on the SoftMotionLight tab in the Online field.In most cases, strDriveInterfaceError provides information about the current problem.

  • Error when executing the CODESYS SoftMotion Light function block: The last occurring error for FB error is displayed in the configuration editor of the CODESYS SoftMotion Light device. on the SoftMotionLight tab, in the Online field.

Changing the sign (+/-) of the home offset

If the current position of the drive has an incorrect sign after homing, then you can correct this by means of a parameter.

Tip

To activate the display of the generic configuration editors, you use the Show generic device configuration editors option in the Device editor category of the the CODESYS options.

Example 1. Example

You call the MC_Home_SML function block with "Position=100". After successful homing, the current position reported by the drive is -100.

  1. In the editor, open the drive and switch to the <device name>: Parameters tab.

  2. Double-click the value of the bInvertHomeOffset parameter.

    The parameter value changes from FALSE to TRUE.



Changing the operating mode

For some drives, you can change the operating mode under certain conditions. Ideally, a drive should be able to switch operating modes, for example from Profile position mode to Profile velocity mode, even when motion is being executed. However, some drives do not behave optimally in such cases; others can switch operating mode only if they are not activated (MC_Power_SML.bRegulatorOn = FALSE). For these, you can use the SML_SetOpmode function block to set the operating mode even when the drive is deactivated. Test the behavior of your drive as early as possible in order to ascertain which tasks can be implemented and how the application should be structured.

Adapting the velocity or acceleration units

If you cannot set the velocity units of the drive to [inc/s] or cannot set the acceleration units to [inc/s²]), then you can adapt the fConstVelFactor and fConstAccFactor parameters.

Tip

You can enabled the display of the generic configuration editors in the options.

Example 2. Example

The drive expects the velocity in [inc/(64*s)], not [inc/s].

  1. In the editor, open the drive and switch to the <device name>: Parameters tab.

  2. You modify the parameter in the generic "...Configuration" tab of the device editor: To do this, select the field in the "Value" column and click it or press the Enter key to open the editing field.

  3. Double-click the value of the fConstVelFactor parameter and specify 64 as the value.