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 1: rising edge
The control layer's state machine is four if-blocks inside PosSpeedCtlLoopTask (motor_ctl_sm.c:345–400), run once per position tick: ERROR / DISABLE / ENABLE. Its input motor_enable is written straight by set_app_Controlword. Enable is an edge: ENABLE only when motor_enable is 1 and last tick's motor_enable_last was 0, so writing 1 again does nothing (the real run shows no event at 1200 ms); before the switch, ModeCheckInInit resets the loops and sets the target to the current position. Disable is a level: a 0 on any tick means DISABLE at once, with the current loop's inputs zeroed. A 2 (quick stop) means nothing to this layer; the PP app ramps to zero speed and writes 0 itself (1331.05 ms). A bus sag to 10 V for 300 ms gives DISABLE, not ERROR: with the application layer in charge error_enable is 0, the control layer's own protection is masked, and the application layer's under-voltage check writes 0 after 200 ms. The only writer of ERROR is nFault: the break interrupt switches the outputs off and AppStatusScanSlow writes state −1, error 8 directly; the host's 1, 0, 3, 0, 1 afterwards are all rewritten to 0 by the application layer every tick, and only a reset clears it. Your turn: a 0 then a 1 between two ticks, and nothing happens.