Basia said:
I'm confused, how can I fix it? (((
[youtube]Mrh2Cx6gcyw[/youtube]
If you are using "my" code, which I am familiar with, I would say that on the previous video that issue does not happen if you are riding the device... That is regen happening very slowly as that wheel has a very small mass.
On the last videos, when it accelerates without pushing the throttle, it is usually also regen working but in wrong conditions, like using a lab power supply instead of a battery.
This is the only piece if code that will increase duty-cycle automatically/without user pushing the throttle:
Code:
else if ((UI8_ADC_BATTERY_VOLTAGE > ((uint8_t) ADC_BATTERY_VOLTAGE_MAX)) || // verify battery max voltage limit
(UI8_ADC_BATTERY_CURRENT < ui8_adc_target_battery_regen_current_max) || // verify battery max regen current limit
(ui8_adc_motor_current < ui8_adc_target_motor_regen_current_max)) // verify motor max regen current limit
{
if (ui8_duty_cycle < 255)
{
ui8_duty_cycle++;
}
}