Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Electric Motors and Controllers
grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 27 2019 7:02am

I think I have found the problem with my wife's bike.
I now understand that when new firmware is used the VLCD5 does not work like before the upgrade. Some variables can only be changed by directly modifying Data Memory values.
On wife's bike I was using 2 magnets for the speed sensor, after installing firmware I checked VLCD5 was set to "cc=2" but I think firmware was expecting 1 magnet so was reading "Max Wheel Speed" too soon?? Is my logic correct?

I have removed one magnet, set VLCD5 to "cc=1" so that the speedometer is correct, quick road test and it feels OK :)

Now I have noticed this problem with both bikes, the battery indicator on VLCD5 is reading low. I am using 36v so I think the value at line 00400E "0A" is correct.
Any ideas please??

I will try to read actual battery voltage and report later.

User avatar
ashrambo   1 W

1 W
Posts: 55
Joined: Apr 30 2018 4:31am
Location: Madrid
Contact:

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by ashrambo » Jan 27 2019 5:02pm

I have problems with the firmware and the XH18 display. Firstly I couldn't use to program the java configurator because the walk assist function didn't work, then I used the svtp to program and I programmed only the program memory. I started the motor and it generated the data memory.
Image
DM that the engine created when I installed the PM firmware, and in the DM tab I overwrote everything with zeros. I installed only the PM and the DM was generated on power up. The walk assist worked with this method.

I tested this morning. suffered continuous engines shutdowns during the test.

The last value written in the DM is 0x004027

Configuration of the DM tab that I will try to use to eliminate the dull ones.

Image
I have a 15amp battery and my engine version is 350W, 36v.

What do you think? What do I set wrong to turn off the engine?
TREK REMEDY MOTOR TSDZ2

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 28 2019 9:22am

Ashrambo
You may want to try these values?

After reading the marco default values document and using the Hex converter that elem shared with me (thanks elem :thumb: ), I decided on these values for my two bikes: They are both 36v 350w motor.

00 01 02 03 04 05 06 07 08 09 A B C D E F
4000 AA 08 00 10 19 1D 01 23 08 2D 01 00 23 19 0A C4
4010 00 3B 01 08 10 1E 32 00 01 04 0C 14 1C 14 23 01
4020 00 00 4B 55 0A 0C 12 1A 20 28 14 00 00 00 00 00

There are some of the values that I do not understand and when I have studies them more I will will document what I did and ask for comments.

My wife and I have just tested the bikes, about 7 miles total riding on road with a few hills and all was excellent with much improvement on original firmware. :bigthumb:

User avatar
ashrambo   1 W

1 W
Posts: 55
Joined: Apr 30 2018 4:31am
Location: Madrid
Contact:

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by ashrambo » Jan 28 2019 4:00pm

I did an excell with the parameter of data memory, I'm trying to understand the meaning of each field. I didn't undestand this fields:

https://drive.google.com/open?id=1EkGts ... pxqIZPNSB

0x004001 ASSIST_LEVEL_FACTOR_X10 5 (0x05) // 0.5 = 10%
0x004005 BATTERY_LOW_VOLTAGE_CUT_OFF_X10_0 34 (0x22) // Battery low voltage cut-off LSB: 36v battery, LVC = 29.0 (2.9 *10): (34 + (1 << 8))
0x004006 BATTERY_LOW_VOLTAGE_CUT_OFF_X10_1 1 (0x01) // Battery low voltage cut-off MSB
0x00400B OFFROAD_CONFIG 0 (0x00) // bit0: enable offroad, bit1: enable offroad on startup, bit2: enable offroad power limit
0x00400F BATTERY_PACK_RESISTANCE_0 196 (0xC4) // Battery pack resistance LSB 196 milli ohms, battery pack 36V 10S5P
0x004010 BATTERY_PACK_RESISTANCE_1 0 (0x00) // Battery pack resistance MSB
0x004020 TARGET_MAX_BATTERY_POWER_DIV25 25 (0x19) // 25 = 625 watts (25 * 25), 0 is disabled

And the walk assist function, How can I change the power to increase the speed?
0x004024 WALK_ASSIST_PERCENTAGE_CURRENT 10 (0x0A) // 10% of max battery current (max = 100%)
0x004025 WALK_ASSIST_PWM_DUTY_CYCLE_LEVEL_0 12 (0x0C) // 0...255
0x004026 WALK_ASSIST_PWM_DUTY_CYCLE_LEVEL_1 17 (0x11) // 0...255
0x004027 WALK_ASSIST_PWM_DUTY_CYCLE_LEVEL_2 25 (0x19) // 0...255
0x004028 WALK_ASSIST_PWM_DUTY_CYCLE_LEVEL_3 33 (0x21) // 0...255
0x004029 WALK_ASSIST_PWM_DUTY_CYCLE_LEVEL_4 40 (0x28) // 0...255
0x00402A WALK_ASSIST_MAX_RAMP_TIME 20 (0x14) // 2.0 seconds
TREK REMEDY MOTOR TSDZ2

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 28 2019 4:49pm

