Experiences with Open Source Firmware on the Tongsheng TSDZ2

Swizz

Pedelecer
Oct 1, 2017
211
161
48
Sk14
Okay, so after riding 200 miles on a standard setup (48v 500w with VLCD5 screen) I have decided to experiment with the Open Source Firmware. The standard performance is more than adequate and with a 14.5Ah battery I have been managing 60 miles on a full charge. On the other hand the drive is not particularly smooth when compared to a Shimano Steps or Bosch equipped bicycle, especially around the 25kph cut off point and to get the best out of it I have to constantly flit between modes to vary the assistance on undulating terrain.

You may also note that I have not plumped for the legal 250w motor. Shop bought eBikes adhere to the ‘nominal rating of 250w’ or however it is worded, but essentially some perform better than others and most have peak power outputs quite a bit higher than 250w - that much is evident when you ride them. I have test ridden a few legal shop bought bicycles with the crank drive motors mentioned above and they both felt no less powerful than my so called 500w. Like those my motor is limited to 25kph. I intend to keep it that way and sleep soundly thank you very much.

You can display quite a bit more data by using one of the universal screens that are available, but these need to be rewired to a Tongsheng display lead and some need programming also. I am happy with the stock VLCD5 display so am keeping that. Assistance at higher speeds can be unlocked using the standard setup so that is not the motivation for installing the Open Source Firmware. It is the possibility of quieter running, smoother power delivery and possibly better economy/range. Oooh Yass :)

So to begin with an interface is required to connect the motor to a pc or laptop. A company in the US - eco-ebike.com - sells them or you can make your own from an ST-Link programming dongle and part of a Tongsheng Speed Sensor extension lead - as per some great instructions courtesy of Empowered People.

38681

38682

Software exists for Windows, Mac & Linux operating systems. We use Linux at home but from a dire experience trying to get an OBD lead to work with some software on my penguin powered PC a few years ago, I begrudgingly borrowed my youngest daughters wreck of a Windows 10 Laptop for the task which (I also begrudgingly must add) performed the task without a hitch.

Github user ‘emmebrusa’ provides brill instructions for what to download and where to install it on your hard drive and so that is what I did. However, before pressing GO! I had a bit of a crisis. What if it did not work and the pretty fine as it is ebike was rendered unusable? Emmebrusa says that their installer allows you to revert back but I was not convinced, so in a better safe than sorry moment I had another look on the web and was directed back to eco-ebike.com who have the original firmware available to download. They use some of the same software used by Emmebrusa along with some updated drivers so I installed them also.

So, following the instructions on eco-ebike.com I ran the ST Visual Programmer software, configured it to match the ST-Link dongle being used and connected it to the speed sensor lead coming out of the TSDZ2 motor. Their instructions then guide you to read the firmware already in the motor in the tab OPTION BYTE. I did the same on the other two tabs also - PROGRAM MEMORY & DATA MEMORY - and like magic, the firmware map appeared in hexadecimal and I did not understand a single bit of it. I took a photo of each tab before loading the standard firmware files into the software. Some patience was required here but I compared the hexadecimal to the photos taken and the PROGRAM MEMORY ones were identical. The DATA MEMORY ones were slightly different but easy enough to alter manually should I need to reinstall them at any point. Phew.

38661

With that little confidence boost I opened up the java software to install Emmebrusa’s Open Source Firmware. Here the mysterious hexadecimal was forsook for a nice graphical interface to choose options and alter parameters. The whole thing was pre-populated but needed tailoring to suit the motor voltage, battery and tyre size at the very least.

From start to finish I did the following:

Basic Setting tab
  • Motor Type - 48v
  • Wheel Circumference - 2220mm (from Schwalbe’s website)
  • Battery Capacity (Wh) - 696 (14.5Ah x 48v)
  • Battery Cells Number - 13 (48v batteries have 13 cells in series - with multiples of these in parallel for extra capacity - they are only asking for the number of cells in series)
  • Battery Cut Off Voltage - 37.7v (this is the number of cells in series multiplied by 2.9v - the voltage of an empty cell - so in this case 13x2.9=37.7v)
  • Display Type - VLCD5
  • Units Type - mph (please note that the manual states that if using mph, on your VLCD5 display you must set the wheel size to the largest size on there - 35 in my case - I did so and it seems to work fine)
