Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
Waynemarlow   1 kW

1 kW
Posts: 387
Joined: Jul 09 2016 7:22am
Location: Bucks, England

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

Post by Waynemarlow » Jun 16 2020 7:05am

Mbrusa

We have now 2 controllers that register 0 on the factory firmware RE and RE1 hidden screens for the torque convertor reading, one was working prior to reprogramming, the other gave the fault after getting wet. In all other aspects everything works OK.

Is there anyway the processor can get into a state where this particular input from the torque convertor can become ignored. I'm pretty sure its a processor / board fault of some kind but I regularly see the same question on the forums of the torque convertor reading zero. Is there anyway we can trick the board to simulate a torque convertor, as in electrical voltage level to check or at least diagnose the fault, as I think this fault is one of the major contributors to having to replace the controller and I suspect once present stocks are gone, then only the newer 2020 controllers will be available.

Thanks

Pompey_Monkey   1 µW

1 µW
Posts: 3
Joined: Jun 16 2019 7:45am

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

Post by Pompey_Monkey » Jun 16 2020 10:40am

Pompey_Monkey wrote:
Jun 14 2020 9:27am
Hi,
Firstly, a big thank you to all that have taken part in the development of the alternative fimwares.
I've been trying to program my TSDZ2 with a the Java Configurator and with the ST programming tool via some ST-Link clones and the official ST_Link.
I've had limited success, probably because my wires are too long. I have no desire to take apart my motor to get directly to the circuit board, so I decided to call it a day and revert back to the original firmware, which I backed up at the start :)
As part of my process I had successfully flashed back to the original firmware (main.ihx and option.ihx) a few times from my back up.
However, after the last roll-back, my motor is completely unresponsive, either through pedalling or the throttle. The VLCD5 behaves exactly like it should at stock FW.
What have I done wrong? Do I need to set the "program memory" to something as well as the main and option?
I have attached my back-up main.ihx and option.ihx files (with *.txt extensions), for examination in the hope it's something trivial to correct.
Please help :)

OEM_FW.ihx.txt
OEM_FW_option.ihx.txt
I fixed it.
it was indeed the data memory that was incorrect. I installed it from the back-ups here https://drive.google.com/drive/folders/ ... jMrpW2ZqvH

Thanks to all for looking anyway! :)

mbrusa   100 W

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

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

Post by mbrusa » Jun 16 2020 11:34am

Atrihalov wrote:
Jun 12 2020 6:14am
I did everything according to your recommendation.
The ADC value changes from 4.0 to 21.0, but the motor does not rotate.
Atrihalov wrote:
Jun 16 2020 6:53am
mbrusa wrote:
Jun 13 2020 11:30am
Atrihalov wrote:
Jun 13 2020 8:49am
I use level 2-3, but the motor does not rotate from the throttle.
Are you using the latest version of the configurator?
If you put the ini file or the config.h file here, I try with your configuration.
Configuration file.
Atrihalov, in the config.h file there are two wrong parameters, "ADC throttle value min" and "ADC throttle value max".
The default values are 47 and 176, from the test you did you could reach 40 and 210.
Why did you set 0 and 22? That's no good!
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Atrihalov   100 mW

100 mW
Posts: 36
Joined: Nov 14 2017 1:30am

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

Post by Atrihalov » Jun 16 2020 11:58am

mbrusa wrote:
Jun 16 2020 11:34am
Atrihalov wrote:
Jun 12 2020 6:14am
I did everything according to your recommendation.
The ADC value changes from 4.0 to 21.0, but the motor does not rotate.
Atrihalov wrote:
Jun 16 2020 6:53am
mbrusa wrote:
Jun 13 2020 11:30am
Atrihalov wrote:
Jun 13 2020 8:49am
I use level 2-3, but the motor does not rotate from the throttle.
Are you using the latest version of the configurator?
If you put the ini file or the config.h file here, I try with your configuration.
Configuration file.
Atrihalov, in the config.h file there are two wrong parameters, "ADC throttle value min" and "ADC throttle value max".
The default values are 47 and 176, from the test you did you could reach 40 and 210.
Why did you set 0 and 22? That's no good!
Thank. I'll try to change the settings.

