TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Is anyone susesfully using a throttle on the v0.19 beta?

I am getting the adc values reporting fine (menu 10/1) I have set the throttle to active (menu 8/4) but cannot get the throttle to trigger to actually activate the motor?

Unrelated issue but I am also seeing the flashing 'error 1' when I apply pressure to the pedals without rotating if not moving for 5 seconds. This is easy to do on this install as its a trike and you tend to add pressure before you set off. Is it possible to increase this timeout or remove all together or maybe adjust the lower pressure that triggers it?

 
Tonite i flashed the 0.19 beta4 that sorted the distance bug, that showed 2x the actual distance performed.

Unfortunately the other bugs are still there:
1. Walk assist is way too strong.. you have to run (not walk) besides the bicycle to keep up..
2. If I use the 1st assistance (I set it to a low value like 0.1) and the motor is currently giving some power, if I switch to assistance 0 while pedalling the motor keeps giving power even if I stop pedalling. It does not detected that assistance 0 is set (no power should be present) and even that there is no pedals turning. every assistance should be cut when 0 is set.
3. I felt, in some assist level, that the motor cuts with a bit of delay when I stop pedalling. Not a problem if you have the brake cut off but still annoying.

General feeling is that the assistance is too strong compared tho the v0.18... and you cannot properly space up the power levels.

The above impressions just after a garage test, i will try to do a better one..
 
perryscope said:
Is anyone susesfully using a throttle on the v0.19 beta?

I am getting the adc values reporting fine (menu 10/1) I have set the throttle to active (menu 8/4) but cannot get the throttle to trigger to actually activate the motor?

Did you successfully use v0.18.2? That was the first version that forced you to specifically turn the throttle on.
 
My motors has no throttle so I can't develop and test for it. Would be nice if more developers could help.

Also, please write the issues on the issue list on GitHub other way we simple forget them.
 
perryscope said:
Unrelated issue but I am also seeing the flashing 'error 1' when I apply pressure to the pedals without rotating if not moving for 5 seconds. This is easy to do on this install as its a trike and you tend to add pressure before you set off. Is it possible to increase this timeout or remove all together or maybe adjust the lower pressure that triggers it?
That is a protection and gave work to develop and test, was asked by an user and I think we still need it.

Would 10 seconds work for your users??
 
casainho said:
perryscope said:
Unrelated issue but I am also seeing the flashing 'error 1' when I apply pressure to the pedals without rotating if not moving for 5 seconds. This is easy to do on this install as its a trike and you tend to add pressure before you set off. Is it possible to increase this timeout or remove all together or maybe adjust the lower pressure that triggers it?
That is a protection and gave work to develop and test, was asked by an user and I think we still need it.

Would 10 seconds work for your users??

Yes thanks i think 10 seconds would work better for trike users. when it errors in this way, if you apply no force on the pedals for a few seconds it will reset but i found i triggered it every time i got on to ride.

i will also test v0.18.2 and report on github issues as you mentioned. Thanks

Update. Tested with 0.18.2 and the throttle works great, so its something specific to V0.19 beta
 
I changed that timeout to be 10 seconds. The code is on the master branch, please build and test it.
 
Happy Easter everyone!
Yesterday I tried the 0.19beta4 for 50km and 1550m D+ and I confirm the issues mentioned on my previous post. I will try to create a GitHub account to track them..

I also experienced the blinking 1 error during a 30% slope, what does it represent? What's the logic behind this blinking 1 code?

overall I feel that there is something wrong with the assist multiplier.
I had to drastically reduce the assist levels (5 levels: 0.1/0.2/0.5/0.8/1.2) compared to the previous release otherwise the motor gets immediately to the maximum.
According to the shown human power, the multiplier set on the configuration menu does not match with the motor power, for instance the assist 3 (0.5) gives about the same motor power as human power, like if the multiplier was set to 1.0.
I do not know how to better explain, but perhaps this issue is related also to the walk assist, that is not usable as intended. In fact, the walk assist is too strong, regardless the assist level, gear or slope, the bike starts running and you cannot keep that speed beside.
 
casainho said:
Just saw the previous message, where the erps value is 480.

Our motors has 16 magnets, so 8 pairs of them. Motor max rpm is 4000 at 48V. So, (4000/60)* 8 = 533 erps.

48v/533 = 0.09V per erps of motor generated BEMF that is contrary to power supply 48V.

