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

Electric Motors and Controllers
perryscope   100 W

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

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

Post by perryscope » Sep 13 2019 7:21am

buba wrote:
Sep 13 2019 5:56am
vadda wrote:
Sep 13 2019 5:31am
buba wrote:
Sep 13 2019 4:13am
vadda wrote:
Sep 12 2019 9:50am
Ok, thanks
But the "Return 0" at the end of the main is necessary ?
No problem!

It is not necessary in the current form but you do not need to remove it. It is just a warning.You can do however you like.
I have compiled and tested the latest version on your GitHub.
The current reading is much better, as is that of the Volts.
There remains a discrepancy of 0.3V on the Volts and about 20W less reported on the LCD3 compared to the Wattmeter (on a reading of about 570W reported by LCD3)
I wanted to know if the two variables that are used to calculate the V and I are BATTERY_VOLTAGE_PER_10_BIT_ADC_STEP_X1000 and BATTERY_CURRENT_PER_10_BIT_ADC_STEP_X100?
I wanted to try raising both by 1 to see if the reading improved.

I do not stop thanking you for the excellent work done and the kindness and competence with which you always respond.
Exciting that you are experimenting and testing! If I can help in any way please let me know!

Yes, I know that there is still a discrepancy but I think it is as close we can get for now. It is best to test the voltage and current separately. If they are correct the watts will be correct. But there are filters on the values displayed on the display so when testing it is best to have a "steady state" on whatever you are measuring. Example: if you limit the current to 10 A and use Cruise to give maximum power the system will limit to around 10 A and hold it there. As a result, it will be possible to somewhat accurately measure the current.

You are free to experiment with the other values you mentioned without any problems. But I would advise against changing the x512 values. They are used in the FOC calculation.

Thank you for the kind words, Vadda! We all appreciate that you are testing and experimenting with the code! Again, please let me know if I can help or if you see anything that can be improved in any way!

Is the Battery voltage used for the calculations measured at the screen or the motor?
I ask as i noticed that when i had a dodgy wet connection in my cable i could easily get a 0.5v volt drop at the screen compared to the actual battery voltage.

Ideally the voltage should be measured as close to the motor as possible for accuracy.
Empowered people support rider and trustee
www.empoweredpeople.co.uk

casainho   1.21 GW

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

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

Post by casainho » Sep 13 2019 7:30am

Buba, should I make a beta.1 version release??
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.

Elinx   100 mW

100 mW
Posts: 48
Joined: Aug 09 2019 6:58am

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

Post by Elinx » Sep 13 2019 8:28am

maximusdm wrote:
Sep 13 2019 6:52am
............
I used aluminium, but it is very hard to make a good contact with the exterior case.
I was thinking about using this also, but not tried yet. Good contact is better for sure, but have you measured the temperature already as it is now? IMHO it should be lower, because the smaller air gap.
I don't know if it is possible to use thin alu tape for improving the contact.

casainho   1.21 GW

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

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

Post by casainho » Sep 13 2019 8:34am

perryscope wrote:
Sep 13 2019 7:21am
Is the Battery voltage used for the calculations measured at the screen or the motor?
I ask as i noticed that when i had a dodgy wet connection in my cable i could easily get a 0.5v volt drop at the screen compared to the actual battery voltage.

Ideally the voltage should be measured as close to the motor as possible for accuracy.
It is measured on the motor controller and is sent to the display.
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.

andrea_104kg   100 W

100 W
Posts: 152
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Sep 13 2019 10:44am

Buba, do you plan to do other change before release the 20 beta 1?

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 » Sep 13 2019 12:16pm

So, all in all the v.0.20 beta1 will have minor fixes plus corrected watt/volt/power measurement, correct?
MTB KTM Ultra 29" - City bike DAYTONA 28"

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 » Sep 13 2019 2:02pm

perryscope wrote:
Sep 13 2019 7:13am
Just a quick bit of feedback, I know not many people are using the Cadence assist mode in 0.20.x but for my one user who has the prosthetic leg having finally managed to try it, she is over the moon!. It has fixed her hunting issue altogether, so much so she has taken that trike home for more long ride testing. Personally i much prefer the Power assist mode or eMTB for my own use, but for some users a traditional pedal assist is still a good option.

Thanks again Buba for adding this mode to allow us to have the option.
And I am over the moon to hear that! What an absolutely wonderful thing to share with the community! I really do hope she finds it much more enjoyable and that it adds to the experience!

Thank you, Perryscope! That means a lot and I appreciate it!

Am very happy!
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 » Sep 13 2019 2:04pm

casainho wrote:
Sep 13 2019 7:30am
Buba, should I make a beta.1 version release??
Yeah, that would be great! :) Thank you!
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 » Sep 13 2019 2:05pm

andrea_104kg wrote:
Sep 13 2019 10:44am
Buba, do you plan to do other change before release the 20 beta 1?
What do you have in mind? :)
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

andrea_104kg   100 W

100 W
Posts: 152
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Sep 13 2019 2:10pm

I look forward to seeing if in beta 1 there is a little more power. the alpha 10 version seems a little less powerful than the 19. Obviously other surprises are welcome :-)

