Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
slonek   1 µW

1 µW
Posts: 3
Joined: Oct 23 2020 3:46am

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

Post by slonek » Oct 26 2020 7:18am

Ok, I understand almost everything 🙂
But I am bothered by power assist above 25 km / h and I think the problem may be incorrect switching from street to off-road mode ....
In the configurator at the beginning I have the first maximum speed of 45 km / h and "Start street mode" selected, and in the second, 25 km/h and 250w, "Power limitation on the street" selected.
In the manual, however, I read that the bike starts with the code "E02 - OFFROAD MODE with the default STREET MODE" so it is an off-road mode, but limited by the options "starting street mode" to street mode.
What code in this case, the memory for off-road E02 wheter E04 ?

LEVEL 1 - ECO -> STREET / OFFROAD MODE change of road or off-road mode
and the standard mode of the cadence sensor
E02 - OFFROAD MODE with the default STREET MODE
or - STREET MODE with the default OFFROAD MODE
E03 - STREET MODE with the default STREET MODE
or - OFFROAD MODE with the default OFFROAD MODE
E04 - STANDARD CADENCE SENSOR MODE
- TORQUE SENSOR CALIBRATION (to be done)

my current settings
Zrzut ekranu (10).png
Zrzut ekranu (10).png (242.4 KiB) Viewed 1784 times
Zrzut ekranu (11).png
Zrzut ekranu (11).png (226.58 KiB) Viewed 1784 times
Zrzut ekranu (12).png
Zrzut ekranu (12).png (237.17 KiB) Viewed 1784 times

Atrihalov   100 mW

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

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

Post by Atrihalov » Oct 26 2020 11:30am

Please explain step by step how to calibrate the torque sensor? I have VLCD5.

mbrusa   1 kW

1 kW
Posts: 327
Joined: Dec 11 2019 12:13am

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

Post by mbrusa » Oct 27 2020 2:52am

slonek wrote:
Oct 26 2020 7:18am
Ok, I understand almost everything 🙂
But I am bothered by power assist above 25 km / h and I think the problem may be incorrect switching from street to off-road mode ....
In the configurator at the beginning I have the first maximum speed of 45 km / h and "Start street mode" selected, and in the second, 25 km/h and 250w, "Power limitation on the street" selected.
In the manual, however, I read that the bike starts with the code "E02 - OFFROAD MODE with the default STREET MODE" so it is an off-road mode, but limited by the options "starting street mode" to street mode.
What code in this case, the memory for off-road E02 wheter E04 ?

LEVEL 1 - ECO -> STREET / OFFROAD MODE change of road or off-road mode
and the standard mode of the cadence sensor
E02 - OFFROAD MODE with the default STREET MODE
or - STREET MODE with the default OFFROAD MODE
E03 - STREET MODE with the default STREET MODE
or - OFFROAD MODE with the default OFFROAD MODE
E04 - STANDARD CADENCE SENSOR MODE
- TORQUE SENSOR CALIBRATION (to be done)
The translation is probably unclear.

If the default mode is STREET, to switch to OFFROAD, at level 1 (ECO) turn on the lights (E02), turn off the lights (E02 flashing), wait for the flashing to stop.
To return to STREET mode, double switch lights on and off, until you get to flashing E03, or switch the display off and on again.
If the default mode is OFFROAD, same procedure but with inverted functions, E02 = STREET, E03 = OFFROAD.

Adarsh881   1 mW

1 mW
Posts: 16
Joined: Sep 18 2020 6:15pm

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

Post by Adarsh881 » Oct 27 2020 3:14am

vass wrote:
Oct 22 2020 8:06am
If i remember correctly if you disable the "odo compensation" its faster to display speed.
Regarding the changes of parameters, just tell him/her if anything fells strange or something strange is displayed to just shutdown the lcd5 and then power again, it will revert to stock settings :D
Adarsh881 wrote:
Oct 22 2020 6:18am
... a few questions about the usage of the vlcd5 display....

Every time I start up the display it takes a few hundred meters of pedaling before the speed is displayed on the screen. Just wondering if that is normal or can I change something in the settings?
I've noticed that the odo correction doesn't function after I'm looking at the data. Any thoughts on that?

I'm curious if there is a way to flash the software without having the extra possibly of changing, or looking at the data from the screen. I'm asking this because I'm building a bike for a friend who is not familiar with computers and it would be good if she could just use the screen in the original stock mode. I'm afraid she might change settings she doesn't want to change etc.