ashrambo

0x004001 Is the lowest battery voltage when the system will stop working so as to protect battery from over discharge. But the Default value 34 (34v) I think is too high. When I tried this my system stopped working with 3 bars on battery indicator. I have changed this to 29 (29v) as shown in the example and the Hex value for 29 is 1D. The battery management system inside my battery will actually turn off the battery at 30v so 29v should never be reached. You can set this value to suit your requirements, some people like to be extra careful with their batteries.
00x004002 I do not understand why this battery voltage is? - I used Default value
00x004006 I do not understand which parts are bit0 bit1 bit2? - I used Default value
I would be very happy for someone to explain bit0 bit1 bi2......?
00x00400F Each battery pack will have an internal resistance, measuring this can show the health of the battery pack. I do not know how the software uses this data but marco has given a general value for a 36v pack. I used Default value.
00x004010 I do not understand why this resistance? - I used Default value
00x004020 I do not understand this line. I used "00" Disabled
I am not really interested in the Walk Assist so I used all Default values

My 2 bikes are working well at the moment but there are other values I do not understand but it is too late for me now so will post another day.........

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 29 2019 6:43am

@marcoq
Hi Marcoq

I like the work you have done with the firmware from Casainho and others so that it can be used with stock LCD.
I have 2x TSDZ2 36v 350w with VLCD5 display and was a little disappointed with performance (sometimes erratic power delivery) from original firmware, but I do not really need all the advanced features of LCD3 and when I get my setting OK I will not want to adjust them when out riding.
Unfortunately I can not get your configerator to work, I am not a programmer but am happy to load Hex file and edit values using StLink and this is what I have done.

I have uploaded your latest Hex file and have needed to edit the Data Memory in order for it to work correctly. It was difficult for me to understand all of the data values in your document, so I guessed some items and used Default for most and now my bikes are working.
There are some problems with speed indication, I have 2 bikes one 26inch wheel and one 29inch wheel. I set the VLCD5 on each bike to 26inch and 29inch. 26inch speed I think is OK but 29inch is 1.5mph higher than 26inch?? I have now set 29inch bike to 27inch on VLCD5 and both bikes show same speed. I know this is not correct fix but is working for now. Is this because I have VLCD5 display and need to change value at 0x004008 and/or 0x004009? How do the data values relate to wheel perimeter? After changing the value on VLCD5 I have looked at the Data Memory but the values do not change, is this correct?

Do you have a document that explains in more detail what each line of the Data Memory is for, example, why are there 2 lines for Battery Low Voltage, Wheel perimeter and Battery resistance, how does the program use battery resistance? What do you mean by bit0 bit1 bit2??

I apologise if I have too many questions :oops:

But I find your work very interesting and want to understand more.

Thank you for your work on this project :bigthumb:

User avatar
ashrambo   1 W

1 W
Posts: 55
Joined: Apr 30 2018 4:31am
Location: Madrid
Contact:

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by ashrambo » Jan 29 2019 7:26am

grecoa wrote:@marcoq
Hi Marcoq

I like the work you have done with the firmware from Casainho and others so that it can be used with stock LCD.
I have 2x TSDZ2 36v 350w with VLCD5 display and was a little disappointed with performance (sometimes erratic power delivery) from original firmware, but I do not really need all the advanced features of LCD3 and when I get my setting OK I will not want to adjust them when out riding.
Unfortunately I can not get your configerator to work, I am not a programmer but am happy to load Hex file and edit values using StLink and this is what I have done.

I have uploaded your latest Hex file and have needed to edit the Data Memory in order for it to work correctly. It was difficult for me to understand all of the data values in your document, so I guessed some items and used Default for most and now my bikes are working.
There are some problems with speed indication, I have 2 bikes one 26inch wheel and one 29inch wheel. I set the VLCD5 on each bike to 26inch and 29inch. 26inch speed I think is OK but 29inch is 1.5mph higher than 26inch?? I have now set 29inch bike to 27inch on VLCD5 and both bikes show same speed. I know this is not correct fix but is working for now. Is this because I have VLCD5 display and need to change value at 0x004008 and/or 0x004009? How do the data values relate to wheel perimeter? After changing the value on VLCD5 I have looked at the Data Memory but the values do not change, is this correct?

Do you have a document that explains in more detail what each line of the Data Memory is for, example, why are there 2 lines for Battery Low Voltage, Wheel perimeter and Battery resistance, how does the program use battery resistance? What do you mean by bit0 bit1 bit2??

I apologise if I have too many questions :oops:

But I find your work very interesting and want to understand more.

Thank you for your work on this project :bigthumb:
Look my excel, I have calculated the wheel circumference in milimeters and I put into the data memory. (DEC TO HEX)

Enviado desde mi SM-G950 mediante Tapatalk


Last edited by ashrambo on Jan 29 2019 7:26am, edited 1 time in total.
TREK REMEDY MOTOR TSDZ2

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 29 2019 8:41am

ashrambo
:thumb:

kh42539o   1 µW

1 µW
Posts: 4
Joined: Jan 29 2019 11:11am

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by kh42539o » Jan 29 2019 11:36am

Sorry if I'm hijacking this thread. Please delete or move if this is the wrong spot. I have two questions:

1) Is it possible to set up the OS firmware to increase amps as motor load approaches 100%?

Example: Start at a baseline amps level of 10A with pedal assist. The software can monitor the signal from the torque sensor and as the load on the system approaches 100% (for instance, going uphill), automatically increase amps until, say, 15A, to get more watts. Then gradually reduce amps to baseline as they are not needed.

2) Would such a system result in lower average temperature than running 15A at all times? (even when not needed)

These questions may well make no sense cause this is my first build. Thanks in advance.
Last edited by kh42539o on Jan 29 2019 1:39pm, edited 1 time in total.

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 29 2019 11:55am

ashrambo

Thank you, I have looked at your excel. My wheel perimeter is 2170mm can you tell me how to convert 2170 to the correct Hex code?
Also, do I need to change lines 0x004011 and 0x004012 Default Value VLCD6 Wheel Speed Factor ??? It may be Wheel Speed Factor that is used to convert the signal from the wheel speed sensor to the correct speed ??? VLCD5 may not be same as VLCD6 ?

User avatar
ashrambo   1 W

1 W
Posts: 55
Joined: Apr 30 2018 4:31am
Location: Madrid
Contact:

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by ashrambo » Jan 29 2019 3:44pm

Look at my excel. cell E17: row 17 column E. Put your diameter there and the cells F17 and the cell F18 will show you the numbers to put in stvp.

I calculated my circumference: 2114, because my wheel is 26x2.35 (ERTRO 57-559) and it has a circumference of 2114mm (559+2x57x3,1416). This number in hex is 0842, I put 0x004007 WHEEL_PERIMETER_0=42 and 0x004008 WHEEL_PERIMETER_1=08

2179 in hex is 0883 0x004007=83 and 0x004008=08


Last edited by ashrambo on Jan 29 2019 3:44pm, edited 3 times in total.
TREK REMEDY MOTOR TSDZ2

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 30 2019 4:07am

ashrambo
Thank you for your help. :thumb:
I know you are from Spain and English is not your first language. Your English is very good (much better than my Spanish :oops: )

Please do not be offended if I try to correct something.
The perimeter of the wheel is called the "Circumference"
The Diameter is the distance across the center of the wheel.

To calculate the circumference of my wheel I start with the valve at the bottom and mark the position with chalk on the floor, then I move forward one turn of the wheel and mark the floor again. When I measure the distance it is 2170mm. I find that this method works well for all different tyres that can be on the wheel. When I convert 2170 to Hex I get 087A. So in line 0x004007 I should put "7A" ? Is this correct?

I will give it a try.

User avatar
ashrambo   1 W

1 W
Posts: 55
Joined: Apr 30 2018 4:31am
Location: Madrid
Contact:

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by ashrambo » Jan 30 2019 5:34am

grecoa wrote:ashrambo
Thank you for your help. :thumb:
I know you are from Spain and English is not your first language. Your English is very good (much better than my Spanish :oops: )

Please do not be offended if I try to correct something.
The perimeter of the wheel is called the "Circumference"
The Diameter is the distance across the center of the wheel.

To calculate the circumference of my wheel I start with the valve at the bottom and mark the position with chalk on the floor, then I move forward one turn of the wheel and mark the floor again. When I measure the distance it is 2170mm. I find that this method works well for all different tyres that can be on the wheel. When I convert 2170 to Hex I get 087A. So in line 0x004007 I should put "7A" ? Is this correct?

I will give it a try.
You are right. 4007=7A 4008=08

Enviado desde mi SM-G950 mediante Tapatalk


TREK REMEDY MOTOR TSDZ2

zappan   10 W

10 W
Posts: 68
Joined: Sep 27 2018 3:00am
Location: Sicilia

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by zappan » Jan 30 2019 6:00am

Hello grecoa, to change the diameter of the wheel I report what was said by Marcoq to my question to configure with STVP in the Data Memory the values of a wheel 27.5:
Hi Zappan.
The circumference of a 27.5 corresponds to 2200mm, translated in hexadecimal equals 0x0898, ie 0x08 (dec 8) for the high byte and 0x98 (dec 152) for the low byte .... therefore in the location 0x004007 of the eeprom you have to write 98 and in the location 0x004008 you have to write 08 (it should already be so)

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 30 2019 12:07pm

