You are here

brake inhibit input

3 posts / 0 new
Last post
kylerlaird
Offline
Last seen: 1 year 9 months ago
VESC Original
Joined: 2020-12-29 16:28
Posts: 5
brake inhibit input

I'm curious if there's a quick way to inhibit braking with an external pulse.  I'm using a pedal torque sensor to drive ADC1 in current+braking mode on a bike.  If pedaling becomes too easy, braking kicks in.  I want to use the cadence output (which is 36 pulses/rev., currently on ADC2) to inhibit braking so that if there's forward pedal movement, even if torque/current goes to zero there will be no braking.

I've been thinking of analog ways to achieve this but I'd much rather keep it clean.  I realize I'm probably going to end up changing the firmware but I don't want to miss a clever option.  (It looks like it could take quite awhile to work through installing firmware.)

district9prawn
Offline
Last seen: 3 months 1 day ago
Joined: 2018-04-26 12:18
Posts: 124

So does your setup brake when you stop pushing on the torque sensor?

I think you only need to add a few lines to check the pas status in the else statement here where the brakes are being applied.

		case ADC_CTRL_TYPE_CURRENT_REV_BUTTON_BRAKE_ADC:
			current_mode = true;
			if (pwr >= 0.0) {
				// if pedal assist (PAS) thread is running, use the highest current command
				if (app_pas_is_running()) {
					pwr = utils_max_abs(pwr, app_pas_get_current_target_rel());
				}
				current_rel = pwr;
			} else {
				current_rel = fabsf(pwr);
				current_mode_brake = true;
			}

 

isamilner
Offline
Last seen: 1 year 9 months ago
Joined: 2021-03-02 09:24
Posts: 1

YES. You are brilliant. Thank you.

wobble man