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

Electric Motors and Controllers
buba   10 kW

10 kW
Posts: 550
Joined: Aug 31 2018 12:36am

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

Post by buba » Feb 28 2019 1:04pm

rmnlsn wrote:
Feb 28 2019 7:24am
Hello everybody,
I'm working on Windows 10,
the installed SDCC is at version mcs51/z80/z180/r2k/r3ka/gbz80/tlcs90/ds390/pic16/pic14/TININative/ds400/hc08/s08/stm8 3.8.0 #10562 (MINGW64),
the STVP is at versione 1.8.0.0.

When I compile the files in the src folder on master branch of Flexible OpenSource firmware for TongSheng TSDZ2 mid drive ebike motor with SDCC i get an ihx file.
Hi! That is correct. If you compile everything correctly you will have a file named main.ihx.
rmnlsn wrote:
Feb 28 2019 7:24am
Which are the next step to get the hex file for the STVP?
You need to convert the ihx file to the hex format. To do this follow this tutorial:

https://www.instructables.com/id/8051-P ... piler-SDC/

In short:

1. Open command
2. Go to the directory where you have the ihx file. Example: type cd Desktop if it is located inside Desktop
3. Type packihx main.ihx > TESTING.hex, replace "TESTING" with whatever name you prefer
4. You will now have the old ihx file and the new hex file in the same directory
5. Use the hex file in ST Visual Programmer as you normally would with any other hex file
rmnlsn wrote:
Feb 28 2019 7:24am
How can I be sure that the my hex and the TSDZ2-v0.18.2.hex are the same if I didn't modify any src file?
It should and must be the same if you are compiling the same source files. Do note that the latest source files will not compile version 0.18.2 of the firmware. The source files have been updated and are continually developed for the next version: 0.19.0.
rmnlsn wrote:
Feb 28 2019 7:24am
Can someone help me?
Hope it helped!
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

10 kW
Posts: 550
Joined: Aug 31 2018 12:36am

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

Post by buba » Feb 28 2019 1:07pm

Bash1303 wrote:
Feb 28 2019 7:55am
Hello every one

