Cross-coupled Motor Control
Cross-coupled motor control is used when two motors are physically connected (coupled) such as automated guided vehicle or gantry stages. Cross-coupled functionality will spread the axis position error across both axes allowing the two axes to be controlled without them interfering with each other.
After cross-coupling two axes, identical motion commands must be performed on each axis for them to move synchronously. Requires these function blocks:
-
LS_MasterPLoopControlOn: This function block is used to allow the XMC to control the position loop of an axis.
-
LS_MasterPLoopControlOff: This function block is used to turn off the XMC’s control of an axis position loop.
-
LS_CrossCoupledControlOn: This function block is used to enable the cross-coupling of two axes.
-
LS_ CrossCoupledControlOff: This function block is used to disable the cross-coupling of two axes.
-
LS_Connect, MC_Power, MC_Home must be executed before these function block can be used.
Section 8.2.15 of the XMC User manual contains some more information about cross-coupled control.
The following examples can be found in the XMC_CrossCoupled.zip downloadable from Example Applications.
In the conventional operation of the motion controller, the drive operates in CSP (positioning) mode, and the entire servo control loop is executed in the drive by passing the position command through EtherCAT from the XMC motion controller.
For Cross-Coupled Control, each axis must have the LS_MasterPLoopControlOn executed so the XMC motion controller will control the position loop of that axis. This will make each drive operate in CSV (speed) mode, and the XMC generates a speed command by comparing the position command input through the motion controller with the current position feedback from the drive.
This speed command is transmitted to the drive operating in CSV mode to execute the control servo loop. The position control part of the entire servo control loop is performed by the XMC motion controller. Make sure the tuning parameters for LS_MasterPLoopControlOn are configured correctly for your application. This will have a large impact on the performance of the system being controlled.
-
LS_CrossCoupledControlOn must be executed after the LS_MasterPLoopControlOn function blocks.
-
LS_CrossCoupledControlOn will share the position error across the two axes so that the two motors don’t interfere with each others movement.
-
Identical movement commands must be executed on each axis, so they move synchronously.
-
LS_CrossCoupledControlOff can be executed to disable cross-coupled control of two axes. This must be done before disabling the XMC’s control of the position loop.
-
LS_MasterPLoopControlOff can be executed to disable the XMC’s control of an axis position loop and must be executed after LS_CrossCoupledControlOff.
Position Loop Control Diagram
Cross-Coupled Control Diagram
Cross-Coupling Restrictions and Error Codes
In the following cases, an error occurs and master position loop control/cross-coupled control cannot be executed:
-
When executing or releasing master position loop control while the axis is in operation (Error code: 0x1230)
-
When the servo driver that the XMC is trying to control master control loop does not support CSV operation mode (Error code: 0x1160)
-
If there is no Target Velocity (0x60FF) object in RxPDO of the axis to execute master position loop control (Error code: 0x1161)
-
When the P gain input value of the master position loop control function block is negative (error code: 0x1231)
-
When the I gain input value of the master position loop control function block is negative (error code: 0x1232)
-
When the control output limit value of the master position loop control function block is negative (error code: 0x1233)
-
When executing or releaseing Cross-coupled control while the axis is in operation (Error code: 0x1234)
-
When the same axis is set in Axis and PairAxis of Cross-coupled control function block (Error code: 0x1235)
-
In case master position loop control is not being executed for Axis and PairAxis set in Cross-coupled control function block (Error code: 0x1236)
-
When the P gain input value of cross-coupled control function block is negative (error code: 0x1237)
-
When a command is executed on an axis for which cross-coupled control is not being executed (Error code: 0x1238)
-
When homing start is executed during master position loop control (Error code: 0x10B8)
-
Target Velocity (0x60FF) object must be present in the RxPDO list of the selected axis.
-
CSV mode must be supported by the controlled servo drive.
-
Can only be executed on an axis that is not in operation.
-
Tuning values and CtrlLimit must be positive values.
-
Make sure to tune the parameters for your application and the servo’s speed controller gain may need to be tuned.
Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Axis | Input | Axis to command. |
P_Gain | Input | Set the master position loop control proportional gain (1/ 1000 Unit). |
I_Gain | Input | Set the master position loop control integral gain (1/ 1000 Unit). |
VelFF_Gain | Input | Set the master position loop control speed Feed Forward gain (1/ 1000 Unit). |
CtrlLimit | Input | Set the master position loop control output limit value. |
InControl | Output | Indicates the XMC is in control of the master position loop of the selected axis. |
Busy | Output | Indicates the function block is still working and not completed. |
Active | Output | Indicates the current settings are running for the selected axis. |
CommandAborted | Output | Indicates the command was aborted and not running. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
This function block is used to release control of the master position loop of an axis. Can only be executed on an axis that is not in operation.
Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Axis | Input | Axis to command. |
Done | Output | Indicates the XMC is no longer in control of the master position loop of the selected axis. |
Busy | Output | Indicates the function block is still working and not completed. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
Each Axis must have LS_MasterPLoopControlOn before executing LS_CrossCoupledControlOn. Axis and PairAxis must be unique axes. Using the same will lead to an error.
-
Must be executed on the axes while they are not in operation.
-
Make sure the P_Gain value is set correctly for your application.
Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Axis | Input | 1st axis to be cross-coupled. |
PairAxis | Input | 2nd axis to be cross-coupled. |
P_Gain | Input | Set the master position loop control proportional gain (1/ 1000 Unit). |
SlaveMode | Input | Not used. |
InControl | Output | Indicates the XMC is in control of the master position loop of the selected axis. |
Busy | Output | Indicates the function block is still working and not completed. |
Active | Output | Indicates the current settings are running for the selected axis. |
CommandAborted | Output | Indicates the command was aborted and not running. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
This function block releases cross-coupled control on a pair of axes.
-
Can only be executed on axes that are being cross-couple controlled.
-
Only execute the function block if the two axes are not in operation.
Element Name | Element Type | Description |
---|---|---|
Execute | Input | Edge detected request to execute the function block. |
Axis | Input | 1st axis to be cross-coupled. |
PairAxis | Input | 2nd axis to be cross-coupled. |
Done | Output | Indicates the axes are not in cross-coupled control. |
Busy | Output | Indicates the function block is still working and not completed. |
Error | Output | Indicates whether an error occurs or not. |
ErrorID | Output | Error Identification number. |
Step | Action |
---|---|
1 |
Connect EtherCAT network.
|
2 |
Power on axes.
|
3 |
Execute Master PLoop On.
|
4 |
Execute Cross-Coupled On.
|
5 |
Execute identical moves on Axis 1 and Axis 2.
|
Step | Action |
---|---|
1 |
Execute LS_CrossCoupleControlOff.
|
2 |
Execute LS_MasterPLoopControlOff on Axis 1 and Axis 2.
|
//Function block Calls
INST_Connect(Execute:=Connect_ECAT, ErrorID=>INST_Connect.ErrorID);
INST_Disconnect(Execute:=Disconnect_ECAT, ErrorID=>INST_Disconnect.ErrorID);
INST_PowerAll(Enable:=Power_On_Axes, Status=>INST_PowerAll.Status, Valid=>INST_PowerAll.Valid, ErrorID=>INST_PowerAll.ErrorID);
INST_Axis1PloopOn(Execute:=Execute_MPloopOn, Axis:=Axis1, P_Gain:=1100.0, I_Gain:=600.0, VelFF_Gain:=10000.0, CtrlLimit:=100000000.0,
InControl=>INST_Axis1PloopOn.InControl, ErrorID=>INST_Axis1PloopOn.ErrorID);
INST_Axis2PloopOn(Execute:=Execute_MPloopOn, Axis:=Axis2, P_Gain:=1100.0, I_Gain:=600.0, VelFF_Gain:=10000.0, CtrlLimit:=100000000.0,
InControl=>INST_Axis2PloopOn.InControl, ErrorID=>INST_Axis2PloopOn.ErrorID);
INST_CoupleOn(Execute:=Execute_CrossCoupleOn, Axis:=Axis1, PairAxis:=Axis2, P_Gain:=1100.0, SlaveMode:=FALSE, InControl=>INST_CoupleOn.InControl,
ErrorID=>INST_CoupleOn.ErrorID);
INST_Axis1Relative(Execute:=Execute_Move, Axis:=Axis1, ContinuousUpdate:=FALSE, Distance:=50000.0, Velocity:=500000.0, Acceleration:=500000.0,
Deceleration:= 500000.0, Jerk:=10000.0, BufferMode:=0, ErrorID=>INST_Axis1Relative.ErrorID);
INST_Axis2Relative(Execute:=Execute_Move, Axis:=Axis2, ContinuousUpdate:=FALSE, Distance:=50000.0, Velocity:=500000.0, Acceleration:=500000.0,
Deceleration:= 500000.0, Jerk:=10000.0, BufferMode:=0, ErrorID=>INST_Axis2Relative.ErrorID);
INST_Axis1PloopOff(Execute:=Execute_MPloopOff, Axis:=Axis1, ErrorID=>INST_Axis1PloopOff.ErrorID);
INST_Axis2PloopOff(Execute:=Execute_MPloopOff, Axis:=Axis2, ErrorID=>INST_Axis2PloopOff.ErrorID);
INST_CoupleOff(Execute:=Execute_CrossCoupleOff, Axis:=Axis1, PairAxis:=Axis2, ErrorID=>INST_CoupleOff.ErrorID);
LM804