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

Electric Motors and Controllers
casainho   1 GW

1 GW
Posts: 3105
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Oct 04 2018 3:17am

jbalat wrote:
Oct 03 2018 7:09pm
I think we need to go back to the old way which sets the assist level as a multiplier (i believe this is how my Bosch works) that way you can use the quick power setting to get the best combination of assist and power while you ride depending on conditions and how tired you are
Seems you are having issues with your firmware... it does not work for me as you say, it just give more power when I increase the assist level (using the default values).
jbalat wrote:
Oct 03 2018 7:09pm
Also the power boost stuff causes problems. As I am coasting down hill and back off power then try to go uphill on the other side i get no power for at least 3 turns. I would also like to leave this out as it is not necessary and causes problems.
Power boost is needed because before we also had power boost but in a way it was not configured that a user complained that could not reduce the power boost (because it was to strong for him), then I implemented power boost to be configured in power and time duration. Without power boost, you have only human power that will always be near zero when you start pedaling/low cadence, this is not good as we also want assist at startup and lower cadences.

But yes, power boost as that issue you mention, the only way is to debug/try understand in what combinations it fails to work.
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 GW

1 GW
Posts: 3105
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Oct 04 2018 3:26am

EndlessCadence wrote:
Oct 04 2018 12:53am
I've disabled power boost in my configuration because I don't really like the feeling and in my opinion it can be bad for the motor. The motor has to deliver a lot of torque for this, especially from a stand still.
So you can also configure the power boost to be the contrary, to make a small increasing ramp start at 0 power and transition to the pedal value, where you can configure that ramp duration -- this means you can force a slow increase of motor power, to protect it!!

The idea it to configure boost time = 1 and power to min value, then configure the fade transition to the desired ramp up time. The idea is to disable boost but keep the fade/transition phase.
[/quote]
EndlessCadence wrote:
Oct 04 2018 12:53am
I don't think we have to remove this code because it can be easily disabled by anyone who doesn't like it but maybe we can make this the default?
Must be enable by default or we will not get immediate assistance at startup! This is the difference from a system with torque sensor or PAS only.
EndlessCadence wrote:
Oct 04 2018 12:53am
In the future I would prefer to have feature toggles in the configuration so a real boost disable without changing other settings and just leave them default.
Yes!! And keep that to be the very first option always, to enable/disable the feature.
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.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

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

Post by EndlessCadence » Oct 04 2018 3:42am

casainho wrote:
Oct 04 2018 3:26am
EndlessCadence wrote:
Oct 04 2018 12:53am
I've disabled power boost in my configuration because I don't really like the feeling and in my opinion it can be bad for the motor. The motor has to deliver a lot of torque for this, especially from a stand still.
So you can also configure the power boost to be the contrary, to make a small increasing ramp start at 0 power and transition to the pedal value, where you can configure that ramp duration -- this means you can force a slow increase of motor power, to protect it!!

The idea it to configure boost time = 1 and power to min value, then configure the fade transition to the desired ramp up time. The idea is to disable boost but keep the fade/transition phase.
Nice! Will try this!
EndlessCadence wrote:
Oct 04 2018 12:53am
I don't think we have to remove this code because it can be easily disabled by anyone who doesn't like it but maybe we can make this the default?
Must be enable by default or we will not get immediate assistance at startup! This is the difference from a system with torque sensor or PAS only.
Thanks I didn't know, maybe we can reduce the effect by default? In my opinion reliability of the motor is the most important then comes high performance and power. I can imagine many users feel this way.
EndlessCadence wrote:
Oct 04 2018 12:53am
In the future I would prefer to have feature toggles in the configuration so a real boost disable without changing other settings and just leave them default.
Yes!! And keep that to be the very first option always, to enable/disable the feature.
Then we fully agree! :D

What do you think of the new repository? Now you can focus on developing, I can help with that and do the releases for you.

User avatar
jbalat   10 kW

10 kW
Posts: 552
Joined: Nov 10 2012 11:50pm
Location: Melbourne, Australia

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

Post by jbalat » Oct 04 2018 4:36am

Casainho can you just answer one thing?

Why can't I flash back the old version yet it let's me flash the new version ?

If you don't believe me I can do a video or try yourself.
Find the first lcd file ending in ...v5.hex
Then flash the 0.2, 0.3 or 0.4 motor file.