mbrusa   100 W

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

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

Post by mbrusa » Jun 17 2020 2:48am

HrKlev wrote:
Jun 13 2020 2:09pm
...
What settings is affecting this? Motor acceleration and maybe ramp down? Im using 35 acceleration (36V battery, 36V motor) and 8 ramp down. Could you share what you are using?
HrKlev, I have no strange settings, only slightly higher values for "Assist whitout pedaling threshold", "Pedal torque adc offset adjustment", "Motor acceleration", because I like to feel the bike start immediately as soon as I put my foot on the pedal.
I disabled "Experimental high cadence mode", because I consume less battery and my average cadence is 60, I rarely reach 80.
I always use "Street mode" with a 500W power limit.
My_config_1.jpg
My_config_1.jpg (151.48 KiB) Viewed 408 times
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

mbrusa   100 W

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

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

Post by mbrusa » Jun 17 2020 3:24am

Patoruzusos wrote:
Jun 12 2020 7:05am
...
Is this a fork or a branch?
I would like to propose the creation of real user defined profiles/presets. Let's say, 3 config slots to choose from at runtime.
Should this be done on the original OpenSource code (HEAD?) and be merged here (Branch?)?
or should I propose this directly here?

And a few more questions to everybody, not strictly frimware related, if allowed.
I have a Y cable on the front of the bike, one goes to the xh18, and one to the Thumb Throttle.
one the back I have a single cable that goes straight the the speed sensor.
Is it possible, and which cables do I need to:
1) Connect a head light.
2) Connect a tail light
3) Connect cut off power break leavers
4) Connect gear sensor

Cheers!
There are no resources for this, free memory is 4%, better to keep it available for anything else.
However, "Power assist", "Torque assist" and "eMTB assist", can be set as different driving profiles, depending on the conditions of use.
To connect throttle, brake sensors and / or gear sensor, controllers with an 8-pin connector are usually used.
I don't know Y cables for XH18 and throttle.
For the lights, you need to have a Y connector on the speed sensor, to which the lights are connected.
http://www.pswpower.com/ven.php?cargo.2017-cm-jnqg
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Atrihalov   100 mW

100 mW
Posts: 36
Joined: Nov 14 2017 1:30am

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

Post by Atrihalov » Jun 17 2020 6:28am

mbrusa wrote:
Jun 16 2020 11:34am
Atrihalov wrote:
Jun 12 2020 6:14am
I did everything according to your recommendation.
The ADC value changes from 4.0 to 21.0, but the motor does not rotate.
Atrihalov wrote:
Jun 16 2020 6:53am
mbrusa wrote:
Jun 13 2020 11:30am
Atrihalov wrote:
Jun 13 2020 8:49am
I use level 2-3, but the motor does not rotate from the throttle.
Are you using the latest version of the configurator?
If you put the ini file or the config.h file here, I try with your configuration.
Configuration file.
Atrihalov, in the config.h file there are two wrong parameters, "ADC throttle value min" and "ADC throttle value max".
The default values are 47 and 176, from the test you did you could reach 40 and 210.
Why did you set 0 and 22? That's no good!
Changed the settings. From throttle motor does not work.
Attachments
config.h
(4.31 KiB) Downloaded 1 time
20200617-141028MSK.ini
(610 Bytes) Downloaded 4 times

Patoruzusos   1 mW

1 mW
Posts: 14
Joined: Jun 11 2020 10:13pm

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

Post by Patoruzusos » Jun 17 2020 7:25am

mbrusa wrote:
Jun 17 2020 3:24am
There are no resources for this, free memory is 4%, better to keep it available for anything else.
I see. So many modes... it should be enough. I will try to install the firmware during the weekend and see what they are and how they work.

I would like to feature request two battery profiles or at least two capacity settings, ie: city/cursing, Pack1/Pack2, That should take less space that full user defined profiles. Does it make sense? It cannot be I am the only one with two different packs.

