You are here

Cruise Control Questions

4 posts / 0 new
Last post
piopi0
Offline
Last seen: 3 weeks 1 day ago
Joined: 2021-02-05 19:40
Posts: 1
Cruise Control Questions

I'm running a VESC6 on the V5.3 firmware. My throttle is set up as "ADC + UART" and I am using "Current no reverse Brake Center". According to this post I should be able to use a button connected to PPM to use control cruise control. However, despite trying pull-up and pull-down button configurations connected to PPM I've had no luck getting the feature to work.

Does anyone have any information regarding the feature? It seems like support may have been removed in newer firmware or limited to the NRF controller?

Frederik Aksel Holst
Offline
Last seen: 6 months 6 days ago
VESC Free
Joined: 2023-05-04 23:33
Posts: 3

Did you ever figure it out?

 

vadicus
Offline
Last seen: 11 hours 50 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 427

Just tested it on 5.3 with ADC+UART Current No Reverse Brake ADC2 and it works when PPM/Servo input is shorted to the ground. The button state is read in the code snippet below in the adc.c file. Depending on what the control mode is selected the PPM pin is assigned to be the cruise control button or the reverse button. If Inverted is selected in the app configuration, the cruise control or reverse is activated by shorting the PPM to 3.3v. The cruise stays activated while the wires are connected and turns off when they are disconnected, so you have to either use two position button or a push button and keep it pressed if for cruise. The first approach would likely be unsafe as cruise disengagement would depend on depressing the button and the second likely works fine for skateboards with the remote control held by a ride at all times but will be inconvenient on bikes, cars, etc. as it requires the push button to be pressed all the time to continue. I'll be adding some code to make the cruise button a toggle switch that also gets canceled on other events like brakes, throttle changes, etc. It might be also good to use the same cruise button for reverse by using long press (5 sec or so).

if (config.ctrl_type == ADC_CTRL_TYPE_CURRENT_REV_BUTTON ||
config.ctrl_type == ADC_CTRL_TYPE_CURRENT_REV_BUTTON_BRAKE_CENTER ||
config.ctrl_type == ADC_CTRL_TYPE_CURRENT_NOREV_BRAKE_BUTTON ||
config.ctrl_type == ADC_CTRL_TYPE_DUTY_REV_BUTTON ||
config.ctrl_type == ADC_CTRL_TYPE_PID_REV_BUTTON) {
rev_button = !palReadPad(HW_ICU_GPIO, HW_ICU_PIN);
if (config.rev_button_inverted) {
rev_button = !rev_button;
}
} else {

cc_button = !palReadPad(HW_ICU_GPIO, HW_ICU_PIN);
if (config.cc_button_inverted) {
cc_button = !cc_button;
}
}
}

 

 

NextGen FOC High voltage 144v/34s, 30kw (https://vesc-project.com/node/1477)

vadicus
Offline
Last seen: 11 hours 50 min ago
VESC Free
Joined: 2018-08-17 07:26
Posts: 427

I've added an example code how to implement a cruise control function with a push button.

Here: https://vesc-project.com/node/1521#comment-11493

 

 

 

NextGen FOC High voltage 144v/34s, 30kw (https://vesc-project.com/node/1477)