-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] DriveBase cannot brake, deceleration is too lazy #881
Comments
Which of the following would you prefer? Or both?
The good news is that you can technically already do both, so you could try to see what works best. To try brake, just call To try a separate deceleration value, perhaps test it in a separate program with a single motor first. You can pass a tuple to the acceleration value. Now, the DriveBase has two of such |
Since you already have brake on Motor, I like the simplicity of adding a matching DriveBase.brake(), so that seems like a simple and easy addition. You could also argue that stop() should brake and drive(0, 0) should decelerate, but that would change current behavior. For deceleration, I did see mention of the tuple for motors but wasn't sure how this would apply to a DriveBase, and as you describe above it's more complex than I would want a DriveBase user to deal with... Since DriveBase.settings() says it applies to the measured movements (but actually applies to drive() too?), perhaps adding a new method that applies specifically to drive() and stop(), since that is really a different situation, and also deserves different defaults. I think the default decel for stop() should be pretty steep. If the default is good, then most users won't have to deal with the settings, given the choice between stop() for a steep decel and brake(). |
With the possible change to
Thanks, this sounds like it needs fixing. Indeed, the settings method should work consistently for everything now, including |
This makes the limits() implementation easier to follow and we will be able to re-use it for DriveBase deceleration. See pybricks/support#881
Deceleration can now be set just like with a single motor: an |
|
Deceleration and passive brake are now both available! |
DriveBase has a stop() method, but this appears to only coast and there is no option to brake. Also, although acceleration works well, the deceleration behavior is not good for remote control (control loop) applications.
When using remote control, it is desirable to have a slower and smoother start, and specifying a lower acceleration can achieve this. However, this also makes the robot decelerate slowly, so once you lift off of the button to stop, the robot overshoots by a lot.
Adding the ability to brake would be an easy way for a user program to fix this.
Also for advanced users, being able to have the acceleration and deceleration ramps be different would be nice, if brake is too sudden.
The text was updated successfully, but these errors were encountered: