TSDZ2 mid drive with 860C, 850C or SW102 displays only -- Flexible OpenSource firmware (Casainho code only)

Finalmente sono riuscito a capire perché ci sono differenze di potenza tra motore, ho tre motori che uso, ma solamente uno eroga potenza da vendere, questa cosa non riuscivo proprio ad accettare, oggi grazie a Mbrusa che ha permesso di leggere il valore del sensore di torque posso affermare che i motori sono tutti uguali ma la differenza la fa la lettura del sensore che poi trasmette i dati alla centralina e di conseguenza eroga potenza.
La potenza che poi riscontriamo quando si utilizza la bici, e ci fa capire le differenze di spinta tra motori.
Vi posto quattro foto,
due dove si legge il valore a pedali orizzontali a vuoto,
e due in piedi sui pedali imprimendo la forza massima.
Ovviamente il sensore che legge 99.3 eroga molta potenza.
@ Casainho,
secondo la tua esperienza
è corretto che con 99.3 il motore raddoppia la potenza?
Grazie
 

Attachments

  • S91225-093112.jpg
    S91225-093112.jpg
    61.1 KB · Views: 2,920
  • S91225-093130.jpg
    S91225-093130.jpg
    87.9 KB · Views: 2,920
  • S91225-093207.jpg
    S91225-093207.jpg
    69.8 KB · Views: 2,920
Finally I managed to understand why there are differences in power between the engine, I have three engines that I use, but only one delivers power to sell, this thing I just could not accept, today thanks to Mbrusa who allowed to read the sensor value of torque I can say that the motors are all the same but the difference is made by reading the sensor which then transmits the data to the control unit and consequently delivers power.
The power that we then find when using the bike, and makes us understand the differences in thrust between engines.
I'll post four photos,
two where the value is read with horizontal empty pedals,
and two standing on the pedals imparting maximum force.
 
chri27.5 said:
read the sensor value of torque I can say that the motors are all the same but the difference is made by reading the sensor which then transmits the data to the control unit and consequently delivers power.
I almost finished the new firmware version where user can read on the 850C display the torque sensor value and then calibrate it.

I am being calibrating my ebikes and using this calibration since a few months ago. I will write a wiki page with my experience, trying to make the calibration process simplified as it involves using a scale that most users may not have at home.

Also users will then be able to evaluate and understand/profile their torque sensors, which is something that no one is doing until now.
 
famichiki said:
I'm checking my torque sensor on the VLCD5 ....
....
Below are the results from a quick test.

Code:
0kg    14
10kg   35
20kg   90
....
It is not clear if this are readed display values or already calculated values.
The differences with the wiki values are large. (calculated or not)

mbrusa had made an update that doesn't need the calaculation anymore (see vlcd5 thread)
 
casainho said:
chri27.5 said:
read the sensor value of torque I can say that the motors are all the same but the difference is made by reading the sensor which then transmits the data to the control unit and consequently delivers power.
I almost finished the new firmware version where user can read on the 850C display the torque sensor value and then calibrate it.

I am being calibrating my ebikes and using this calibration since a few months ago. I will write a wiki page with my experience, trying to make the calibration process simplified as it involves using a scale that most users may not have at home.

Also users will then be able to evaluate and understand/profile their torque sensors, which is something that no one is doing until now.

Hi casainho,
the values ​​shown in the photo on the vlcd5 display measure empty with horizontal pedals 51.8
standing with the maximum force measured 99.3
this engine has an incredible power that I never understood why, I have two other engines but their power and almost 40% less, today I can say that the motivation is due to the sensor readings.
I wanted you to confirm this, the values ​​shown are measured at 10bit,
I read the wiki (how to calibrate the stress sensor) what is the movement that allows you to move the sensor?
The game between tree and compass?
Thank you
 
Elinx said:
famichiki said:
I'm checking my torque sensor on the VLCD5 ....
....
Below are the results from a quick test.

Code:
0kg    14
10kg   35
20kg   90
....
It is not clear if this are readed display values or already calculated values.
The differences with the wiki values are large. (calculated or not)

mbrusa had made an update that doesn't need the calaculation anymore (see vlcd5 thread)