Are you pulling and merging updates from the original version or going your own way?
In other words, a display independent feature as the one I mentioned above, should I ask here (Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18), which is the version I plan to use, or there (TSDZ2 mid drive with 860C, 850C or SW102 displays only)
mbrusa wrote:
Jun 17 2020 3:24am
I don't know Y cables for XH18 and throttle.
My Motor came with a Y at the front, one side went to the xh18, the other was open, and the TSDZ2 support explained it could be used for the throttle (they sent me the wrong cable, so I bought and added the throttle)
mbrusa wrote:
Jun 17 2020 3:24am
For the lights, you need to have a Y connector on the speed sensor, to which the lights are connected.
http://www.pswpower.com/ven.php?cargo.2017-cm-jnqg
Thanks, I will buy one, and disconnect the dynamo hub.

Cheers!

HrKlev   1 W

1 W
Posts: 57
Joined: Dec 06 2019 10:24am

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

Post by HrKlev » Jun 18 2020 1:28am

mbrusa wrote:
Jun 17 2020 2:48am
HrKlev wrote:
Jun 13 2020 2:09pm
...
What settings is affecting this? Motor acceleration and maybe ramp down? Im using 35 acceleration (36V battery, 36V motor) and 8 ramp down. Could you share what you are using?
HrKlev, I have no strange settings, only slightly higher values for "Assist whitout pedaling threshold", "Pedal torque adc offset adjustment", "Motor acceleration", because I like to feel the bike start immediately as soon as I put my foot on the pedal.
I disabled "Experimental high cadence mode", because I consume less battery and my average cadence is 60, I rarely reach 80.
I always use "Street mode" with a 500W power limit.
My_config_1.jpg
OK, thanks a lot for sharing. I have been out riding and trying to adress it, and I think a lot of it is because my right pedal is almost really unresponsive. When the motor stops like I described in the first "problem" its always the right foot forward. I might buy another torque sensor or try to adjust the one I have. Anyway, I'm getting more used to it and its not a big problem. Still having loads of fun both up and down the trails. The extra cadence I got with the OSF is such a big deal when building momentum trying to get up a difficult spot :)

mc_lee   1 µW

1 µW
Posts: 1
Joined: Jun 18 2020 2:04am

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

Post by mc_lee » Jun 18 2020 2:21am

Atrihalov wrote:
Jun 17 2020 6:28am
mbrusa wrote:
Jun 16 2020 11:34am
Atrihalov wrote:
Jun 12 2020 6:14am
I did everything according to your recommendation.
The ADC value changes from 4.0 to 21.0, but the motor does not rotate.
Atrihalov wrote:
Jun 16 2020 6:53am
mbrusa wrote:
Jun 13 2020 11:30am

Are you using the latest version of the configurator?
If you put the ini file or the config.h file here, I try with your configuration.
Configuration file.
Atrihalov, in the config.h file there are two wrong parameters, "ADC throttle value min" and "ADC throttle value max".
The default values are 47 and 176, from the test you did you could reach 40 and 210.
Why did you set 0 and 22? That's no good!
Changed the settings. From throttle motor does not work.
From your ini file, I can see you have enabled the "Street mode on startup" in "Basic settings" page. And I noitced that you have not enabled the "Throttle on street mode" in "Assistance settings" page. May be you can try to enable it to see whether it can help.

mbrusa   100 W

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

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

Post by mbrusa » Jun 18 2020 3:07am

mc_lee wrote:
Jun 18 2020 2:21am
From your ini file, I can see you have enabled the "Street mode on startup" in "Basic settings" page. And I noitced that you have not enabled the "Throttle on street mode" in "Assistance settings" page. May be you can try to enable it to see whether it can help.
:bigthumb:
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Atrihalov   100 mW

100 mW
Posts: 36
Joined: Nov 14 2017 1:30am

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

Post by Atrihalov » Jun 19 2020 2:48am

mbrusa wrote:
Jun 18 2020 3:07am
mc_lee wrote:
Jun 18 2020 2:21am
From your ini file, I can see you have enabled the "Street mode on startup" in "Basic settings" page. And I noitced that you have not enabled the "Throttle on street mode" in "Assistance settings" page. May be you can try to enable it to see whether it can help.
:bigthumb:
I turned on the throttle mode on the help settings tab in the street mode. When you turn on the engine immediately starts to work.

