Recovering coming down from above setpoint

Skip to first unread message


Jun 13, 2023, 3:18:18 PM6/13/23
to DIY PID Control
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! 


Pieter S

Jun 14, 2023, 12:44:32 AM6/14/23
Check if there is an "I" / Integrator-wound up limit?  If an error persist the integration term get very large and could take long to wound down resulting in shooting past the set point.

You received this message because you are subscribed to the Google Groups "DIY PID Control" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Reply all
Reply to author
0 new messages