Control systems are an intrinsic part of our daily lives. From the cars we drive to the household appliances we use, control systems play an indispensable role. The interesting thing is, that many of these systems operate on a core concept known as PID Control. If you’ve ever wondered how cars, aircraft, boilers, ovens, and microwaves function and do their job, the chances are that a PID Controller is working behind the scenes.
So, what is a PID Controller? Let’s find out the PID Control basics.
What is a PID Controller?
Let’s start from the basics. PID stands for Proportional-Integral-Derivative, a type of feedback control loop. It’s like the brain of many modern control systems. It manipulates an input to get a desired output, known as the setpoint. The PID controller looks at the errorā the difference between the setpoint and the current conditionā and adjusts the input to minimize it.
For example, let’s say we have just engaged the cruise control on our brand-new car. Chances are that a PID is at work trying to keep our car’s speed close to our desired speed. To be precise, we have:
- Manipulated variable or control input: the throttle pedal
- Process variable or controlled variable: the measured speed of the car
- Setpoint: the desired speed we have set on our dashboard
PID Controllers: The Four Components
To answer the question “what is a PID Controller” we need to start by saying that the manipulated variable or control input calculated by a PID Controller is equal to the sum of 4 components.
Let’s see what these four basic concepts of PID Control are.
Proportional Component
The Proportional Component is equal to the error multiplied by a constant known as the Proportional Gain (Kp). In simple terms, the bigger the error the bigger (or smaller depending on the relationship input-output) the manipulated input.
In our example, this component will be big if the speed is significantly lower than the setpoint and will be small if the speed is close to the setpoint.
Integral Component
Next up is the Integral Component. The integral of the error is multiplied by another constant called the Integral Gain (Ki). This component is crucial because it ensures the system will only be at steady state when the error equals zero. This is because the integrator will output a constant value only if its input is zero. Therefore, it helps eliminate the residual steady-state error that is common in proportional-only control.
In our example, if the speed is below the setpoint, the integral component “grows” with time, causing the throttle to keep increasing. If the speed exceeds the setpoint, the integral component starts decreasing. If everything works well, the component becomes constant when the speed is at the setpoint.
Derivative Component
Last but not least is the Derivative Component. It gives the PID controller a predictive capacity by looking at the rate of change of the error. The derivative of the error is multiplied by a constant known as the Derivative Gain (Kd). By considering the rate at which the error is changing, the derivative control anticipates future error and thus provides a control action to counteract it.
Considering again our cruise control example, if the speed is approaching “fast” towards the setpoint (the error is decreasing fast) then the derivative component is big and negative, causing the throttle to decrease. On the contrary, if the speed is decreasing fast (for example we encounter an uphill bit of road) the derivative component will be big and positive, causing the throttle to increase.
Feedforward Component
Although not a part of the traditional PID controller setup, a Feedforward Component can often be added for enhanced performance. It uses knowledge of the system to predict what the command should be.
In our example, the car maker certainly knows at what percentage the throttle needs to be to get the car to a certain speed (in nominal conditions like flat road and average weight on the car). This knowledge can be used to add the term based on the nominal conditions to the PID.
In ideal conditions, the feedforward component could be the only thing needed for good control. However, if something’s slightly off (uphill or downhill roads, wind, different weight, an old engine that is not as powerful anymore, etc.) the 3 components are essential to achieve good setpoint tracking.
What is a PID Controller? Block Diagram
Here’s the block diagram of a PID Controller:

PID Tuning: Achieving Optimal Performance
The effectiveness of a PID Controller lies in its tuning. This involves setting the correct values for Kp, Ki, and Kd gains to get the best performance for your specific system.
PID tuning is an iterative process and often involves simulations or real-time testing to evaluate system response and adjust the gains accordingly.
If you are interested in a digging deeper into PID tuning, I suggest you check out my blog PID Tuning: The Power of Python, where I show an approach to automate the tuning of the 3 gains, assuming that a relatively accurate model of the plant is available.
Conclusion
PID Controllers are extremely versatile and present in various applications, from automotive systems to kitchen appliances. As we have explored, PID Control consists of three main components: Proportional, Integral, and Derivative, which work together to ensure optimal system performance. With a proper PID tuning, these controllers can work wonders. Understanding how they work can open up a whole new world of possibilities for both aspiring control engineers and enthusiasts.
If you are still eager to learn more about PID Controllers, here’s more interesting stuff for you:
- How to implement a PID Controller in C
- PID Control ā Things I Wish I Knew When I Graduated: a 3-hour video course that contains 12 years of experience working with and programming from scratch these controllers.
So, the next time you step into a car or an aircraft, remember the simple magic of PID Control that makes our lives easier – even when we don’t know!





I am currently controlling a vacum chamber and reading the pressure via an analog voltage from the Barometer ADC. I use the error to control the valve position going to a vacum pump. This is controlled by a digital command from 0-90 degrees. I think my “error” signal is the difference in the set point voltage and the current voltage from the barometer. Based on this I need to send a new valve set angle.
I am walking through the equations in “Reusable PID Controller in C” and trying to put physical units to each variable so I can check my final math and my understanding.
I think the units of the “Command” output of the PID Loop “should” be in degrees (New Valve Angle). So will the units of Ki & Kp be Degrees/volt so the output of below value will be in degrees? I would think that the command
/* Summing the 3 terms units depend on Kp and Kd */
command = pid.Kp*err + pid.integral + pid.Kd*deriv_filt;
Hi Kenneth, good question. Your understanding is broadly correct, but the unit of the 3 gains is slightly different:
assuming that you treat your pressure directly in V as you said (pressure setpoint and measurement are in V) then you have:
A further step, neater, would be to convert first the voltage reading to mbar (or an equivalent pressure measurement unit) and have the setpoint in mbar. Then you would have: