Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Copy link
Owner

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 🙂

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);
Copy link
Owner

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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?

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...)

Copy link
Owner

Choose a reason for hiding this comment

The 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) {
Expand Down
Loading