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

Electric Motors and Controllers
buba   10 kW

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

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

Post by buba » May 29 2019 3:14am

casainho wrote:
May 29 2019 2:58am
The latest beta version with the changes done by Buba:

DO NOT USE THIS BETA VERSION, USE INSTEAD LATEST NON BETA VERSION.

This version is only for developers/testers.

https://github.com/OpenSource-EBike-fir ... 19.0-beta7
Looking forward to the feedback from the community!

Have updated the wiki with the changes:

https://github.com/OpenSource-EBike-fir ... ion-0.19.X

Note: the Offroad Mode logic has been changed.

thineight   100 W

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

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

Post by thineight » May 29 2019 3:40am

casainho wrote:
May 29 2019 2:58am
The latest beta version with the changes done by Buba:

DO NOT USE THIS BETA VERSION, USE INSTEAD LATEST NON BETA VERSION.

This version is only for developers/testers.

https://github.com/OpenSource-EBike-fir ... 19.0-beta7
Thanks Casainho and buba! Why this time do you strongly point out that the beta7 is only for testers?
Is there any new sensitive modification?
MTB KTM Ultra 29" - City bike DAYTONA 28"

buba   10 kW

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

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

Post by buba » May 29 2019 5:00pm

thineight wrote:
May 29 2019 3:40am
casainho wrote:
May 29 2019 2:58am
The latest beta version with the changes done by Buba:

DO NOT USE THIS BETA VERSION, USE INSTEAD LATEST NON BETA VERSION.

This version is only for developers/testers.

https://github.com/OpenSource-EBike-fir ... 19.0-beta7
Thanks Casainho and buba! Why this time do you strongly point out that the beta7 is only for testers?
Is there any new sensitive modification?
I have been putting down some hours on development. There are a lot of changes. I think Casainho is trying to approach this beta with safety in mind and only recommend experienced users to validate the changes.

Some of the changes will affect all development moving forward so it is essential that everything is the best that it can be.

Am really pleased with this beta. Many nice changes. Expecting button bugs on the KT-LCD3 though.

thineight   100 W

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

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

Post by thineight » May 30 2019 9:14am

buba wrote:
May 29 2019 5:00pm
I have been putting down some hours on development. There are a lot of changes. I think Casainho is trying to approach this beta with safety in mind and only recommend experienced users to validate the changes.

Some of the changes will affect all development moving forward so it is essential that everything is the best that it can be.

Am really pleased with this beta. Many nice changes. Expecting button bugs on the KT-LCD3 though.
Hello folks.
I had a spare hour to install and briefly test the new beta7, my impressions here below.

I must admit I had a bit of headache to use the new menu logic, I could not even change the first setting kmh/mph.. so I tried to reboot couple of time. Then I managed to get through the menus.
As far as I remember not all the setting are numbered: for example the "unit" selection should be menu 0 submenu 0 but the latter is not visualized (only the "km/h" or "mph").
In a occasion, not in the configuration menu, the UP and DOWN keys looked inactive.. so I had to reboot again.

OFF-ROAD MODE
Off-road mode logic is inverted. My default setting is disabled at startup, but it resulted enabled, with no blinking ASSIST.
If I change the state, the ASSIST starts blinking but the power is cut to 250W.
On the contrary, if i set enabled at startup in the configuration menu, it starts disabled.
Moreover the new button assignment is not ideal to me. Fairly long press of ON/OFF+DOWN button triggers the control but at the same time changes also the menu to the next one (it reads ON/OFF press) and scales the assistance to a lower value (it reads DOWN press).
I have to press ON/OFF+DOWN a bit longer because a simple press, as it was before with the previous logic, does not work. Am I doing it wrong?
Why can't we keep the old key combination ON+UP / ON+DOWN to activate/deactivate the offroad mode?

CRUISE CONTROL
Looks better than before.. so for my test (small flat trip around the block) it is OK.

Longer mountain trips will give a better test of the overall system..

Just my last question: I set up the 1st assistance with the multiplier 0.1, but the bike does not start up until human power reaches 200W, therefore for the first second or two I got no assistance, is it normal?
The 2nd assistance is set to 0.2, and it kicks in as I reach 100W of human power.
Is 20W the mininum power that the motor can give?

