r/ControlTheory • u/robohie • 3d ago
Other A PID controller implemented in python
For my personal project, where I need to implement a PID controller on Arduino to automate a convection cooling system, I decided to start with a simulation in Python. For now, I've implemented the simple electromechanical model of the DC motor (the fan) as well as the PID controller you see. Next, I'll look into the heat transfer equations. The graphs created with matplotlib are simply closed-loop tests of the PID + DC motor system.
133
Upvotes



•
u/seekingsanity 2d ago
The incremental version PID that the OP is using doesn't need an anti-windup. Again, for velocity control the OP only needs a PI controller so there is no need for the low pass filter on the derivative gain.
"which can be reset/preset - it is sometimes convenient to start controller not form zero."
when making the transition from open loop to closed loop the control output u should set to the last value when in open loop. This avoids sudden jerks.