Ok, so I finally managed to drain the battery below 45V. It seems your tip worked, I set the voltage cut-off to 29V and now I still have support on lower voltages. The battery bars show the Soc correct.
However, I noticed a very strong power loss now when I am at lower voltages.
Today I cycled up a hill and even at level 04 there was little assistance when going >15 km/h. I remember having less power at low voltages because of current cap, but I don't remember it being that bad. When starting from 0 km/h uphill I have a good amount of motor support, but after about >15 km/h level 04 feels like level 01 and I have to pedal with tremendous amount of work to get to higher speeds.
Battery max current in configurator is set to 18A, motor max power is at 700W. Battery voltage measured at 43V.
Is there a way to circumvent that behaviour?
I believe the issue you encountered with the shutdown voltage is due to the comparison being made with the raw ADC voltage, which is therefore subject to interference. On the other hand, there's no other way to do it; there's no time for a filter.
I made a change that should solve the problem.
Now the shutdown voltage is no longer tied to the cut-off voltage.
It's set to 20 volts, the minimum value needed to save Soc% when the display turns off.
It's therefore possible to set the cut-off voltage to the correct value for the battery in use (39 V for a nominal 48 V battery).
Regarding the drop in performance when the battery is low, this could be normal (with a Soc of 3%, you'll get a few dozen watts).
The Soc should never be lower than 10%.
It also depends greatly on the battery's characteristics and cell type.
Keep in mind that when the voltage approaches the cut-off value, the current is limited.
At a high current (18 A), a voltage drop of up to 3 volts can occur. If the cut-off voltage is set to 39 V, the current is already limited at 42 V (39 + 3).
There are other considerations regarding the drop in power as the voltage decreases, and they depend on the assist mode used.
In Power mode, the rider's power defines the motor's power.
The current is calculated from the target motor power / battery voltage.
Therefore, as the voltage decreases, the current increases. For the same pedal input (torque * cadence), the motor power remains constant (up to the maximum current and cut-off voltage limits).
In torque-based modes (Torque, eMTB, and Hybrid), the pedal input (torque) defines the motor current.
The power is calculated from the target motor current * battery voltage.
Therefore, as the voltage decreases, for the same pedal force (torque), the motor's power decreases. For example, with a calculated current of 10 A and a voltage drop of 2 V, with a charged battery you get 10 * (54.6 - 2) = 526 W, while with a flat battery you get 10 * (39 + 2) = 410 W. This is a significant difference.
To compensate for this difference, so that the rider doesn't feel any loss of power as the voltage decreases, I've added a new feature.
There are two parameters, found in the configurator at the bottom of the "Assistance settings" tab:
1 - Torque, eMTB, Hybrid on current / power
- current, like previous versions, with power decreasing as the voltage decreases.
- power, the current is recalculated to maintain a constant power as the voltage decreases, within the limits of maximum current and the cut-off voltage.
2 - Reference voltage
Reference voltage value, used to calculate the target power to maintain.
For more details, see the manual.
In all modes, to achieve constant power as the voltage decreases, also check the consistency between maximum current and maximum power.
Example: if you set the maximum battery current to 15 A, the maximum power with a flat battery will be 15 * (39 + 2) = 615 W. This is the value to which the maximum motor power should be set.
If you'd like to try it, you can download the master version.
https://github.com/emmebrusa/TSDZ2-Smart-EBike-1/archive/refs/heads/master.zip