Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
cejean   100 µW

100 µW
Posts: 9
Joined: Jul 20 2019 5:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by cejean » Apr 14 2020 4:20pm

Thanks to @StanceCoke for making the new configurator design available and thanks to @Mbrusa for the updates. I am sure all the riders appreciate the excellent work you have done.
Cheers Emma

Yes we do! Thanks a lot StanceCoke and Mbrussa to put energy and time in this project :thumb:

maki1000   1 µW

1 µW
Posts: 2
Joined: Oct 07 2019 8:38am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by maki1000 » Apr 15 2020 3:15am

mbrusa wrote:
Apr 14 2020 3:41am
maki1000 wrote:
Apr 13 2020 2:38am
Hi, sorry for my poor english. I downloaded the software via Java cofnfigulator from this link https://github.com/stancecoke/TSDZ2-Sma ... /master?q= I set my battery to 14s and minimum voltage 42v and set 48v for the engine. I changed nothing more. Unfortunately, I still have a problem with the info button, which hangs the display and nothing can be done.

https://youtu.be/QuN4Mf73NRU
The display broke?
Isn't it that you flashed with the display on?
The VLCD5 doesn't like this!

It was the extra handle to change the degree of assistance. After disconnecting it, everything returned to nomra.

stefkrger   1 mW

1 mW
Posts: 18
Joined: Dec 03 2018 11:49am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by stefkrger » Apr 15 2020 8:27am

Is there any way to make the turbo mode (4/4 bars) the default at startup?
My bike is super heavy and I'm riding turbo mode most of the time anyways. The display always starts at tour mode (2/4 bars).

mbrusa   100 W

100 W
Posts: 101
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by mbrusa » Apr 16 2020 1:50am

You cannot change the default assistance level at startup, It is in the display firmware and cannot be changed.
However, it is possible to change the intensity of assistance at all levels with POWER_ASSIST_LEVEL_X, (if you use power assist mode).
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

ji.ti@seznam.cz   1 µW

1 µW
Posts: 3
Joined: Jun 10 2019 1:25am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by ji.ti@seznam.cz » Apr 18 2020 11:41am

Today, after switching on again showed only one piece of battery and the engine completely inoperative. I upload the firmware again. Luckily it happened at home. TSDZ2, VLCD5 Java 0.3.7 vM0.19.c

Suggy   10 mW

10 mW
Posts: 22
Joined: Mar 06 2020 6:57am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Suggy » Apr 18 2020 3:26pm

I would just like to say thank you to stancecoke for his great work and mrbusa i have been out on my bike for the first time in a long time due to lockdown.The bike works great while using there great software and firmwares.
Keep up the great work.

w0utje   1 mW

1 mW
Posts: 10
Joined: Jan 12 2020 3:02am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by w0utje » Apr 20 2020 9:39am

I'm a missing some? Cant find the file v0.20.0-beta.2 with the new configurator?
https://github.com/OpenSource-EBike-fir ... e/releases
Here the latest is TSDZ2-v0.57.2? Had version 19 but yesterday had 2 times the xh18 and motor just shut off for no reason. During cycling, the first time it happened it also dropped to odo with 70km? So gonna try something else.

cejean   100 µW

100 µW
Posts: 9
Joined: Jul 20 2019 5:41pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by cejean » Apr 20 2020 12:42pm

@ Woutje,
I think this is the last firmware for VLCD5, VLCD6 and XH18:

https://github.com/stancecoke/TSDZ2-Smart-EBike

* TongSheng TSDZ2 motor controller firmware
* adapted to stock displays VLCD5 VLCD6 XH18
* Author: mbrusa
* Version mb.20beta1.A

geekmystique   10 µW

10 µW
Posts: 5
Joined: Jul 27 2019 3:15pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by geekmystique » Apr 22 2020 12:40am

first of all
THANKS for this firmware. The reason I got TSDZ2 is obviously also price, and investing an additional $80 for a new LCD kind of defeats the purpose.

I noticed the boost mode is removed in this firmware. My wife misses the "push" she needs to get going from standstill with a loaded bike compared to the stock, and boost would give this back. Maybe there are other ways to do this, but I am looking for a specific startup boost, not a constant boost.

https://github.com/OpenSource-EBike-fir ... ower_boost


It must be hard to allow configuration of this without a proper LCD interface, however, could I just add the code back and hardcode some values in my firmware? Or are there other reasons it was removed in the code or could i just add it back?
Attachments
disabled.PNG
disabled.PNG (29.8 KiB) Viewed 940 times