The inner motor seems to have given upp :(
I manager to order a replacement that Will take some time.
Sorry to hear that! May I ask what happened?
Bash1303 wrote:
Feb 28 2019 7:55am
My question is: if i connect my old hub motor 36v 350w (hall sensor) to the controller. Will it run normal or i Will be damaging the controller?

I am running the open source firmware V 17
I do not recommend to do that if you are not willing to change the source code so that it works better with a different motor.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

Bash1303   1 mW

1 mW
Posts: 19
Joined: Oct 01 2018 1:45am

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

Post by Bash1303 » Feb 28 2019 1:26pm

buba wrote:
Feb 28 2019 1:07pm
Bash1303 wrote:
Feb 28 2019 7:55am
Hello every one

The inner motor seems to have given upp :(
I manager to order a replacement that Will take some time.
Sorry to hear that! May I ask what happened?
Bash1303 wrote:
Feb 28 2019 7:55am
My question is: if i connect my old hub motor 36v 350w (hall sensor) to the controller. Will it run normal or i Will be damaging the controller?

I am running the open source firmware V 17
I do not recommend to do that if you are not willing to change the source code so that it works better with a different motor.
Hello buba,
Thanks for answering.
I am not sure what happened, I think it overheated. I need to check and maybe replace the temp sensor also

What do i need to change in the source code and how to do it?

Thank you

buba   10 kW

10 kW
Posts: 550
Joined: Aug 31 2018 12:36am

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

Post by buba » Feb 28 2019 3:41pm

Bash1303 wrote:
Feb 28 2019 1:26pm
Hello buba,
Thanks for answering.
I am not sure what happened, I think it overheated. I need to check and maybe replace the temp sensor also

What do i need to change in the source code and how to do it?

Thank you
No problem at all!

Hope you sort it out.

If you want to use a different motor you need to rewrite the motor firmware for that specific motor. Not something I recommend to do.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

Bash1303   1 mW

1 mW
Posts: 19
Joined: Oct 01 2018 1:45am

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

Post by Bash1303 » Mar 01 2019 5:05am

buba wrote:
Feb 28 2019 3:41pm

No problem at all!

Hope you sort it out.

If you want to use a different motor you need to rewrite the motor firmware for that specific motor. Not something I recommend to do.
I Will try to sort it out. Am not sure i Will attempt to change the firmware. It Will be a more complicated task.

Thank you buba. 🙂
And have a nice day and weekend

casainho   1.21 GW

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

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

Post by casainho » Mar 01 2019 8:42am

I received the LCD SW102 that I bought from PSWPower and I went to open it and I wrote a wiki page with my findings:

https://github.com/OpenSource-EBike-fir ... wiki/SW102

Although seems it is not possible to open this LCD without breaking/deform it, it is easy to access to the board that has the firmware programming/debug pads:

Image

1. use something thin to slide on the sides on the keypad
2. force gently to the side the plastic cover until you can remove the keypad plastic cover
3. you will find the firmware programming/debug pads under the keypad plastic cover

The front glass and LCD are glued, there is no way to open without breaking the case. I had to heat the plastic case and deform it until I could get the boards and LCD exposed.

Image

Image

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

rmnlsn   1 µW

1 µW
Posts: 2
Joined: Feb 21 2019 10:41am

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

Post by rmnlsn » Mar 01 2019 2:14pm

buba wrote:
Feb 28 2019 1:04pm
rmnlsn wrote:
Feb 28 2019 7:24am
How can I be sure that the my hex and the TSDZ2-v0.18.2.hex are the same if I didn't modify any src file?
It should and must be the same if you are compiling the same source files. Do note that the latest source files will not compile version 0.18.2 of the firmware. The source files have been updated and are continually developed for the next version: 0.19.0.
And so to get, for example, the github version 0.18.0 of the firmware which source code version should I compile? I made some test but didn't get the same file.

I'm a rookie in this world, thank you for the patience.

buba wrote:
Feb 28 2019 1:04pm
rmnlsn wrote:
Feb 28 2019 7:24am

Can someone help me?
Hope it helped!
Thank you very much for clarifying some steps!

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 » Mar 01 2019 2:42pm

casainho wrote:
Mar 01 2019 8:42am
I received the LCD SW102 that I bought from PSWPower and I went to open it and I wrote a wiki page with my findings:

https://github.com/OpenSource-EBike-fir ... wiki/SW102

Although seems it is not possible to open this LCD without breaking/deform it, it is easy to access to the board that has the firmware programming/debug pads:

1. use something thin to slide on the sides on the keypad
2. force gently to the side the plastic cover until you can remove the keypad plastic cover
3. you will find the firmware programming/debug pads under the keypad plastic cover

The front glass and LCD are glued, there is no way to open without breaking the case. I had to heat the plastic case and deform it until I could get the boards and LCD exposed.
I bought a bunch of these displays as Eggriders. The engineers that wrote the software for the Eggrider have a small UK company and ebike business. They did a total rewrite of the firmware to work with Bafang, Lishui, and other controllers. The Bafang version is what I use because it is small, discrete and the big feature is it can completely reconfigure the bafang controller on the fly. The kind of stuff you normally need a computer and programming cable to do, this little display does while riding down the road. This is what they do to implement a road and off-road mode. It must have a lot of memory to be able to do this.

It is programmed and set up using Bluetooth. In fact they use bluetooth to flash the firmware in the display using a free iOS and Android utility "nRF Connect". Instructions can be found here on their wiki https://bitbucket.org/eggpower/eggriderv2/wiki/Home.

I have been in contact with Topology Tech, the manufactureres of this display. Unlike APT, they are willing to provide programming details that include how to flash it using nRF Connect. They will provide complete technical documentation with a signed NDA. I will send you contact info separately via PM.

Here is the technical specification of the display.

User avatar
eyebyesickle   10 kW

10 kW
Posts: 678
Joined: Apr 07 2015 9:28pm
Location: Nashville

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

Post by eyebyesickle » Mar 01 2019 4:54pm

Rydon wrote:
Mar 01 2019 2:42pm
I bought a bunch of these displays as Eggriders. The engineers that wrote the software for the Eggrider have a small UK company and ebike business. They did a total rewrite of the firmware to work with Bafang, Lishui, and other controllers. The Bafang version is what I use because it is small, discrete and the big feature is it can completely reconfigure the bafang controller on the fly. The kind of stuff you normally need a computer and programming cable to do, this little display does while riding down the road. This is what they do to implement a road and off-road mode. It must have a lot of memory to be able to do this.

It is programmed and set up using Bluetooth. In fact they use bluetooth to flash the firmware in the display using a free iOS and Android utility "nRF Connect". Instructions can be found here on their wiki https://bitbucket.org/eggpower/eggriderv2/wiki/Home.

I have been in contact with Topology Tech, the manufactureres of this display. Unlike APT, they are willing to provide programming details that include how to flash it using nRF Connect. They will provide complete technical documentation with a signed NDA. I will send you contact info separately via PM.

Here is the technical specification of the display.SW102 display technical specification-20171013.pdf
Precisely, as I had mentioned earlier, the info is easily available, but an NDA is required. I am in the latter stages of TSDZ2 development, and have had them working for some time... we started on these way back when I presented them to casianho last year. Anyway, another batch due to land next week! They are a very responsive company, and I am happy to deal with them. While I like the eggrider, I much prefer the easier setup, and styled my own BBS model, as well as the TSDZ2 model we are perfecting. I'll post some videos over the weekend if I have time. This is my favorite display out! Glad to see it picking up more traction.

buba   10 kW

10 kW
Posts: 550
Joined: Aug 31 2018 12:36am

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

Post by buba » Mar 01 2019 4:56pm

Okay, so I am working on increasing the resolution of the assist level multipliers. This is so that we can setup the assistance for any rider and their particular disposition.

Could not help myself to include physics. I have calculated (not measured) the aerodynamic forces in play. Mostly parasitic drag and approximations.

The air resistance in particular is something I usually only considered in airborne designs. But we have bikes capable of 50 KPH / 30 MPH. So I became curious of the relative wind speed and its relation to motor power.

----------------------------------------------

Force of air resistance = 1/2 * AirDensity * DragCoefficient * TotalArea * Velocity^2

The power required to sustain speed would then be:

Power = Force * Velocity => Power = Force of air resistance * Velocity

----------------------------------------------

Following graphs were born:
funGraphs.png
funGraphs.png (67.42 KiB) Viewed 1599 times
This is why we all instinctively setup the assist level multipliers as a polynomial growth. It better suits the different speeds in which we operate our bikes. One can add rolling resistance as well and create a mathematical formula for calculating the optimal assist level multipliers.

Just wanted to share this as I found it interesting.
Last edited by buba on Mar 01 2019 5:24pm, edited 1 time in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

buba   10 kW

10 kW
Posts: 550
Joined: Aug 31 2018 12:36am

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

Post by buba » Mar 01 2019 5:12pm

rmnlsn wrote:
Mar 01 2019 2:14pm
buba wrote:
Feb 28 2019 1:04pm
rmnlsn wrote:
Feb 28 2019 7:24am
How can I be sure that the my hex and the TSDZ2-v0.18.2.hex are the same if I didn't modify any src file?
It should and must be the same if you are compiling the same source files. Do note that the latest source files will not compile version 0.18.2 of the firmware. The source files have been updated and are continually developed for the next version: 0.19.0.
And so to get, for example, the github version 0.18.0 of the firmware which source code version should I compile? I made some test but didn't get the same file.

I'm a rookie in this world, thank you for the patience.
If you want a particular hex file I recommend going to the releases on the project page on GitHub and download the version of the firmware you want to test:

https://github.com/OpenSource-EBike-fir ... e/releases

If you want the source files for a particular version of the firmware you can find it on the same link just below the hex files. It is zipped and named: Source code (zip).
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

QuirkyOrk   100 µW

100 µW
Posts: 9
Joined: Mar 01 2019 5:20pm

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

Post by QuirkyOrk » Mar 01 2019 5:29pm

Hello everyone,

I just installed the opensource firmware for the first time on my TSDZ2 36V, but for some reason it is limiting the power to around 320-380w. No matter how hard I pedal I can't raise the assist above 380w. What am I doing wrong? Is this normal? It seems significantly less powerful than the stock firmware at the moment. I have the max current set to 16a so I figured that I would be able to pull aprox 550w at peak. I have tried disabling/adjusting any setting that would limit the speed/power in the sub menus, but the bike still is stuck at 320-380w as the upper limit.

Thanks

User avatar
eyebyesickle   10 kW

10 kW
Posts: 678
Joined: Apr 07 2015 9:28pm
Location: Nashville

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

Post by eyebyesickle » Mar 01 2019 6:37pm

casainho wrote:
Mar 01 2019 8:42am
I received the LCD SW102 that I bought from PSWPower and I went to open it and I wrote a wiki page with my findings:

https://github.com/OpenSource-EBike-fir ... wiki/SW102

Although seems it is not possible to open this LCD without breaking/deform it, it is easy to access to the board that has the firmware programming/debug pads:

1. use something thin to slide on the sides on the keypad
2. force gently to the side the plastic cover until you can remove the keypad plastic cover
3. you will find the firmware programming/debug pads under the keypad plastic cover

The front glass and LCD are glued, there is no way to open without breaking the case. I had to heat the plastic case and deform it until I could get the boards and LCD exposed.
Yes, this is what I cautioned against as far as the construction went... Good to see you were at least able to inspect.... Let me know if you want to move forward and I will send the Bluetooth model, but I will also need to have you sign an NDA as well if we move forward perfect manufacturers requirements, as we previously discussed.

Best Regards

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 » Mar 01 2019 8:48pm

buba wrote:
Mar 01 2019 4:56pm
Okay, so I am working on increasing the resolution of the assist level multipliers. This is so that we can setup the assistance for any rider and their particular disposition.

Could not help myself to include physics. ...
...
This is why we all instinctively setup the assist level multipliers as a polynomial growth. It better suits the different speeds in which we operate our bikes. One can add rolling resistance as well and create a mathematical formula for calculating the optimal assist level multipliers.

Just wanted to share this as I found it interesting.
Yes, amazing how non-linear wind resistance makes it. After about 25-30kph it graph gets pretty vertical. A little extra speed costs a lot of power. Thanks for sharing this. I look forward to trying out the results. :)

casainho   1.21 GW

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

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

Post by casainho » Mar 02 2019 2:56am

QuirkyOrk wrote:
Mar 01 2019 5:29pm
Hello everyone,

I just installed the opensource firmware for the first time on my TSDZ2 36V, but for some reason it is limiting the power to around 320-380w. No matter how hard I pedal I can't raise the assist above 380w. What am I doing wrong? Is this normal? It seems significantly less powerful than the stock firmware at the moment. I have the max current set to 16a so I figured that I would be able to pull aprox 550w at peak. I have tried disabling/adjusting any setting that would limit the speed/power in the sub menus, but the bike still is stuck at 320-380w as the upper limit.

Thanks
See if you had configured the max power limit to 350W or something. You have the max current limit and max power limit on the firmware, changed on LCD3.
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: 3579
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 02 2019 7:29am

buba wrote:
Mar 01 2019 4:56pm
Okay, so I am working on increasing the resolution of the assist level multipliers. This is so that we can setup the assistance for any rider and their particular disposition.

Could not help myself to include physics. I have calculated (not measured) the aerodynamic forces in play. Mostly parasitic drag and approximations.

The air resistance in particular is something I usually only considered in airborne designs. But we have bikes capable of 50 KPH / 30 MPH. So I became curious of the relative wind speed and its relation to motor power.

----------------------------------------------

Force of air resistance = 1/2 * AirDensity * DragCoefficient * TotalArea * Velocity^2

The power required to sustain speed would then be:

Power = Force * Velocity => Power = Force of air resistance * Velocity

----------------------------------------------

Following graphs were born:

funGraphs.png

This is why we all instinctively setup the assist level multipliers as a polynomial growth. It better suits the different speeds in which we operate our bikes. One can add rolling resistance as well and create a mathematical formula for calculating the optimal assist level multipliers.

Just wanted to share this as I found it interesting.
That is very interesting, maybe we should write a wiki page specific to how to configure the assist levels multipliers.

When I am on the mountains, when I increase to double the motor power, I clear feel that I need to do half of the power with my legs to maintain the same low speed at climbs. There, I do not feel the wind so I prefer to setup at increase of 50% of power only.

But I use the same bicycle on everyday at the city and there I think can be nice to follow that graph.
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: 3579
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Mar 02 2019 8:02am

eyebyesickle wrote:
Mar 01 2019 6:37pm
Yes, this is what I cautioned against as far as the construction went... Good to see you were at least able to inspect.... Let me know if you want to move forward and I will send the Bluetooth model, but I will also need to have you sign an NDA as well if we move forward perfect manufacturers requirements, as we previously discussed.
No NDA, as it would not be compatible with OpenSource. Anyway, the idea would be to fully develop our firmware for it and they would not give us the full "secrets".

The LCD hardware is only one (just like on TSDZ2 various versions), it fully supports Bluetooth but it may be disabled on the firmware. But Bluetooh firmware part is the piece from Nordic that is free available for anyone that uses that Nordic microcontroller, so Bluetooth is pretty straightforward to implement.

I wounder if that LCD could communicate simultaneously with the popular chinese BMS with Bluetooth (the "Smart BMS with Bluetooth") and with mobile app. If so, we could have a system much more integrated, access data/control from each battery pack cells on LCD and mobile app, other than keep controlling TSDZ2.

Anyway, I am busy working on 850C LCD and I will not start developing to SW102 LCD but I could help if other developers want to do it. For instance, the only piece missing is the information on how to control that monochrome graphic LCD and I have the tolls to look at the digital signals and find it, just like I did on 850C LCD.
casainho wrote:
Mar 02 2019 7:47am
I am sharing pictures of the battery pack I built for using with TSDZ2.

I am using the most power density cells available on the market, the LG INR18650-M36 3600mAh - 10A.
Using this cells, my pack as 14S3P (14 cells in series and 3 cells in parallel) of 42 cells in total.

This pack has about 525 Wh and weighs only about 2.5 kgs (including the weight of BMS, connectors, etc). My girlfriend wants a light bicycle so I decided to use this cells/battery on his bicycle. Next I will do another for my bicycle and I will keep my older big packs (that use the same cells) to use when we do long rides like near or over 100 kms in a day.

I am using for the first time the chinese popular BMS with Bluetooth, the "Smart BMS with Bluetooth", that we can find in many online shops. This BMS would be very easy to develop firmware for if we want (used Arduino AVR microcontroller and popular battery management IC) but there is a lot of information about it, including the communication protocol.

I think I will need to limit on LCD3 the battery current to be 10 Amps, other way this cells may heat to much and damage quick but I will configure the BMS temperature sensors protection and I will keep a loop at the temperature to find the "max" average current for this cells in 3P.

Image

Image

Image

Image

Image

My girlfriend bicycle:
Image
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.

User avatar
eyebyesickle   10 kW

10 kW
Posts: 678
Joined: Apr 07 2015 9:28pm
Location: Nashville

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

Post by eyebyesickle » Mar 02 2019 9:43am

Understood, however an NDA may not be as ultimately limiting as you think... To gain all the info, one is required, however with permission and negotiation I'm sure there could be an understanding with the manufacturer, or I would not be suggesting it. No worries though, I am also glad to hear you are still working on the 850c. I am waiting for the manufacturers tech to get back and will hopefully have access to the bootloader etc very soon! They have been a hard egg to crack!

QuirkyOrk   100 µW

100 µW
Posts: 9
Joined: Mar 01 2019 5:20pm

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

Post by QuirkyOrk » Mar 02 2019 10:02am

casainho wrote:
Mar 02 2019 2:56am
QuirkyOrk wrote:
Mar 01 2019 5:29pm
Hello everyone,

I just installed the opensource firmware for the first time on my TSDZ2 36V, but for some reason it is limiting the power to around 320-380w. No matter how hard I pedal I can't raise the assist above 380w. What am I doing wrong? Is this normal? It seems significantly less powerful than the stock firmware at the moment. I have the max current set to 16a so I figured that I would be able to pull aprox 550w at peak. I have tried disabling/adjusting any setting that would limit the speed/power in the sub menus, but the bike still is stuck at 320-380w as the upper limit.

Thanks
See if you had configured the max power limit to 350W or something. You have the max current limit and max power limit on the firmware, changed on LCD3.
I figured out that the V cutoff was set for a 48v battery @ 39.0 by default. I think this might have been what caused it.

Thank you for taking the time to reply as well as the time and effort you've put into this project. I've made a small paypal contribution as a token of gratitude.

NIPSEN   100 mW

100 mW
Posts: 38
Joined: Feb 26 2019 5:14pm

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

Post by NIPSEN » Mar 02 2019 10:10am

Hello guys,

I work for the automotive industry, and we regularly use the formulas for calculating resistant forces.
The formula calculating the air resistance force is correct, but the rolling resistance component is missing.
Rolling resistance does not depend on speed, it is a constant that depends in particular on the type of tyre, tyre pressure etc.
The formula used is therefore:

Fr= F0 + F1 * V + F2 * V²

Fr = Resistance force in Newton
F0 = Rolling resistance force
F1 and F2 = Air resistance force
V = velocity in meters/second

It is possible to measure the F0,1,2 coefficients on the vehicle, for this it is necessary to find a flat road, or almost, and to measure the deceleration of the vehicle from a high speed. Knowing the deceleration as a function of speed, we can deduce the 3 coefficients specific to the vehicle.
It is important to measure back and forth on the same road and average to eliminate the effect of slope.

The slope is of course a very important component of the resistance to driving.

Slope force = Weight x G x Slope

Slope Force in Newton
Weight in kg
G = 9.8066
Slope in % (height divided by distance travelled)

I hope this will help you.

buba   10 kW

10 kW
Posts: 550
Joined: Aug 31 2018 12:36am

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

Post by buba » Mar 02 2019 5:26pm

Rydon wrote:
Mar 01 2019 8:48pm
Yes, amazing how non-linear wind resistance makes it. After about 25-30kph it graph gets pretty vertical. A little extra speed costs a lot of power. Thanks for sharing this. I look forward to trying out the results. :)
Totally! :)

