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

casainho said:
Thanks and I am lost...

For your note 2., high assist level factor will multiply the human power (torque sensor value * cadence * a constant). Torque sensor value is not exactly 0 when you are not doing force on the pedals..., so, cadence plays an important role here, once cadence equal to 0, the motor stops even if torque sensor value is not zero... but your TSDZ2 motor is a coast version and so this kind of interactions may work differently from regular TSDZ2...

Do you have suggestions for next steps??

Casainho, what about repeating the test only using walk assit mode using different torque configurations.If everything works fine, this means if there is an issue in the other part of the software that takes input from the torque and and pas sensors and controls the motor. I may assume that this is common for the two firmware versions, and if it works for you on the road, it will work also with the coaster brake version in real conditions.
If this is the case, you can can release the motor firmware adding a new configuration line for the negative torque that will be required to stop the motor using coaster brake. In case the value is 0, this may mean the feature is disabled.
 
plpetrov said:
1. Experimental approach. In case you have doubts in the current versions of the motor code, I may try to install some old versions in order to try to identify the code where an error was introduced. However this may lead to nothing.

Could you please try to install this version,
https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_SW102_v0.6.5
I'm using it and do not see any of those issues that you have describe. There might be some bugs that were introduced later when we move to 20 assistance levels and to overrun fix?
 
vshitikov said:
plpetrov said:
1. Experimental approach. In case you have doubts in the current versions of the motor code, I may try to install some old versions in order to try to identify the code where an error was introduced. However this may lead to nothing.

Could you please try to install this version,
https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_SW102_v0.6.5
I'm using it and do not see any of those issues that you have describe. There might be some bugs that were introduced later when we move to 20 assistance levels and to overrun fix?

I will test tomorrow morning. First I will test the version of Casainho with the negative torque detection and brake with walk assit only and then I will install this one. For some reason I can not open the link at the moment. Is this the Casainho release or the one modified by you with the overrun fix?
 
plpetrov said:
vshitikov said:
plpetrov said:
1. Experimental approach. In case you have doubts in the current versions of the motor code, I may try to install some old versions in order to try to identify the code where an error was introduced. However this may lead to nothing.

Could you please try to install this version,
https://github.com/OpenSource-EBike-firmware/Color_LCD/releases/tag/850C_SW102_v0.6.5
I'm using it and do not see any of those issues that you have describe. There might be some bugs that were introduced later when we move to 20 assistance levels and to overrun fix?

I will test tomorrow morning. First I will test the version of Casainho with the negative torque detection and brake with walk assit only and then I will install this one. For some reason I can not open the link at the moment. Is this the Casainho release or the one modified by you with the overrun fix?

This is the official Casainho release. it's a 0.6.5 version. in a Color_LCD repository
https://github.com/OpenSource-EBike-firmware/Color_LCD/releases
 
