In this How-to guide, we will explain how to execute a movement (profile torque) by directly changing the register values, instead of using MotionLab or the dedicated macros for motion.
We will consider a movement towards a specific torque in this example.
Changing registers can be done in motion lab, by using macros, or externally by using for example CAN-communication. This HowTo just focusses on the sequence of commands that needs to be done for a movement.
Changing directly the register values is only recommended for advanced users.
- All the documentation about relevant motion registers can be found in the EMCL documentation: Motion objects
- The register values are always in counts: position is counts, velocity counts/sec etc. The conversions depend on the resolution, maximum stroke of a motor etc. In general, how to convert units can be found here: EMCL Units
- A step by step guide explaining how to set up serial commanding: Serial commanding
- Explanation of profile torque mode: Profile torque mode
First, the movement should be prepared, meaning all the relevant parameters should be set:
Execute the movement
Starting the movement
Now that all the parameters are set correctly, we can start the movement by changing the controlword (register 0x6040). For more information about the control word, see 'Controlword in profile velocity mode' explanation: Profile torque mode
Most important steps here are:
- Set the driver status to Ready to Switch On -> controlword value to 6
- Set the driver status to Switch On -> controlword value to 7
- Set the driver status to Operation Enable -> controlword value to 15
- The requested target torque is sent to the motion controller.
- After the new target torque has been delivered to the drive, the motion controller does not expect any controlword action.
- To change to a new torque the user only needs to redefine the target torque register (0x6071)
Now that the movement has started, we need to monitor the statusword bit. To see if the target is reached, see 'Statusword in profile torque mode' explanation: Profile torque mode
Once the 10th bit (target bit) is 1, the target has been reached (unless a controlled stop is being made by the Halt bit of the control word).
Serial code example
Steps to be done to be able to manually move the motor at a specific torque:
Set Modes of Operation to Profile Torque
Write in Modes of Operation (0x6060) a Value of 4
Set the driver status to Ready to Switch On
Write in the controlword (0x6040) a Shutdown Command (Value 6)
Set the driver status to Switch On
Write in the controlword (0x6040) a Switch on Command (Value 7)
Set the driver status to Operation Enable
Write in the controlword (0x6040) a Switch on Command (Value 15)
Set the new Target Torque
Write in Target Torque (0x6071) the new value (500)
The movement will be executed using the profile torque slope set. The torque slope can be changed before changing the target torque register.
w 0x6060 4
w 0x6040 6
w 0x6040 7
w 0x6040 15
w 0x6071 x (x = your target torque, in ‰ rated torque)