Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
Nfer   100 mW

100 mW
Posts: 44
Joined: Sep 17 2019 6:51am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Nfer » Oct 21 2019 7:26am

Badmotor wrote:
Oct 21 2019 6:12am
I'm getting an error "cannot communicate with the device". It seems the STlink dongle might be faulty.

But now I have a serious noob question. Is STlink supposed to be connected to the VLCD5 or the motor controller? And is it supposed to be flashed from the Configurator? At first I press Compile, then if all goes well, I press "program" and it's supposed to work?
run the java configurator as an computer admin

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 21 2019 8:19am

After flashing with different settings all I got is that my motor got so weak that I can't even ride it anymore. I think I'll stick to stock firmware. Hopefully it will return everything back to defaults.

godofglow   10 mW

10 mW
Posts: 23
Joined: Oct 19 2019 2:46am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by godofglow » Oct 21 2019 11:40am

Badmotor wrote:
Oct 21 2019 8:19am
After flashing with different settings all I got is that my motor got so weak that I can't even ride it anymore. I think I'll stick to stock firmware. Hopefully it will return everything back to defaults.
Oh - that sounds frightening :?
I also want to do some first test the next weeks on a 48V motor.

Can you show us your settings and details about your HW?

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 21 2019 12:25pm

Badmotor wrote:
Oct 21 2019 8:19am
After flashing with different settings all I got is that my motor got so weak that I can't even ride it anymore. I think I'll stick to stock firmware. Hopefully it will return everything back to defaults.
It depends if you have flashed the version of Marcoq or Ackmaniac. The last version has another current control.
As seen here the motor has a more gentle respons on your input.
Also your personal settings are important as godofglow already said.

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 21 2019 3:06pm

godofglow wrote:
Oct 21 2019 11:40am
Badmotor wrote:
Oct 21 2019 8:19am
After flashing with different settings all I got is that my motor got so weak that I can't even ride it anymore. I think I'll stick to stock firmware. Hopefully it will return everything back to defaults.
Oh - that sounds frightening :?
I also want to do some first test the next weeks on a 48V motor.

Can you show us your settings and details about your HW?
Hi, My motor is 36v 350W (claimed by the manufacturer). Battery is 36v, 12ah. I used Ackmaniac's version as he fixed the bug for power assist level 3. Here are the last settings I used . Btw I have no idea how many battery cells I have. It's not written anywhere.
settings2.JPG
settings2.JPG (240.65 KiB) Viewed 2754 times

I already flashed the stock firmware back and thankfully now it's all working like before. Here's step-by-step info https://www.eco-ebike.com/blogs/eco-cyc ... rogramming
Last edited by Badmotor on Oct 22 2019 2:31am, edited 1 time in total.

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 22 2019 2:27am

Alright.

So turns out the previous firmware made by Marcoq, which is 0.19c, actually works quite well and I can notice the bike got a bit more powerful now. My goal was to get maximum assist and minimal pedaling effort. I mostly use Turbo and it's definitely gotten better than with stock firmware. So as far as I know this is the version that works well, at least for me - https://github.com/stancecoke/TSDZ2-Sma ... D6-display

Another issue here is that the naming of modes and assist levels are all confusing as hell. The information here is simply all over the place and nothing is quite clear until you go through all of the 19 pages. And even then, certain important questions were either not answered or answered in a language that is too technical. And then to add more confusion to the mess there were people asking and advising for displays other than VLCD5 even though the thread name clearly states VLCD5. There should be other threads for other displays imho.

Anyways, here's a question I've been wondering the whole time. On VLCD5 I've got 4 modes. Eco, Tour, Speed (Not Sport) and Turbo. So I go into configurator and see "Speed" being called "Sport" all of a sudden. Why is that? Is my version of display different to others? :?

Apart from that now here is something new to me and maybe even to others who are dealing with this for the first time. First off, for the sake of making myself clear, I'm going to call the terms "ECO, TOUR, STREET/(SPORT for some?)/TURBO" that you see on the display - "Assist levels". And I'm going to refer to hidden features described below as "Modes".