Just made my experimental firmware for TSDZ2 v0.56 (0.6.10/0.7.0 850C FW). I've changed the following:

  • Current calculation is now based purely on pedal torque, not the pedal power
  • Motor type setting is now always experimental high-cadence for both 36V and 48V. This setting did’t seem to have any effect on max RPM, so I just hardcoded the values (there's an issue on GitHub: https://github.com/OpenSource-EBike-firmware/TSDZ2-Smart-EBike/issues/133).
  • Current ramp is 2,4 times faster, in fact 10 A/sec means 24 A/sec.
  • Target current calculation made 2x more sensitive to assist ratio. Without this modification assist was too weak. This is because the pedal torque numbers are at least two times less than pedal power, so the new formula needed to be adjusted.

This is a very temporary dirty hack and not the state of the art code, but it does work. Now I gonna test this in real applications. I've made a short ride around my home and have the following observations:
  • Pedal effort became much more even across RPM range. It gives much more oomph at low RPM, but does not get crazy as RPM rise. Motor current at normal cadence (60-80 RPM) appears to be lower, which, I suppose, should save some juice in my battery.
  • Motor spins up to insane 6700 RPM, which equals to 123 RPM candence. As I use a 36V motor with a 48V battery, it delivers some solid torque at high RPM. Highly recommended mod! (installing a temperature sensor is mandatory though)
  • Due to faster current ramp you can gain speed much faster, but it still prevents jerkiness and reduces stress to transmission. This change is quite conservative and the current ramp can be made even more fast and disabled at all for higher RPM.
Short demo of high cadence with this firmware:
[youtube]yAhqZRt_vIY[/youtube]

I've published a release on Github for whoever is brave enough to try this firmware on their TSDZ2: https://github.com/r0mko/TSDZ2-Smart-EBike/releases/tag/v0.56-experimental
 
vshitikov said:
24A/sec = bye bye blue gear.

I insist, this is still VERY conservative value. In fact is takes MORE that a full second to reach max 16A current. I will go for 30-40A per second.
 
Ooh, I like the sound of this - just program main.hex, yes?
 
I'm out riding it now, this firmware is awesome aside from some creep without pedal pressure if you set the current ramp too high. At least with my uncalibrated torque sensor.
 
HughF said:
I'm out riding it now, this firmware is awesome aside from some creep without pedal pressure if you set the current ramp too high. At least with my uncalibrated torque sensor.

I've forgot to mention: I have calibrated the torque sensor. The creep issue is fixable. If RPM < 10, we just disable assist.
 
r0mko said:
HughF said:
I'm out riding it now, this firmware is awesome aside from some creep without pedal pressure if you set the current ramp too high. At least with my uncalibrated torque sensor.

I've forgot to mention: I have calibrated the torque sensor. The creep issue is fixable. If RPM < 10, we just disable assist.
It is perfect code and power delivery for my single speed setup.
 
HughF said:
It is perfect code and power delivery for my single speed setup.

Please share your config (battery voltage and motor version), so I bake a personalised firmware for your setup. I'm a bit concerned that the motor setting in the menu has no influence on max RPM, so this makes me think that important values related to motor's windings inductivity don't change at all, and as a temporary solution until this is fixed in the Casainho's code, I'd create several binaries, two for 36V motor and two for the 48V.
 
r0mko said:
Just made my experimental firmware for TSDZ2 v0.56 (0.6.10/0.7.0 850C FW).

Everything works fine so far. Made a round trip to a grocery store (5 km in total). Acceleration from stand-still became much faster, but the current ramp feature obviously limits stress to the blue gear and chain, which I find quite nice. TSDZ2 with the original firmware could lift the front wheel at "turbo” setting, and this was a bit of a concern.

I'm thinking of replacing the current ramp feature with current limiter that depends on motor RPM. For instance, at 0 RPM we limit the current to 1A, but allow full 16A at 1k-2k RPM. This will presumably make a soft start, but allows for quicker current changes during normal riding, which will make the motor more responsive while limiting stress on the blue gear. current_limiter_graph.png
Your thoughts, folks?
 
r0mko said:
HughF said:
It is perfect code and power delivery for my single speed setup.

Please share your config (battery voltage and motor version), so I bake a personalised firmware for your setup. I'm a bit concerned that the motor setting in the menu has no influence on max RPM, so this makes me think that important values related to motor's windings inductivity don't change at all, and as a temporary solution until this is fixed in the Casainho's code, I'd create several binaries, two for 36V motor and two for the 48V.

I run a 13s battery, on a 36v motor. Just come back from doing 35kms, this firmware absolutely rips. So much power delivery, perfect for single speed users, really perfect.

The only bugs: at assistance level 15 or higher you can make the motor go to full assistance just by moving the cranks very slowly, which is kind of cool and fun, like a foot throttle. I tend to ride on level 13 all the time, I found that gave the best assistance for my cadence and still gave me a good heart rate
 
HughF said:
I run a 13s battery, on a 36v motor.

This is the same config as mine besides that I have 9-gear derailleur. I've found a bug in 850C FW code which leads to the issue when the motor type (36V/48V) never changes in the TSDZ2 settings. It defaults to 48V normal cadence mode regardless of what is set in the Motor settings screen. The problem is that I don't have a Windows laptop to flash my display, so for now I will make a bunch of TSDZ2 firmware binaries with different configs. Then I'll copy my windows VM to my laptop and flash my display tomorrow.
 
r0mko said:
r0mko said:
Just made my experimental firmware for TSDZ2 v0.56 (0.6.10/0.7.0 850C FW).

Everything works fine so far. Made a round trip to a grocery store (5 km in total). Acceleration from stand-still became much faster, but the current ramp feature obviously limits stress to the blue gear and chain, which I find quite nice. TSDZ2 with the original firmware could lift the front wheel at "turbo” setting, and this was a bit of a concern.

I'm thinking of replacing the current ramp feature with current limiter that depends on motor RPM. For instance, at 0 RPM we limit the current to 1A, but allow full 16A at 1k-2k RPM. This will presumably make a soft start, but allows for quicker current changes during normal riding, which will make the motor more responsive while limiting stress on the blue gear. current_limiter_graph.png
Your thoughts, folks?
I think this will be a good idea for most users who have gears, but for me with the single speed (part of the joy of electric assistance is you don't need gears), I like the hard starts to get me away from the lights and the traffic.
 
HughF said:
The only bugs: at assistance level 15 or higher you can make the motor go to full assistance just by moving the cranks very slowly, which is kind of cool and fun, like a foot throttle. I tend to ride on level 13 all the time, I found that gave the best assistance for my cadence and still gave me a good heart rate

I strongly advise you to calibrate your torque sensor. This can be easily done using simple luggage scale like this:52703916_images_9816772224.jpg
 
r0mko said:
HughF said:
The only bugs: at assistance level 15 or higher you can make the motor go to full assistance just by moving the cranks very slowly, which is kind of cool and fun, like a foot throttle. I tend to ride on level 13 all the time, I found that gave the best assistance for my cadence and still gave me a good heart rate

I strongly advise you to calibrate your torque sensor. This can be easily done using simple luggage scale like this:52703916_images_9816772224.jpg
Genius. There was me trying to find piles of rocks to weigh then pile on the pedals. I have a luggage scale somewhere, I'm sure.
 
how do you calibrate the torque sensor in new software without using family members or friends?

Edit :

thanks for suggesting an idea with a luggage scale, I have one. I understand that you need to attach the weight to the pedal and put on the foot, then press to the appropriate weight and read the ADC?
 
hetm4n said:
how do you calibrate the torque sensor in new software without using family members or friends?

That's a good question. I didn't manage to do it without help of my wife.
 
HughF said:
r0mko said:
HughF said:
It is perfect code and power delivery for my single speed setup.

Please share your config (battery voltage and motor version), so I bake a personalised firmware for your setup. I'm a bit concerned that the motor setting in the menu has no influence on max RPM, so this makes me think that important values related to motor's windings inductivity don't change at all, and as a temporary solution until this is fixed in the Casainho's code, I'd create several binaries, two for 36V motor and two for the 48V.

I run a 13s battery, on a 36v motor. Just come back from doing 35kms, this firmware absolutely rips. So much power delivery, perfect for single speed users, really perfect.

The only bugs: at assistance level 15 or higher you can make the motor go to full assistance just by moving the cranks very slowly, which is kind of cool and fun, like a foot throttle. I tend to ride on level 13 all the time, I found that gave the best assistance for my cadence and still gave me a good heart rate

I've updated the release, now there's a bunch of binaries for different motor versions. Also I've fixed the crawling bug and made the current ramp even more aggressive to make more oomph.

https://github.com/r0mko/TSDZ2-Smart-EBike/releases/tag/v0.56-experimental
 
r0mko said:
I've updated the release, now there's a bunch of binaries for different motor versions. Also I've fixed the crawling bug and made the current ramp even more aggressive to make more oomph.

https://github.com/r0mko/TSDZ2-Smart-EBike/releases/tag/v0.56-experimental

I will flash the new 36v-HC code and go for another spin tomorrow.

Perhaps now we should start a new thread for your fork? To avoid this important fork getting lost in this thread?
 
r0mko said:
HughF said:
The only bugs: at assistance level 15 or higher you can make the motor go to full assistance just by moving the cranks very slowly, which is kind of cool and fun, like a foot throttle. I tend to ride on level 13 all the time, I found that gave the best assistance for my cadence and still gave me a good heart rate

I strongly advise you to calibrate your torque sensor. This can be easily done using simple luggage scale like this:
Oh wow that’s so much easier!!! Why didn’t I think of that too?!
 
Just realised that motor speed 670 does not mean 6700 RPM. This is an ERPS, a mysterious unit which is 7 and 7/15 of RPM per ERPS (7.4667). So my 670 was not really 6700, but 5000 RPM. So my graph should be updated, but anyway you got the idea.
 
Back
Top