Also any experience on how well this vlcd5 display can handle the rain?

Thanks to all replies in advance! 🙂
Thanks for your advice :bigthumb:

Indeed turning off the odo correction did the job. I think the odo correction was working but it doesn't correct the trip distance.

As for the rain I just drove in quite heavy rain and so far it is still going... 🤞🏼😄

mbrusa   1 kW

1 kW
Posts: 327
Joined: Dec 11 2019 12:13am

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

Post by mbrusa » Oct 27 2020 3:56am

Atrihalov wrote:
Oct 26 2020 11:30am
Please explain step by step how to calibrate the torque sensor? I have VLCD5.
Copy and paste from the manual, adapted to the configurator.
The procedure is the same for all displays.

Torque sensor calibration
There are two modes of use for the torque sensor, standard and advanced.
In advanced mode a calibration is required.
There are two possible calibrations:
1 - ADC conversion factor calibration, is carried out in standard mode but is used in both modes.
2 - calibration of the ADC working range, only for advanced mode.
Mode change at level 1-ECO, E04 (light button 2 + 2 + 2 times).
How to recognize the chosen mode: if the value of the ADC conversion factor (67) is displayed, it is standard, if the displayed value is zero, the mode is advanced.
Press the lights button twice to change from one mode to another.

- ADC conversion factor calibration
In standard mode it is possible to calibrate the ADC conversion factor with a weight.
The purpose of this calibration is to obtain a correct calculation of human power (up to 40 kg).
Prepare a weight between 20 and 25 kg max, which can be hung on the pedal in a horizontal position.
Go to level 1-ECO, E04 (light button 2 + 2 + 2 times), the current value is displayed, by default 67.
At this point within 10 seconds, hang the weight on the pedal and with the value on the display, activate walk assist.
The display shows another number that gradually increases, release walk assist when the value displayed corresponds to the weight on the pedal.
After the release of walk assist, the display shows the new calculated ADC conversion factor.
Make a note of this value to update "Pedal torque adc step" in the configurator.
Wait 10 seconds or change level to finish the procedure. Calibration has ended.
It is possible to store the value in eeprom, as already described for the calibration of the cadence sensor.
This parameter is used only in POWER ASSIST mode.
Attention, the calculated value can be very different from the default one, so much so as to require a modification of the assistance values "Power assist level x".
This calibration is not essential, it is recommended only if you want a precise calculation of human power and possibly show it on the display.
If you decide to do it, it must be done after the calibration of the ADC working range.
Hardware calibration is required to improve the accuracy and resolution of the torque sensor.

- ADC working range calibration
In advanced mode it is possible to calibrate the maximum relative torque applied to the pedal.
It is the difference between the ADC value with maximum torque applied (weight of the cyclist on the pedal) and the ADC value without thrust on the pedals.
The torque sensors have different sensitivity and working range, this causes different responses in the assistance of the motor.
The purpose of this calibration is to measure and memorize the value of the maximum relative torque, to then amplify the working range if less than a minimum value (160).
Go to level 1-ECO, E04 (light button 2 + 2 + 2 times), choose the advanced mode, the displayed value is zero.
At this point, within 10 seconds, stand on one pedal, it must be in a horizontal position.
The display shows the value of the maximum relative torque (working range), take note of it to update the configurator.
Wait 10 seconds or change level to finish the procedure. Calibration has ended.
It is possible to store the value in eeprom, as already described for the calibration of the cadence sensor.
The parameter to update in the configurator is "Pedal torque adc range".
By setting a value lower than the calibration one, a higher amplification is obtained, on the contrary with a higher value the amplification will be more attenuated.
Attention, the working range of the torque sensor is amplified by the software only if the value is lower than 160, higher values are not amplified.
This calibration is recommended for torque sensors with low sensitivity and limited working range.
Hardware calibration is required to improve the accuracy and resolution of the torque sensor.

In this menu position, level 1-ECO, E04 (light button 2 + 2 + 2 times), in addition to the ADC calibrations, you can change the torque sensor mode, standard or advanced.
Attention, this setting is to be done with the bike stopped without the feet on the pedals, otherwise the calibration starts.
Each time you press the light button, you change from one mode to another.
How to recognize the chosen mode: if the value of the conversion factor ADC (67) is displayed, it is standard, if the displayed value is zero, the mode is advanced. To finish, wait 10 seconds or change level.
If you want to have the default advanced mode, in the configurator enabled "Torque sensor adv on statrup" .


