Torque setpoint with CST
3 minute read
The application sends the drive a target torque every cycle, and the drive closes the torque loop. Motorcortex runs no position or velocity loop, so the axis moves as the torque and the load dictate.
Paths are under root/AxesControl/actuatorControlLoops/actuatorControlLoopNN/, where NN is the axis number.
Set the drive mode
Warning
Change the drive mode only while the axes are disabled.
In Desk, write 10 to root/DriveLogic/driveMode for each axis that uses this mode, and save with Save parameter tree to server. See Drive logic for details.
Check the drive’s PDOs and links
The standard configuration has these already. Otherwise, map the entries in the drive (CiA402 drives) and link them with channel 0 (EtherCAT configuration). Paths starting with …/ are under the axis’s control loop:
See the links in the ECAT tool
Each entry shows its production link to the control loop and, below it, its simulation link to the Simulator. The blue marks the simulation link.
Set the transformations
The transformations turn drive units into rad, rad/s and Nm at the load. This is what happens to a position reading; velocity and torque work the same way, with their own transducer:
| Set | Parameter | Example |
|---|---|---|
| Gearbox | gearboxLoadSide, gearboxMotorSide |
100, 1 for 100:1 |
| Torque units | torqueTransformation/transducer/gainNum, gainDen |
500, 1 for 2 Nm rated, drive in ‰ |
| Encoder, for the position read-back | positionTransformation/transducer/ticksPerRevolution |
1048576 for 20 bits |
Set the controllers
Leave positionController/parameter/enable and velocityController/parameter/enable at 0: the setpoint goes to the drive as it is. The torque you send is added to any feedforward torque the control loop computes.
Send the setpoint
Warning
Without a position setpoint, the application’s position limits do not stop the axis: it keeps turning as long as the setpoint asks. Use this mode for axes that may turn freely, such as wheels, or watch the position with a position window detector.
The setpoint goes into root/AxesControl/axesTorquesInput, one value per axis in Nm, at the load. Channel 0 is the first axis.
To take the setpoint from another part of the application, link it to root/AxesControl/axesTorquesInput in a link file, with Index set to the channel of the first axis it drives.
To test by hand, write a small value to that channel of axesTorquesInput in Desk while the axis is engaged. A linked input is overwritten every cycle, so test on a channel that is not linked. See position window detector to guard the position.
Check the result
Plot root/AxesControl/axesTorquesInput and the measured actuatorTorqueActual in Desk: the measured value should follow the setpoint.
Next: Step 3: configure the axes.