Update the motor state periodically.