Skip to main content
NewEpisode 3a is out: Carry the conversation onWatch →

This part is for members

Membership opens soon. Leave your email and we'll tell you the day it does. Founding members get the launch price.

Keep watching the free parts
Motion modes · 26c

CSV and CST: the same skeleton

In 26a and 26b the master sent positions; here it sends speeds (CSV, mode 9, 0x60FF) and torques (CST, mode 10, 0x6071). One mechanism: CsvModeRun and CstModeRun are CspModeRun's skeleton (flag and brake released → clear the flag, shift the four slots, the new value into slot 3, tell the planner, the handle zeroes the clock, makima through four points) with three changes: what goes into the slots, its unit, and which loop gets the output. Running example: 25a's two-turn move again; the bench sil-mac/ep26 cs26 gains --mode csv|cst, and in CST the bench master closes the loop itself (PD + J·a at 150 rad/s, labelled as bench code, not servohub). Seven stops: one skeleton (at enable the slots hold what the motor is doing: −0.376 rpm in CSV, 0.0779 A in CST); CSV's units (0x60FF is counts/s, turned into rpm on the write and back into motor counts/s in CsvModeRun; 655,360 at 50 ms lands in slot 3 as 300.000031 rpm and becomes the speed target at tick 530, three periods behind; with no position loop the motor still ends at 262,144, one count past the plan); CST straight to the current loop (per mille × 6.5 A × √2, one step = 0.0092 A, written straight to idq_tar_A[1]; 21 at 50 ms = 0.193 A, about 16 at cruise); 708 is dropped (set_app_Target_torque refuses anything above Max_current, 6.5 A, but set_Target_torque answers success: a step to 707 runs the motor to 7236 rpm in 23 ms and into a fault, a step to 708 is dropped write after write, the slots keep 0.147 A and the motor stays at 600 rpm); when points stop coming (after 2 ip CSP holds slot 3 while CSV's and CST's else branch is 0: CSV brakes at −6.5 A, swings to −55.7 rpm and comes back to 128,512; CST lets go and coasts for 147 ms and 66,867 counts); quick stop, option 2 (every tick each mode pushes its own value into slot 3: CSP its last point, CSV 0, CST the master's torque, none resetting the clock; CSP reaches 129,760 in two ticks, never reads 0x6085 and disables at zero speed on tick 1940, CSV disables at 1870, CST disables on the tick itself at 598 rpm, the coast after that worked out from the code); quick stop, option 6 (no disable, statusword 0x0217; CST outputs 0 after 1.1 ms and coasts as if the master were gone). Your turn: a master loop at 300 rad/s oscillates, motor up to 1681 rpm.

Up next27a · MIT mode 1: one tick of the spring→