You either get a locked lcd or the config menus are so screwed up you can't enter any data or get no assistance.
Please subscribe to my Youtube home page for Quadcopters, FPV and Bike Rides http://www.youtube.com/jbalatutube
My build log here http://endless-sphere.com/forums/viewto ... =6&t=55352
For some cool ebike talk join us on The Best ebike https://www.facebook.com/groups/193581737807033/
Tech talk TSDZ2 Opensource firmware https://endless-sphere.com/forums/viewt ... &start=150
Opensource TSDZ2 Wiki https://github.com/OpenSource-EBike-fir ... _wiki/wiki

casainho   1 GW

1 GW
Posts: 3105
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Oct 04 2018 6:25am

jbalat wrote:
Oct 04 2018 4:36am
Casainho can you just answer one thing?

Why can't I flash back the old version yet it let's me flash the new version ?

If you don't believe me I can do a video or try yourself.
Find the first lcd file ending in ...v5.hex
Then flash the 0.2, 0.3 or 0.4 motor file.

You either get a locked lcd or the config menus are so screwed up you can't enter any data or get no assistance.
I don't know. Was supposed to work.
I think we need urgent fix/develop this issue of EEPROM reset values.

Can you help EndlessCadence??
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.

zappan   100 mW

100 mW
Posts: 48
Joined: Sep 27 2018 3:00am
Location: Sicilia

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

Post by zappan » Oct 04 2018 6:50am

Casainho because my 36V engine and with installed the ver. sw.0.12 makes no difference between the settings at 16h and 18h, releases in both cases max 570W also controlled with Watts'Up?

zappan   100 mW

100 mW
Posts: 48
Joined: Sep 27 2018 3:00am
Location: Sicilia

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

Post by zappan » Oct 04 2018 7:02am

jbalat wrote:
Oct 04 2018 4:36am
Casainho can you just answer one thing?

Why can't I flash back the old version yet it let's me flash the new version ?

If you don't believe me I can do a video or try yourself.
Find the first lcd file ending in ...v5.hex
Then flash the 0.2, 0.3 or 0.4 motor file.

You either get a locked lcd or the config menus are so screwed up you can't enter any data or get no assistance.
Jbalat have you tried to start with the connection cable between LCD3 and TDSZ2 not connected? I did that to get back from 0.13 that did not work.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

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

Post by EndlessCadence » Oct 04 2018 7:11am

casainho wrote:
Oct 04 2018 6:25am
jbalat wrote:
Oct 04 2018 4:36am
Casainho can you just answer one thing?

Why can't I flash back the old version yet it let's me flash the new version ?

If you don't believe me I can do a video or try yourself.
Find the first lcd file ending in ...v5.hex
Then flash the 0.2, 0.3 or 0.4 motor file.

You either get a locked lcd or the config menus are so screwed up you can't enter any data or get no assistance.
I don't know. Was supposed to work.
I think we need urgent fix/develop this issue of EEPROM reset values.

Can you help EndlessCadence??
Yes I can but I'm not supporting old versions of the firmware.

I also think that jbalat should use the procedures of clearing the data memory as described before. I've had many users asking this (sometimes by private messages) and (almost?) all of them are happy now.
This isn't my (or casainho's?) daily job so things take some time and everyone should respect this. We're not a company supporting our products, we're just fellow users of the same motor and release the improvements we're making to public for everyone's benefit.

I've bought a STM8 dev kit and have just received it to make it possible to fix these kind of bugs quicker, yes I'm doing my best. :D

casainho   1 GW

1 GW
Posts: 3105
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Oct 04 2018 7:20am

EndlessCadence wrote:
Oct 04 2018 7:11am
casainho wrote:
Oct 04 2018 6:25am
jbalat wrote:
Oct 04 2018 4:36am
Casainho can you just answer one thing?

Why can't I flash back the old version yet it let's me flash the new version ?

If you don't believe me I can do a video or try yourself.
Find the first lcd file ending in ...v5.hex
Then flash the 0.2, 0.3 or 0.4 motor file.

You either get a locked lcd or the config menus are so screwed up you can't enter any data or get no assistance.
I don't know. Was supposed to work.
I think we need urgent fix/develop this issue of EEPROM reset values.

Can you help EndlessCadence??
Yes I can but I'm not supporting old versions of the firmware.

