TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Electric Motors and Controllers
casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 17 2019 3:39am

Zelenaar wrote:
Apr 17 2019 2:10am
Nick wrote:
Apr 16 2019 4:23am

BTW,
discussing all technical ideas and details in this thread makes it very confusing. Should we move with those details to another solution? Github maybe?
Nick,
indeed maybe better to create a seperated post for it "TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor - SW102 developments"

Casainho,
Could you give me write access to the github section for SW102 (Also "Zelenaar") ? I would like to start adding a "spec wishlist" for the android app. and maybe some different gui designs for SW102 & Android app
Is there somewhere a list of info's that can be displayed ? (speed, odo, motor watts, human watts, .....) ?
stupid question without going thr your existing display codes ... Is the basic principle that the data is pushed to the display by the motor ? or is the display every x sec pulling the data from the motor ?

PS : I'm still waiting on my SW102 displays, hopefully in 1 to 2 weeks until then I need to limit myself to "paperware" :evil:
I created this thread specifically for SW102: https://endless-sphere.com/forums/viewt ... 30&t=99698

I gave you write permissions to the wiki and repo for SW102 firmware. For mobile app, maybe we should use another repo specific to that.

Motor controller pushes data to the display and it is very basic to understand, please see here the full data that is sent:
uart_send_package()

https://github.com/OpenSource-EBike-fir ... bike_app.c

See that there are some features that are implemented by the LCD, like battery colomb counting for SOC.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

perryscope   100 W

100 W
Posts: 105
Joined: Jan 06 2019 4:29pm
Contact:

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by perryscope » Apr 19 2019 1:24pm

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?
IMG_20190419_101428-800x600.jpg
IMG_20190419_101428-800x600.jpg (273.98 KiB) Viewed 1610 times
Empowered people support rider and trustee
www.empoweredpeople.co.uk

thineight   100 W

100 W
Posts: 187
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Apr 19 2019 5:01pm

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..
MTB KTM Ultra 29" - City bike DAYTONA 28"

Rydon   100 W

100 W
Posts: 237
Joined: Aug 11 2016 5:26pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by Rydon » Apr 20 2019 2:54am

perryscope wrote:
Apr 19 2019 1:24pm
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.

casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 20 2019 3:03am

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.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 20 2019 10:01am

perryscope wrote:
Apr 19 2019 1:24pm
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??
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

perryscope   100 W

100 W
Posts: 105
Joined: Jan 06 2019 4:29pm
Contact:

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by perryscope » Apr 20 2019 2:35pm

casainho wrote:
Apr 20 2019 10:01am
perryscope wrote:
Apr 19 2019 1:24pm
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
Empowered people support rider and trustee
www.empoweredpeople.co.uk

casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 21 2019 2:57am

I changed that timeout to be 10 seconds. The code is on the master branch, please build and test it.
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

thineight   100 W

100 W
Posts: 187
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Apr 21 2019 12:35pm

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.
MTB KTM Ultra 29" - City bike DAYTONA 28"

maximusdm   10 W

10 W
Posts: 69
Joined: Sep 08 2018 12:51pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by maximusdm » Apr 22 2019 4:28am

casainho wrote:
Mar 19 2019 11:10am
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.

casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 22 2019 10:05am

thineight wrote:
Apr 21 2019 12:35pm
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??
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

thineight   100 W

100 W
Posts: 187
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Apr 22 2019 12:53pm

casainho wrote:
Apr 22 2019 10:05am
thineight wrote:
Apr 21 2019 12:35pm
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
MTB KTM Ultra 29" - City bike DAYTONA 28"

thineight   100 W

100 W
Posts: 187
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Apr 22 2019 4:38pm

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!
MTB KTM Ultra 29" - City bike DAYTONA 28"

perryscope   100 W

100 W
Posts: 105
Joined: Jan 06 2019 4:29pm
Contact:

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by perryscope » Apr 23 2019 3:59am

thineight wrote:
Apr 22 2019 12:53pm
casainho wrote:
Apr 22 2019 10:05am
thineight wrote:
Apr 21 2019 12:35pm
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.
Empowered people support rider and trustee
www.empoweredpeople.co.uk

casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 23 2019 8:25am

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-fir ... 19.0-beta5
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

thineight   100 W

100 W
Posts: 187
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Apr 23 2019 10:04am

Great, will try.
Does the LCD3 require the update too? Or just the motor side? I've the beta4 currently.
MTB KTM Ultra 29" - City bike DAYTONA 28"

torque72   1 µW

1 µW
Posts: 3
Joined: Apr 21 2019 3:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by torque72 » Apr 23 2019 1:32pm

maximusdm wrote:
Apr 22 2019 4:28am
(...)
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?

hefest   10 W

10 W
Posts: 83
Joined: Jan 11 2019 4:55am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by hefest » Apr 23 2019 3:14pm

crun wrote:
Dec 01 2018 12:22am
Rafe wrote:
Nov 30 2018 7:02pm
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 wrote:
Oct 16 2018 1:57am
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?

User avatar
ashrambo   1 W

1 W
Posts: 53
Joined: Apr 30 2018 4:31am
Location: Madrid
Contact:

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by ashrambo » Apr 24 2019 2:39am

hefest wrote:
Apr 23 2019 3:14pm
crun wrote:
Dec 01 2018 12:22am
Rafe wrote:
Nov 30 2018 7:02pm
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 wrote:
Oct 16 2018 1:57am
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
TREK REMEDY MOTOR TSDZ2

la8rat   1 W

1 W
Posts: 59
Joined: Mar 12 2019 10:34am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by la8rat » Apr 24 2019 10:25am

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 ?

perryscope   100 W

100 W
Posts: 105
Joined: Jan 06 2019 4:29pm
Contact:

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by perryscope » Apr 24 2019 12:55pm

casainho wrote:
Apr 23 2019 8:25am
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-fir ... 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
Empowered people support rider and trustee
www.empoweredpeople.co.uk

SamCX   1 µW

1 µW
Posts: 4
Joined: Mar 27 2019 9:31am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by SamCX » Apr 24 2019 4:14pm

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).

thineight   100 W

100 W
Posts: 187
Joined: Oct 05 2018 3:53am

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by thineight » Apr 24 2019 4:40pm

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?
MTB KTM Ultra 29" - City bike DAYTONA 28"

bruwie   1 mW

1 mW
Posts: 13
Joined: Mar 02 2017 3:12pm
Location: Lower Saxony,Germany

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by bruwie » Apr 26 2019 10:12am

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 . . .
TSDZ2 36 Volt 350 Watt with motor temperature sensor, LCD3, Batterypack 36 Volt 23 Ah, no throttle and brakesensors

casainho   1.21 GW

1.21 GW
Posts: 3586
Joined: Feb 14 2011 2:43pm

Re: TSDZ2 mid drive -- Flexible OpenSource firmware for TongSheng TSDZ2 mid drive motor

Post by casainho » Apr 26 2019 1:03pm

thineight wrote:
Apr 24 2019 4:40pm
+ 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-fir ... 19.0-beta6

corrected humam power value shown on KT-LCD3 (thanks to Leon leon927)
updated configuration menus buttons (thanks to Jeroen Brosens j0bro)
Developer of the Flexible OpenSource firmware for EBike motor controllers (TSDZ2 and KT) and LCDs (KT-LCD3 and Bafang 850C color LCD).

If you like my work, please consider making a donation. I am being using the donations to buy needed resources for my developments. My paypal: casainho AT gmail.com.

Post Reply