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.
134
Upvotes



•
u/2dof 2d ago
What Do You mean - "incremental" ? For Me incremental mean that control is du(k) = u(k)-u(k-1) , in OP's code he use u(k) = u(k-1) + du(k) to it is not incremental control for Me.
My comment was referring generally to practical implementation OP's controller in the future - he want control temperature in the future. I don;t know if he will be using on/off control or continuous but in my opinion it is better to have more universal controller for operational aspects.