Now that we got that out of the way, after flashing with open source (didn't test this with stock) there are extra hidden features you can change in each assist level with clicking the Power Button two times with around half a second delay in-between the presses, and you should see a code displayed for less than a second which means the following:
ECO:
E03 - Street mode (limited to 25kmh and 250w)
E04 - Offroad mode

TOUR:
E01 - Boost off
E05 - Boost on

Street/Sport:
E01 - Emtb mode off
E02 - Emtb mode on

Turbo:
This one has no modes.
I am not entirely sure on the effect of these modes because I personally haven't felt any noticeable differences in them, but it's up to you to test and try it out.

In case you are wondering, here are my settings for 36v, 12ah battery and 36V motor (all 36v motors from 250W to 500W are the same). Once again, I was going for maximum torque/cadence and minimal pedaling effort.
new-settings-working.JPG
new-settings-working.JPG (245.92 KiB) Viewed 2742 times
Another point to make is the connection/flashing firmware and software needed. I think it would be smart to write a simple guide for VLCD5 display owners. Here's a very simplified noob-friendly version I made:
1. Buy a STlink v2 USB clone from ebay. It will need to be connected to the motor's controller plug (where your speed sensor and light wires go). Don't connect to the display plug. The wiring can be found here https://github.com/OpenSource-EBike-fir ... nsor_cable
2. Download and install correct drivers https://www.st.com/en/development-tools ... nk009.html (will need your email)
3. Download and install ST link Visual programmer https://www.st.com/en/development-tools/stvp-stm32.html (will need your email)
4. Download and install ST Toolset http://www.bdtic.com/download/ST/sttoolset.zip
5. After installing ST Toolset, copy the folder "STmicroelectroncs" (usually found in Program Files (x86)) to root directory of disk C:\. Make sure it has a subfolder named "st_toolset".
6. Download and install Java if you don't already have it.
7. Download and unpack the TSDZ2 controller firmware and configurator to a separate folder (Usually on github, for instance marcoq's latest stable version - https://github.com/stancecoke/TSDZ2-Sma ... D6-display .
8. Run TSDZ2-Configurator.jar
9. Play with settings and press "Compile". A command line window will appear with running text. Wait for it to finish, it will close automatically. If there is an error, check what it says and try to figure out the solution or ask for help here. Don't close the configurator yet.
10. If at this point you still haven't hooked up your STlink thingy to the motor's controller, it's time to do so. Go to step 1 for the wiring and also unplug/take out your ebike battery.
11. If step 9 went smoothly and step 10 is done, while still in the Configurator window press "Program". A command line window will appear with running text. Wait for it to finish, it will close automatically. If there is an error, check what it says and try to figure out the solution or ask for help here.
12. Remove STlink wires and plug the connector back to your speed sensor/lights.
13. Enjoy your new firmware.

If you messed the settings and want to return to original firmware, then follow the guide here in the "Stock TSDZ2 Firmware (STF) Programming" section https://www.eco-ebike.com/blogs/eco-cyc ... rogramming
But remember that you need to change Open Byte in "Option Byte 2" section from whatever number you have after opensource firmware (I had 20) to 28 just like in the guide's picture. Otherwise the motor won't start.
Last edited by Badmotor on Oct 25 2019 6:39am, edited 3 times in total.

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 22 2019 4:31am

Badmotor wrote:
Oct 22 2019 2:27am
Alright.

So turns out the previous firmware made by Marcoq, which is 0.19c, actually works quite well and I can notice the bike got a bit more powerful now. ................. And then to add more confusion to the mess there were people asking and advising for displays other than VLCD5.... There should be other threads for other displays ............
..... very simplified noob-friendly version I made:.................
Thanks for your noob friendly flashing guide.
I understand your frustration for beginners, but you must understand that Marcoq originally has made this version in the first place for himself and VLCD6 display.
The software is useable for all default displays (vlcd5, vlcd6 and xh18) but these have their own differences. Names or numbers for the four assistlevels is the least to be worry about. If there where more topics for the different displays it will be even more cluttered, because the main software for all display's is the same.

Because Marcoq's time is limited he made choices what he will do. He even haven't time for his own Github branche and you see him sporadic on the fora. Priority for him is changing and developing the OSF for default displays.
Users of this software (like andrea_104kg, Ashrambo, Elem and stancecoke) made some partly guides for set up and use of this software. But for other things you must look in the basic OSF wiki. That is why al info is so cluttered.

Stancecoke has collected most of these links on his Github in one place.

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 22 2019 5:34am

Elinx wrote:
Oct 22 2019 4:31am
Badmotor wrote:
Oct 22 2019 2:27am
Alright.

So turns out the previous firmware made by Marcoq, which is 0.19c, actually works quite well and I can notice the bike got a bit more powerful now. ................. And then to add more confusion to the mess there were people asking and advising for displays other than VLCD5.... There should be other threads for other displays ............
..... very simplified noob-friendly version I made:.................
Thanks for your noob friendly flashing guide.
I understand your frustration for beginners, but you must understand that Marcoq originally has made this version in the first place for himself and VLCD6 display.
The software is useable for all default displays (vlcd5, vlcd6 and xh18) but these have their own differences. Names or numbers for the four assistlevels is the least to be worry about. If there where more topics for the different displays it will be even more cluttered, because the main software for all display's is the same.

Because Marcoq's time is limited he made choices what he will do. He even haven't time for his own Github branche and you see him sporadic on the fora. Priority for him is changing and developing the OSF for default displays.
Users of this software (like andrea_104kg, Ashrambo, Elem and stancecoke) made some partly guides for set up and use of this software. But for other things you must look in the basic OSF wiki. That is why al info is so cluttered.

Stancecoke has collected most of these links on his Github in one place.
You have a point. Ok, I don't know the specifics of who developed what. I am just seeing it from a passerby's point of view and how much of a headache finding correct info might feel. It sure takes a while to get the bearings and grasp the basics. But I'd argue that the names of the four levels are actually quite important as there are 'bonus' sublevels/features such as emtb, street/offroad. For instance, I struggled to understand how ECO could have a 'Street mode' feature when my level 3 is also called STREET. Sure it's not a big deal, but you don't want to have additional doubts about something basic like that.

But I am being pedantic about all this. I always try to create some sort of basic order out of clutter.

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 22 2019 6:28am

Badmotor wrote:
Oct 22 2019 5:34am
........
But I am being pedantic about all this. I always try to create some sort of basic order out of clutter.
That is the best way to handle. There is such a lot of information.
I made always a document with all the collected info and links for my specific need of all fora.
I found the most useable and complete info to start with, the 4 parts of TSDZ2 pages on the Spanish blog of Ashrambo.
With Google translate it is quite understandable

About the names of the assist levels. Because of the limitations and differences of the default displays you have to deal with that.
It is a compromise that you can use these displays without flashing them.
If you don't want this and want more control, you have to use the OSF with flashable KT-LCD3 display (or 850C, SW102)

About the motors. There are only two versions of TSDZ2 motors 36V and 48V. The bad thing with these motors is the heat management. So if you want the most power of it, think about improving heat dissipation and a adding a temperature sensor.

User avatar
stancecoke   100 kW

100 kW
Posts: 1164
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Oct 22 2019 8:52am

Badmotor wrote:
Oct 22 2019 2:27am
Here's a very simplified noob-friendly version I made:
I've added a Link to your post to the wiki, thank you, but I don't know why you needed the additional steps with all the ST stuff and the manual copying of folders?! The steps in the wiki didn't work for you?!

Link to the Wiki at github

I'm not using a TSDZ2, my repo is just a service for marcoq, as he is not familiar with github and obviously has no priority on documentation. It would be much more user-friendly, if marcoq would supply all this information at his github repo directly. One central place with all information.

regards
stancecoke

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 22 2019 3:09pm

stancecoke wrote:
Oct 22 2019 8:52am
Badmotor wrote:
Oct 22 2019 2:27am
Here's a very simplified noob-friendly version I made:
I've added a Link to your post to the wiki, thank you, but I don't know why you needed the additional steps with all the ST stuff and the manual copying of folders?! The steps in the wiki didn't work for you?!

Link to the Wiki at github

I'm not using a TSDZ2, my repo is just a service for marcoq, as he is not familiar with github and obviously has no priority on documentation. It would be much more user-friendly, if marcoq would supply all this information at his github repo directly. One central place with all information.

regards
stancecoke
I probably don't understand how github works either so I never saw that wiki. :D It does help now :thumb:

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 25 2019 5:21am

I just realized this, Marcoq's github repo still has a bug with switching levels, does it not? So I thought i'd just look into Ackmaniac's archive and find the file where he fixed that. It's in the folder Src/controller/ named "ebike_app.c" So I replaced marcoq's file with his... and my bike almost flew off from under me in ECO mode and didnt feel like braking. Ackmaniac's clearly edited the file according to his firmware. It is not compatible with Macoq's version. Ackmaniac, can you please fix that assist switching bug only for Marcoq's files without any additional mods?
Last edited by Badmotor on Oct 25 2019 6:57am, edited 3 times in total.

User avatar
stancecoke   100 kW

100 kW
Posts: 1164
Joined: Aug 02 2017 2:56pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by stancecoke » Oct 25 2019 6:52am

I've added the download-link to ackmaniacs fork to the wiki:
https://github.com/stancecoke/TSDZ2-Sma ... splay/wiki

regards
stancecoke

Ackmaniac   10 mW

10 mW
Posts: 27
Joined: Jan 02 2017 8:30pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Ackmaniac » Oct 25 2019 9:04am

Badmotor wrote:
Oct 25 2019 5:21am
I just realized this, Marcoq's github repo still has a bug with switching levels, does it not? So I thought i'd just look into Ackmaniac's archive and find the file where he fixed that. It's in the folder Src/controller/ named "ebike_app.c" So I replaced marcoq's file with his... and my bike almost flew off from under me in ECO mode and didnt feel like braking. Ackmaniac's clearly edited the file according to his firmware. It is not compatible with Macoq's version. Ackmaniac, can you please fix that assist switching bug only for Marcoq's files without any additional mods?
Sorry that doesn't work. you need to use the entire repository and not only the single file.

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 25 2019 10:46am

Badmotor wrote:
Oct 25 2019 5:21am
I just realized this, Marcoq's github repo still has a bug with switching levels, ..........
It is not compatible with Macoq's version. ...
Ackmaniac has found some bugs and changed also the current control of the motor.
Maybe collect these bugs in one post could help Marcoq with developing the next release (based on v0.20).

The version of Ackmaniac fixed the next things.
• firmware supported 32 ADC steps for torque
instead of 255
• If you set the PWM value for up too small the motor will ramp up to max power in a fraction of a second.
• Power assist for level 3 doesn't work
• It doesn't show error codes anymore when a drive mode was changed.
Last edited by Elinx on Jan 18 2020 5:46am, edited 3 times in total.

sp1n4d0   100 µW

100 µW
Posts: 9
Joined: Jun 13 2019 6:49pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by sp1n4d0 » Oct 25 2019 2:03pm

Installed this firmware and a temperature sensor, it is running fine except when I stop pedaling the motor takes mutch time to stop compared to stock firmware, this is grinding my gears and lost the natural feeling.
there is any option on the java configuration to make motor stop faster?

Badmotor   1 mW

1 mW
Posts: 14
Joined: Sep 09 2019 5:06am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Badmotor » Oct 25 2019 2:22pm

Elinx wrote:
Oct 25 2019 10:46am

The version of Ackmaniac fixed the next things.
• firmware supported 32 ADC steps instead of 255
Btw was 255 steps supposed to show on the screen ? At least In vlcd5 it only showed 32 like before.

ilu   10 mW

10 mW
Posts: 33
Joined: Oct 18 2019 10:51am

Re: Tsdz2 firmware open source adapted to vlcd5

Post by ilu » Oct 25 2019 3:06pm

sp1n4d0 wrote:
Oct 25 2019 2:03pm
Installed this firmware and a temperature sensor, it is running fine except when I stop pedaling the motor takes mutch time to stop compared to stock firmware, this is grinding my gears and lost the natural feeling.
there is any option on the java configuration to make motor stop faster?
You need to put smaller value in the "PWM Duty Cycle Ramp Dw" field. There was some discussion about the safe values for these and if I understand correctly, in marcoqs firmware it shouldn't be lower than 0.6ms but Ackamaniac seems to have only 0.3ms in his setup.

Personally I use 1.2 for up and 0.8 for down and it feels quite satisfactory to me.

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 25 2019 3:17pm

sp1n4d0 wrote:
Oct 25 2019 2:03pm
Installed this firmware .............
Please say about wich firmware you talk.
Marcoq or Ackmaniac, because there is a big difference. Ackmaniac changed a lot.
Ilu has already explained what it could be in case of you use Ackmaniacs version.
Badmotor wrote:
Oct 25 2019 2:22pm
.... 255 steps supposed to show on the screen ? ......
I hope Ackmaniac can answer this question.
I only have collected all his fixes in one post.
He has mentioned this fix here
Last edited by Elinx on Oct 25 2019 3:38pm, edited 1 time in total.

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 25 2019 3:33pm

double

sp1n4d0   100 µW

100 µW
Posts: 9
Joined: Jun 13 2019 6:49pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by sp1n4d0 » Oct 25 2019 6:01pm


Elinx wrote:
sp1n4d0 wrote:
Oct 25 2019 2:03pm
Installed this firmware .............
Please say about wich firmware you talk.
Marcoq or Ackmaniac, because there is a big difference. Ackmaniac changed a lot.
Ilu has already explained what it could be in case of you use Ackmaniacs version.
It's Marcoq 0.19C with this configuration.

Tomorrow I will test Ackmaniacs firmware
Image

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 26 2019 5:14am

sp1n4d0 wrote:
Oct 25 2019 6:01pm
... It's Marcoq 0.19C with this configuration.

Tomorrow I will test Ackmaniacs firmware
..
Thanks for mentioning.
Have you tried to lower the value of PWM Duty Cycle Ramp Dw ?
These PWM values are for saving the blue gear with start/stop the motor.
So realize what you are doing with lowering these values.

sp1n4d0   100 µW

100 µW
Posts: 9
Joined: Jun 13 2019 6:49pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by sp1n4d0 » Oct 26 2019 5:19pm

Elinx wrote:
Oct 26 2019 5:14am
sp1n4d0 wrote:
Oct 25 2019 6:01pm
... It's Marcoq 0.19C with this configuration.

Tomorrow I will test Ackmaniacs firmware
..
Thanks for mentioning.
Have you tried to lower the value of PWM Duty Cycle Ramp Dw ?
These PWM values are for saving the blue gear with start/stop the motor.
So realize what you are doing with lowering these values.
I tried PWM cycle dwn with 1.1, 1.0 and 0.3, and current ramp 5, 10 and 15
i didn´t see any improvements.
Maybe it´s something with my torque sensor calibration, but don´t know what values i have to change.
I also tryed Ackmaniac firmware whith the settings he posted some pages back, it is a litle better, but with level 3 and 4 assists sometimes the motor takes more than a second to stop after you stop pedaling, and with this version walk assist and MTB modes doesn´t work for me.
If i can´t solve this problem i will connect the temperature sensor with external display and flash stock firmware witch i´m pretty happy with it.
Maybe i am oversensitive with it, but before i buyed the tsdz2, i´ve done 2000km with my BBS02B with brake sensors and gear sensor (maybe it was defective because it only senses gear changes 50% of the times), and the most cool thing about tsdz2 for me it is he stops immediately wen you release the pressure in the pedals with the stock firmware.
My only problem is i live in a very hilly island and do MTB with my bike, tsdz2 heats mutch more than bbs02 (touching the cover from outside), thats why i want to install a temperature sensor to cut the motor when he´s getting too hot.

wpenner   10 W

10 W
Posts: 98
Joined: May 10 2018 3:27pm

Re: Tsdz2 firmware open source adapted to vlcd5

Post by wpenner » Oct 26 2019 7:30pm

I finally installed my silicone heat transfer pads today. It took two pads $4.44US. 3 layers at some points. I’ll find out tomorrow if they work as my bike usually hits throttle reduction temperature on last 5 minutes of my ride home.
ABB77FD1-5ECC-4188-A953-542379BEEFBC.jpeg
ABB77FD1-5ECC-4188-A953-542379BEEFBC.jpeg (88.72 KiB) Viewed 2436 times
1028174E-677A-4DF7-9087-0F77C6F73D77.jpeg
1028174E-677A-4DF7-9087-0F77C6F73D77.jpeg (73.1 KiB) Viewed 2436 times

Elinx   100 W

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

Re: Tsdz2 firmware open source adapted to vlcd5

Post by Elinx » Oct 27 2019 4:29am

sp1n4d0 wrote:
Oct 26 2019 5:19pm
........................
If i can´t solve this problem i will connect the temperature sensor with external display and flash stock firmware witch i´m pretty happy with it.
................, thats why i want to install a temperature sensor to cut the motor when he´s getting too hot.
You can't use the temperature sensor with stock firmware. Only the Open source firmware can handle this protection.

Post Reply