pub enum BrakeMode {
Coast,
Brake,
Hold,
}Expand description
The brake mode determines how motors behave when stopped.
Each mode offers different trade-offs between stopping speed, position accuracy, and power consumption:
- Coast: Lowest power consumption, but least precise stopping
- Brake: Good balance between speed and precision
- Hold: Most precise, but highest power consumption
§Examples
use ev3_drivebase::BrakeMode;
// For general movement where exact stopping position doesn't matter
let casual = BrakeMode::Coast;
// For controlled stopping without position holding
let controlled = BrakeMode::Brake;
// For precise positioning tasks
let precise = BrakeMode::Hold;Variants§
Coast
The motor will freely coast to a stop.
No active braking is applied. The motor will gradually slow down due to friction. This mode uses the least power but provides the least control over stopping position.
Brake
The motor will actively brake, resisting motion until it comes to a stop.
Slows the motor faster than Coast but does not hold the final position.
After stopping, the motor can be moved freely by external forces.
Hold
The motor will actively hold its current position once stopped.
Provides the most precise stopping and maintains position against external forces. This mode consumes more power as it continuously applies holding torque.
Trait Implementations§
Source§impl Ord for BrakeMode
impl Ord for BrakeMode
Source§impl PartialOrd for BrakeMode
impl PartialOrd for BrakeMode
impl Copy for BrakeMode
impl Eq for BrakeMode
impl StructuralPartialEq for BrakeMode
Auto Trait Implementations§
impl Freeze for BrakeMode
impl RefUnwindSafe for BrakeMode
impl Send for BrakeMode
impl Sync for BrakeMode
impl Unpin for BrakeMode
impl UnwindSafe for BrakeMode
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)