Calibration of "Pedal torque adc step" (ADC conversion factor) is not necessary.
On the other hand, the calibration of the "Pedal torque adc range" (ADC working range) is important.
I recommend to try with an intermediate value between the one measured and 160, then possibly correct more or less. Check that the assistance is well distributed on the 4 levels, at TURBO level it must reach maximum power with maximum effort (a wattmeter is useful).

Slipy   10 mW

10 mW
Posts: 25
Joined: Mar 19 2020 6:22pm

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

Post by Slipy » Oct 27 2020 8:38am

Welcome to the new topic TSDZ2 to S06S firmware
viewtopic.php?f=30&t=108904

dodonike   1 µW

1 µW
Posts: 3
Joined: Oct 27 2020 9:05pm

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

Post by dodonike » Oct 27 2020 9:19pm

Hi all and congrats for all this job. I ve past hours and hours to understand and try to inject the firmware but many troubles occured and now its doesnt work anymore.Hope someone can help here...
First do i connect 4 PINS OR 3? wiki says 3, videos show 4 (RST line)
2nd i cant install in C: directory i must create a file so i install in C:\SDCC
3 an error occured and it cant write sometime i can read sometime not.. do we need to put on battery and display as in wiki shows or disconnect battery??

thank you in advance ! im in france and try to read youtube wiki italian but not a simply process.
often says i should connect rst power on... dunno what its mean...
last screen i got show "api eror programing failed problem when trying to reset swim and device.apply a power on reset"
my steps was
install the program (as i can but not in root)
connect ' wires to st link v2
try a read
and try a fail program hex
try a fail program java
first without battery then with battery on then with battery on and display on.

What is the correct process plz?

dodonike   1 µW

1 µW
Posts: 3
Joined: Oct 27 2020 9:05pm

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

Post by dodonike » Oct 27 2020 9:22pm

i got a 48v 17.5 ah 13s7p battery and a 750W 48Vtsdz2 with Y splitter connection from psppower .

Elinx   10 kW

10 kW
Posts: 710
Joined: Aug 09 2019 6:58am

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

Post by Elinx » Oct 28 2020 11:16am

dodonike wrote:
Oct 27 2020 9:19pm
....
First do i connect 4 PINS OR 3? wiki says 3, videos show 4 (RST line)
2nd i cant install in C: directory i must create a file so i install in C:\SDCC
3 an error occured and it cant write sometime i can read sometime not.. do we need to put on battery and display as in wiki shows or disconnect battery??

thank you in advance ! im in france .....
You need 3 pins (Swim, Ground and Voltage)
RST isn't needed and also NO battery Voltage, so disconnect the battery !!
There is also an English wiki but Elem has writed some things in French too for the older Marcoq version, but install base is the same.

dodonike   1 µW

1 µW
Posts: 3
Joined: Oct 27 2020 9:05pm

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

Post by dodonike » Oct 30 2020 10:20am

