OpenSourceEBike / TSDZ2-Smart-EBike

Flexible OpenSource firmware for TongSheng TSDZ2 mid drive ebike motor
GNU General Public License v3.0
251 stars 130 forks source link

Current controller counter issue in motor.c #151

Open 4var1 opened 3 years ago

4var1 commented 3 years ago

ui16_motor_speed_controller_counter never gets reset after firing so will fire lots more than expected... means it fires most of the time - only not firing for 2000 pwm cycles just after ui16_motor_speed_controller_counter wraps back to 0...

Not tested - just noticed as part of porting mspider65's changes across

else if ((ui16_motor_speed_controller_counter > 2000) && // test about every 100ms
    (ui16_motor_speed_erps > ui16_max_motor_speed_erps))

The equivalent current counter gets reset ok - so would work as expected...

if (ui8_current_controller_counter > 14)
  ui8_current_controller_counter = 0;
casainho commented 3 years ago

Good catch!

4var1 commented 3 years ago

no probs - any idea why I can't open issues for the Android App too?

On Mon, 12 Apr 2021 at 15:34, casainho @.***> wrote:

Good catch!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenSourceEBike/TSDZ2-Smart-EBike/issues/151#issuecomment-817864119, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRDIVWY4YMPO3N45CT7ETLTIMAF3ANCNFSM42Y5T7XQ .

casainho commented 3 years ago

no probs - any idea why I can't open issues for the Android App too?

Was disabled. You can now.

4var1 commented 3 years ago

OK great thanks

On Tue, 13 Apr 2021, 12:35 casainho, @.***> wrote:

no probs - any idea why I can't open issues for the Android App too?

Was disabled. You can now.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/OpenSourceEBike/TSDZ2-Smart-EBike/issues/151#issuecomment-818666038, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASRDIVQZSNQUV3N57FX22C3TIQT75ANCNFSM42Y5T7XQ .