updated motor state machine