Question about usage of 393 motors

I was looking at some older code from a top team that was using 393 motors for their drive motors. . When they went to stop the robot after a move, rather than just issuing a stop command, they would first issue a command with power in the opposite direction equal to approx 1/10 of the current power level. For example, they’d be driving at speed 127 and then when it reached the target, they would change power to -127/10 for approx 1/4 second, then set power to 0…

They did this in several different places in the code and the motor command in the opposite direction was between 1/10 and 1/20 of the current power level.

Why would a programmer issue a negative power command prior to stopping the motors?


I would imagine that the goal of that is to prevent it from overshooting, makes it slow down more gradually.

actually that would make it stop more abruptly. the reason is probably so that the robot doesn’t keep rolling after the motors stop getting power


Yep, it’s a brake function, if you just set it to zero power the robot (if it’s heavy) will roll forward another inch or so (depending on how fast it’s going, it could be farther). The reverse burst is a way to stop on a dime.


As others have said, this method can help to prevent overshoot. However, a more effective way to do this is with a PD or PID loop which essentially slows down as it reaches its target to prevent overshooting. Not only is it better for the motors, it’s much more accurate as well. :slight_smile:


Thanks for the replies. I guess I was surprised that the motors could handle this and wonder if it was a common technique. It is interesting to me that in some situations the ‘reverse burst’ was -1/19 of current power value for one side of the robot and -1/20 for the other side, which I imagine is to ensure the robot remains straight during the duration of the braking period.

1 Like