mbrusa   100 W

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

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

Post by mbrusa » Jun 19 2020 8:01am

Atrihalov wrote:
Jun 19 2020 2:48am
When you turn on the engine immediately starts to work.
If you have VLCD5, is the throttle connector inserted in the right direction?
What happens when you operate the throttle?
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

mbrusa   100 W

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

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

Post by mbrusa » Jun 19 2020 8:49am

Patoruzusos wrote:
Jun 17 2020 7:25am
I see. So many modes... it should be enough. I will try to install the firmware during the weekend and see what they are and how they work.

I would like to feature request two battery profiles or at least two capacity settings, ie: city/cursing, Pack1/Pack2, That should take less space that full user defined profiles. Does it make sense? It cannot be I am the only one with two different packs.
The max battery capacity is only used to calculate the remaining%. Only one value can be saved in eeprom on shutdown.
You should only change batteries when fully charged, which you can already do. You just need to calculate the% difference when using the one with the less capacity.
The display of the bars is also not sure, if you set the voltage values for one battery, it may not correspond with the other.
Thanks, I will buy one, and disconnect the dynamo hub.

Cheers!
Remember that for lights the max output is 0.35A
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

Atrihalov   100 mW

100 mW
Posts: 36
Joined: Nov 14 2017 1:30am

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

Post by Atrihalov » Jun 19 2020 11:23am

mbrusa wrote:
Jun 19 2020 8:01am
Atrihalov wrote:
Jun 19 2020 2:48am
When you turn on the engine immediately starts to work.
If you have VLCD5, is the throttle connector inserted in the right direction?
What happens when you operate the throttle?
when I carry out a throttle, the motor runs faster.

mbrusa   100 W

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

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

Post by mbrusa » Jun 19 2020 1:47pm

Atrihalov wrote:
Jun 19 2020 11:23am
when I carry out a throttle, the motor runs faster.
The cause of the problem may be the value of "ADC throttle value min".
You read 40, but there may be a display error.
Try to change it, I can't tell you whether to increase or decrease, you have to do some tests.
Flexible OpenSource firmware for TongSheng TSDZ2 motor and VLCD5 VLCD6 XH18 displays
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1

HughF   100 W

100 W
Posts: 144
Joined: Jan 23 2020 6:13pm

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

Post by HughF » Jun 21 2020 9:56am

Is there an option in the latest configurator to build a firmware file that will default to eMTB mode on power up?

If so, could someone build me a hex file if I give them a list of options? I do not have a working Windows machine at the moment, so would need to flash from Linux. I understand that even though the configurator is written is Java, it relies on the windows ST tools.

I have seen this in screenshots of the configurator, but I thought that the display would force the motor into standard mode on startup?

I would like to use my spare vlcd6 on my hardtail mountain bike, so would be looking to have this firmware fork on this bike.
Genesis iOiD Alfine8 Hard tail MTB, 36v TSDZ2, 13s battery, SW102 display
Raleigh reynolds road frame from the 80's, TSDZ2, SW102 display, 1x10 drivetrain, gravel tyres

Atrihalov   100 mW

100 mW
Posts: 36
Joined: Nov 14 2017 1:30am

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

Post by Atrihalov » Jun 22 2020 4:49am

mbrusa wrote:
Jun 19 2020 1:47pm
Atrihalov wrote:
Jun 19 2020 11:23am
when I carry out a throttle, the motor runs faster.
The cause of the problem may be the value of "ADC throttle value min".
You read 40, but there may be a display error.
Try to change it, I can't tell you whether to increase or decrease, you have to do some tests.
Thanks for the help. The throttle works with these settings.
Attachments
20200622-124358MSK.ini
(610 Bytes) Downloaded 11 times

Waynemarlow   1 kW

1 kW
Posts: 387
Joined: Jul 09 2016 7:22am
Location: Bucks, England

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

Post by Waynemarlow » Jun 23 2020 6:12am

Can anyone describe how easily we can save tested files in the configurator as in the exeprimental file area to the proven file area.

Thanks

kallt_kaffe   10 mW

10 mW
Posts: 22
Joined: Jun 06 2020 11:06am

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

Post by kallt_kaffe » Jun 23 2020 6:33am

Waynemarlow wrote:
Jun 23 2020 6:12am
Can anyone describe how easily we can save tested files in the configurator as in the exeprimental file area to the proven file area.
Copy or move (and possibly rename) the ini-file from C:\TSDZ2-Smart-EBike-1-master\experimental settings to C:\TSDZ2-Smart-EBike-1-master\proven settings

Waynemarlow   1 kW

1 kW
Posts: 387
Joined: Jul 09 2016 7:22am
Location: Bucks, England

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

Post by Waynemarlow » Jun 23 2020 6:37am

Ah, its been so long using windows you forget about old Dos style movement of files. Thanks

kallt_kaffe   10 mW

10 mW
Posts: 22
Joined: Jun 06 2020 11:06am

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

Post by kallt_kaffe » Jun 23 2020 6:47am

Got my STLinkV2 yesterday and have since been trying out this firmware. Still tweaking settings and just did ADC working range calibration. Right pedal measured 130 while left measured 120 so I entered 125 in the configurator. Is that the recommend thing to do or should I go with the lower or higher value?

Also I cannot get the "auto display data with lights on" to work on my display. Manual display of data works if I go into display mode but in set parameter mode with lights on it just goes E02 and the briefly flashes 00.0 a couple of times. It should display battery percentage and voltage as the two first numbers and those are not supposed to be zero. Manually displaying the data shows data as it should. My display (VLDC5) is version 5.0, and allows settings speed limit up to 60km/h instead of the normal 45km/h so I suppose it may work different in some ways compared to older displays. Anyone else seen this?

Patoruzusos   1 mW

1 mW
Posts: 14
Joined: Jun 11 2020 10:13pm

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

Post by Patoruzusos » Jun 23 2020 11:35am

mbrusa wrote:
Jun 19 2020 8:49am
The max battery capacity is only used to calculate the remaining%. Only one value can be saved in eeprom on shutdown.
You should only change batteries when fully charged, which you can already do.
I am really confused here. My unmodified xh18 calculates the remaining %, without knowing the capacity. How? Furthermore, I seldom charge to 100% (not always practical), I may even charge it for a few minutes while stopping at a restaurant, and the display always shows the remaining %. And the battery pack has additionally inside a 48v circuit board to also calculate the remaining battery, this time not in % but with 5 leds. it also only knows it is powered by a 48V pack. Con someone explain how this works without knowing the capacity and why this firmware needs it? My understanding says one cannot guess capacity level from Voltage level on Li Ion packs.

As I mentioned earlier, I have a city pack (13s2p) and a touring pack (13s and somewhere between 7p and 9p any way to verify this without tearing the pack apart?). I have a trailer and would like to place on top a solar panel to see if I can go touring with my 2p pack. This will be constantly and simultaneously charged/discharged. Will I be getting accurate %? Running out of power with a trailer in some distant mountain could be disastrous :shock:

Waynemarlow   1 kW

1 kW
Posts: 387
Joined: Jul 09 2016 7:22am
Location: Bucks, England

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

Post by Waynemarlow » Jun 23 2020 12:18pm

13S9P battery pack, is that what the trailer is for, to carry the pack :D

Patoruzusos   1 mW

1 mW
Posts: 14
Joined: Jun 11 2020 10:13pm

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

Post by Patoruzusos » Jun 23 2020 12:47pm

Waynemarlow wrote:
Jun 23 2020 12:18pm
13S9P battery pack, is that what the trailer is for, to carry the pack :D
Almost true :lol:
The trailer is a small agile monowheel,
and the battery a rear pack, optically a normal size, until you lift it :)

But when also carrying large and loaded pannier rear touring bags, the center of gravity becomes too high.
So sooner or later the 9p will land on top of the trailer and be about 20cm lower than my bike wheels axis.

Post Reply