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 partsCSP: four points, one curve
In episode 25's profile modes the drive planned every move itself; this one is the cyclic synchronous position mode, CSP (0x6060 = 8): the master plans and sends one point per sync period, and the drive only draws the line between points. Running example: 25a's move again (two turns, 262,144 counts, 600 rpm, 6000 rpm/s), sent one point a millisecond in 0x607A by a master the bench plays; the bench sil-mac/ep26 cs26 is the bus build with the generated csp_planning renamed at link level so every call is recorded, and servohub is not changed. We follow 131,071 (exactly one turn), sent at 150 ms, through six stops: a point arrives (writing 0x607A only stores Target_position; CSP waits for the update flag Target_update_state, raised on the board by the position-loop interrupt on one locked tick, board.c:216, on CANopen by the SYNC frame, and here by the bench on the first tick of every millisecond); four slots (at enable all four get the motor's position, −1, then each new point shifts them down one and lands in slot 3; at tick 1500 they hold 127,139, 128,450, 129,760 and 131,071); the clock (x0_sum restarts when a point arrives and adds 0.1 ms a tick; the spacing comes from 0x60C2, 1 ms by default); the curve (csp_planning puts the points at 0, 1, 2 and 3 ms and plays the oldest stretch, slot 0 to slot 1, with makima slopes, the only rule compiled in: 1311.5 counts/ms = 600.36 rpm at slot 0; ten ticks walk the cubic and land on the next point); three outputs (the position goes through the input shaper, which is off, to the position loop; speed feedforward times vff 1; acceleration times aff 0, unused); three behind (131,071 is passed at tick 1530; in the cruise the command trails the master by 3 ms, 3,932 counts). The end: the command reaches the end point at tick 3030 (303 ms) and the internal reached bit is back at tick 3192, but CSP's statusword table has no target-reached row and it reads 0x1237 throughout. Your turn: with a 2 ms cycle and 0x60C2 set to match, the lag is 6 ms, about 7,865 counts, and the end comes at tick 3060.