Tsdz2 firmware open source adapted to vlcd5, vlcd6 and xh18

Unfortunately I did not manage to modify the cooling system. But I could test the new Github version. Now the display and limit function works as intended :D Thanks a lot! Also the overrun fix works great.

But... I think your E06 fix is not that good, because the error code (when reaching the MOTOR_TEMPERATURE_X_VALUE_LIMIT ) blocks the display and you can't see or adjust anything else. A short announcement would be better.

And another problem: after displaying another value (e.g. temperature) the current speed is often not displayed for a while. Instead, the display shows only "0.00" for some minutes.

Apart from that, the firmware is a lot of fun! :D
 
bingo5 said:
And another problem: after displaying another value (e.g. temperature) the current speed is often not displayed for a while. Instead, the display shows only "0.00" for some minutes.

If I recall correctly that is a feature. Since the speedometer is used to display values, the odometer gets wrong values, so the speedometer stays 0 for a while to compensate.
 
flufferty said:
If I recall correctly that is a feature. Since the speedometer is used to display values, the odometer gets wrong values, so the speedometer stays 0 for a while to compensate.
That makes sense. Thanks, then I'll turn off the compensation.
 
bingo5 said:
Unfortunately I did not manage to modify the cooling system. But I could test the new Github version. Now the display and limit function works as intended :D Thanks a lot! Also the overrun fix works great.

But... I think your E06 fix is not that good, because the error code (when reaching the MOTOR_TEMPERATURE_X_VALUE_LIMIT ) blocks the display and you can't see or adjust anything else. A short announcement would be better.

And another problem: after displaying another value (e.g. temperature) the current speed is often not displayed for a while. Instead, the display shows only "0.00" for some minutes.

Apart from that, the firmware is a lot of fun! :D
All error codes block the use of the display because I have given them priority, it is a problem I know and I have already solved, the change will be in the next version.
For the odometer they have already answered.
The display always interprets the data received as speed and increases the odometer even when the bike is stationary, the speed remains at zero until the added kilometers are compensated.
If the accuracy of the kilometers is not important to you and you prefer to see the speed immediately, you must set ENABLE_ODOMETER_COMPENSATION to zero.
Well, I'm happy to hear that "fix overrun" works.
 
mbrusa said:
I attach the correct files, if you can update GitHub

A question to all users: is it still valuable to have the java configurator? To be honest, I don't feel like updating my repo with mbrusa's developments all the time.
I think it's confusing for unexperienced users to have one version without the configurator from various zip-files published in the forums and one with the configurator from github...

regards
stancecoke
 
just done my first firmware with marcos software all seem to be ok apart from my throttle no longer works I have enabled it to 1 in advanced settings but do I also have to enable the assist without peddaling on the main screen.
cheers
 
stancecoke said:
mbrusa said:
I attach the correct files, if you can update GitHub

A question to all users: is it still valuable to have the java configurator? To be honest, I don't feel like updating my repo with mbrusa's developments all the time.
I think it's confusing for unexperienced users to have one version without the configurator from various zip-files published in the forums and one with the configurator from github...

regards
stancecoke

For me its verry helpfull to have the java configurator. Thank you mr. Stancecoke for making that great tool! :wink:
After MarcoQ took a breake it was nice to see that you and Mbrussa did put time and energy into this project for all TSDZ2 users worldwide.
I hope you both will continue to do this for people like me.

:thumb: Many, many thanks fot that! :thumb:
 
Hi mbrusa,

I plan to add the overrun fix to the LCD3 version.
LE: I noticed in lcd3 thread taht you already did it :). But my question still stands.

I noticed that in case of STANDARD_MODE there is
Code:
// for overrun problem
ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 4));
and in case of ADVANCED_MODE there is
Code:
// for overrun problem
ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 2));

Can you please explain?

Thanks,
Max.
 
Hi i have updated my firmware with the latest one everything seems to work except my throttle which i like to use i have tried altering the settins in the advanced txt file from zero to one but with no job any help much appreciated i have a tsdz2 48v
 
maximusdm said:
Hi mbrusa,

I plan to add the overrun fix to the LCD3 version.
LE: I noticed in lcd3 thread taht you already did it :). But my question still stands.

I noticed that in case of STANDARD_MODE there is
Code:
// for overrun problem
ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 4));
and in case of ADVANCED_MODE there is
Code:
// for overrun problem
ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 2));

Can you please explain?

