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

@casainho Just tried the 0.52 motor firmware and 0.63 850c firmware. I became very use to the lcd3 but i'm happy with the 850c now, it has more display features and a easier menu system. I think it needs an AVG speed metric as well.

For the 0.52 motor firmware, i have to report bad news on it. The power delivery is very inconsistent. In 2.5x assist going at 20mph I observed the power delivery varying from 100watt to 600watt at a steady 80 cadence. The increase in resolution helps in the initial response ( :thumb: ) but while cruising i cant get steady power delivery. Im going to downgrade to the last version. My motor has about 1000 miles and the torque sensor was never calibrated. Torque sensor calibration is something i know i have to do, but is it possible to bring back the old settings and toggle between the 2 power delivery programs?

Also, sensor sensitivity seems like an important thing at stop/go and low cadence cases. When cruising you're not going to have much power fluctuation. Is it possible to reduce sensitivity at 60+ cadence? Not everyone who uses the firmware is going to have a perfectly calibrated torque sensor. And the torque sensor becomes uncalibrated eventually right?
 
Or before i downgrade, is it possible to mitigate an uncalibrated torque sensor in the most current firmware?

edit: just realized calibrating the torque sensor is done in the firmware (not by taking apart the motor). Will try that next...
 
ezrider1199 said:
Or before i downgrade, is it possible to mitigate an uncalibrated torque sensor in the most current firmware?

edit: just realized calibrating the torque sensor is done in the firmware (not by taking apart the motor). Will try that next...
If you keep torque sensor calibration disabled, then it is the same previous code. But yes, go and calibrate it!!
 
casainho said:
ezrider1199 said:
Or before i downgrade, is it possible to mitigate an uncalibrated torque sensor in the most current firmware?

edit: just realized calibrating the torque sensor is done in the firmware (not by taking apart the motor). Will try that next...
If you keep torque sensor calibration disabled, then it is the same previous code. But yes, go and calibrate it!!

But the sampling resolution still remains high even if torque sensor calibration is disabled? I think a universal fix would be to allow people to specify the resolution in the menu. I will try to calibrate the sensor now and will report back.