mbrusa   100 W

100 W
Posts: 101
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by mbrusa » Apr 23 2020 2:36am

Already in version 20 beta 1 for LCD3, buba had eliminated the boost function.
It can be replaced with the "motor acceleration" parameter. Increase very carefully!
Another possibility to have the push at the start is to enable "assist without pedal rotation".
What version of firmware are you using?
Motor? Battery? Display?
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Wimpy747   1 µW

1 µW
Posts: 2
Joined: Apr 25 2020 12:02pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Wimpy747 » Apr 25 2020 12:16pm

Hello Guys, I have the tsdz2 motor for more than one year now but was a bit disappointed in the software causing very strange behaviour sometimes. That's why I started searching and found the forum, in the meantime I have already flashed the latest firmware 20 beta1a with the vlcd5 display and was impressed how much smoother the motor performs.
However even after reading the 5 page manual for changing settings I am not able to change settings on the display, sorry but just don't fully understand how to.
I had first flashed it as streetmode at startup, but not able to get it into offroad, so always stuck in max speed of 25kmh.
I now have it flashed to start in offroad but rather would like street as default en change the mode with the display.
But in streetmode as I have the display in eco and press the light swith I see E02 flashing but the speed limit is not removed.
I know it's annoying for you as experts that I can't get this to work, but can someone point me in a direction of what I am doing wrong?
Furthermore thank you very much for all the effort you guys put in this firmware.

emr   1 W

1 W
Posts: 55
Joined: Apr 22 2018 5:37am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by emr » Apr 25 2020 4:10pm

Wimpy747 wrote:
Apr 25 2020 12:16pm
Hello Guys, I have the tsdz2 motor for more than one year now but was a bit disappointed in the software causing very strange behaviour sometimes. That's why I started searching and found the forum, in the meantime I have already flashed the latest firmware 20 beta1a with the vlcd5 display and was impressed how much smoother the motor performs.
However even after reading the 5 page manual for changing settings I am not able to change settings on the display, sorry but just don't fully understand how to.
I had first flashed it as streetmode at startup, but not able to get it into offroad, so always stuck in max speed of 25kmh.
I now have it flashed to start in offroad but rather would like street as default en change the mode with the display.
But in streetmode as I have the display in eco and press the light swith I see E02 flashing but the speed limit is not removed.
I know it's annoying for you as experts that I can't get this to work, but can someone point me in a direction of what I am doing wrong?
Furthermore thank you very much for all the effort you guys put in this firmware.
I have found that this can be accomplished when in ECO mode by pressing the 'Lights' button once to enter E02, and then pressing the 'Lights' button again, but only after setting the 'ENABLE_SET_PARAMETER_ON_STARTUP' to 1 in the 'Advanced settings' when flashing the controller.

Please someone else chime in if my advice is not correct.

Elinx   100 W

100 W
Posts: 233
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » Apr 25 2020 4:37pm

emr wrote:
Apr 25 2020 4:10pm
..., but only after setting the 'ENABLE_SET_PARAMETER_ON_STARTUP' to 1 in the 'Advanced settings' when flashing the controller.....
That is the correct setting if you want to switch between "street mode" or "offroad mode" in only one step.

It is possible to choose this "set parameter" setting (or "display data" setting) also in Off level (0) too.
After that you can choose in Eco level (1) "street mode" or "offroad mode". In that case you need two steps.

geekmystique   10 µW

10 µW
Posts: 5
Joined: Jul 27 2019 3:15pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by geekmystique » Apr 26 2020 12:57am

mbrusa wrote:
Apr 23 2020 2:36am
Already in version 20 beta 1 for LCD3, buba had eliminated the boost function.
It can be replaced with the "motor acceleration" parameter. Increase very carefully!
Another possibility to have the push at the start is to enable "assist without pedal rotation".
What version of firmware are you using?
Motor? Battery? Display?
Thanks Mbrusa! I was not aware of this.

I use the latest firmware from Stancecoke's git, 36V motor with 10s and vlcd5.
Acceleration of the bike is sufficient after it takes off- so i am afraid that increasing this is giving more aggressiveness over the entire power band, which is not required.

I might consider trying "assist without pedal rotation" - however can this even be enabled without brake sensor installed? (yes also the rider needs to be very careful with this). Maybe if i tune it with a low value that it is still relatively safe.

