-
Notifications
You must be signed in to change notification settings - Fork 15
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
New brake current behavior for 6.05 firmware #7
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1052,7 +1052,22 @@ static void brake(data *d) { | |
} | ||
|
||
VESC_IF->timeout_reset(); | ||
VESC_IF->mc_set_brake_current(d->float_conf.brake_current); | ||
|
||
// If brake current is set to 0 don't do anything | ||
if (d->float_conf.brake_current == 0) { | ||
return; | ||
} | ||
|
||
// Use brake current over certain ERPM to prevent the board skidding to a stop when deactivated | ||
// at speed? | ||
if (d->motor.abs_erpm > 2000) { | ||
VESC_IF->mc_set_brake_current(d->float_conf.brake_current); | ||
return; | ||
} | ||
|
||
// Use DC control mode as it has better holding power | ||
// Also improves with 6.05 shorting feature | ||
VESC_IF->mc_set_duty(0); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if you'd always want to do this, not just when movement was detected (on line 1046 above) and it didn't time out? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
that would be a question for the VESC Discord. My guess is that it would waste energy and drain our batteries. That's why this entire logic exists (we used to not have it and brake current was keeping our ESCs warm...) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No response on the discord, I guess I'll do some testing when I have a chance... |
||
} | ||
|
||
static void set_current(data *d, float current) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the question mark in the comment intentional? It doesn't make me feel very confident 🙂