Hi everybody,
I'm using a PI-controller to control the speed limit of my electric bike. Accelerating up to the speed limit/setpoint works fine. My issue is that when going down hill the speed will increase above setpoint (because of me pedalling and down hill, not because of motor) and when the road levels out and the speed decreases, it goes too far below the setpoint before starting to accelerate again. I think this is to be expected, as output will be low or zero when above setpoint (in most cases). So instead I want to achieve something like in picture B, rather than A (green is speed, black is set point). I'm using an Arduino.
Any ideas on how to do this? Any ideas are appreciated!