Thanks a lot.
MTB KTM Ultra 29" - City bike DAYTONA 28"

buba   10 kW

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

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

Post by buba » May 30 2019 2:19pm

thineight wrote:
May 30 2019 9:14am
Hello folks.
I had a spare hour to install and briefly test the new beta7, my impressions here below.

I must admit I had a bit of headache to use the new menu logic, I could not even change the first setting kmh/mph.. so I tried to reboot couple of time. Then I managed to get through the menus.
I understand that it is completely new and there is some getting use to. Please let me know how I might help and if there are any bugs.
thineight wrote:
May 30 2019 9:14am
As far as I remember not all the setting are numbered: for example the "unit" selection should be menu 0 submenu 0 but the latter is not visualized (only the "km/h" or "mph").
That is correct. It is done this way as not to confuse the user with the sub menu number and the units. In the case of changing system units it would display "0 km/h" or "0 mph". Do you think we should add the numbers?
thineight wrote:
May 30 2019 9:14am
In a occasion, not in the configuration menu, the UP and DOWN keys looked inactive.. so I had to reboot again.
Will fix!
thineight wrote:
May 30 2019 9:14am
Off-road mode logic is inverted. My default setting is disabled at startup, but it resulted enabled, with no blinking ASSIST.
If I change the state, the ASSIST starts blinking but the power is cut to 250W.
On the contrary, if i set enabled at startup in the configuration menu, it starts disabled.
Yes, you now setup the motor power and speed limit in "normal/onroad mode" and in "offroad mode", separately. This is because one user created an issue on gitHub stating that the logic was strange. This is the result after trying to simplify the logic.

When Offroad Mode is activated it is the speed limit and power limit that is entered in the configuration menu that is used. Wanted to rename the mode to Road Legal Mode or Onroad Mode to make it crystal clear for future and current users. But need feedback from the community regarding this.
thineight wrote:
May 30 2019 9:14am
Moreover the new button assignment is not ideal to me. Fairly long press of ON/OFF+DOWN button triggers the control but at the same time changes also the menu to the next one (it reads ON/OFF press) and scales the assistance to a lower value (it reads DOWN press).
I have to press ON/OFF+DOWN a bit longer because a simple press, as it was before with the previous logic, does not work. Am I doing it wrong?
Why can't we keep the old key combination ON+UP / ON+DOWN to activate/deactivate the offroad mode?
Will completely fix this and make it work!
thineight wrote:
May 30 2019 9:14am
CRUISE CONTROL
Looks better than before.. so for my test (small flat trip around the block) it is OK.

Longer mountain trips will give a better test of the overall system..
It is not perfect yet but will get better! Feel free to give more feedback!
thineight wrote:
May 30 2019 9:14am
Just my last question: I set up the 1st assistance with the multiplier 0.1, but the bike does not start up until human power reaches 200W, therefore for the first second or two I got no assistance, is it normal?
The 2nd assistance is set to 0.2, and it kicks in as I reach 100W of human power.
Is 20W the mininum power that the motor can give?
The system works by setting the appropriate target current for the motor. This is done in steps as the analog-to-digital converter has a finite resolution. So there might be some noticeable effects similar to what you are reporting. There are ways to fix this and make it smoother but I think it is best to make the 0.19.0 stable first. I am glad you are reporting this though! The goal is to have it super smooth!

Thank you!

thineight   100 W

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

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

Post by thineight » May 30 2019 4:04pm

Buba thanks for your prompt reply.

Regarding the configuration menu, I will try again to surf into the menus to see if something strange appears.. and of course report.
For the 0 on the unit selection menu.. it doesn't matter.. I think you can leave as is. I just felt a bit lost in the beginning because the keys seemed not responding the way I expected.

OFF-ROAD MODE: I think the community is now used to call it that way and the meaning is that you can unlock more power and speed out of the public road.
Reading carefully your response I understand that it was my mistake.. the logic is changed and it is clearly written in the wiki which field represents what. Apologize.
Now speed and power need to be filled the other way around. I will try and but think it is ok.

Thanks for the other fixes, specially the off-road mode combination keys not changing the menu and assistance!!

Very last one, if you could add a little more delay to enter the configuration menu, as I feel now is too quick the UP+DOWN press.
MTB KTM Ultra 29" - City bike DAYTONA 28"