casainho wrote:
Mar 02 2019 7:29am
That is very interesting, maybe we should write a wiki page specific to how to configure the assist levels multipliers.

When I am on the mountains, when I increase to double the motor power, I clear feel that I need to do half of the power with my legs to maintain the same low speed at climbs. There, I do not feel the wind so I prefer to setup at increase of 50% of power only.

But I use the same bicycle on everyday at the city and there I think can be nice to follow that graph.
I agree!

The wind resistance is actually not that bad compared to elevation changes. But I thought it was interesting to see the graphs nonetheless. Take it as fun trivia :wink:

NIPSEN wrote:
Mar 02 2019 10:10am
Hello guys,

I work for the automotive industry, and we regularly use the formulas for calculating resistant forces.
The formula calculating the air resistance force is correct, but the rolling resistance component is missing.
Rolling resistance does not depend on speed, it is a constant that depends in particular on the type of tyre, tyre pressure etc.
...
Thank you so much for taking your time to write, NIPSEN! :)

I deliberately did not incorporate rolling resistance nor calculations for elevation changes. The latter particularly has an insane effect on power required! But as mentioned before I mostly focused on parasitic drag (aerodynamics). This is because a lot of parameters are user dependent and it is hard to draw conclusions as everyone has a different setup: bike, tires, weight and so on.