At 480 erps, it is a BEMF of 43.2V. This means the only voltage on motor coils are 48 - 43.2 = 4.8V.

If the power was 300W, the current can be about 300/48 = 6 amps.

So, motor is absorbing only 6 amps instead of the 18 amps you would like to, but that is a limitation of the BLDC motors, they say they has max torque at startup and it reduces to 0 at motor max speed.

Starting from the experimental hugh cadence mode and based on the technical details above provided by casainho, I tested various combinations of FOC angle and MAX_ERPS for the 48v motor trying to find the best motor behavior.
I tested FOC from 200 - 230 and MAX_ERPS from 700 - 1000.
The best values I found are FOC 220 with ERPS 900 and I tested them for 300 km so far on flat, city traffic and also climb. I am very pleased, all aspects are improved clearly.
Power = the improvement is clear from the old experimental candence mode (199 - 700) and quite big from standard mode.
Temperature = depending on the type of ride the increase is around 5 - 10 C.
Battery consumption = it is almost the same. I did not notice any difference.

I tested the changes on 0.18.02. I recommend also other users to test it. If the feedback is good we should add it as new experimental mode for 48v in next release.
 
thineight said:
I had to drastically reduce the assist levels (5 levels: 0.1/0.2/0.5/0.8/1.2) compared to the previous release otherwise the motor gets immediately to the maximum.
According to the shown human power, the multiplier set on the configuration menu does not match with the motor power, for instance the assist 3 (0.5) gives about the same motor power as human power, like if the multiplier was set to 1.0.
Are you sure on this??

What I see is the multiplication of the human power being correct, like if I do 0.5 and human power is 200, I get 100 on the motor.

What I think is wrong is the human power value, seems like it did double to me... like if on peak startup I can go to 800W on pedals!! I was not able to verify but I think the issue can be on the pedal cadence value that for some reason, now it has the double value!!

Can you please look at the cadence value? And after the human power value??
 
casainho said:
thineight said:
I had to drastically reduce the assist levels (5 levels: 0.1/0.2/0.5/0.8/1.2) compared to the previous release otherwise the motor gets immediately to the maximum.
According to the shown human power, the multiplier set on the configuration menu does not match with the motor power, for instance the assist 3 (0.5) gives about the same motor power as human power, like if the multiplier was set to 1.0.
Are you sure on this??

What I see is the multiplication of the human power being correct, like if I do 0.5 and human power is 200, I get 100 on the motor.

What I think is wrong is the human power value, seems like it did double to me... like if on peak startup I can go to 800W on pedals!! I was not able to verify but I think the issue can be on the pedal cadence value that for some reason, now it has the double value!!

Can you please look at the cadence value? And after the human power value??
I will double check, I was comparing the human and motor power on the menu 4.0.
But it is sure that the assist levels had to be drastically reduced compared to 18.x not to have strong assistance. The behaviour is confirmed also in the Italian forum.

I do not know how the human power is calculated, I will check also the cadence and report something..

Btw, what is the blinking 1 code?

Thanks
 
Hello casainho,
I just checked some of the parameters you suggested.
The cadence shown on menu 4.1 looks fairly correct, and i assume that also the human power is somehow correct given the torque value, cadence and relevant multipliers.

The motor power does not match the multiplier of the assistance level.
In fact the assistance 1 (multiplier 0.1) gives about the 20% of human power shown in menu 4.0, i.e. 2x the set value.
Assistance 2 (multiplier 0.2) gives nearly half of the human power, again about 2x more.
Assistance 3 (multiplier 0.4) gives the same as human power.. again 2x more.

I conclude that there is a multiplier somewhere that spoils the intended motor power.

As mentioned earlier, the walk assist at any assistance brings the bike to more than 10 km/h, unusable pushing the bike uphill. Maybe the issue is linked to the above "scale factor" in motor power.

Hope this helps.
Ciao!
 
thineight said:
casainho said:
thineight said:
I had to drastically reduce the assist levels (5 levels: 0.1/0.2/0.5/0.8/1.2) compared to the previous release otherwise the motor gets immediately to the maximum.
According to the shown human power, the multiplier set on the configuration menu does not match with the motor power, for instance the assist 3 (0.5) gives about the same motor power as human power, like if the multiplier was set to 1.0.
Are you sure on this??