Uturn   1 W

1 W
Posts: 58
Joined: Jun 06 2018 10:09am

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

Post by Uturn » May 31 2019 1:43am

Does opensource firmware support optimal rider cadence?
Something like a cadence-related power setting curve?
So, bikers would be encouraged to pedal a bit faster instead or ruining their knees with super low cadence and max pressure plus max support? Under cadence 30, the motor would give only 30% support (except boost phase), under cadence 50 only 50% and above cadence 50 100%, or something like that.
Is that possible, or do we have a linear setting plus boost effect?

Dirkro   10 W

10 W
Posts: 82
Joined: Jun 30 2018 8:18am
Location: Bochum Germay

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

Post by Dirkro » May 31 2019 3:44am

Uturn wrote:
May 31 2019 1:43am
Does opensource firmware support optimal rider cadence?
Something like a cadence-related power setting curve?
So, bikers would be encouraged to pedal a bit faster instead or ruining their knees with super low cadence and max pressure plus max support? Under cadence 30, the motor would give only 30% support (except boost phase), under cadence 50 only 50% and above cadence 50 100%, or something like that.
Is that possible, or do we have a linear setting plus boost effect?
I like to have a good torque with low candence too, to pass crossings and pass mud holes you dont expect. Then I start below 50 cadence and enjoy / need the power.
Just my two cents
Oh darling, this is not a new bike.. :roll:

thineight   100 W

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

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

Post by thineight » May 31 2019 7:54am

thineight wrote:
May 30 2019 4:04pm
Buba thanks for your prompt reply.

Regarding the configuration menu, I will try again to surf into the menus to see if something strange appears.. and of course report.
For the 0 on the unit selection menu.. it doesn't matter.. I think you can leave as is. I just felt a bit lost in the beginning because the keys seemed not responding the way I expected.

OFF-ROAD MODE: I think the community is now used to call it that way and the meaning is that you can unlock more power and speed out of the public road.
Reading carefully your response I understand that it was my mistake.. the logic is changed and it is clearly written in the wiki which field represents what. Apologize.
Now speed and power need to be filled the other way around. I will try and but think it is ok.

Thanks for the other fixes, specially the off-road mode combination keys not changing the menu and assistance!!

Very last one, if you could add a little more delay to enter the configuration menu, as I feel now is too quick the UP+DOWN press.
Buba, I switched the speed/power values between the off-road menu and the general, as per wiki and of course the behaviour is as expected. :thumb:

I suggets you to update the wiki highlighting/underlining the "legal" and "offroad" words to put the focus on the change as everyone is now used to the opposite logic ;)
Where to highlight the change:
- description on menu 0 - submenu 1 (legal speed)
- description on menu 7 - submenu 1 (legal power)
- description on menu 8 - (off-road speed and power)

In beta 5 it was ON+UP -> activate offroad mode
ON+DOWN -> deactivate offroad mode

From beta7 I understand you want to use ON+DOWN to activate/deactivate offroad mode, is that because you want to reserve the ON+UP to set the motor power limit on the fly?
I am fine with it, just matter to get used to the logic, but please fix the simultaneous commands due to the ON and DOWN press (reported in the previous post).

Thanks! :wink:
MTB KTM Ultra 29" - City bike DAYTONA 28"

dameri   100 W

100 W
Posts: 182
Joined: Sep 20 2018 10:57am

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

Post by dameri » May 31 2019 11:08am

I tried v0.19.0-beta 7. I drove to shop about 7 kms. There was quite poor assist alltough my levels and factors was exact same as previous version. Also other configurations are same as before. After shopping I went back to home and assist came back as good as before. Maby power off helped when I was shopping.

As thineight said there is new logic in menus. Previus was better. I had fast quide made by myself for on the road. Now I have to make new one because menus has changed so much.

I have always offroad mode on and it worked. I didn’t try to switch it off with on/off + down buttons. Thineight said it’s working. Blinking 1 was gone, thanks for that. I didn’t test any else.

Tomorrow I try to drive longer trip and test other functions.

thineight   100 W

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

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

Post by thineight » May 31 2019 12:42pm