Hi Elinx,
Mbrusa with the latest modification released used the same conversion of casainho, just to compare them in the same way.
 
chri27.5 said:
.....
Mbrusa with the latest modification released used the same conversion of casainho, just to compare them in the same way.
Yes, I know and have already linked to it. :)
 
Elinx said:
It is not clear if this are readed display values or already calculated values.
The differences with the wiki values are large. (calculated or not)

mbrusa had made an update that doesn't need the calaculation anymore (see vlcd5 thread)

I'm posting here instead of the VLCD5 thread to hopefully get input from the original developers.

The original version of v0.19 appears to send the value in ui16_pedal_torque_x10 to the display, so if we wanted to compare with the wiki why wouldn't we send the same to the VLCD5? Is the wiki page based on v0.19? I easily did that as an error code.

https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/How-to-calibrate-the-torque-sensor

This is the original code, but I'm just sending the same. I don't understand why additional calculations would be needed.

Code:
// ui16_pedal_torque_x10
ui8_tx_buffer[22] = (uint8_t) (ui16_pedal_torque_x10 & 0xff);
ui8_tx_buffer[23] = (uint8_t) (ui16_pedal_torque_x10 >> 8);

Mbrusa appears to be displaying using the speedometer instead.

Under normal circumstances it displays ui16_adc_read_torque_sensor_10b() / 10 but then there is a commented 'test torque' section where it ui8_torque_sensor * 10 or ui8_torque_sensor_filtered * 10.

So which should be be using and how can we be sure these are comparable to what the original v0.19 displays?

Code:
// alternative data
ui8_oem_wheel_diameter = ui8_rx_buffer[3]; // min valid value 21" oem display setting!
ui16_alternative_display_factor = OEM_WHEEL_FACTOR * ui8_oem_wheel_diameter; // for Km/h oem display setting!

ui16_alternative_display_array[0] =  (uint16_t) ui16_alternative_display_factor / configuration_variables.ui8_motor_temperature;
ui16_alternative_display_array[1] =  (uint16_t) ui16_alternative_display_factor / (ui16_battery_SOC_percentage_x10 / 10);
ui16_alternative_display_array[2] =  (uint16_t) ui16_alternative_display_factor / (ui16_battery_voltage_x10 / 10);
ui16_alternative_display_array[3] =  (uint16_t) ui16_alternative_display_factor / (ui16_adc_read_torque_sensor_10b() / 10);

// test torque
//ui16_alternative_display_array[0] =  (uint16_t) ui16_alternative_display_factor / configuration_variables.ui8_assist_level_factor_x10;
//ui16_alternative_display_array[1] =  (uint16_t) ui16_alternative_display_factor / ui8_torque_sensor * 10;
//ui16_alternative_display_array[0] =  (uint16_t) ui16_alternative_display_factor / ui8_torque_sensor_filtered * 10;
//ui16_alternative_display_array[0] =  (uint16_t) ui16_alternative_display_factor / ui8_pas_cadence_rpm;

// test power
//ui16_alternative_display_array[0] =  (uint16_t) ui16_alternative_display_factor / (ui16_battery_power_x10 / 100);
//ui16_alternative_display_array[1] =  (uint16_t) ui16_alternative_display_factor / (ui16_battery_SOC_percentage_x10 / 10);
//ui16_alternative_display_array[2] =  (uint16_t) ui16_alternative_display_factor / (ui16_battery_voltage_x10 / 10);
//ui16_alternative_display_array[2] =  (uint16_t) ui16_alternative_display_factor / (ui8_battery_current_x10 / 10);

ui8_tx_buffer[6] = (uint8_t) (ui16_alternative_display_array[ui8_alternative_display_index] & 0xFF);
ui8_tx_buffer[7] = (uint8_t) (ui16_alternative_display_array[ui8_alternative_display_index] >> 8);

Edit: Just installed Mbrusa's firmware and got these readings.

Code:
0kg    18
10kg   23
20kg   27
 
Hi casainho, what is the conversion factor between the v.19 torque reading shown on the wiki about sensor calibration (desirable rest value around 30-35) and the values shown in the charts shown few days ago (rest value about 280)?
It is just x10 or is there any 8/10 bit ratio?
Many thanks.
 