I also think that jbalat should use the procedures of clearing the data memory as described before. I've had many users asking this (sometimes by private messages) and (almost?) all of them are happy now.
This isn't my (or casainho's?) daily job so things take some time and everyone should respect this. We're not a company supporting our products, we're just fellow users of the same motor and release the improvements we're making to public for everyone's benefit.

I've bought a STM8 dev kit and have just received it to make it possible to fix these kind of bugs quicker, yes I'm doing my best. :D
Let's focus on this issue of EEPROM. Just ask anything if you need about this. Maybe I did not follow the example codes correctly, maybe I am not waiting for finish of writing cycle??

Here is an example from ST about writing to memory: STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Examples/FLASH
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.

Hurricane1973   1 µW

1 µW
Posts: 4
Joined: Sep 28 2018 5:14pm

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

Post by Hurricane1973 » Oct 04 2018 10:11am

In the wiki for firmware version 0.14 I noticed "Speed limit" values in both "General Basic setup" and "Offroad mode configuration". They seem to serve the same purpose. Also it's very confusing to set road legal settings in "Offroad mode configuration" as it currently stands. In my opinion it would be far better to have each in their own menus.

Road Legal configuration
------------------------
Legal Speed Limit: 25 Either kmh or mph as set in "Speed Unit"
Limit power: 1 Determines whether power should be limited as well. Enabled (1) or disabled (0)
Power limit: 250 W

OffRoad configuration
------------------------
Derestrict: 0 enabled (1) or disabled (0) Remove all road legal limits.
Active on system startup: 0 Determines whether offroad mode should be active on system startup. Enabled (1) or disabled (0)

User avatar
gaber   10 W

10 W
Posts: 69
Joined: Sep 22 2017 8:56am
Location: Grand Rapids, MI

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

Post by gaber » Oct 04 2018 2:08pm

Hurricane1973 wrote:
Oct 04 2018 10:11am
In the wiki for firmware version 0.14 I noticed "Speed limit" values in both "General Basic setup" and "Offroad mode configuration". They seem to serve the same purpose. Also it's very confusing to set road legal settings in "Offroad mode configuration" as it currently stands. In my opinion it would be far better to have each in their own menus.

Road Legal configuration
------------------------
Legal Speed Limit: 25 Either kmh or mph as set in "Speed Unit"
Limit power: 1 Determines whether power should be limited as well. Enabled (1) or disabled (0)
Power limit: 250 W

OffRoad configuration
------------------------
Derestrict: 0 enabled (1) or disabled (0) Remove all road legal limits.
Active on system startup: 0 Determines whether offroad mode should be active on system startup. Enabled (1) or disabled (0)
From an end user perspective, this makes a lot of sense.
sometimes you eat the bear, and sometimes, well, he eats you.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

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

Post by EndlessCadence » Oct 04 2018 2:57pm

gaber wrote:
Oct 04 2018 2:08pm
Hurricane1973 wrote:
Oct 04 2018 10:11am
In the wiki for firmware version 0.14 I noticed "Speed limit" values in both "General Basic setup" and "Offroad mode configuration". They seem to serve the same purpose. Also it's very confusing to set road legal settings in "Offroad mode configuration" as it currently stands. In my opinion it would be far better to have each in their own menus.

Road Legal configuration
------------------------
Legal Speed Limit: 25 Either kmh or mph as set in "Speed Unit"
Limit power: 1 Determines whether power should be limited as well. Enabled (1) or disabled (0)
Power limit: 250 W

OffRoad configuration
------------------------
Derestrict: 0 enabled (1) or disabled (0) Remove all road legal limits.
Active on system startup: 0 Determines whether offroad mode should be active on system startup. Enabled (1) or disabled (0)
From an end user perspective, this makes a lot of sense.
Could be and I probably agree but I think that calling something "legal" is disputable, that's why I opted for the contrary and added the offroad mode to be used only on private property in most countries.

I personally would prefer a limited bike by default. Whether it is legal to remove the limits in the specific country of the user is their responsibility. The rules also differ from location to location. That's why we advice you to consult the laws of your country and tailor the motor configuration accordingly.

The speed limits don't serve the same purpose, this has been explained quite a few times now.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

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

Post by EndlessCadence » Oct 04 2018 3:11pm

