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 partsTwo state machines 3: switching both, and why the motor will not move
The host's mode write calls set_app_Modes_of_operation (data_param.c:1002): one write sets the control layer's mode (which loops ModeRun runs) and starts the application layer's app, and the two need not match (homing runs on the speed loops, CSP on the position loops). A value equal to the last request returns at once, and the "display" mode is just the stored request; a value with no case falls to the default, which sets the control layer to IDLE and calls no set_app; ModeRun's IDLE case writes the state to 0 itself. Four traps, all real runs: write 1 before the mode and PpModeInit overwrites the 1 with 0, so the motor never enables or calibrates and PP sits in READY, with 6000 starts in 600 ms; call only set_app, or write only the control word, and the control layer stays IDLE, disables itself at 1102.55 after calibration, and every later 0→1 enables and disables in the same tick; after a failed homing, writing 7 again is ignored until another mode comes first; writing 4 mid-move idles and disables the control layer while PP stays RUNNING. Your turn: writing 3 again mid-move does nothing at all.