What I see is the multiplication of the human power being correct, like if I do 0.5 and human power is 200, I get 100 on the motor.

What I think is wrong is the human power value, seems like it did double to me... like if on peak startup I can go to 800W on pedals!! I was not able to verify but I think the issue can be on the pedal cadence value that for some reason, now it has the double value!!

Can you please look at the cadence value? And after the human power value??
I will double check, I was comparing the human and motor power on the menu 4.0.
But it is sure that the assist levels had to be drastically reduced compared to 18.x not to have strong assistance. The behaviour is confirmed also in the Italian forum.

I do not know how the human power is calculated, I will check also the cadence and report something..

Btw, what is the blinking 1 code?

Thanks

Blinking Code 1 is triggered when the Motor detects torque applied to the pedals but the motor does not rotate within 5 seconds ( 10 seconds in current source to be tested). If you do not apply torque for another 5 seconds ( i.e back pedal is a good way to do this while riding to be sure) then it should reset and allow you to power the motor again.

I have found this is usually triggered when you set off and apply pressure to the pedals with the brakes on (if not running break sensors on both brakes) or in my case also with a trike were its easy to apply pressure to the pedal but not actually rotate.
 
I got the main issues solved, I hope, I was able to test most of them:

- corrected cadence value (now cadence and human pedal power are correct)
- walk assist levels are now setup as PWM duty-cycle values
- no motor power when assist level = 0
- throttle overrides torque sensor

https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.19.0-beta5
 
Great, will try.
Does the LCD3 require the update too? Or just the motor side? I've the beta4 currently.
 
maximusdm said:
(...)
Power = the improvement is clear from the old experimental candence mode (199 - 700) and quite big from standard mode.
Temperature = depending on the type of ride the increase is around 5 - 10 C.
Battery consumption = it is almost the same. I did not notice any difference.

I tested the changes on 0.18.02. I recommend also other users to test it. If the feedback is good we should add it as new experimental mode for 48v in next release.

Hi, just for me to understand - do you mean 5..10°C of additional temperature increase or just 5-10°C above ambient?
 
crun said:
Rafe said:
I've been running the TSDZ2 52 v version for a year now over some of the steepest terrain and and have never found overheating to be a problem ... There is already a relatively large surface area of metal to metal contact where the motor inserts into the motor housing to transfer heat away. The major problem with this drive is the noise it makes and the blue gear which can fail without warning

As the (metal) motor shaft is the driving gear to the blue gear, I have wondered if
high motor temperature >> high gear temperature >> blue gear stripping

jbalat said:
Spiked, would be great if we could conduct some heat between the motor and motor casing ? Any ideas ?
Fan is likely easiest *if* it moves enough air. I will be trying this on the bench when a 35mm fan arrives from CN. I have a high current supply that can heat up the motor with DC, so I can accurately measure thermal resistance on the bench with various scenarios:
Factory standard
Motor+fan
Black inside of cover to improve radiation transfer
Black motor to improve radiation
thermal grease/tape between front motor flange and case

Did you get meaningful data on this?
 
hefest said:
crun said:
Rafe said:
I've been running the TSDZ2 52 v version for a year now over some of the steepest terrain and and have never found overheating to be a problem ... There is already a relatively large surface area of metal to metal contact where the motor inserts into the motor housing to transfer heat away. The major problem with this drive is the noise it makes and the blue gear which can fail without warning

As the (metal) motor shaft is the driving gear to the blue gear, I have wondered if
high motor temperature >> high gear temperature >> blue gear stripping

jbalat said:
Spiked, would be great if we could conduct some heat between the motor and motor casing ? Any ideas ?
Fan is likely easiest *if* it moves enough air. I will be trying this on the bench when a 35mm fan arrives from CN. I have a high current supply that can heat up the motor with DC, so I can accurately measure thermal resistance on the bench with various scenarios:
Factory standard
Motor+fan
Black inside of cover to improve radiation transfer
Black motor to improve radiation
thermal grease/tape between front motor flange and case
Did you get meaningful data on this?

It is an idea, changing the design and adding an air inlet and water outlet, and slots for ventilation in the engine .... would have to ensure the tightness of the system ...

https://www.thingiverse.com/thing:2025367
 
ive been wondering about this for a while now and still no closer to finding the answer.