Although I am careful, this time my motor controller did burn in a very ugly way while I was developing...

2019-12-26-17-24-39-2.jpg


This is way I want to keep my focus because I can´t do more so I do not answer to the many questions unless they bring value for my current development. I simple can´t do support and keep developing and improving.
 
Here is the new firmware version with torque sensor full calibration (for 850C display only and TSDZ2 motor controller -- sorry, we have currently an issue with SW102 firmware).

Download here both firmware: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.6.0

On next days I will update the wiki page with instructions but for now here is a short resume:

Using calibration is option, it can be disabled and the system will works as previously.

To calibrate:
- go to Technical configuration menu to see torque sensor ADC value in real time
- use weights, your own known weight, weight from other members of your family or friends (mainly others with different value), put them on each pedal only (the pedal must be parallel to the ground)
- take note of each weight value and ADC value
- choose 8 points, first one with 0 weight value and last one with your weight
- use a calc sheet on as seen on the next image. Draw a graph and choose the other 6 points near the knee zone as seen on the graph and not on flat zones. You can extrapolate some points if you don´t have the weights, follow the curve on the graph but try to validate with real measurements:

Screenshot-from-2019-12-27-18-11-25.png


- go to Torque sensor configuration menu and input the data of each point: weight and ADC value

How to use:
- everyime you startup the system, the pedals need to be vertical pointing to ground. You can select on Configurations to be left or right pedal to point to ground at startup, based on your preferences. This is needed to the system can know in which pedal are you doing the force with your legs, since the weight is measured differently on each pedal due to the torque sensor.

Boot screen showing TSDZ2 and 850C display firmware versions:
71526683-e5fb1480-28cf-11ea-812d-6c6a2ab60d6f.jpg


Torque sensor calibration table:
71526681-e5fb1480-28cf-11ea-977d-ddf80a2db734.jpg


Seeing and validating the pedal side as also the weight measured on the pedals:
71526680-e5fb1480-28cf-11ea-854b-c7a2b70390a0.jpg
 
Hi,
I updated motor firmware, and display.
On my display is not showing motor-firmware version, is "waiting for TSDZ2" and after that shows main screen, without 0.50.0.

I cant test ride now, because is snow, and below 0 degrees C. Odometer again reseting after poweroff.

Best regards.
 
I tried to calibrate the torque sensor. 160 was the value. But I don't get the value under 60. Even when I have completely removed the sensor.


Mfg Michael
 
redwater said:
Hi,
I updated motor firmware, and display.
On my display is not showing motor-firmware version, is "waiting for TSDZ2" and after that shows main screen, without 0.50.0.

I cant test ride now, because is snow, and below 0 degrees C. Odometer again reseting after poweroff.

Best regards.
You need to keep on/off button pressed to see the motor firmware version. But there is no need to do this step.

The new feature on this version is the torque sensor full calibration and that you can do inside house. Only after it is calibrated and you did the validation, then you should a test ride.

Yes, there are the previous features missing because by mistake, I did develop this new feature on top of an old version of the firmware... Next I will recover all the previous features.
 
casainho said:
Here is the new firmware version with torque sensor full calibration (for 850C display only and TSDZ2 motor controller -- sorry, we have currently an issue with SW102 firmware).

Download here both firmware: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.6.0

On next days I will update the wiki page with instructions but for now here is a short resume:

Using calibration is option, it can be disabled and the system will works as previously.

To calibrate:
- go to Technical configuration menu to see torque sensor ADC value in real time
- use weights, your own known weight, weight from other members of your family or friends (mainly others with different value), put them on each pedal only (the pedal must be parallel to the ground)
- take note of each weight value and ADC value
- choose 8 points, first one with 0 weight value and last one with your weight
- use a calc sheet on as seen on the next image. Draw a graph and choose the other 6 points near the knee zone as seen on the graph and not on flat zones. You can extrapolate some points if you don´t have the weights, follow the curve on the graph but try to validate with real measurements:

Screenshot-from-2019-12-27-18-11-25.png


- go to Torque sensor configuration menu and input the data of each point: weight and ADC value

