Thanks for your answer. I have to describe my bike/usage better: My bike is PAS only, so no throttle. I pedal a lot, so the main purpose of motor is to help with accelerations and keeping speed at about 25-27 km/h. At 27 km/h I only need about 100 W of motor power in addition to pedalling. I also use a child trailer quite often, which requires a bit more power.
The reason I don’t want IntSGain at all is that I don’t want the accumulated past error (going over the speed limit) affect motor power at all. Therefore, it only matters how much over the speed limit the current speed is, not how long it has been over the limit. That way I can keep on cycling e.g. 1 km/h over the limit with a constant but lower motor power. If IntSGain is higher than zero, then power keeps on decreasing if speed is constantly 1 km/h over the limit. Using PAS it feels like the bike tries to slow you down. If IntSGain is zero, then going over the speed limit is much smoother and you don’t even always notice it. When IntSGain is zero, the PID controller should turn into PD or P controller. Another advantage of IntSGain = 0 is that when after a high speed downhill going uphill power adjusts much quicker. If IntSGain is higher than zero, speed can drop several kph bellow speed limit before power is restored.
Thanks for the tip to use DSGain. I tried 10 and 100, but still with those values I have had the speed limiter to start at 10-20 km/h. But DSGain = 10 feels a bit better than 0.
These are the PID value combinations I have tried:
PSGain = 1.00
IntSGain = 0
DSGain = 0
PSGain = 1.00
IntSGain = 0
DSGain = 100
PSGain = 1.00
IntSGain = 1
DSGain = 100
PSGain = 1.00
IntSGain = 0
DSGain = 10
With every combination the speed limit has at least once been randomly activated at somewhere between 10-20 kph. Even setting IntSGain to 1 did not help. But the limiter does not activate prematurely at every hard acceleration. With the best combination so far (PSGain = 1.00 IntSGain = 0 DSGain = 10) it has happened only once.
EDIT: Today it happened a couple of times with these settings. If the limiter is activated at e.g. 14 kph, it does not help if I keep on pedalling at 14 km/h or lower or higher. Only way to reset the limit to 26.5 kph is to stop. Not even restarting CA without stopping helped.
I need to have a speed limiter to keep the bike legal in EU. If you wonder why I’m setting the speed limit a bit over 25 kph, it is because EN 15194 standard allows the speed limit to be 10 % over 25 kph. Also the Finnish police reduce 3 kph from the speeds that they measure vehicles travelling because of the measuring accuracy.
Edit: It seems that premature speed limiting occurs when I accelerate rapidly, but then suddenly slow down in the middle of the acceleration. Speed limiting flag (flashing kph) seems to show up quite often when accelerating somewhere between 10-20 kph, but it dissappears if I keep on accelerating. But if I slow down while it is showing up, then speed limit gets stuck there.
Edit 2: I discovered that this happens every time I adjust speed limit with digiaux while moving from 26.5 to 0 and again to 26.5. After these adjustments speed limiter is stuck at about 15 kph.
I also discovered that if IntSGain = 10, then speed limit gets stuck initially to a low value but slowly recovers to 26.5 kph. It seems that IntSGain affects the speed how fast speed limit recovers to set speed limit.
teklektik said:
Setting IntSGain to 0 is not a good idea - there is almost no error correction generated so the throttle adjustments for speed can be super slow. This is probably the cause of your slow recovery. This is part of the black art of PID tuning and that particular rule of thumb and consequence is not called out in the Guide...
The DSGain term is the cause of the speed limit tripping lower than the speed setpoint. This gain controls the CA 'future sense' as it sees a rapid rate of speed change and throttles back to avoid an 'anticipated' speed limit overshoot. This only happens on hard acceleration - which is exactly the symptom you describe.
- Think of DSGain as driving with your white-knuckled mother in the car screaming 'SLOW DOWN!' because you burned out but actually were going less than 20mph at the time - it's the acceleration that freaked her out.
If you want to deactivate speed limiting, the settings in the Guide on the bottom of page 30 will do the trick:
Guide said:
If Speed Throttle and maximum speed limit enforcement are not required, disable the speed control logic:set SLim->MaxSpeed to the maximum value, IntSGain = 100, PSGain = 0, DSGain = 0.