given that i can select watts and amps limit in the settings and i know my battery voltage lets say its a freshly charged 48v battery putting out around 52v

if i set the watts limit to 600 and the amps limit to 15

how exactly does the controller and software decide what to use between the amps and the volts to get to that 600w limit?

is it all the volts and some of the amps 600/52 = 11.53 amps.

or is it all the amps and some of the volts 600/15 = 40 volts

or a mixture of both in some kind of ratio ?
 
casainho said:
I got the main issues solved, I hope, I was able to test most of them:

- corrected cadence value (now cadence and human pedal power are correct)
- walk assist levels are now setup as PWM duty-cycle values
- no motor power when assist level = 0
- throttle overrides torque sensor

https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.19.0-beta5

Thanks again for the quick turn around on thease casainho
Having tested v0.19.0-beta5 quickly on the stand indoors.

- corrected cadence value (now cadence and human pedal power are correct) - untested
- walk assist levels are now setup as PWM duty-cycle values - confirmed working as expected
- no motor power when assist level = 0 - confirmed working as expected
- throttle overrides torque sensor - unfortunatly still no throttle , but readings as expected so throttle input is detected correctly
 
Hello everybody,

My bro and I just went for a ride today. We have the same 48V 13ah battery, same motor, only the bike is different and I was on the v0.19.0-beta5 whereas he was on the beta4.

We can confirm that the cadence issue is corrected (he got twice than mine)

Not sure about it (not a test, too few opensource firmware experience) but it seems that the max wheel speed was actually buggy sometimes (printing values way lower that the actual ones i.e 10kmh instead of 38kmh).
 
Hello, i did test the beta5 too tonight.. just a garage check to be honest.

+ Cadence: did not try but i trust the commenti here above
+ Walk assist is now reasonably good and, I presume, usable in mountain
+ Still power at assistance 0: seems solved
+ Despite my low assistance levels 0.1/0.2/0.4/0.7/1.2 I see the motor power compared to human power (menu 4.0) is still 20%/40%/100%/etc.. that is double than expected. Unless I misunderstood the logic, if I set assistance 0.2 I expect that, if I put 200W myself, the motor contributes with 40W, correct?
 
Hello,
unfortunately the git does not compile since 25.04.
sdcc 3.8.0 win7 64bit.
  • This script will release a new version of the firmware, e.g. 1.0.0
    Please enter the new version number: 26.04
    Cleaning files...
    Done.
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -owatchdog.c watchdog.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -otorque_sensor.c torque_sensor.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -ouart.c uart.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -opwm.c pwm.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -omotor.c motor.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -owheel_speed_sensor.c wheel_speed_sens
    or.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -obrake.c brake.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -opas.c pas.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -oadc.c adc.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -otimers.c timers.c
    sdcc -c -I../common/STM8S_StdPeriph_Lib/inc -I. -I../ -mstm8 -Ddouble=float --st
    d-c99 --nolospre --out-fmt-ihx --debug -oebike_app.c ebike_app.c
    ebike_app.c:908: error 20: Undefined identifier 'configuration_variables'
    ebike_app.c:908: error 25: Structure/Union expected left of '.->'
    ebike_app.c:911: error 20: Undefined identifier 'ui8_walk_assist_target_PWM'
    ebike_app.c:916: error 20: Undefined identifier 'ui8_walk_assist_target_PWM'
    ebike_app.c:916: error 20: Undefined identifier 'configuration_variables'
    ebike_app.c:916: error 25: Structure/Union expected left of '.->'
    make: *** [ebike_app.rel] Error 1

    Failed with error code 2.
    Drücken Sie eine beliebige Taste . . .
 
thineight said:
+ Despite my low assistance levels 0.1/0.2/0.4/0.7/1.2 I see the motor power compared to human power (menu 4.0) is still 20%/40%/100%/etc.. that is double than expected. Unless I misunderstood the logic, if I set assistance 0.2 I expect that, if I put 200W myself, the motor contributes with 40W, correct?
New beta:

https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/releases/tag/v0.19.0-beta6

corrected humam power value shown on KT-LCD3 (thanks to Leon leon927)
updated configuration menus buttons (thanks to Jeroen Brosens j0bro)
 
casainho said:
updated configuration menus buttons (thanks to Jeroen Brosens j0bro)

Thanks for the update!
Does this configuration require a new wiki? I don't understand what was changed..
 
Back
Top