I have an application with 2 axis. The master axis will be configured as Modulo. During motion i want to be able to change the rollover position if required. How is it possible to do this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you mean you want to shift the Origin or Zero position of your axis, you can try MC_SetPosition and set the position to 0 (if you want to take the current active position and make it the new 0. Adjust this number accordingly if/as needed). This means the servo drive keeps it's current origin position, and Codesys applies an offset to the servo drive position in the logic.
You can also use the homing function of your servo drive using MC_Home and have your drive configured to set the current position as origin when it receives a homing command.
Last edit: trusty-squire 20 hours ago
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The MC_Home or MC_SetPosition requires a programm cycle to be completed. In my application the speed is approximately 120m/min and the programm cycle is 2ms. That means that i will have a 4mm loss on each Trigger of either MC_Home or MC_SetPosition.
The best option is to change the value defined in the axis configuration. I tried the SMC_SetMovementType but it only works with the axis standstill or powered off. I need to be able to change it while the axis is moving.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In that case, the best thing to do might be to track the offset in a separate variable of your logic, then when you provide target positions, make your target position use the tracked offset as below:
Hello,
I have an application with 2 axis. The master axis will be configured as Modulo. During motion i want to be able to change the rollover position if required. How is it possible to do this?
If you mean you want to shift the Origin or Zero position of your axis, you can try MC_SetPosition and set the position to 0 (if you want to take the current active position and make it the new 0. Adjust this number accordingly if/as needed). This means the servo drive keeps it's current origin position, and Codesys applies an offset to the servo drive position in the logic.
You can also use the homing function of your servo drive using MC_Home and have your drive configured to set the current position as origin when it receives a homing command.
Last edit: trusty-squire 20 hours ago
The MC_Home or MC_SetPosition requires a programm cycle to be completed. In my application the speed is approximately 120m/min and the programm cycle is 2ms. That means that i will have a 4mm loss on each Trigger of either MC_Home or MC_SetPosition.
The best option is to change the value defined in the axis configuration. I tried the SMC_SetMovementType but it only works with the axis standstill or powered off. I need to be able to change it while the axis is moving.
In that case, the best thing to do might be to track the offset in a separate variable of your logic, then when you provide target positions, make your target position use the tracked offset as below:
Although, upon further reflection, you'll still have the same cycle time issues.
You might be able to break your code into multiple tasks to reduce the cycle time, or use an Event task to capture the offset position?
Last edit: trusty-squire 6 minutes ago