casainho wrote:
Oct 04 2018 7:20am
Let's focus on this issue of EEPROM. Just ask anything if you need about this. Maybe I did not follow the example codes correctly, maybe I am not waiting for finish of writing cycle??

Here is an example from ST about writing to memory: STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Examples/FLASH
Thanks, I will do this. First I have to create/compile a usable version of the current master (basically v0.13).

What do you think of the new repository? https://github.com/OpenSource-EBike-fir ... mart-EBike

GeoffS   1 mW

1 mW
Posts: 13
Joined: Oct 08 2017 11:40pm

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

Post by GeoffS » Oct 04 2018 8:15pm

Hi people:
Can I get a confirmation that on the 6 pin speed sensor it is a white wire 5V input and the Black wire SWIM is Switched Magnet (permanent on/continuity but the magnet at about 12mm switches it OFF) as I have zero speed display and I'm trying to de-bug this.
The main thing I needed to know was confirmation that SWIM was the magnetic switch as I have open circuit on all apparent options.
I hope this was the correct post to ask on :)
Thanks in advance.
-Geoff

Rydon   100 W

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

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

Post by Rydon » Oct 04 2018 9:55pm

GeoffS wrote:
Oct 04 2018 8:15pm
Hi people:
Can I get a confirmation that on the 6 pin speed sensor it is a white wire 5V input and the Black wire SWIM is Switched Magnet (permanent on/continuity but the magnet at about 12mm switches it OFF) as I have zero speed display and I'm trying to de-bug this.
The main thing I needed to know was confirmation that SWIM was the magnetic switch as I have open circuit on all apparent options.
I hope this was the correct post to ask on :)
Thanks in advance.
-Geoff
Hi Geoff, The speed sensor also contains signals for programming and lights not just the speed sensor. SWIM is for programming. The white wire is the speed sensor signal that you will see the magnet pulse on. This and the orange (ground) wire are all that is used for the speed sensor.

Posts like this are better on viewtopic.php?p=1416133#p1416133. This forum is for the OpenSource firmware project.

GeoffS   1 mW

1 mW
Posts: 13
Joined: Oct 08 2017 11:40pm

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

Post by GeoffS » Oct 05 2018 6:10am

Thanks, Rydon. I'll post to the suggested thread (I have more Q's as I suspect the sensor is stuffed)

nbdriver   10 mW

10 mW
Posts: 33
Joined: Jul 31 2015 4:38am
Location: Belgium

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

Post by nbdriver » Oct 05 2018 6:26am

Hello,

I'm also a happy user of the TSDZ2 for more than 2 years now. 1500Km on the motor and still going strong. The complaints i had for this motor was the lack of information on the display (Power in Watts, Battery Voltage, power usage in Wh) and also to not be able to customise the cut-off voltage for the battery (i'm usig LiPo so battery default gauge is not correct).

I discovered and followed this firmware in the early stages of development, and waited until now to order the LCD3 display and everything that was needed to flash it, but before jumping into this, i had need to understand something :

I don't understand clearly how the assist levels settings are working, i'm more familiar with a multiplier of human power (like bosh system : Level One 1x Human input power, Level 2 2xHuman input power....) with no limit of max power (beside the global limit, if i give an imput of 200w and the multiplier is 2X i'm willing to receive 400W from the motor, if i wan't more power i have to push harder or change the assist level). How does it exactly work, with this firmware ?

User avatar
jbalat   10 kW

10 kW
Posts: 552
Joined: Nov 10 2012 11:50pm
Location: Melbourne, Australia

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

Post by jbalat » Oct 05 2018 6:54am

Yes that's how they used to be in the old version. Awesome. Now I've been riding with the new firmware everyday for 3 days about 100kms or so. It is not bad but I have no control over the power any more like I did with the old version. Before if I wanted 500w I would just set it to 500w. Changing the assist level now also changes the power but not as programmed. I set the power to 2000 watts and I get about 400 when I go up hills.
It may just be that I will get used to it in a couple of weeks but i have to say i really dont like it at the moment.
For those who are getting in now you won't know any different. It is still much better than the original firmware, I'm sure you will be raving to everybody how good it is.
Btw I disabled the power boost and it is a little better. There is still a bug where you get little or no power for a short period after you stop and take off with a really high gear at low cadence. Just need to gear down before you stop.
Please subscribe to my Youtube home page for Quadcopters, FPV and Bike Rides http://www.youtube.com/jbalatutube
My build log here http://endless-sphere.com/forums/viewto ... =6&t=55352
For some cool ebike talk join us on The Best ebike https://www.facebook.com/groups/193581737807033/
Tech talk TSDZ2 Opensource firmware https://endless-sphere.com/forums/viewt ... &start=150
Opensource TSDZ2 Wiki https://github.com/OpenSource-EBike-fir ... _wiki/wiki