The results from the aerodynamic effects give good approximations as there are fewer variables that change from user to user, in short: the standard deviations are low on those variables that might differ among users.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

NIPSEN   100 mW

100 mW
Posts: 38
Joined: Feb 26 2019 5:14pm

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

Post by NIPSEN » Mar 02 2019 6:33pm

You're right not to integrate these parameters. I think the performance is better without it. The cyclist wants to have the feeling of assistance, proportional to the pressure on the pedals, by integrating these parameters, we would obtain an identical acceleration of the bike whatever the slope.
As for rolling resistance, it is clearly negligible on a bicycle.

554226203   1 µW

1 µW
Posts: 2
Joined: Mar 09 2019 1:36am

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

Post by 554226203 » Mar 09 2019 1:45am

Thanks for the contribution, I don't know English, so I use Google Translate, I would like to ask, I have a 350w 36v tsd z2 xh18, if I brush the firmware, can I have more power and speed?

tomtom50   100 W

100 W
Posts: 186
Joined: Jun 18 2018 10:09am

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

Post by tomtom50 » Mar 09 2019 7:01pm

554226203 wrote:
Mar 09 2019 1:45am
Thanks for the contribution, I don't know English, so I use Google Translate, I would like to ask, I have a 350w 36v tsd z2 xh18, if I brush the firmware, can I have more power and speed?
You can increase power two ways:

1. Increase the allowed amperage in the manufacturer firmware.
2. Install the open source firmware and set a higher power level. This is harder and you need to wire in a different display. (KT-LCD3).

350W at 36V is 9.7 amperes. You can overheat your motor if you use many more amperes for long time.

At 36V 350W is safe. 550W (15A) is OK for 5 - 10 minutes to climb a hill. 550W to go fast for a long time might overheat your motor.

554226203   1 µW

1 µW
Posts: 2
Joined: Mar 09 2019 1:36am

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

Post by 554226203 » Mar 09 2019 11:07pm

tomtom50 wrote:
Mar 09 2019 7:01pm
554226203 wrote:
Mar 09 2019 1:45am
Thanks for the contribution, I don't know English, so I use Google Translate, I would like to ask, I have a 350w 36v tsd z2 xh18, if I brush the firmware, can I have more power and speed?
You can increase power two ways:

1. Increase the allowed amperage in the manufacturer firmware.
2. Install the open source firmware and set a higher power level. This is harder and you need to wire in a different display. (KT-LCD3).

350W at 36V is 9.7 amperes. You can overheat your motor if you use many more amperes for long time.

At 36V 350W is safe. 550W (15A) is OK for 5 - 10 minutes to climb a hill. 550W to go fast for a long time might overheat your motor.
Thank you for your reply, then please, how can I do the first solution?

Post Reply