casainho   1.21 GW

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

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

Post by casainho » Sep 13 2019 2:19pm

buba wrote:
Sep 13 2019 2:04pm
casainho wrote:
Sep 13 2019 7:30am
Buba, should I make a beta.1 version release??
Yeah, that would be great! :) Thank you!
What is the full change log from v0.19.0??

And there is an issue on Linux Makefile for the motor controller...
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.

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 » Sep 13 2019 2:32pm

thineight wrote:
Sep 13 2019 12:16pm
So, all in all the v.0.20 beta1 will have minor fixes plus corrected watt/volt/power measurement, correct?
The 0.20.0 Beta 1 has many small improvements to the feeling and experience. It has also more power and torque compared to previous Alpha versions. Then there is the volt/current/power correction. Feels like there is more still but those are the biggest changes.

I really do recommend the entire community to try out the 0.20.0 Beta 1! Sorry for the many 0.20.0 Alpha versions you all have had to go through to get here!
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 » Sep 13 2019 2:34pm

andrea_104kg wrote:
Sep 13 2019 2:10pm
I look forward to seeing if in beta 1 there is a little more power. the alpha 10 version seems a little less powerful than the 19. Obviously other surprises are welcome :-)
Absolutely, I hope you will like it! :)
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 » Sep 13 2019 2:40pm

casainho wrote:
Sep 13 2019 2:19pm
buba wrote:
Sep 13 2019 2:04pm
casainho wrote:
Sep 13 2019 7:30am
Buba, should I make a beta.1 version release??
Yeah, that would be great! :) Thank you!
What is the full change log from v0.19.0??

And there is an issue on Linux Makefile for the motor controller...
I will have to gather all the changes and write down on a list. Will also, of course, take a look at the Makefile. I do not use Linux for this project so that is why I have not noticed any issues. Do you have any error messages or anything when you are building on Linux?

EDIT: Will possibly test on my Linux machine but if you have any error messages to share I do not mind getting some data.

Will get back to you as soon as possible. Will have limited time tomorrow though.
Last edited by buba on Sep 13 2019 3:12pm, edited 3 times in total.
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

elfnino   100 mW

100 mW
Posts: 38
Joined: Mar 06 2019 5:09am

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

Post by elfnino » Sep 13 2019 2:44pm

Alfa10
The MAX speed (submenu 7.2) not showing correct values. When riding 30km/h the values bounce from 3 to 14km/h

Also while selecting 7.1 or 7.2 submenu ( average and max speed) the symbols AVG and MAX are not visible on display. Symbols are visible just once the submenu is selected.

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 » Sep 13 2019 2:54pm

elfnino wrote:
Sep 13 2019 2:44pm
Alfa10
The MAX speed (submenu 7.2) not showing correct values. When riding 30km/h the values bounce from 3 to 14km/h

Also while selecting 7.1 or 7.2 submenu ( average and max speed) the symbols AVG and MAX are not visible on display. Symbols are visible just once the submenu is selected.
Will take a look! Thank you for letting me know! Will fix before 0.20.0 Beta 1 is released! Sorry for any inconvenience!

I think Casainho will now wait for me to:

1. Fix a list of the changes from 0.19.0

2. Fix Makefile on Linux for anyone trying to build on Linux

3. Solve the bugs you reported
GitHub: https://github.com/leon927
PayPal: leonstor at bredband.net

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 » Sep 15 2019 8:12am

Hello,

I did a few flashes of the KT lcd3 and now it is almost brick.

In the last 2 versions on boot all chars light up and after a few seconds it state working.
Now it lights up all symbols and it is frozen. I did write 4 different versions and the result is the same.
I had no crashes and I did not modified the LCD wiring.

Please some help.

bwb   1 mW

1 mW
Posts: 17
Joined: Jun 23 2019 7:07am

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

Post by bwb » Sep 15 2019 8:36am

Yesterday done the Eddy Merckx route in the Flemisch Ardens together with 5 other road ebikes.
1 x TSDZ2 36V OSF 20A5
3 x Bosch Active line
2 x hub motors
I was the only one that reached pedaling the top of the Paterberg https://en.wikipedia.org/wiki/Paterberg.
It was a 20°C sunny day and at the top, the motor temperature didn't felt hot (feeling by hand).
Ow I had very big smile on my face and was proud on what you guys have achieved. :bigthumb: :bigthumb:

casainho   1.21 GW

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

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

Post by casainho » Sep 15 2019 8:45am

bwb wrote:
Sep 15 2019 8:36am
Yesterday done the Eddy Merckx route in the Flemisch Ardens together with 5 other road ebikes.
1 x TSDZ2 36V OSF 20A5
3 x Bosch Active line
2 x hub motors
I was the only one that reached pedaling the top of the Paterberg https://en.wikipedia.org/wiki/Paterberg.
It was a 20°C sunny day and at the top, the motor temperature didn't felt hot (feeling by hand).
Ow I had very big smile on my face and was proud on what you guys have achieved. :bigthumb: :bigthumb:
Thanks for the link. I also just arrived home from riding starting early morning, me and my wife, also a very nice weather -- also many smile in our faces :-)