mbrusa   100 W

100 W
Posts: 101
Joined: Dec 11 2019 12:13am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by mbrusa » Apr 26 2020 1:37am

geekmystique wrote:
Apr 26 2020 12:57am
...
I might consider trying "assist without pedal rotation" - however can this even be enabled without brake sensor installed? (yes also the rider needs to be very careful with this). Maybe if i tune it with a low value that it is still relatively safe.
With the 20 beta 1, I have always used "assist without pedal rotation" enabled and without brake sensors.
You need to set ASSISTANCE_WITHOUT_PEDAL_ROTATION_THRESHOLD to 30 max and go safe.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

geekmystique   10 µW

10 µW
Posts: 5
Joined: Jul 27 2019 3:15pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by geekmystique » Apr 26 2020 10:27am

mbrusa wrote:
Apr 26 2020 1:37am
You need to set ASSISTANCE_WITHOUT_PEDAL_ROTATION_THRESHOLD to 30 max and go safe.
Wow thanks ! That was it!
My guess is the stock firmware actually also pushed without rotation. With the treshold as 30 I tried to mess a bit, but the power delivery is coming smooth and doesn't cause unnatural acceleration just by relaxing the legs on the pedals.

Wimpy747   1 µW

1 µW
Posts: 2
Joined: Apr 25 2020 12:02pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Wimpy747 » Apr 26 2020 12:39pm

emr wrote:
Apr 25 2020 4:10pm
Wimpy747 wrote:
Apr 25 2020 12:16pm
Hello Guys, I have the tsdz2 motor for more than one year now but was a bit disappointed in the software causing very strange behaviour sometimes. That's why I started searching and found the forum, in the meantime I have already flashed the latest firmware 20 beta1a with the vlcd5 display and was impressed how much smoother the motor performs.
However even after reading the 5 page manual for changing settings I am not able to change settings on the display, sorry but just don't fully understand how to.
I had first flashed it as streetmode at startup, but not able to get it into offroad, so always stuck in max speed of 25kmh.
I now have it flashed to start in offroad but rather would like street as default en change the mode with the display.
But in streetmode as I have the display in eco and press the light swith I see E02 flashing but the speed limit is not removed.
I know it's annoying for you as experts that I can't get this to work, but can someone point me in a direction of what I am doing wrong?
Furthermore thank you very much for all the effort you guys put in this firmware.
I have found that this can be accomplished when in ECO mode by pressing the 'Lights' button once to enter E02, and then pressing the 'Lights' button again, but only after setting the 'ENABLE_SET_PARAMETER_ON_STARTUP' to 1 in the 'Advanced settings' when flashing the controller.

Please someone else chime in if my advice is not correct.
Thats what I thought but does E02 have to steady or flashing at this point?
If I push again the display switches to E03..

emr   1 W

1 W
Posts: 55
Joined: Apr 22 2018 5:37am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by emr » Apr 27 2020 5:21am

Wimpy747 wrote:
Apr 26 2020 12:39pm
emr wrote:
Apr 25 2020 4:10pm
Wimpy747 wrote:
Apr 25 2020 12:16pm
Hello Guys, I have the tsdz2 motor for more than one year now but was a bit disappointed in the software causing very strange behaviour sometimes. That's why I started searching and found the forum, in the meantime I have already flashed the latest firmware 20 beta1a with the vlcd5 display and was impressed how much smoother the motor performs.
However even after reading the 5 page manual for changing settings I am not able to change settings on the display, sorry but just don't fully understand how to.
I had first flashed it as streetmode at startup, but not able to get it into offroad, so always stuck in max speed of 25kmh.
I now have it flashed to start in offroad but rather would like street as default en change the mode with the display.
But in streetmode as I have the display in eco and press the light swith I see E02 flashing but the speed limit is not removed.
I know it's annoying for you as experts that I can't get this to work, but can someone point me in a direction of what I am doing wrong?
Furthermore thank you very much for all the effort you guys put in this firmware.
I have found that this can be accomplished when in ECO mode by pressing the 'Lights' button once to enter E02, and then pressing the 'Lights' button again, but only after setting the 'ENABLE_SET_PARAMETER_ON_STARTUP' to 1 in the 'Advanced settings' when flashing the controller.

