I just put on github a version 0.1.16 for 860C display.
In this version I made some changes in the way the torque sensor is managed.
I noticed that on some TSDZ8 motors (not all) the value returned by the torque sensor varies with the position of the pedal even if load does not change (easy to test with no no load).
Then I made changes in order to calculate
- the "actual" torque sensor value (with just a small filtering). This value can change very fast because it is updated every 52usec
- the "current rotation" torque value = the maximum of "actual" torque sensor during current 360° pedal rotation.
- the "previous rotation" torque value = the "current rotation" torque value during the previous rotation.
The assistance is based on the maximum of the 3 calculated values.
It allows to keep a fast reaction of the motor (because based on the max of 3 values) and to discard cyclic variations (present on some TSDZ8 but also inherent to a pedal system).
The drawback is that when you release the pressure on the pedal, the assistance will decrease only after one or two pedal rotation.
This add a delay.
To limit the drawback, the assistance change immediately to reflect the "actual" torque when the cadence become 0.
I could change it later on (if tests are positive) in order to do the same when cadence is lower than a thresehold of if cadence decreases by more than x% in a short time.
I tested 0.1.16 and it seems me much better than version 0.1.15.
Still you have to take care of some new points in your config in torque sensor menu:
- Coast brake ADC : This concept is not used in OSF TSDZ8. Still this field has been "reused" in order to let the user specify the "FOC multiplier" that is used to calculate "FOC angle" that play a role in motor efficiency and stability when current are high. So enter here a value for "FOC multiplier". It seems that a value in the range 24/28 is good. Feel free to experiment but be careful with values that would be very different.
- calibration MUST be disabled. If you enable it, 860C transmit some false data to the controller.
- Torque ADC step must be correct in order to get a correct value of the human power
- Torque ADC step adv is not used (860c value is discarded)
- Torque offset adj is used. The value in 860C is transmitted to the controller and is added to the Torque ADC offset (see below) to calculate a "total" offset. The logic is that there is no assistance when torque sensor value is less than ( Torque ADC offset + Torque offset adv). Please note that if calibration is enabled, the value transmitted to the controller is not the value on screen. That is one of the reason why calibration must be disabled. You can try with a value of 6. When you increase this value, it means that you will have to press more on the pedal before you get some assistance. Avoid a to low value because this increase the risk that you get assistance even with no load on the pedal.
- Torque range adj is currently not used. In a future version, I plan to use this field to let the user modify the way torque sensor generate assist (getting more or less assistance with low pressure on the pedal for the same maximum assistance for high pressure)
- Torque angle adj is not used (860c value is discarded)
- Torque ADC offset is very important. In TSDZ2 or in previous versions, the firmware read the torque sensor during the first 3 seconds and consider this value as the reference when no load is applied. This was done in order to get an automatic recalibration at each power on. This process is not good for TSDZ8 because, for some TSDZ8, the value varies significantly with the position of the pedal. So in this version of OSF, there is no autocalibration of the torque sensor with no load. Instead, the user has to fill in Torque ADC offset the value that will become the reference. To find the value to be encoded, you must use the menu technical and look at the field ADC torque sensor. When no load is applied on the pedal, turn manually the pedal and look at the values in ADC torque sensor. Note the MAXIMUM and enter it in Torque ADC offset (in Torque sensor menu). For TSDZ8, I expect that value should be between 150 and 190 depending on your motor.
- Torque ADC max has to be filled : to find the value, go to technical menu, look at field ADC torque sensor when you apply the max pressure on the pedal (about 80 kg = full human weight) while holding the brakes.
For other fields of Torque sensor menu, see the 860c manual provided by mbrusa.
As this version, use the maximum values of torque sensor during one pedal rotation (instead of some kind of averages), it could be that you have to adapt the values you introduced in the menu assist for the different levels to get the same feeling.
Note:
In previous version, "FOC angle" depends also on pwm duty cycle. As there were lot of fluctuations of PWM duty cycle in previous version, I made a change in 0.1.16 version in order not to use it anymore for FOC angle. This could have an impact on the value to be used for FOC multiplier. Perhaps it is a mistake. Should be tested.
It could be that with this version you have also to change acceleration and deceleration in Motor menu.