dameri wrote:
May 31 2019 11:08am
I tried v0.19.0-beta 7. I drove to shop about 7 kms. There was quite poor assist alltough my levels and factors was exact same as previous version. Also other configurations are same as before. After shopping I went back to home and assist came back as good as before. Maby power off helped when I was shopping.

As thineight said there is new logic in menus. Previus was better. I had fast quide made by myself for on the road. Now I have to make new one because menus has changed so much.

I have always offroad mode on and it worked. I didn’t try to switch it off with on/off + down buttons. Thineight said it’s working. Blinking 1 was gone, thanks for that. I didn’t test any else.

Tomorrow I try to drive longer trip and test other functions.
Actual menu logic is more.. logic. We got used to the previous one but in fact this one is more intuitive.

Be careful because if you did not swap speed and power on the menus the off-road mode works with the "legal" values and you are limited to 25km/h and 250W.
Read my previous post.. I didn't pay much attention on the wiki.
MTB KTM Ultra 29" - City bike DAYTONA 28"

casainho   10 GW

10 GW
Posts: 4826
Joined: Feb 14 2011 2:43pm

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

Post by casainho » May 31 2019 2:12pm

thineight wrote:
May 31 2019 7:54am
I suggets you to update the wiki highlighting/underlining the "legal" and "offroad" words to put the focus on the change as everyone is now used to the opposite logic ;)
Where to highlight the change:
- description on menu 0 - submenu 1 (legal speed)
- description on menu 7 - submenu 1 (legal power)
- description on menu 8 - (off-road speed and power)
I think we can use "street mode" instead of "legal mode". I think offroad mode and street mode are good names.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

btslo   10 W

10 W
Posts: 75
Joined: Apr 17 2019 8:55am

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

Post by btslo » May 31 2019 2:22pm

Flashed motor and LCD today (first time user) but when I plug in the LCD and connect battery the LCD and backlight come on and flicker faintly. I checked the LCD connectors to the motor and they seem to be correct and no visible shorts. Plugging in the VLCD5 gives E3 error so I guess the motor firmware is the open source. Tried reflashing the LCD and it was sucessful, it powers on normally when I plug it into PC with STlink. Flashing the controller was also a success and threw no errors (I used the "program all tabs" button for both LCD and controller flashing, is this OK?)

casainho   10 GW

10 GW
Posts: 4826
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 01 2019 4:26am

btslo wrote:
May 31 2019 2:22pm
Flashed motor and LCD today (first time user) but when I plug in the LCD and connect battery the LCD and backlight come on and flicker faintly. I checked the LCD connectors to the motor and they seem to be correct and no visible shorts. Plugging in the VLCD5 gives E3 error so I guess the motor firmware is the open source. Tried reflashing the LCD and it was sucessful, it powers on normally when I plug it into PC with STlink. Flashing the controller was also a success and threw no errors (I used the "program all tabs" button for both LCD and controller flashing, is this OK?)
Maybe your LCD3 is configured on hardware for a different battery voltage? Can you confirm that this issue did not happen with original firmware of LCD3 and the same battery??
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

btslo   10 W

10 W
Posts: 75
Joined: Apr 17 2019 8:55am

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

Post by btslo » Jun 01 2019 5:19am

Got it working, I plugged all the wires in reverse since I thought they should look like in this picture but actually it should show the female end with these colors:

download/file.php?id=239409&mode=view

Just need to figure out the menu logic now :)

btslo   10 W

10 W
Posts: 75
Joined: Apr 17 2019 8:55am

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

Post by btslo » Jun 01 2019 8:35am

Tried it now but get no motor assist :( (like the motor is not working) Speedo works, I get torque values and cadence in settings but PWM stays at zero.

Interestingly I also get no assist with stock firmware and LCD, speedo doesn't work there and battery only shows 1 bar (fully charged) Could the controlled be dead?

dameri   100 W

100 W
Posts: 182
Joined: Sep 20 2018 10:57am

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

Post by dameri » Jun 01 2019 9:00am

It was a very fun ride with tszd2 motor once again. The v0.19.0-beta7 version worked very well. I tried walk assist and Cruise and both worked. I did’t tried the startup boost feature.

Big thanks to the developers.

buba   10 kW

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

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

Post by buba » Jun 01 2019 9:35am

thineight wrote:
May 30 2019 4:04pm
Buba thanks for your prompt reply.

Regarding the configuration menu, I will try again to surf into the menus to see if something strange appears.. and of course report.
For the 0 on the unit selection menu.. it doesn't matter.. I think you can leave as is. I just felt a bit lost in the beginning because the keys seemed not responding the way I expected.
Thank you! Totally understand and hope you get used to the new button logic! I think many will feel the same!
thineight wrote:
May 30 2019 4:04pm
Very last one, if you could add a little more delay to enter the configuration menu, as I feel now is too quick the UP+DOWN press.
Will take a look at it! :)
thineight wrote:
May 31 2019 7:54am
Buba, I switched the speed/power values between the off-road menu and the general, as per wiki and of course the behaviour is as expected. :thumb:

I suggets you to update the wiki highlighting/underlining the "legal" and "offroad" words to put the focus on the change as everyone is now used to the opposite logic ;)
Where to highlight the change:
- description on menu 0 - submenu 1 (legal speed)
- description on menu 7 - submenu 1 (legal power)
- description on menu 8 - (off-road speed and power)
Will try to make it more clear! Good feedback!
thineight wrote:
May 31 2019 7:54am
In beta 5 it was ON+UP -> activate offroad mode
ON+DOWN -> deactivate offroad mode

From beta7 I understand you want to use ON+DOWN to activate/deactivate offroad mode, is that because you want to reserve the ON+UP to set the motor power limit on the fly?
I am fine with it, just matter to get used to the logic, but please fix the simultaneous commands due to the ON and DOWN press (reported in the previous post).

Thanks! :wink:
Yes! Thought it would be good to reserve the ONOFF and DOWN button to enable and disable the offroad mode. And the ONOFF and UP button to enter the quick set power menu. Want to have it as simple as possible for all current and new users. I see that you already understand and accept this change.
dameri wrote:
May 31 2019 11:08am
I tried v0.19.0-beta 7. I drove to shop about 7 kms. There was quite poor assist alltough my levels and factors was exact same as previous version. Also other configurations are same as before. After shopping I went back to home and assist came back as good as before. Maby power off helped when I was shopping.
What version of the firmware did you upgrade from? Please try it out more and let me know if you have a bug!
dameri wrote:
May 31 2019 11:08am
As thineight said there is new logic in menus. Previus was better. I had fast quide made by myself for on the road. Now I have to make new one because menus has changed so much.
It is as thineight said more "logical" but there is some getting used to. Thank you for the feedback!
casainho wrote:
May 31 2019 2:12pm
thineight wrote:
May 31 2019 7:54am
I suggets you to update the wiki highlighting/underlining the "legal" and "offroad" words to put the focus on the change as everyone is now used to the opposite logic ;)
Where to highlight the change:
- description on menu 0 - submenu 1 (legal speed)
- description on menu 7 - submenu 1 (legal power)
- description on menu 8 - (off-road speed and power)
I think we can use "street mode" instead of "legal mode". I think offroad mode and street mode are good names.
Very good and will change! Thanks, Casainho!

buba   10 kW

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

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

Post by buba » Jun 01 2019 9:41am

dameri wrote:
Jun 01 2019 9:00am
It was a very fun ride with tszd2 motor once again. The v0.19.0-beta7 version worked very well. I tried walk assist and Cruise and both worked. I did’t tried the startup boost feature.

Big thanks to the developers.
Glad to hear! :bigthumb:

buba   10 kW

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

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

Post by buba » Jun 01 2019 9:45am

btslo wrote:
Jun 01 2019 5:19am
Got it working, I plugged all the wires in reverse since I thought they should look like in this picture but actually it should show the female end with these colors:

download/file.php?id=239409&mode=view

Just need to figure out the menu logic now :)
Let me know if we can write the wiki any better and if anything is not clear! Would be interesting to hear feedback from a new user!

Welcome to this great community! (credit: Casainho)

casainho   10 GW

10 GW
Posts: 4826
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 01 2019 9:51am

