Skip to content
View in the app

A better way to browse. Learn more.

Pedelecs Electric Bike Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Experiences with Open Source Firmware on the Tongsheng TSDZ2

Featured Replies

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.

 

2020-10-08_07-56-29.thumb.jpg.4296ac75f4110bea6c534124caf3621d.jpg

 

2020-10-08_07-58-34.thumb.jpg.60056a29fd776c5ffe1c3ddcb40b082a.jpg

 

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.

 

IMG_20201006_221825113.thumb.jpg.498b85d9c0cdd1471a1c17db8dd156cd.jpg

 

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)

IMG_20201006_211726099.thumb.jpg.f6acde1bb06d5128bd0643f4dfd1d935.jpg

 

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!

Edited by Swizz

  • Replies 176
  • Views 81.7k
  • Created
  • Last Reply

Top Posters In This Topic

Posted Images

  • Author

Brilliant writeup, Isla. Thanks! Will be following in your footsteps as soon as my extra cable arrives

Best of luck. Report your findings too!

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.

  • Author

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!

Well done explained in plain English my old head finally got it:rolleyes: that almost makes it sound painless
  • Author

Well done explained in plain English my old head finally got it:rolleyes: that almost makes it sound painless

R welcome :)

  • Author

You couldn't pick a nicer nose.

Where's my coat... Can someone call me a taxi?

:D

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

Edited by TJS109

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.

  • Author

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

My st-link key arrived yesterday (with the correct pinout, thanks for link [mention=18152]Swizz[/mention]) so time to dust of the soldering iron and see if I can make myself an expensive doorstop ;)
  • Author

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 :)

  • Author
P.S: That seems like a lot of negatives but not so...have just added more detail on those for clarity

Edited by Swizz

  • 2 weeks later...

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

  • Author

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

Isla,

 

I think your speedo delay is covered in the display manual :-

 

" Attention, the display always interprets the data received as a speed and consequently increases the odometer, even when the bike is stationary. By enabling the parameter ENABLE_ODOMETER_COMPENSATION in the config.h file (default enabled), it is possible to recover the kilometers added and not traveled, during this operation the speed displayed while driving remains at zero until the kilometers are equalized"

 

So basically it waits until it has caught up the "extra " false distance and then starts to work and so is a "feature " one has to live with.

 

Tim

 

P.S. I find the manual pretty impenetrable and would not like to use the display to set data parameters

Have you tried installing the windows software in Wine on your Linux pc.? I had varied success when I tinkered with ubuntu and PC Linux many years ago...
  • Author

Isla,

 

I think your speedo delay is covered in the display manual :-

 

" Attention, the display always interprets the data received as a speed and consequently increases the odometer, even when the bike is stationary. By enabling the parameter ENABLE_ODOMETER_COMPENSATION in the config.h file (default enabled), it is possible to recover the kilometers added and not traveled, during this operation the speed displayed while driving remains at zero until the kilometers are equalized"

 

So basically it waits until it has caught up the "extra " false distance and then starts to work and so is a "feature " one has to live with.

 

Tim

 

P.S. I find the manual pretty impenetrable and would not like to use the display to set data parameters

Ah cool thank you Tim!

  • Author

Have you tried installing the windows software in Wine on your Linux pc.? I had varied success when I tinkered with ubuntu and PC Linux many years ago...

I haven't no. The Windows method is not a simple job either requiring various sources being installed to work, so I would not expect Wine to do well with it. Happy to be proven wrong tho! There are some instructions to run the software natively in Linux so will give that a go.

I haven't no. The Windows method is not a simple job either requiring various sources being installed to work, so I would not expect Wine to do well with it. Happy to be proven wrong tho! There are some instructions to run the software natively in Linux so will give that a go.

I’ve not fired up my pc in a long while, my tablet is just so convenient, might have a wee look at some point!

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...
Background Picker
Customize Layout

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.