How to use:
- everyime you startup the system, the pedals need to be vertical pointing to ground. You can select on Configurations to be left or right pedal to point to ground at startup, based on your preferences. This is needed to the system can know in which pedal are you doing the force with your legs, since the weight is measured differently on each pedal due to the torque sensor.

Boot screen showing TSDZ2 and 850C display firmware versions:
71526683-e5fb1480-28cf-11ea-812d-6c6a2ab60d6f.jpg


Torque sensor calibration table:
71526681-e5fb1480-28cf-11ea-977d-ddf80a2db734.jpg


Seeing and validating the pedal side as also the weight measured on the pedals:
71526680-e5fb1480-28cf-11ea-854b-c7a2b70390a0.jpg


Is the 0.50 comparable to the 0.20?

Mfg Michael
 
michih. said:
Is the 0.50 comparable to the 0.20?
Very different each one.
 
I prepared a google file and I am sharing it so it is easier for everyone make the graphs. You will only need to edit own measured values on the tables:

Screenshot-from-2019-12-28-10-33-41.png


Here is the link to google file: https://docs.google.com/spreadsheets/d/1OwM1yURzHkPsrL9uz8oNlX6FHGzw_nr2TolGgUH9oy4/edit?usp=sharing

I had to calibrate again my torque sensor because I found the values were wrong... seems that after I burned the motor controller and changed it, the torque sensor values were different!! Or maybe it was any other maintenance I did recently that for some reason changed the torque sensor values...


casainho said:
Here is the new firmware version with torque sensor full calibration (for 850C display only and TSDZ2 motor controller -- sorry, we have currently an issue with SW102 firmware).

Download here both firmware: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.6.0

On next days I will update the wiki page with instructions but for now here is a short resume:

Using calibration is option, it can be disabled and the system will works as previously.

To calibrate:
- go to Technical configuration menu to see torque sensor ADC value in real time
- use weights, your own known weight, weight from other members of your family or friends (mainly others with different value), put them on each pedal only (the pedal must be parallel to the ground)
- take note of each weight value and ADC value
- choose 8 points, first one with 0 weight value and last one with your weight
- use a calc sheet on as seen on the next image. Draw a graph and choose the other 6 points near the knee zone as seen on the graph and not on flat zones. You can extrapolate some points if you don´t have the weights, follow the curve on the graph but try to validate with real measurements:

Screenshot-from-2019-12-27-18-11-25.png


- go to Torque sensor configuration menu and input the data of each point: weight and ADC value

How to use:
- everyime you startup the system, the pedals need to be vertical pointing to ground. You can select on Configurations to be left or right pedal to point to ground at startup, based on your preferences. This is needed to the system can know in which pedal are you doing the force with your legs, since the weight is measured differently on each pedal due to the torque sensor.

Boot screen showing TSDZ2 and 850C display firmware versions:
71526683-e5fb1480-28cf-11ea-812d-6c6a2ab60d6f.jpg


Torque sensor calibration table:
71526681-e5fb1480-28cf-11ea-977d-ddf80a2db734.jpg


Seeing and validating the pedal side as also the weight measured on the pedals:
71526680-e5fb1480-28cf-11ea-854b-c7a2b70390a0.jpg
 
I updated the firmware to my wife bicycle and then I calibrated the torque sensor. This is an old motor compared to the motor of my bicycle, where I already changed the torque sensor, the motor controller, etc for ones I bought recently.

So, as I already measured, the torque sensor of my wife TSDZ2 is way better than my torque sensor, here the comparison:

My TSDZ2 torque sensor:
Screenshot-from-2019-12-28-10-33-41.png


My wife TSDZ2 torque sensor:


My notes:
1. One torque sensor is kind of linear only up to 15 kgs while other up to 45 kgs. The rate/sensitivity are the same for both on this "linear" zone but clearly mine lacks resolution because this zone is very short. I can do peaks of 40 or 60 kgs on my pedals without taking my but from the saddle.

2. One torque sensor seems to measure the similar values for both left and right pedals while the other does not (the left pedal has lower sensitivity).

3. The one that is worst on 1. is also worst on 2. So, clearly there are torque sensors that are worst than the others.