casainho   1 GW

1 GW
Posts: 3105
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Oct 05 2018 7:55am

jbalat wrote:
Oct 05 2018 6:54am
Yes that's how they used to be in the old version. Awesome. Now I've been riding with the new firmware everyday for 3 days about 100kms or so. It is not bad but I have no control over the power any more like I did with the old version. Before if I wanted 500w I would just set it to 500w. Changing the assist level now also changes the power but not as programmed. I set the power to 2000 watts and I get about 400 when I go up hills.
Hmmm, I am start to think that before it was not using cadence/human power..., only the torque aensor value.

Do you think the candence is high as when you ride on the road??
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
gaber   10 W

10 W
Posts: 69
Joined: Sep 22 2017 8:56am
Location: Grand Rapids, MI

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

Post by gaber » Oct 05 2018 8:14am

casainho wrote:
Oct 05 2018 7:55am
Hmmm, I am start to think that before it was not using cadence/human power..., only the torque aensor value.
As someone who is following with everything and trying to keep pace with the conversation, could you (or anyone) describe the difference b/t the two (cadence/human power vs only torque sensor value? I'm not 100% following with what was changed in the code in the "new" version of calculating assist output. Been appreciating the thoughtful changes made in the codebase and would love to understand this one.
sometimes you eat the bear, and sometimes, well, he eats you.

casainho   1 GW

1 GW
Posts: 3105
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Oct 05 2018 11:38am

casainho wrote:
Oct 05 2018 7:55am
jbalat wrote:
Oct 05 2018 6:54am
Yes that's how they used to be in the old version. Awesome. Now I've been riding with the new firmware everyday for 3 days about 100kms or so. It is not bad but I have no control over the power any more like I did with the old version. Before if I wanted 500w I would just set it to 500w. Changing the assist level now also changes the power but not as programmed. I set the power to 2000 watts and I get about 400 when I go up hills.
Hmmm, I am start to think that before it was not using cadence/human power..., only the torque aensor value.

Do you think the candence is high as when you ride on the road??
Oh men, I am on a trip of 3 days and I have that issue were at boost phase I can get the regular power like 800W but after it goes to the regular value but this one can't go over 250W.

I did had this issue when I implemented the boost... And I wonder if there is some bad calculation with limit of 255 doing to use an 8 bits variable...
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.

Bartman   1 W

1 W
Posts: 54
Joined: Feb 11 2018 2:38pm

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

Post by Bartman » Oct 05 2018 1:28pm

casainho wrote:
Oct 01 2018 3:17pm
Bartman wrote:
Oct 01 2018 2:00pm
in section 9 get a reading from parameter 2 ADC torque sensor, but only a 0 reading from the parameter 3 - Pedal torque sensor.
You got everything working and seems you understand well how the parameters works.
As you could understand, your torque sensor is not working :-( :-(
If you search on past messages you will find that did happen to others users -- faulty torque sensor on a new TSDZ2. I suggest you to contact the seller and also find the message of other users and tell to the seller, because this is happening to some users, fortunately, seems not to many users.
I got .hex files for the standard 36v firmware (program, data, option file). Loaded them up and did a program all tabs. Got a validation error and ST Visual programmer aborted loading. Did the same again and validated ok. The VLC5 did not register speed nor provide assistance.

I then reloaded ST VP, and on each corresponding tab loaded the relevant .hex file. Then on each tab loaded the .hex onto the TSDZ2 (program current tab) Instead of doing a program all tabs. It all worked and everything is normal for VLCD5 and TSDZ2 prviding power and assistance. Very strange. And now I've got a Torque sensor on the way from PSPower.... oops.

So why would the TSDZ2 not work with the opensource firmware? I did get a validation error when flashing the firmware on it. but flashed it again and all ok. I'm using a Mac with parallels desktop with windows 10.

Any ideas ? i really want the opensource firmware on my TSDZ2. it will be great for by bikepacking adventures.

andrea_104kg   1 W

1 W
Posts: 62
Joined: Mar 05 2018 5:51pm

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

Post by andrea_104kg » Oct 05 2018 3:02pm

Today I finally tried the tsdz2 and modified software v 07 (I'm not interested in the additional functions)
the ride still had important climbs, you climb 150 meters in one km in a couple of sectors (unpaved roads).
The tsdz2 behaved very well, not so much for maximum power (I do not know why but the wattmeter indicated at most 500w PRECISE) as for how it delivers the power .. very similar to "brand" engines! I came back without feeling any hassle!
noise: My tsdz2 unfortunately seems a slicer of the 1920 left under water until today
However the shimano of a "colleague" makes a very high noise very similar to the tsdz2.
Back, it was night but I could not resist doing a couple of miles with my turbo levo for comparisons.
I must say that the tsdz2 with modified software does not disfigure at all.
The noise on the levo is non-existent, you can hear only the wheels, but apart from that:
- the main difference is that in my opinion the turbo levo, in the face of legality has 150-200w peak more. (in fact the app blevo saw an absorption of about 740w) I give exactly the same feeling as when I pass from a legal hub to one with a 20a control unit.
- the tsdz2 with this software is not tiring but the levo is SLIGHTLY LESS, in the sense that it is more sensitive pushing hard, if you want you can work very little, the tsdz2 seems to want a little more push, the difference is not it is however abysmal ..
I thank casaihno to do a good job!
I do not really like the bost, in the first few meters the bike leaps forward, it seems almost the attack of the pas !.
Or rather, the bost is pleasant but too immediate, just touch the pedal and start forward .. It would be better if allowed 1/4 pedaling without assistance.
a question: why the wattmeter is fixed at 500w and does not reach higher values? I lack 100w of power for my weight (100kg)

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

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

Post by EndlessCadence » Oct 05 2018 3:46pm

I'm testing the latest version of the firmware, basically the released but withdrawn version 0.13 and the master branch of the new TSDZ2-Smart-EBike repository.

I think I fixed the EEPROM issues and I'm able to reset to default settings using the menu option of the display, so big success there!
It also felt like the motor had enough power this time! I used almost only the default settings. Configured my battery and motor type and disabled boost fade in time and boost menu option 0.

But offroad mode was broken because a few crucial parts of the functionality were removed by someone :P Now I understand why some users had issues, maybe they used this firmware version.

I have the following suggestions to be implemented very soon, I believe I can do this :D :
- From 9 to 5 assist levels default
- Revert the assist levels to simple factors (instead of "watts") as it was previously if this isn't too much work.
- Boost functionality toggle if possible, default off to reduce wear of the motor.
- Investigate 500W peak "limit"
- Prevent drag when pushing the bike backwards. It seems that we're still powering the motor coils. I think I need some help or experimenting here.
- Meanwhile my lighting parts will arrive, to be continued...

I will call this release v0.13.1 as it's a bugfix for v0.13 really.

Edit: after a bit more testing I can confirm that offroad mode is fully functional again for me. I also noticed what other users are saying. The bike is limited at around 500W peak (on display) no matter the current limiting of the battery. I didn't notice this before as this is already plenty of power for me with no hills around here. Added this to the list above!

I didn't really test the odometer but it seems to work fine for the little ride I did!
Last edited by EndlessCadence on Oct 05 2018 4:39pm, edited 1 time in total.

EndlessCadence   100 W

100 W
Posts: 217
Joined: Aug 22 2018 4:31am

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

Post by EndlessCadence » Oct 05 2018 4:35pm

Version 0.13.1 (bugfix) is released, see my signature below for the link. Tomorrow I will try to update the wiki accordingly, but very little was changed compared to v0.12.

To use the reset to factory defaults feature (it's no longer necessary to program the data memory!):
- Enter configuration menu 6
- Go to submenu 3
- Press the UP button 10 times, a counter on the display will be incremented anytime you do this
- The display will turn off
- Turn it on again and it will reset your configuration to the factory defaults!

Preferably follow this procedure for every upgrade of the firmware and directly after programming both the firmware of the controller and the display. But, for smaller bug fixes I'll try to prevent changes which require the configuration to be reset. Normally you can see this in the version number of the release, from now on the last number (e.g. x.x.3) will indicate whether it's a bug fix release.

Post Reply