Please someone else chime in if my advice is not correct.
Thats what I thought but does E02 have to steady or flashing at this point?
If I push again the display switches to E03..
This is what occurs for me...
  • Press power button
  • Wait for system to initialise (battery level displayed and speedo '00.0')
  • Press the Power/Lights button
  • Display shows E02 (not flashing)
  • Press the Power/Lights button again
  • Display shows E02 (flashing) if you wait a second or two the flashing stops and speedo returns to '00.0'
  • I then press the '+' level button to change to the desired level
Remember that for the above to work, that you need to either...
Set the 'ENABLE_SET_PARAMETER_ON_STARTUP' to 1 in the 'Advanced settings' when flashing the controller
OR
As Elinx advised...
Elinx wrote:
Apr 25 2020 4:37pm
emr wrote:
Apr 25 2020 4:10pm
..., but only after setting the 'ENABLE_SET_PARAMETER_ON_STARTUP' to 1 in the 'Advanced settings' when flashing the controller.....
That is the correct setting if you want to switch between "street mode" or "offroad mode" in only one step.

It is possible to choose this "set parameter" setting (or "display data" setting) also in Off level (0) too.
After that you can choose in Eco level (1) "street mode" or "offroad mode". In that case you need two steps.
Cheers Emma

Andrew707   1 mW

1 mW
Posts: 16
Joined: Feb 26 2020 10:10pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Andrew707 » Apr 28 2020 2:46pm

Yesterday I flashed my 36V motor with 48V stock firmware and it worked well.

Today I want to try out OS firmware with VLCD5 display. I read the wiki and skimmed through the manuals. However, I didn't understand how to flash the controller. After running JavaConfigurator and pressing "Compile & Flash" will it automatically flash the controller if it's connected? Or it'll just update required files with the right config and I'll have to run ST Visual Programmer to load and write files from releases/20.1 folder?

gomyles   100 mW

100 mW
Posts: 38
Joined: Nov 13 2019 12:54pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by gomyles » Apr 28 2020 10:01pm

Andrew707 wrote:
Apr 28 2020 2:46pm
Yesterday I flashed my 36V motor with 48V stock firmware and it worked well.

Today I want to try out OS firmware with VLCD5 display. I read the wiki and skimmed through the manuals. However, I didn't understand how to flash the controller. After running JavaConfigurator and pressing "Compile & Flash" will it automatically flash the controller if it's connected? Or it'll just update required files with the right config and I'll have to run ST Visual Programmer to load and write files from releases/20.1 folder?
Did you see this Andrew ? https://github.com/stancecoke/TSDZ2-Smart-EBike/wiki
Really explains well how to do it. Just follow it step by step.

Andrew707   1 mW

1 mW
Posts: 16
Joined: Feb 26 2020 10:10pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Andrew707 » Apr 30 2020 9:59pm

gomyles wrote:
Apr 28 2020 10:01pm
Did you see this Andrew ? https://github.com/stancecoke/TSDZ2-Smart-EBike/wiki
Really explains well how to do it. Just follow it step by step.
Yes, I read it like 10 times. In general, this is a very good description, but it doesn't explain well what happens in step 7. Does it actually flash everything necessary (program, data, option memory) for you or you have to do it yourself manually and then step 7 just apply custom config to your already flashed controller?

Here's what I've tried so far:
- Connected everything as explained in main wiki page.
- Then downloaded the firmware hex file from here and flashed program memory tab (this step was in main wiki page too). On another occasion, I've tried to flash (program, data, option) tabs from releases folder instead. On third occasion, I didn't flash anything at all.
- Then went through steps 1-7 in the wiki. In JavaConfigurator selected my settings and pressed "Compile & Flash". So this is the part which is either not working for me or I'm doing something wrong. After pressing this button the opened command prompt only writes Cleaning files... and that's it. My assumption that it silently run everything necessary in the background. Or the process failed somewhere but didn't show me any error messages.

EDIT: As far as I understand JavaConfigurator just updates setting in the source code and then launches compile_20.bat which should compile the code and create some build artefacts and then program_20.bat is launched which actually does all the flashing.
So I've tried to run these two .bat files manually but looks like compile one just cleans something but doesn't do anything else. And then program_20.bat complains that it can't find files to write to controller's memory...

I'll try to install everything again on a Windows VM on my MAC. Hope it works...

barrettrussell   1 mW

1 mW
Posts: 16
Joined: Nov 14 2018 9:35pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by barrettrussell » May 01 2020 12:59am