Assistance Settings tab
  • eMTB mode - Enable on startup (this was recommended as the best option by the Empowered-People Peeps)
38662

And then I took a deep breath and clicked on Compile & Flash. A terminal window opened that listed in text what the software was doing from compiling the file to installing it on the motor. When completed I unplugged the dongle, reconnected the speed sensor lead, entered the largest wheel size into the VLCD5 display and had a quick roadtest. The difference it must be said was night & day. The power delivery is super smooth as promised around the 25kph cutoff speed in particular and the motor is noticeably quiet.

Today I put a further 12 miles on it and continued to be impressed. There is now less need to change the assistance settings as often if at all if you do not mind a little effort, although getting into the swing of letting the motor take the strain, I did up the power on some steep bits. If there is one niggle it is that the motor seems a bit too keen to help now in the lowest power setting so that whereas the drop off is smoother at 15.5mph, plodding at around 8mph in places on a canal towpath for example the power could be felt taking up the drive. After another 20 miles or so I think I will hook her up to the laptop again to reduce some of the numbers to try and improve that some more.

I must finish off this instalment by saying that this little adventure in hackery has been totally worth the small expense and effort thus far. The only aspect that I do not yet know has been improved upon or made worse is the economy and the effect that will have on the range it will get from the 14.5Ah battery. 60 miles of range is a high bar to have set really. I was extremely pleased that the standard out of the box firmware gave assistance for such an impressive distance and if truth be known will not be disappointed if that number is not improved upon, although I would not want it to be worsened either!

Expect updates as the miles pass by :D

Isla...

P.S: The links to where I bought the parts from are just that, not an advertisement and they are likely available elsewhere.

P.P.S: Yes, that is my rather impressive nose in the first picture. Apologies for that!
 
Last edited:

MontyPAS

Esteemed Pedelecer
May 16, 2020
390
148
Great write up!
 
  • Like
Reactions: Swizz

MontyPAS

Esteemed Pedelecer
May 16, 2020
390
148
Thank you!
You've made it look remarkably simple.
Looked into doing it myself, but was deterred in that the Casainho OSF firmware I was looking at needed the display re-flashed as well. That could invoke the "FU Factor"
Your version clearly works with the stock display. Keep everyone updated with any issues.
 
  • Like
Reactions: Swizz

Swizz

Pedelecer
Oct 1, 2017
211
161
48
Sk14
You've made it look remarkably simple.
Looked into doing it myself, but was deterred in that the Casainho OSF firmware I was looking at needed the display re-flashed as well. That could invoke the "FU Factor"
Your version clearly works with the stock display. Keep everyone updated with any issues.
Will do. Have only used instructions off some very helpful websites but it's great that it can be done. Kudos to the hacker community really!
 
  • Like
Reactions: MontyPAS

TJS109

Pedelecer
Sep 29, 2017
112
48
77
Glos
Hi,
Great write up and very full detail. I have been put off upgrading my bike by having to buy a new display ( or so i thought). I read through all the links but am a little confused. I could not find the link to open source firmware that uses the VLD5 display I could only find "stock firmware" .
Did I miss the link or manage to confuse myself in some other way ?

EDIT: On reading the info properly I now see that the tools provided compile and flash a version of the firmware, when i was looking for pre-compiled hex files. Now much wiser and will try it out and see what we get

Tim
 
Last edited:
  • Like
Reactions: Bikes4two

haggis

Pedelecer
Aug 3, 2015
36
15
Fife
I have recently fitted a 48V 750W tsdz2 to my bike,is there any amateur in Scotland that could update my motor with the open source update for payment?
Please contact as keen to upgrade.
 

Swizz

Pedelecer
Oct 1, 2017
211
161
48
Sk14
Hi,
Great write up and very full detail. I have been put off upgrading my bike by having to buy a new display ( or so i thought). I read through all the links but am a little confused. I could not find the link to open source firmware that uses the VLD5 display I could only find "stock firmware" .
Did I miss the link or manage to confuse myself in some other way ?

