Stop

class Stop

Action after the motor stops.

COAST

Let the motor move freely.

BRAKE

Passively resist small external forces.

HOLD

Keep controlling the motor to hold it at the commanded angle. This is only available on motors with encoders.

The following table shows how each stop type adds an extra level of resistance to motion. In these examples, m is a Motor and and d is a DriveBase. The examples also show how running at zero speed compares to these stop types.

Type
Friction
Back
EMF
Speed
kept at 0
Angle kept
at target
Examples

Coast

m.stop()
m.run_target(500, 90, Stop.COAST)

Brake

m.brake()
m.run_target(500, 90, Stop.BRAKE)
m.run(0)
d.drive(0, 0)

Hold

m.hold()
m.run_target(500, 90, Stop.HOLD)
d.straight(0)
d.straight(100)