emmebrusa / TSDZ2-Smart-EBike-860C

TSDZ2 Open Source Firmware adapted to 860C display
GNU General Public License v3.0
43 stars 12 forks source link

Update main.h #1

Closed michibike closed 1 year ago

michibike commented 3 years ago

faster response

emmebrusa commented 3 years ago

Thank you for the report, you understand that to have greater reactivity the ramp must be faster, but it is not necessary to change that value. The two ramp up parameters are used to calculate the acceleration ramp as a function of speed, the higher the speed, the faster the ramp. I had changed the values ​​in the stock displays version as follows:

define PWM_DUTY_CYCLE_RAMP_UP_INVERSE_STEP_DEFAULT 160

define PWM_DUTY_CYCLE_RAMP_UP_INVERSE_STEP_MIN 20

in the other versions I forgot, but it is not important. Let me explain, the value 195 is not a fixed value, it is recalculated according to the "Motor acceleration" parameter. Zero speed example: With Motor acceleration = 0%, ramp step = 195 With Motor acceleration = 50%, ramp step = 109.5, ((195-24) (100-50) / 100) +24 With Motor acceleration = 100%, ramp step = 24 So if PWM_DUTY_CYCLE_RAMP_UP_INVERSE_STEP_DEFAULT to 40 is okay with you, just set "Motor acceleration" to 90%, ((195-24) (100-90) / 100) + 24 = 41. With this value, be careful of starting uphill with a high level of assistance. Attention, the "Motor acceleration" setting depends on the motor-battery voltages, I would not go beyond double the values recommended in the manual.

michibike commented 3 years ago

unfortunately it doesn't work. Setting the motor acceleration to 99 has no effect on the response. the engine still takes a long time to respond. then he just hacks in suddenly. with the change from 195 to 40 there is no delay in responding. when down from 49 to 15 and the lag is fixed.

emmebrusa commented 3 years ago

Strange, the Motor acceleration parameter is used to change that value, 0% = 195, 100% = 24. If so, there is something wrong. I'll check.