I am also recovering as also a second surgery to happen soon, I can't walk, run or doing sports with high oscillations so we are now doing more road paths and near the beaches -- so nice the ebikes as machines for fun as also fitness/health.

TSDZ2 running our firmware, installed on a good bicycle and with the best battery cells in the market, very good experience!!!
Last edited by casainho on Sep 15 2019 8:47am, edited 1 time in total.
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 » Sep 15 2019 8:46am

maximusdm wrote:
Sep 15 2019 8:12am
Hello,

I did a few flashes of the KT lcd3 and now it is almost brick.

In the last 2 versions on boot all chars light up and after a few seconds it state working.
Now it lights up all symbols and it is frozen. I did write 4 different versions and the result is the same.
I had no crashes and I did not modified the LCD wiring.

Please some help.
Do you have break sensors installed?
If so, Double check that the magnet are working at the right distance, if one is not working anymore properly the circuit closes and you will see all the symbols ON at startup.
This is now stated in the brake sensor wiki.
MTB KTM Ultra 29" - City bike DAYTONA 28"

casainho   1.21 GW

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

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

Post by casainho » Sep 15 2019 8:48am

maximusdm wrote:
Sep 15 2019 8:12am
Hello,

I did a few flashes of the KT lcd3 and now it is almost brick.

In the last 2 versions on boot all chars light up and after a few seconds it state working.
Now it lights up all symbols and it is frozen. I did write 4 different versions and the result is the same.
I had no crashes and I did not modified the LCD wiring.

Please some help.
Make sure rx and tx wires are well soldered and correct, as also the brake sensors are not active.
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: 3588
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Sep 15 2019 9:00am

bwb wrote:
Sep 15 2019 8:36am
Yesterday done the Eddy Merckx route in the Flemisch Ardens together with 5 other road ebikes.
1 x TSDZ2 36V OSF 20A5
3 x Bosch Active line
2 x hub motors
I was the only one that reached pedaling the top of the Paterberg https://en.wikipedia.org/wiki/Paterberg.
It was a 20°C sunny day and at the top, the motor temperature didn't felt hot (feeling by hand).
Ow I had very big smile on my face and was proud on what you guys have achieved. :bigthumb: :bigthumb:
Can you please share some data?
1. How many kilometers?
2. Battery Watts hours, number of cells and cells amps hour?
3. How many watts hours used?
4. Max or average motor power?
5. Picture of your ebike?
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.

bwb   1 mW

1 mW
Posts: 17
Joined: Jun 23 2019 7:07am

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

Post by bwb » Sep 15 2019 9:46am

casainho wrote:
Sep 15 2019 9:00am
bwb wrote:
Sep 15 2019 8:36am
Yesterday done the Eddy Merckx route in the Flemisch Ardens together with 5 other road ebikes.
1 x TSDZ2 36V OSF 20A5
3 x Bosch Active line
2 x hub motors
I was the only one that reached pedaling the top of the Paterberg https://en.wikipedia.org/wiki/Paterberg.
It was a 20°C sunny day and at the top, the motor temperature didn't felt hot (feeling by hand).
Ow I had very big smile on my face and was proud on what you guys have achieved. :bigthumb: :bigthumb:
Can you please share some data?
1. How many kilometers?
2. Battery Watts hours, number of cells and cells amps hour?
3. How many watts hours used?
4. Max or average motor power?
5. Picture of your ebike?
1. we did arround 52km in total
2. I have 10S5P 36V 17.5Ah battery
3. had +-297 Wh used
4. worst case, the motor delivered arround 620W
5. Standard city bike, have recently installed a 52T front sprocket. I have been riding 6 months standard sw, and now already 647km with 0.19 & 20.
Image
Well, since the OSF bike did perform much, much better then the Bosch and hub-bikes, I could ride upfront and was photographer on duty
Image
Image

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 » Sep 15 2019 11:29am

bwb wrote:
Sep 15 2019 9:46am

1. we did arround 52km in total
2. I have 10S5P 36V 17.5Ah battery
3. had +-297 Wh used
4. worst case, the motor delivered arround 620W
5. Standard city bike, have recently installed a 52T front sprocket. I have been riding 6 months standard sw, and now already 647km with 0.19 & 20.
How could you climb a 20% slope with a 52t chainring? :shock:
You must have iron legs :mrgreen: .. or you just used constant 600w? Looks like you miss the right gears to climb that slopes.. and maybe Bosch systems couldn't supply more than legal power, that's why perhaps they couldn't make it to the top.
Did you check the heat of the motor once you reach the top of the hill?
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 » Sep 15 2019 12:24pm

@casainho, thineight
Thank you for quick help as always! I managed to crush the lcd cable between the frame and the motor :(.
I was lucky it was not ruined so I managed to give it a bit of tape and all is ok... for now.
The behaviour was very strange. I started to have burst of motor power and eventually no assistence.
Maybe this info heps other users as well.

@buba
I will test starting tomorrow latest version from 0.20 dev branch(beta1). Let you know how it feels.

Post Reply