This article briefly introduces an example of how the Schneider M241 PLC communicates with the LXM28A servo via CANopen to achieve hardware capture functionality, including hardware wiring, software configuration, and power-on debugging.
First, let’s briefly introduce the capture function of Lexium 28:
•What is the capture function?
The capture input can capture the motor position at the moment the signal enters.
•Selection of capture methods.
There are two different methods to capture the motor position: 1. One-time capture of motor position refers to capturing the motor position at the first pulse edge. 2. Continuous capture of motor position refers to re-capturing the motor position at each pulse edge. The previously captured value will be lost at this time.
•Motor position can be captured on the rising or falling edge.
Lexium 28 communicates via CANopen for capturing.
Here, we take the M241 CANopen communication to control the servo as an example.
•Control the servo’s input points to perform capturing through the M241 output points.
•For the first power-on, set the servo’s control mode, communication parameters, and cancel alarm information.
•Enable the hardware capture function and confirm the switch type of the capture point (normally open or normally closed).
•Here, P5-39 is set to 101 (external signal is normally open).
• Set the function of DI7 to be the capture point function (normally open, normally closed must be consistent with P5-39), here P2-16 is set to 11C.
• Note: This parameter can only be modified when disabled, and a power-off restart is required for the modification to take effect.
Now that the servo parameters have been set, let’s look at the settings and program on the PLC side.
• We will take M241 controlling the servo in speed mode for a single capture as an example to see how to capture the position value, starting with hardware configuration.
• Call the necessary function blocks in the POU.
• Detailed explanation of the MC_TouchProbe_LXM28 function block:
• Detailed explanation of the MC_AbortTrigger_LXM28 function block:
• First enable the servo, then control the servo to move in speed mode using the MC_MoveVelocity_LXM28 function block.
• Trigger the MC_TouchProbe_LXM28 function block to enable the capture function, then control the M241Q0.0 output signal to the servo DI7 for capturing.
• We can see that when triggering Q0.0, the MC_TouchProbe_LXM28 function block’s RecordedPosition pin captured the current position value (user unit).
• By tracking and monitoring with SoMachine software, it can be seen that the capture operation was completed within approximately 40ms after triggering.
This is the complete process of hardware capturing of the LXM28 servo via M241 CANopen communication. It can be seen that excluding the impact of the M241 program cycle, the capture speed from start to finish is quite fast.
If you have any questions, please leave a message below, and I will answer them one by one.
Thank you all!