Skip to content

Commit

Permalink
Don't set brake_timeout on startup
Browse files Browse the repository at this point in the history
Just leave it at 0, meaning it's timed out and let the brake just be
activated by motor movement.

Feature: Don't activate idle brake right after startup
  • Loading branch information
lukash committed Oct 20, 2024
1 parent 70a705c commit d860415
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1012,10 +1012,8 @@ static void apply_turntilt(data *d) {
}

static void brake(data *d) {
// Brake timeout logic
float brake_timeout_length = 1; // Brake Timeout hard-coded to 1s
if (d->motor.abs_erpm_smooth > ERPM_MOVING_THRESHOLD || d->brake_timeout == 0) {
d->brake_timeout = d->current_time + brake_timeout_length;
if (d->motor.abs_erpm_smooth > ERPM_MOVING_THRESHOLD) {
d->brake_timeout = d->current_time + 1.0f;
}

// Reset VESC Firmware safety timeout
Expand Down

0 comments on commit d860415

Please sign in to comment.