polyglot
New here
I've just got a DM01 installed on my tandem and it's (mechanically) great. The control scheme has some shortcomings though, particularly wrt speed-limiting. For legal reasons, I need to have 25km/h speed-limiting enabled which would be fine except that it looks like the controller is using a PID loop to do the speed control.
I live in the hills, and when a tandem descends a big hill, it spends a lot of time at 35-60km/h and the integrator in the PID winds up. When I reach the bottom of the hill and start climbing, the motor gives NO assistance for up to 15s after my speed goes below the limit-speed, which in some cases had me slowing down to 10km/h while pedalling at full effort before the assist would come back on. The longer you've been going faster, the longer it takes before the controller realises that you're no longer overspeed and comes back on. There's also a minor mirror issue of the motor overshooting to 32km/h if you accelerate quickly, as the integrator is causing control lag.
As an engineer who very occasionally writes control firmware, this looks to me like classic PID behaviour when there is nothing to prevent integrator windup. I know that the motor has correct speed estimates because it appears on the display. Assuming (I haven't looked) that the firmware allowed me to change the Kp/Ki/Kd values on the PID, I don't think that would work correctly because a PID with Ki=0 will always have an output offset which will result in it limiting to the wrong speed.
IMHO the correct way to do speed limiting is for the power to taper across a speed range (e.g. 25-27km/h), using the instantaneous (or very slightly filtered) speed measurements. I think that's how Bosch works, and it is instantly responsive - power cuts off immediately when overspeed, and comes back immediately when underspeed. There are other ways of fixing it while retaining the PID code, e.g. by clamping the integrator as soon as the PID output saturates at either full power or zero power.
Is there any way in the menues to set speed limiting to be either a hard-stop based on speed, or a taper with respect to instantaneous speed, instead of PID?
Otherwise, does anyone have contact details for the to7 firmware developer? I can totally help fix this.
Edit: yes I have set Filter=0 on the speed menu, and changed the torque-sensor control from Safe to Sensitive. Neither of those prevents the integrator windup though.
I live in the hills, and when a tandem descends a big hill, it spends a lot of time at 35-60km/h and the integrator in the PID winds up. When I reach the bottom of the hill and start climbing, the motor gives NO assistance for up to 15s after my speed goes below the limit-speed, which in some cases had me slowing down to 10km/h while pedalling at full effort before the assist would come back on. The longer you've been going faster, the longer it takes before the controller realises that you're no longer overspeed and comes back on. There's also a minor mirror issue of the motor overshooting to 32km/h if you accelerate quickly, as the integrator is causing control lag.
As an engineer who very occasionally writes control firmware, this looks to me like classic PID behaviour when there is nothing to prevent integrator windup. I know that the motor has correct speed estimates because it appears on the display. Assuming (I haven't looked) that the firmware allowed me to change the Kp/Ki/Kd values on the PID, I don't think that would work correctly because a PID with Ki=0 will always have an output offset which will result in it limiting to the wrong speed.
IMHO the correct way to do speed limiting is for the power to taper across a speed range (e.g. 25-27km/h), using the instantaneous (or very slightly filtered) speed measurements. I think that's how Bosch works, and it is instantly responsive - power cuts off immediately when overspeed, and comes back immediately when underspeed. There are other ways of fixing it while retaining the PID code, e.g. by clamping the integrator as soon as the PID output saturates at either full power or zero power.
Is there any way in the menues to set speed limiting to be either a hard-stop based on speed, or a taper with respect to instantaneous speed, instead of PID?
Otherwise, does anyone have contact details for the to7 firmware developer? I can totally help fix this.
Edit: yes I have set Filter=0 on the speed menu, and changed the torque-sensor control from Safe to Sensitive. Neither of those prevents the integrator windup though.
Last edited: