AGHSEagleRobotics / frc1388-2024

0 stars 0 forks source link

Brake/coast mode #35

Closed jtechau closed 8 months ago

jtechau commented 9 months ago

Extension of issue #36 item 4

Overview

When the robot is enabled, most motors have a desired brake/coast setting. For example, the drive train should be in brake mode to slow the robot when it's commanded to stop; a shooter may be in coast mode to conserve its momentum after shooting (good for shooter startup time and battery usage).

When the robot is disabled, it's beneficial for most motors to be in coast mode, to allow humans to manually move mechanisms more easily. For example, to push the robot across the floor, or to move an arm or other mechanism without fighting the braking force.

When the robot becomes disabled, we don't want the motors to immediately switch to coast mode. This has a negative side effect of allowing the robot to coast across the playing field when time expires at the end of a match. Other mechanisms may have similar side effects. In the past, we've used the roboRIO User button to switch the robot into coast mode, and automatically switch into brake mode when the robot is enabled.

We should implement brake/coast mode switching for motors as appropriate. When the robot enables, motors should switch to brake mode (as appropriate). Switching to coast mode could be either by use of the User button, or automatically some amount of time (e.g. 5 seconds) after the robot is disabled.

Automatically switching to coast mode should not happen if there are any safety concerns. (For example, in the 2023 game where the robot could be on an inclined ramp and start rolling unexpectedly).

Suggested implementation

calvinxp commented 8 months ago

done