Thanks,
Max.
Hi maximusdm
If you only ask this question I think you understand the rest of the change.
Synthesizing.
To minimize the overrun time I had to add another control method for stationary pedals, and above all I had to put all the code in motor.c inside the PWM cycle function that runs every 64us (first, part of the code was in ebike_app.c which runs every 0.1 sec).
"ui16_cadence_sensor_ticks" is the number of pulses, at the PWM frequency, between one step of the cadence sensor and the next, and is inversely proportional to the speed.
"ui16_cadence_sensor_ticks_counter" is the counter of these impulses, when the pedal stops the counter does not immediately reset, continues to count.
When it reaches the value of "ui16_cadence_sensor_ticks_stop" the padals are considered stationary.
"ui16_cadence_sensor_ticks_stop" is calculated with the last valid value of "ui16_cadence_sensor_ticks" by adding an extra number of pulses.
To establish how proportionally the number of extra pulses must be, I have not made any calculations, I have obtained the optimal values ​​experimentally.

Optimal value detected in standard mode
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 4));"
equivalent to (ui16_cadence_sensor_ticks * 1.06)

Optimal value detected in advanced mode
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 2));"
equivalent to (ui16_cadence_sensor_ticks * 1.25)

The calculation factor of the extra pulses is different in the two modes because the value of "ui16_cadence_sensor_ticks" is different, at the same speed, in advanced mode it is on average the half of the standard one.
I want to highlight that by increasing the calculated value of "ui16_cadence_sensor_ticks_stop", increases the overrun time, decreasing it lacks startup assistance.
I had reports of too fast stops and a case of lack startup assistance.
For this reason, in the next full version I will slightly increase the calculated values.
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 3)));" in standard mode,
"ui16_cadence_sensor_ticks_stop = (ui16_cadence_sensor_ticks + (ui16_cadence_sensor_ticks >> 1));" in advanced mode,
or maybe I'll add editable parameters in the config.h file.
 
Suggy said:
Hi i have updated my firmware with the latest one everything seems to work except my throttle which i like to use i have tried altering the settins in the advanced txt file from zero to one but with no job any help much appreciated i have a tsdz2 48v
With the latest version, on the Italian forum I had confirmation that the throttle works.
Do you use it in street mode? By default it is enabled only in offroad mode.
To enable it also in street mode, set STREET_MODE_THROTTLE_ENABLED to 1.
 
Can you point me in the right direction to the latest software and firmware in case i am using the wrong one cheers
 
Suggy said:
Can you point me in the right direction to the latest software and firmware in case i am using the wrong one cheers
The version on stancecoke github is the latest version with overrunfix and corrected temperature reading.
The difference between mbrusa's version and the one on github is the configurator for basic settings, that is missing with mbrusa's version. Meaning that you must use an text editor for all settings with mbrusa's and only the advanced settings with stancecoke's.
 
Suggy said:
Thank you so which version should i use lol
That is on you, both are equal, but stancecoke has all repair inside his distribution and with mbrusa you must replace some files.
 
I am now trying the stancoke version from github but getting this error when flashing
8A2BB321-1628-4325-B53C-EA8954940099.jpeg
 
Suggy said:
but getting this error when flashing

Have you read the wiki? It is obvious, that the STVP_CmdLine.exe is in the wrong folder. It has to be in

C:\STMicroelectronics\st_toolset\stvp

Or you have to set the correct path in the flash.bat.

regards
stancecoke
 
Finally got it to work flashing i have tried all setting using the latest firmware but throttle still does not work can someone post an image of there settings in the advanced so i can compare
 
Suggy said:
Finally got it to work flashing i have tried all setting using the latest firmware but throttle still does not work can someone post an image of there settings in the advanced so i can compare
Have you read the guide and manual?
Have you enabled throttle and brake sensor?

#define ENABLE_BRAKE_SENSOR 1
#define ENABLE_THROTTLE 1
#define ENABLE_TEMPERATURE_LIMIT 0
 
Just an update finally working throttle i had not enabled brake sensor doh
Sorry to everyone being a pain
 
Finally my tsdz2 bike works from a fresh battery charge but ime getting the error on screen E0 8 which is battery over voltage will this do some harm to the motor if i use the bike until the voltage drops from use.
Before the firmware update the motor would struggle to get going until the voltage dropped.
 
Suggy said:
Finally my tsdz2 bike works from a fresh battery charge but ime getting the error on screen E0 8 which is battery over voltage will this do some harm to the motor if i use the bike until the voltage drops from use.
Before the firmware update the motor would struggle to get going until the voltage dropped.
Suggy do not think I understand correctly, perhaps because of the translation.
First I will explain E08 then you will confirm me.
Error E08 "overvoltage" is displayed when the battery voltage detected by the controller is higher than expected. The comparison voltage is calculated with BATTERY_CELLS_NUMBER (13 for 48V motor) multiplied LI_ION_CELL_OVERVOLT (4.30 V), if the voltage measured by the controller exceeds this value, the error occurs. It is used only to verify that the number of cells corresponds to that of the connected battery. Check in the advanced.h file the number of cells inserted, if it is correct you can increase the value of LI_ION_CELL_OVERVOLT to 4.35.
It would be better to change the adc conversion factor of the voltage, but it is more complicated.
This error does not limit the operation of the motor, it better explains the problem encountered.
 
Back
Top