I will put all this information on the wiki, when I will write the page about torque sensor full calibration.


casainho said:
I prepared a google file and I am sharing it so it is easier for everyone make the graphs. You will only need to edit own measured values on the tables:

Screenshot-from-2019-12-28-10-33-41.png


Here is the link to google file: https://docs.google.com/spreadsheets/d/1OwM1yURzHkPsrL9uz8oNlX6FHGzw_nr2TolGgUH9oy4/edit?usp=sharing

I had to calibrate again my torque sensor because I found the values were wrong... seems that after I burned the motor controller and changed it, the torque sensor values were different!! Or maybe it was any other maintenance I did recently that for some reason changed the torque sensor values...


casainho said:
Here is the new firmware version with torque sensor full calibration (for 850C display only and TSDZ2 motor controller -- sorry, we have currently an issue with SW102 firmware).

Download here both firmware: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.6.0

On next days I will update the wiki page with instructions but for now here is a short resume:

Using calibration is option, it can be disabled and the system will works as previously.

To calibrate:
- go to Technical configuration menu to see torque sensor ADC value in real time
- use weights, your own known weight, weight from other members of your family or friends (mainly others with different value), put them on each pedal only (the pedal must be parallel to the ground)
- take note of each weight value and ADC value
- choose 8 points, first one with 0 weight value and last one with your weight
- use a calc sheet on as seen on the next image. Draw a graph and choose the other 6 points near the knee zone as seen on the graph and not on flat zones. You can extrapolate some points if you don´t have the weights, follow the curve on the graph but try to validate with real measurements:

Screenshot-from-2019-12-27-18-11-25.png


- go to Torque sensor configuration menu and input the data of each point: weight and ADC value

How to use:
- everyime you startup the system, the pedals need to be vertical pointing to ground. You can select on Configurations to be left or right pedal to point to ground at startup, based on your preferences. This is needed to the system can know in which pedal are you doing the force with your legs, since the weight is measured differently on each pedal due to the torque sensor.

Boot screen showing TSDZ2 and 850C display firmware versions:
71526683-e5fb1480-28cf-11ea-812d-6c6a2ab60d6f.jpg


Torque sensor calibration table:
71526681-e5fb1480-28cf-11ea-977d-ddf80a2db734.jpg


Seeing and validating the pedal side as also the weight measured on the pedals:
71526680-e5fb1480-28cf-11ea-854b-c7a2b70390a0.jpg
 
casainho said:
My notes:
1. One torque sensor is kind of linear only up to 15 kgs while other up to 45 kgs. The rate/sensitivity are the same for both on this "linear" zone but clearly mine lacks resolution because this zone is very short. I can do peaks of 40 or 60 kgs on my pedals without taking my but from the saddle.

Casainho, do you think that the response of your torque sensor can improve similarly to your wife's one if you do the hardware calibration mentioned in the wiki?
I have in mind that the calibration will extend the good linear range of the sensors, correct?
 
thineight said:
casainho said:
My notes:
1. One torque sensor is kind of linear only up to 15 kgs while other up to 45 kgs. The rate/sensitivity are the same for both on this "linear" zone but clearly mine lacks resolution because this zone is very short. I can do peaks of 40 or 60 kgs on my pedals without taking my but from the saddle.

Casainho, do you think that the response of your torque sensor can improve similarly to your wife's one if you do the hardware calibration mentioned in the wiki?
I have in mind that the calibration will extend the good linear range of the sensors, correct?
Maybe.

Last time I did it, over the time the sensor drifted to this bad values.

I wish more users test this and share the graphs.
 
I dont know is that issue, but when I try to pull bike backward then motor braking. In 0.19.0 there was no effect like now in 0.50.0.
 
redwater said:
I dont know is that issue, but when I try to pull bike backward then motor braking. In 0.19.0 there was no effect like now in 0.50.0.
Yes, I noted that. Also once you pedal and motor runs, that does not happen anymore.
 
One more thing, on boot screen is example 50,7V , but on main screen is 51,3V (0,6V above). On multimeter is 50,7V.

Best regards, and happy new year 2020 !!!
 
Back
Top