Thank you zappan
I now understand what to put in Lines 0x004007 and 0x004008 :thumb:

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 30 2019 12:09pm

zapan
I was born in and live in England, but my parents are from Sicilia near Catania :bigthumb:

zappan   10 W

10 W
Posts: 68
Joined: Sep 27 2018 3:00am
Location: Sicilia

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by zappan » Jan 31 2019 5:04am

I'm glad I'm from the province of Catania, a village on Etna :D

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Jan 31 2019 8:53am

I have family in Zafferana Etnea, Aci Sant'Antonio, Linera and Pozzillo :D

zappan   10 W

10 W
Posts: 68
Joined: Sep 27 2018 3:00am
Location: Sicilia

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by zappan » Jan 31 2019 4:11pm

I live in Pedara :D

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Feb 01 2019 3:39am

zappan wrote:
Jan 31 2019 4:11pm
I live in Pedara :D
:bigthumb:

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Feb 02 2019 11:49am

We have just done 26 mile ride and have noticed some slight issues.
Sometimes (doesn't feel like it does it always), when pedaling under light load it feels like there is a slight resistance coming from the motor? If I increase the pressure on the pedals I can feel the motor cut in and give assistance. It may be that under light pedal force the motor is not assisting but is adding some resistance to pedaling?
Is this normal?
Also the battery capacity indicator first dropped 1 bar at a time until 3 bars then changed between 3 and 1 bar for rest of journey?
is this to be expected??

Have others had these issues?

thineight   100 W

100 W
Posts: 228
Joined: Oct 05 2018 3:53am

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by thineight » Feb 02 2019 12:07pm

If you have the VLCD5 is normal, the code was written for the VLCD6 which has less bars in the indicator, therefore to keep the same code (marcoq does not have the VLCD5 and he can't try it out) he sorted by dropping 2 bars at the second and third drop.
You will see (full - lose 1 bar - lose 2 bars - lose 2 bars - empty).
Perhaps marcoq will receive a VLCD5 from another user to try to fix the (minor) issue.
MTB KTM Ultra 29" - City bike DAYTONA 28"

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Feb 02 2019 12:41pm

thineight wrote:
Feb 02 2019 12:07pm
If you have the VLCD5 is normal, the code was written for the VLCD6 which has less bars in the indicator, therefore to keep the same code (marcoq does not have the VLCD5 and he can't try it out) he sorted by dropping 2 bars at the second and third drop.
You will see (full - lose 1 bar - lose 2 bars - lose 2 bars - empty).
Perhaps marcoq will receive a VLCD5 from another user to try to fix the (minor) issue.
Thank you
Makes sense

dameri   100 W

100 W
Posts: 146
Joined: Sep 20 2018 10:57am

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by dameri » Feb 03 2019 3:04am

grecoa wrote:
Feb 02 2019 11:49am
We have just done 26 mile ride and have noticed some slight issues.
Sometimes (doesn't feel like it does it always), when pedaling under light load it feels like there is a slight resistance coming from the motor? If I increase the pressure on the pedals I can feel the motor cut in and give assistance. It may be that under light pedal force the motor is not assisting but is adding some resistance to pedaling?
Is this normal?
Also the battery capacity indicator first dropped 1 bar at a time until 3 bars then changed between 3 and 1 bar for rest of journey?
is this to be expected??

Have others had these issues?
I had same issues and also hard pedalling motor give back some resistance when I was riding with stock firmware. It was wery annoying.
All was gone when I installed new firmware and KT-LCD3.

grecoa   100 mW

100 mW
Posts: 45
Joined: Nov 18 2018 4:51am
Location: UK S.Yorks

Re: Tsdz2 firmware open souce adapted to vlcd5

Post by grecoa » Feb 03 2019 4:31am

dameri wrote:
Feb 03 2019 3:04am
grecoa wrote:
Feb 02 2019 11:49am
We have just done 26 mile ride and have noticed some slight issues.
Sometimes (doesn't feel like it does it always), when pedaling under light load it feels like there is a slight resistance coming from the motor? If I increase the pressure on the pedals I can feel the motor cut in and give assistance. It may be that under light pedal force the motor is not assisting but is adding some resistance to pedaling?
Is this normal?
Also the battery capacity indicator first dropped 1 bar at a time until 3 bars then changed between 3 and 1 bar for rest of journey?
is this to be expected??

Have others had these issues?
I had same issues and also hard pedalling motor give back some resistance when I was riding with stock firmware. It was wery annoying.
All was gone when I installed new firmware and KT-LCD3.
Is anyone having similar issue with marcoq software and VLCD5?

Post Reply