EDIT: On reading the info properly I now see that the tools provided compile and flash a version of the firmware, when i was looking for pre-compiled hex files. Now much wiser and will try it out and see what we get

Tim
Tim, this is the firmware for the VLC5D5 >>> https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/wiki
 
  • Informative
Reactions: peter.c

Swizz

Pedelecer
Oct 1, 2017
211
161
48
Sk14
Okay time for a lil' update.

Have just put her on charge for the 1st time since flashing the new firmware.

Positives:
* Range seems okay. Managed 70 miles
* Can pretty much live with Eco mode for most if not all of the time, although have not yet tackled any 25% grades!
* Super smooth around the 25kph cut off point!

Negatives:
* At 70 miles we found the low battery cut off...not really a negative though...am taking this to mean that the range is at least as good as before and well...70 miles!
* After booting up and setting off, the Speedo reads 0 mph for about a minute before bursting into life.
* Had an issue at around 50 miles where upon activating the lights to illuminate the screen I got an E02 error. I was also waiting at a red traffic light (take that Daily Fail readers!) with brakes on and a foot weighted on the pedal which may have been the cause.
* As mentioned previously, initial take up of drive is a touch aggressive and the assistance in the 3 higher power settings is noticeably weaker than before...but as mentioned, have yet to test again on a steep climb.
* Youngest Dahling Windoze 10 laptop has thrown the towel in, so unable to do the fine tuning yet.

Conclusion:
* 60 mile range seems realistic.
* If the take up of drive & higher power settings imperfections can be tuned out then, Wow :)
* Need to monitor that E02 error - hopefully nothing.
* Universal eBike kit + Firmware from the hacker community = With fine tuning needed, an experience in the Shimano ballpark.

It is pretty good y'know :)
 

TJS109

Pedelecer
Sep 29, 2017
112
48
77
Glos
Well the extension lead finally arrived so I bit the bullet and did it. Early on i could not get read the program byte to read but after checking the pin-out umpteen times and re-flashing the dongle I finally shortened the interface wires from short to very short and eureka it burst into life. Having saved the original program and memory files I programmed it in the power assist mode.
I have only had a short ride but the response is better and smoother especially in high assist mode but not mind blowingly so. One worry I get the E02 error on startup and when I stop so will have to look into that. It does disappear when riding so maybe OK. I did wonder if it was something to so with the weird odometer data catch up that is mentioned in the manuals.
I will be attempting some longer tests but may wait for the weather to improve.

As an aside I used self-soldering heat shrink to make the connections ( heat shrink with an internal collar of solder) they worked brilliantly.

Thanks to Swizz for finding the original link and the clear outline of the process.

Tim
 

Swizz

Pedelecer
Oct 1, 2017
211
161
48
Sk14
Well the extension lead finally arrived so I bit the bullet and did it. Early on i could not get read the program byte to read but after checking the pin-out umpteen times and re-flashing the dongle I finally shortened the interface wires from short to very short and eureka it burst into life. Having saved the original program and memory files I programmed it in the power assist mode.
I have only had a short ride but the response is better and smoother especially in high assist mode but not mind blowingly so. One worry I get the E02 error on startup and when I stop so will have to look into that. It does disappear when riding so maybe OK. I did wonder if it was something to so with the weird odometer data catch up that is mentioned in the manuals.
I will be attempting some longer tests but may wait for the weather to improve.

As an aside I used self-soldering heat shrink to make the connections ( heat shrink with an internal collar of solder) they worked brilliantly.

Thanks to Swizz for finding the original link and the clear outline of the process.

Tim
Great to hear, Tim!

Have discovered mine gives an E02 error when switching on the lights on the VLCD5. This only illuminates the screen as my lights are wired separately, so no idea why the error.

My Speedo is still hesitant to burst into life until after a minute or so of riding.

Look forward to hearing of how you get on after more riding.

Isla
 
  • Like
Reactions: Bikes4two

Advertisers