thank you elinx ive read elem forum too.
The issue was shitty st linkv2. It works once on 50 tried after 2 night on the issue. was so happy thought the update firmware of the dongle was the solution, after a ride i was upset no speed display before 200 meters, so wanted to flash without odo compensation, that go fail again and again. solution was tu update again dongle then switch gnd and swim cable.. Dont ask me why it worked that way. (With RST linked and battery off). I think if you encounter this issue you may try with another stlink... (mine dont have a physical reset button wich seems to resolve this fail)
Thanks a lot for your works the motor worth his money now. But we cant go out now in france ;((!

Elinx   10 kW

10 kW
Posts: 710
Joined: Aug 09 2019 6:58am

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

Post by Elinx » Oct 30 2020 11:06am

dodonike wrote:
Oct 30 2020 10:20am
...
The issue was shitty st linkv2. ........ Dont ask me why it worked that way. (With RST linked and battery off). ......
It is a known problem with cheap ST Link V2 adapters that sometimes the pinout on the case is another than on the PCB.
If it is possible to slide the case aside you can compare the layout on the case and PCB. The PCB has the right pinout.

w0utje   100 mW

100 mW
Posts: 35
Joined: Jan 12 2020 3:02am

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

Post by w0utje » Nov 11 2020 5:34am

Just bought a 52v14Ah battery for the mtb, had 1 battery with 48-11.6Ah that I used on the street bike 500watt tsdz2 and on the 750watt mtb. Now with the singles day on aliexpress bought a 52v battery, lighter then my 11.6Ah and a little more watts capacity. Cant wait to reflash the firmware to 52volts and then give it a try, was tired of switching battery's on 2 bike's and charging it almost every day. Some more range om the -emtb is also nice, going up from 556watts ( or whats left of it after 5000Km's) to 728watts.
Really like the e-mtb mode, run it on both bikes now.
Image
with these settings, the stock settings where way to powerfull to bike with "natural" pedaling people ;)

Adarsh881   1 mW

1 mW
Posts: 16
Joined: Sep 18 2020 6:15pm

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

Post by Adarsh881 » Nov 21 2020 6:44pm

Hey I just built my 'old' 36v motor on a friend's bike and would like to reset the odometer. I tried to push the + and - and on/off together for 10 seconds but the vlcd5 screen turns off after about 2 seconds and the odometer is not reset..

Am I doing something wrong or does this not function because of the open source firmware?

Thanks in advance 🙂

w0utje   100 mW

100 mW
Posts: 35
Joined: Jan 12 2020 3:02am

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

Post by w0utje » Nov 22 2020 2:51am

Just did it a few weeks ago with custom firmware, so it still works. Choose the odometer and then hold on/off - and + for 10 seconds. And voila, my display was on 0 again. Bought a second hand vlcd5 display for the mountainbike. Couldnt read the xh18 display on the move.

Adarsh881   1 mW

1 mW
Posts: 16
Joined: Sep 18 2020 6:15pm

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

Post by Adarsh881 » Nov 23 2020 12:42pm

I just upgraded my 36v to a 48 v motor with a 17.5 ah 48v battery 13s /5p

Does someone know what to put in on max battery watts. The battery can handle 25amp continued but I don't think this motor would like that...

Thanks 👍😊

w0utje   100 mW

100 mW
Posts: 35
Joined: Jan 12 2020 3:02am

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

Post by w0utje » Nov 25 2020 2:34am

Adarsh881 wrote:
Nov 23 2020 12:42pm
I just upgraded my 36v to a 48 v motor with a 17.5 ah 48v battery 13s /5p

Does someone know what to put in on max battery watts. The battery can handle 25amp continued but I don't think this motor would like that...

Thanks 👍😊
The motor amps are maxed out at 18 I believe, the max battery watts is the power the motor can deliver I think. So my 500watt motor is on 500 watts and my 750watts on the mtb is set on 750 on max battery power.

Waynemarlow   10 kW

10 kW
Posts: 641
Joined: Jul 09 2016 7:22am
Location: Bucks, England

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

Post by Waynemarlow » Dec 03 2020 5:13pm

Hi guys, I've had to do a computer rebuild and having trouble getting the configurator up and running, could you have a look through the attached photo and any suggestion welcome. The configurator runs Ok, its just when trying to compile and flash.

Now I have changed my batch file to read
@echo off
PATH = %PATH%;C:\Program Files (x86)\STMicroelectronics\st_toolset\stvp
::PATH = %PATH%;%1

To where my ST program lies ( I think )

Thanks
Attachments
Screenshot 2020-12-03 220256.jpg
Screenshot 2020-12-03 220256.jpg (63.33 KiB) Viewed 1126 times

Elinx   10 kW

10 kW
Posts: 710
Joined: Aug 09 2019 6:58am

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

Post by Elinx » Dec 03 2020 7:15pm

Waynemarlow wrote:
Dec 03 2020 5:13pm
....The configurator runs Ok, its just when trying to compile and flash.

Now I have changed my batch file to read .......

To where my ST program lies ( I think )....
And how about the SDCC path? Normally ST and SDCC must be installed into root of C:
If you install them both inside "program files" and change the path inside bat files, you must do this for both.

Adarsh881   1 mW

1 mW
Posts: 16
Joined: Sep 18 2020 6:15pm

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

Post by Adarsh881 » Dec 04 2020 5:59am

Waynemarlow wrote:
Dec 03 2020 5:13pm
Hi guys, I've had to do a computer rebuild and having trouble getting the configurator up and running, could you have a look through the attached photo and any suggestion welcome. The configurator runs Ok, its just when trying to compile and flash.

Now I have changed my batch file to read
@echo off
PATH = %PATH%;C:\Program Files (x86)\STMicroelectronics\st_toolset\stvp
::PATH = %PATH%;%1

To where my ST program lies ( I think )

Thanks
Maybe you are not logged in as administrator? That solved it for me...

famichiki   100 W

100 W
Posts: 291
Joined: Jul 12 2019 9:00am

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

Post by famichiki » Dec 08 2020 10:56am

At some stage Mbrusa has added a limit on the number of EEPROM write attempts in eeprom.c. The original code continually tried rewriting but now it only tries 3 times then throws an error.

However, it seems that ui8_error_number does not get reset to zero, so all further failed attempts at saving the user configuration will immediately throw an error without retrying. Have I understood that correctly?

mbrusa   1 kW

1 kW
Posts: 327
Joined: Dec 11 2019 12:13am

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

Post by mbrusa » Dec 08 2020 12:35pm

Hi famichiki.
The purpose of this check is to avoid, in case of problems, unlimited writing attempts that would damage the eeprom.
ui8_error_number is reset by turning the display off and on again.

Waynemarlow   10 kW

10 kW
Posts: 641
Joined: Jul 09 2016 7:22am
Location: Bucks, England

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

Post by Waynemarlow » Dec 08 2020 1:05pm

I'm not sure I've fully solved the problem as I may have another problem compounding the issue. I copied over the ST directory to the C:/ root directry and the configurator runs and does appear to load the file into the motor. But the motor won't run, display comes up and does its bit, but not the motor.

I tried the old fix of simply reloading the option byte directly from the ST programmer as I've had to do before, but still no joy. I tried going back to the factory 52 volt program settings with mixed results, my motor will program ( the motor is down on power and I wanted to try 48V values with the the 3rd bit set to 52v values ) and run sometimes and not others, its all a bit strange and inconsistant, is it the ST Link, is it the controller, is it the computer, so many variables.

The downside is this motor is definately down on power though, is this the difference between V20 and factory, have I over heated the motor perhaps as we have been doing a lot of climbing of late ( I have modified the internals for better thermal efficiency but so far haven't fitted the temp sensor fitted ) ? Its getting to the stage of pulling the motor down to have a look perhaps.

Far too many variables on this one.

famichiki   100 W

100 W
Posts: 291
Joined: Jul 12 2019 9:00am

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

Post by famichiki » Dec 08 2020 5:08pm

mbrusa wrote:
Dec 08 2020 12:35pm
Hi famichiki.
The purpose of this check is to avoid, in case of problems, unlimited writing attempts that would damage the eeprom.
ui8_error_number is reset by turning the display off and on again.
Thanks. I wasn't sure if this was as intended as it still allows a single attempt at subsequent writes.

Also were your reasons for manually saving the config and not automatically after a setting change? Was it mainly out of concern for wear on the EEPROM?

mbrusa   1 kW

1 kW
Posts: 327
Joined: Dec 11 2019 12:13am

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

Post by mbrusa » Dec 09 2020 4:25am

The choice to save manually is deliberate, I think it must be voluntary.
With stock displays it is difficult to understand what the current settings are, if they may be different at each start.

Better that the settings at power on, after having chosen them with the configurator or saved voluntarily, always remain the same. I consider it a set default at power on.
It is not always advisable to automatically save the changed parameters, think for example of "street mode".

Furthermore, with LCD3 and 860C the parameters are saved in the eeprom of the display at shutdown.
With stock displays it is not possible, they must be saved on the motor controller.
At shutdown, before the micro loses consciousness, there is time and energy to save just one byte, the battery soc.
I should save in eeprom at every parameter change and choose which ones to save and which not, but I find it a useless complication.

famichiki   100 W

100 W
Posts: 291
Joined: Jul 12 2019 9:00am

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

Post by famichiki » Dec 09 2020 5:35pm

mbrusa wrote:
Dec 09 2020 4:25am
The choice to save manually is deliberate, I think it must be voluntary.
No worries, I was just curious.

Is cruise mode all working properly? In my own port I had some issues with it overshooting the target speed a lot, then cutting all power until the speed came back down. I'm not sure if it's supposed to be more intelligent or that's normal operation. I did notice that CRUISE_PID_KP was set for a 48V motor while CRUISE_PID_KI was for 36V.

Post Reply