edit: used a luggage scale to get the measurements (https://docs.google.com/spreadsheets/d/1eypGXRuYNb9ZjbJMJJQHWhhbZXZDE-iG5qS2w2w2CP0/edit?usp=sharing). Still not happy with the power delivery, i did not notice a difference. The power remains low while cruising and sometimes it goes up and jerks the bike a bit, then goes back to low power. My only reference is v0.19 that it was good at cruising speed although less responsive and not too user friendly at low speed & low cadence.
 
dameri said:
casainho said:
So, I think you need to focus on the values around the knee of the graph, maybe trying to measure 5 values near around, because that zone will have a big impact on the values calculated. Also I think is important for you try to imagine a soft round curve passing on/near all the points and so you can estimate some of that values.

As we can see, your torque sensor is like mine, good sensitivity only from 0 up to 20 kgs.

dameri said:
So, I don't know what I've doing wrong. Assist was very poor with torgue sensor enabled. I just followed wiki instructions. I'll try again at weekend.
Here is my values, 25 kg and 46 kg are estimate, others real weights.
file.php

Ok, thanks. I do changes at weekend.


Hi did you try any new settings, I am also having very little assistance after calibration.



Sent from my iPad using Tapatalk Pro
 
andrewgateway said:
dameri said:
casainho said:
So, I think you need to focus on the values around the knee of the graph, maybe trying to measure 5 values near around, because that zone will have a big impact on the values calculated. Also I think is important for you try to imagine a soft round curve passing on/near all the points and so you can estimate some of that values.

As we can see, your torque sensor is like mine, good sensitivity only from 0 up to 20 kgs.

dameri said:
So, I don't know what I've doing wrong. Assist was very poor with torgue sensor enabled. I just followed wiki instructions. I'll try again at weekend.
Here is my values, 25 kg and 46 kg are estimate, others real weights.
file.php

Ok, thanks. I do changes at weekend.

Hi did you try any new settings, I am also having very little assistance after calibration.
Can you put on the numeric fields the human power and share here your average value as also a min value?

And then, put on numeric fields the motor power and compare motor power VS human power and see if it follows the assist level rate / factor multiplier??
 
does anyone need an opened display of a normal tong sheng motor. For research or whatever
what other parts may be of interesst as I may get a hold of some that are broken in different ways, cosmetic or others like one button not working etc.
 
andrewgateway said:
dameri said:
casainho said:
So, I think you need to focus on the values around the knee of the graph, maybe trying to measure 5 values near around, because that zone will have a big impact on the values calculated. Also I think is important for you try to imagine a soft round curve passing on/near all the points and so you can estimate some of that values.

As we can see, your torque sensor is like mine, good sensitivity only from 0 up to 20 kgs.

dameri said:
So, I don't know what I've doing wrong. Assist was very poor with torgue sensor enabled. I just followed wiki instructions. I'll try again at weekend.
Here is my values, 25 kg and 46 kg are estimate, others real weights.
file.php

Ok, thanks. I do changes at weekend.


Hi did you try any new settings, I am also having very little assistance after calibration.



Sent from my iPad using Tapatalk Pro



casainho said:
jeff.page.rides said:
Please include the link to the wiki and will V0.51 allow you to set the sensitivity of the torque sensor?
Thanks
https://github.com/OpenSource-EBike-firmware/TSDZ2_wiki/wiki/How-to-install-the-Flexible-OpenSource-firmware

Once you calibrate the torque sensor, you use the assist level to scale up the motor power compared to pedal human power.

An example: I do comfortable 100 watts of pedal human power with my legs. If doing 100W and want motor to assist 500W, then I set assist level to factor 5.0.


You will need to test how much pedal human power you usually do and then decide for motor max power you want and then select an assist level factor.

According to casainho more factor levels must be used, when torque sensor is calibrated. I drive most of the time without torque sensor calibrated at factor level 1.0. It is enough for me on a flat road or small uphill, and I am happy when I get a little bit of exercise also when I’m driving with TSDZ2. When it gets steeper hills or am already tired I can use bigger levels of assistance.

I tried calibration with many different settings and it didn't t worked well. Nor do I understand the benefits of having to change the level of assistance all the time. As I said before, factor level 1.0 helps me well and I get enough power out of the TSDZ2. When I drive with torque sensor calibrated on factor level 1.0 assist is no good.
 
dameri said:
When I drive with torque sensor calibrated on factor level 1.0 assist is no good.
So you don't know how to change the assist factor levels or you are simple being lazy to do it?
 
The whole point of the calibration is to allow the assists levels to give motor power proportional to your own power.
So, after calibration, it will likely give less assistance on assist level 1 and that assistance should increase when you increase your assist level.
It will work like that till it reaches it's maximum battery current. At that moment it will give it's maximum assistance for your setup.
Other things that can limit maximum assistance are motor temperature when you have the additional temperature sensor mounted in the motor. This prevents overheating and permanent damage to it.
 
At this point my bike is unrideable . I'm trying to downgrade to get the feel of my lcd3 setup back. I went back to 0.61 before the high resolution change log and the power delivery is still erratic. Will try to go back to 0.19 and 0.5 beta display firmware. I know in the future I should probably take apart my torque sensor but I'm hoping that the firmware will eventually accommodate really crappy torque sensors so I don't have to take it apart
 
ezrider1199 said:
I know in the future I should probably take apart my torque sensor but I'm hoping that the firmware will eventually accommodate really crappy torque sensors so I don't have to take it apart
Yes, the latest firmware version accommodate the "really crappy" torque sensors and I don't think there is a possible better solution.
 
casainho said:
dameri said:
When I drive with torque sensor calibrated on factor level 1.0 assist is no good.
So you don't know how to change the assist factor levels or you are simple being lazy to do it?

I wouldn't call myself lazy, I commute by bike, I do my daily shopping by the bike and I also ride for fun. I have seven assist levels the lowest factor 1.0 and the highest 4.0. Like I said, most of the time I ride at level 1.0 and then adjusting to a higher level if needed.

Torque sensor calibration just did not work for me, and the program without that calibration works wery well.

Thank you very much for developing open source software :bigthumb:
 
dameri said:
Torque sensor calibration just did not work for me, and the program without that calibration works wery well.
You do not give details other than saying "just did not work for me", which is strange since this is the first time someone says this.
 
You advised me to change the values at the knee of curve, I did it and it didn't help. I tried many options. And as I said the program works well without calibration, and I am satisfied.

By the way, maby I’m not the only one.

andrewgateway said:
Hi did you try any new settings, I am also having very little assistance after calibration.



Sent from my iPad using Tapatalk Pro
 
dameri said:
You advised me to change the values at the knee of curve, I did it and it didn't help. I tried many options. And as I said the program works well without calibration, and I am satisfied.

By the way, maby I’m not the only one.

andrewgateway said:
Hi did you try any new settings, I am also having very little assistance after calibration.
I don't understand, if the assistant is low, than the assist level factors need to be increased. Everyone is different, everyone has different physical capacities and so each user may need to adjust the assist level factors.

Anyway, I am ready to release a new version that changed everything about the assistance and where the assist level factor starts at 0.01 and goes to 2.55 max, so, I will try improve the instructions on wiki on how to change the assist level factors and validate looking at the pedal human power value.
 
New TSDZ2 firmware: motor current control, much more soft and natural motor control!!

On previous firmware versions, the motor was controlled by controlling the battery current and keeping motor current always at a max fixed value, which made sensation of a strong startup. Now, the motor current is controlled instead of battery current and this makes more soft and natural felling of the motor control, mainly at startup / low cadence / low motor speed. This should had been done from the begin of this project!!
To be clear, the firmware now maps the pedal human power to motor current while previously was mapping pedal human power to motor power.

Since on recent versions the torque sensor sensitivity was increased 4 times as also implemented full linearization / full calibration, the current control resolution was increased 4 times, and now controlling the motor current, the system is very responsive and fells very natural!!

Please follow the next steps to adapt assist level factors for you:

1. calibrate the torque sensor

2. ride with assist level 0 (motor will be disabled) for some minutes on a flat road and see on the display what is the average value of pedal human power - my average value is 100 watts

3. as it is advised to not exceed 18 amps of motor current on TSDZ2, let's say I want to have a motor current of 12 amps for my average human power of 100 watts, so, the assist level factor should be 0.12 (divide motor current by human power: 12 / 100 = 0.12)

4. you can choose an assist level factor like 0.05 for assist level 1 and increase next one by multiplying 1.33 (each level have +33% motor current from previous one), resulting in the following values: 0.05, 0.07, 0.09, 0.12, etc.

Changelog:
- changed motor control to be motor current and not battery/motor power
- changed assist level factors to be between 0.01 and 2.55
- current ramp configuration is now for motor current
- min ADC current step is now for motor current

Download here: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.6.4
 
When I set level factor on 0.12, drive motor current will be 12A ? (576W motor vs my 100W on pedal) ? Is 0,01 factor equal 1A on motor ?
 
redwater said:
When I set level factor on 0.12, drive motor current will be 12A ? (576W motor vs my 100W on pedal) ? Is 0,01 factor equal 1A on motor ?
Yes, that is simple math, 100W * 0.12 = 12.

My 48V motor, 52V battery, my motor current can go up to 25 amps since I remember. The limit on the firmware for motor current is 30 although I think 15 or 20 should be a safe limit.
 
Waynemarlow said:
Casainho, for us not so bright on motor technology, what is the difference between battery current and motor current ?
Motor current is the current that flows on the motor coils and is the one that provides the motor torque.

Battery current is the one that flows on the battery wires.

Motor current = battery current / PWM duty-cycle

Voltage on motor coils = Voltage battery * PWM duty-cycle

For TSDZ2 motor of 48V, at 525 ERPS/4000 rpm speed, the BEMF generated voltage is 48V, 0V at 0 speed and half of the voltage at half of the speed. BEMF oposes to voltage on motor coils, so as the motor speed increase, higher BEMF voltage means less possible motor current flowing, as voltage on coils is motor voltage - BEMF voltage.

Configure on display to show that variables as also motor speed and see how they change in real time.
 
Ok lots of terms in there in which I need to do some more reading. I found a couple of good fundamental motor learning papers last night and if I anything good I'll post them here.

On this website is also both a primer and more detailed
https://endless-sphere.com/forums/viewtopic.php?f=30&t=240

Thanks.
 
casainho said:
Download here: https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_v0.6.4

Casainho, which motor controller firmware needs to be used with this display firmware?
I'm a bit lost and I do not find the latest motor firmware source code.. other than v.19 and v.20beta1(Buba?).
Thanks
 
thineight said:
.....which motor controller firmware needs to be used with this display firmware?......

https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike?files=1
 
Back
Top