This has been great. I love being able to change various parameters. 2 that I can't seem to find are:

increasing max rpm to 120-130 would be great, is it possible?

my biggest pet peeve is that I max out assist at around 1/4 my body weight being applied to the pedals. As if it was designed for a child.Still worlds better than the bafang for ability to maneuver trails, but it would be nice to get a torque calibrated to my weight. even keeping the same curve would be fine. I spent the last couple hours poking around regarding torque and there reallydoesn't appear to be a straight forward answer. A concise step by step is what I seek. Is there such a thing I overlooked? something like with the open source for bafang displays?
Thanks
Barrett

Elinx   100 W

100 W
Posts: 233
Joined: Aug 09 2019 6:58am

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Elinx » May 01 2020 3:39am

Andrew707 wrote:
Apr 30 2020 9:59pm
gomyles wrote:
Apr 28 2020 10:01pm
Did you see this Andrew ? https://github.com/stancecoke/TSDZ2-Smart-EBike/wiki .............
Yes, I read it like 10 times. In general, this is a very good description, but it doesn't explain well what happens in step 7. Does it actually flash everything necessary (program, data, option memory) for you or you have to do it yourself manually and then step 7 just apply custom config to your already flashed controller?

Here's what I've tried so far:
- Connected everything as explained in main wiki page.
Till here you did good

But then it goes wrong, because you got the FW with the link on the main wiki page and downloaded casainho's hex code
gomyles wrote:
Apr 28 2020 10:01pm
- Then downloaded the firmware hex file from here and flashed program memory tab (this step was in main wiki page too). ........
You must not download a hex file, but the master code of stancecoke github chamnnel and then follow the guide.
With step 7
If you have connected the STlink V2 to the Tsdz2, the code will be compiled and flashed (program, data, option memory)

But there are some conditions that the bat file needed otherwise you must change something inside.
The programs SDCC and ST link must be in the root directory ( C:\SDCC\ and C:\STMicroelectronics\ ) of a Windows PC.
Because you run a VM inside a Mac, I don't know if the paths to these installed programs are right.

Andrew707   1 mW

1 mW
Posts: 16
Joined: Feb 26 2020 10:10pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by Andrew707 » May 01 2020 11:54am

Elinx wrote:
May 01 2020 3:39am
You must not download a hex file, but the master code of stancecoke github chamnnel and then follow the guide.
With step 7
If you have connected the STlink V2 to the Tsdz2, the code will be compiled and flashed (program, data, option memory)

But there are some conditions that the bat file needed otherwise you must change something inside.
The programs SDCC and ST link must be in the root directory ( C:\SDCC\ and C:\STMicroelectronics\ ) of a Windows PC.
Because you run a VM inside a Mac, I don't know if the paths to these installed programs are right.
Thanks, so now I understood what I did wrong. First thing was manually flashing memory before running JavaConfigurator. Second thing was that I was using my work windows laptop and it has some restrictions which prevents running scripts from .bat files so that's why JavaConfigurator was failing to compile the code and invoke program_20.bat.
On my Windows VM on a MAC everything worked well since this VM is just a fresh windows with no restrictions.

gomyles   100 mW

100 mW
Posts: 38
Joined: Nov 13 2019 12:54pm

Re: Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Post by gomyles » May 01 2020 8:17pm

Andrew707 wrote:
May 01 2020 11:54am
Elinx wrote:
May 01 2020 3:39am
You must not download a hex file, but the master code of stancecoke github chamnnel and then follow the guide.
With step 7
If you have connected the STlink V2 to the Tsdz2, the code will be compiled and flashed (program, data, option memory)

But there are some conditions that the bat file needed otherwise you must change something inside.
The programs SDCC and ST link must be in the root directory ( C:\SDCC\ and C:\STMicroelectronics\ ) of a Windows PC.
Because you run a VM inside a Mac, I don't know if the paths to these installed programs are right.
Thanks, so now I understood what I did wrong. First thing was manually flashing memory before running JavaConfigurator. Second thing was that I was using my work windows laptop and it has some restrictions which prevents running scripts from .bat files so that's why JavaConfigurator was failing to compile the code and invoke program_20.bat.
On my Windows VM on a MAC everything worked well since this VM is just a fresh windows with no restrictions.

Nicely done! Who would have guessed that the .bat files would be restricted. Glad to hear you got it down, congrats. Enjoy the new firmware!

Post Reply