Motor Torque Smooth

mspider65

100 W
Joined
Aug 4, 2019
Messages
194
We are well aware that torque sensing motors acts as power/torque amplifier. An annoying effect though, at least for the TSDZ2 motor that I normally use, is that it follows just exactly the force measured instantly which, even if we are pedaling constantly, changes significantly according to the position of the pedals and I find this wave effect annoying.
Below is an example of a graph that shows the trend of the torque impressed by the cyclist based on the position of the pedals.
Torque.png
The shape changes from cyclist to cyclist and also for the same cyclist it changes according to the pedaling style you are using, if you are more or less tired, etc.
To overcome this problem, I have seen that other firmware use an average of the measured torque value which, however, has the effect of reducing the responsiveness of the motor to changes in the effort impressed on the pedals.
So I asked myself if there is a way to overcome this problem while maintaining a good reactivity of the motor and I came up with the following method which is very simple and in the tests I did it proved to be effective.

The idea is the following:

The PAS of the TSDZ2 supplies 80 impulses for every crank revolution (one every 4.5 degrees) the Software detects the value of the torque at every impulse of the PAS and keeps in memory the last 80 values.
When the Software has to calculate the target motor power, the SW detects the torque value on the pedals and compares it with the value detected in the same pedal position at the previous pedal revolution. If the difference is lower than a configurable threshold, the average of the last 80 samples is used (moving average over 360 degrees), otherwise the instantaneous value is used.
In addition, to ensure an immediate stop, if the instantaneous torque value is lower than another configurable threshold, it still applies the instantaneous value instead of the moving average.

From the first tests I did it seems to me that it works well and when you pedal constantly in my opinion you can feel the difference and in the same way, as soon as you change the effort, the motor still reacts instantly as before.
The operation is confirmed by my monitoring Android application which shows now also the percentage of time in which the average is used instead of the instantaneous value and when I pedal regularly the value is almost always at 100%.
I wonder if others also detect this annoying wave effect or if it is just my impression, or if others have faced this problem and have adopted different solutions.

Soon, as always, I will publish an update of my Firmware with this change on Github as I am curious to hear other opinions.
 
I’ve just used a rolling average to smooth it out, but your system sounds brilliant. Very interested to see the code when you publish.
 
ie, "learning" control, it knows what to expect so can react better to the unexpected. Are you also using speed, the time between positions? I'd imaging the troughs between peaks would be hard to use otherwise and they're usually where I'd stop peddling. Could also work for low power, keep things moving when you're just peddling air, only moving them at maybe half speed with no force.
 
stan.distortion said:
ie, "learning" control, it knows what to expect so can react better to the unexpected. Are you also using speed, the time between positions? I'd imaging the troughs between peaks would be hard to use otherwise and they're usually where I'd stop peddling. Could also work for low power, keep things moving when you're just peddling air, only moving them at maybe half speed with no force.
No, at the moment it only uses the information coming from the torque sensor. In practice, the software memorizes the last curve and compares the instantaneous value with that of the previous pedal stroke to understand if the cyclist is modifying the effort.
I tried to keep things simple also because the controller MCU is not very powerful.
 
I was able to test the change more thoroughly and had to change my mind a bit on my first impressions.

The difference is more noticeable the greater the effort applied and the lower the cadence and also depends on how the motor is configured, particularly if aggressive or softer motor current ramps are used.

This is for example the graph of the minimum, maximum and average torque sensor delta signal from the zero reference, detected during one full revolution of the pedal on my motor while I am pedaling with medium effort in a constant way.
There is a noticeable difference between min - max torque but the difference is lower than expected.
Screenshot_20220422-155035_TSDZ2_ESP32.png

I also imagine that an important role is played by the torque sensor which on the TSDZ2 motor is a delicate component and which can have very different performances from one motor to another. I also realized that the TSDZ2 torque sensor is a low pass filter by itself which attenuates the signal since it uses reciprocal inductance to transfer the signal to the controller.

All in all, however, the algorithm works well and I have not detected any drawback and therefore I decided to release a new version of my TSDZ2 firmware with this change anyway.
 
Back
Top