btslo wrote:
Jun 01 2019 8:35am
Tried it now but get no motor assist :( (like the motor is not working) Speedo works, I get torque values and cadence in settings but PWM stays at zero.
PWM variable should increase with cadence and torque and even if motor controller is dead (on the part that control the motor coils), the PWM must increase and decrease as usually -- I would say there is something, maybe current limit, power limit, brake sensor, etc that is disabling the PWM.
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

btslo   10 W

10 W
Posts: 75
Joined: Apr 17 2019 8:55am

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

Post by btslo » Jun 01 2019 10:05am

buba wrote:
Jun 01 2019 9:45am
btslo wrote:
Jun 01 2019 5:19am
Got it working, I plugged all the wires in reverse since I thought they should look like in this picture but actually it should show the female end with these colors:

download/file.php?id=239409&mode=view

Just need to figure out the menu logic now :)
Let me know if we can write the wiki any better and if anything is not clear! Would be interesting to hear feedback from a new user!

Welcome to this great community! (credit: Casainho)
Nevermind, the menu logic is very clear and easy to understand now. Was only confused by the first kmh/mph menu as there were no numbers like in the next ones.


casainho wrote:
Jun 01 2019 9:51am
btslo wrote:
Jun 01 2019 8:35am
Tried it now but get no motor assist :( (like the motor is not working) Speedo works, I get torque values and cadence in settings but PWM stays at zero.
PWM variable should increase with cadence and torque and even if motor controller is dead (on the part that control the motor coils), the PWM must increase and decrease as usually -- I would say there is something, maybe current limit, power limit, brake sensor, etc that is disabling the PWM.
Got stock working again, had to fix the option byte value as it was wiped out (found somewhere in this thread) But still have problems with open source, when flashing the motor controller should I change to STM8S105x4 or x6 like for LCD?

If I use x4 I get a million errors like these when loading the hex file: FILE : line 1364: Address 0xD505 is out of range and is ignored!


EDIT: I hope I'm not retarded, after checking the wiki again stock max motor power value is 0, I should probably change that before first ride? Would explain no PWM value and assist as you said.

casainho   10 GW

10 GW
Posts: 4826
Joined: Feb 14 2011 2:43pm

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

Post by casainho » Jun 01 2019 10:40am

btslo wrote:
Jun 01 2019 10:05am
Got stock working again, had to fix the option byte value as it was wiped out (found somewhere in this thread) But still have problems with open source, when flashing the motor controller should I change to STM8S105x4 or x6 like for LCD?

If I use x4 I get a million errors like these when loading the hex file: FILE : line 1364: Address 0xD505 is out of range and is ignored!


EDIT: I hope I'm not retarded, after checking the wiki again stock max motor power value is 0, I should probably change that before first ride? Would explain no PWM value and assist as you said.
Did you read the wiki installation guide? because there says that you must choose STM8S105x6 on both!
- TSDZ2 FAQ: issues and repairs, etc
- TSDZ2 OpenSource firmware

Developer of OpenSource knowledge and technology for ebikes: Wireless Ebike boar ANT+ and Bluetooth, Flexible OpenSource firmware for EBikes: TSDZ2 mid drive motor, KT motor controllers and displays: Bafang 850C color, SW102 Bluetooth and KT-LCD3.

If you like my work, please consider making a donation to help my developments: paypal.me/jorgecasa

btslo   10 W

10 W
Posts: 75
Joined: Apr 17 2019 8:55am

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

Post by btslo » Jun 01 2019 2:11pm

Yes I read the wiki, but jbalad's video had x4 I think (outdated probably)

Anyhow I got it working, was under the impression assist levels were already preset but that was not the case which was the reason I had no motor power.

dameri   100 W

100 W
Posts: 182
Joined: Sep 20 2018 10:57am

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

Post by dameri » Jun 02 2019 3:38am

buba wrote:
Jun 01 2019 9:35am


dameri wrote:
May 31 2019 11:08am
I tried v0.19.0-beta 7. I drove to shop about 7 kms. There was quite poor assist alltough my levels and factors was exact same as previous version. Also other configurations are same as before. After shopping I went back to home and assist came back as good as before. Maby power off helped when I was shopping.
What version of the firmware did you upgrade from? Please try it out more and let me know if you have a bug!
I had v0.19.0-beta6. I'm not developer but I can test new versions and if they not work I can tell you what is wrong.
As I said afterwards beta7 is working fine. New logic is "hard to learn" to old man.

Thank you buba reading testers reports.

Also quoting is not my best shots.

Post Reply