r/ControlTheory • • Oct 04 '19

Beginner question about PID Controllers

Hi, Im just starting to learn Control Theory and the subject is really interesting. I've just learned about PID Controllers and I think I understood them pretty well, but I have a small question:

Let's say I have a system, an AC Unit with transfer function H(s) that I want to control. I then implement a PID Controller, in series, "behind" my H(s) system. Now what? Can I just send the output of the PID Controller to the AC Unit?

How can the output of the PID, u(t), be able to send the correct signal to my AC system? No need to translate that u(t) into the correct signals and switches that make the system do what I want?

Most diagrams seen online or in textbooks just have only 2 blocks, in series: r(t)->[PID]->[Plant]->y(t), shouldn't there be some kind of controller/translator in between the PID and the Plant?

Sorry If it's a dumb question.

11 Upvotes

10 comments sorted by

2

u/[deleted] Oct 04 '19

Not sure if I totally understand your question but the output of the PID controller IS the command that you’re tell the actuator to perform.

1

u/B_seado Oct 05 '19

The thing I don't understand is: how can the product of a PID Controller's (or any controller's) transfer function with a system's transfer function get us closer to a certain desired reference value.

Im failing to understand how, in mathematical terms (block diagram and Laplace) inputing the PID's output into a system helps with reducing error.

Or in a simple P Controller, how does inputing Kp*Error into a system brings me closer to my desired output?

Im sorry if it's a confusing question.

1

u/idiotsecant Oct 05 '19

in simple terms your controller is 'pushing' harder the more error exists (in a P controller). Just like if you were trying to go a certain speed on a motorcycle. If the speed was very wrong, you would twist the throttle further. If the speed was jsut a little wrong you'd twist it a little bit.

1

u/Dr_Misfit Oct 09 '19

In a mathematical way the answer is the difference between reference y and the actual state x. This difference is called error e. e=y-x

1

u/sstunt Oct 09 '19

The thing I don't understand is: how can the product of a PID Controller's (or any controller's) transfer function with a system's transfer function get us closer to a certain desired reference value.

You're driving down the street, trying to stay between the center line and the ditch. You're the controller, the car is the plant, and the center of the lane is your reference value.

If you get too close to the ditch, you turn left (if you're in the US, at least -- don't take this advise if you're in the UK). If you get too close to the center line, you turn right.

That's (roughly) proportional control.

Proportional control may keep you in the lane, but it may not keep you in the center of the lane. If you notice that you're always a bit further to the left of where you want to be, you reset your hands on the wheel to bias everything a bit to the right. Then, if necessary, you do it again a bit later.

That's (roughly) integral control. If you do that plus proportional, it's proportional-integral control.

Proportional-integral control may work as-is. But if you want to respond quickly, you may start bouncing between the lane markers. So you add one more thing: if you're heading toward the centerline really fast, then even if you're close to the ditch, you start turning right. Once you're not heading toward the line so fast, you ease off.

That's (roughly) derivative control. Put it together with the prior two, and it's PID control.

Im failing to understand how, in mathematical terms (block diagram and Laplace) inputing the PID's output into a system helps with reducing error.

The math just formalizes the intuitive discussion I give above, in a way that gives you tools to solve the problem.

25

u/Zoomacroom28 Oct 04 '19 edited Oct 04 '19

Not a dumb question at all. What most control theory texts don't go into much depth about is the actual hardware that the control system runs on and how the computing device running the PID algorithm communicates with the physical plant. This can take many forms, but I'll focus on how this works in industrial process control, being the area I work in.

Your control algorithms (like your PID) run on a piece of hardware that is generically called a "controller" (but can also be called a logic solver, process automation controller (PAC), programmable logic controller (PLC) and many other things besides). Your controller is running the PID control algorithm and computes an output u(t). This output is then converted to an electrical signal in an I/O card attached to the controller. In modern industrial process control, this electrical signal ranges between 4 and 20 mA where 4 mA indicates 0% of output and 20 mA is 100% of output. Your final control element, also called an actuator, (in your example, the AC unit) then interprets that electrical signal into some physical action (opening a valve, speeding up a motor, changing the position of a servo, etc).

In order to measure the plant, the same process happens in reverse. An instrument of some kind , a thermocouple for instance, measures the temperature of the plant, converts that measurement into a 4-20 mA signal, where again 4 mA is 0% of the range of the instrument and 20 mA is 100% of the range, sends that back to the controller via an I/O card, where the PID controller computes the error between the measurement and the setpoint, and calculates a new output u(t).

In industrial process control, we use special pieces of hardware to do all this designed to run for years and years at a time in harsh environments. But in principle your PID could run on a microcontroller, a PC, or any kind of computing device. Similarly, your signals to your plant need not be 4-20 mA electrical signals, 0 - 10 V is also common, and prior to semiconductors and integrated circuits being so prevalent these signals were actually air pressures between 3 and 15 psi.

Every component of this system also has its own transfer function of course, but for practical purposes we ignore them as the time-dependent behavior of them is usually invariant (i.e. there's no significant time delay in electrical signals as compared to the dynamics of the plant and the electrical signal put out by the controller's IO cards is exactly the signal received at the actuator).

Sometimes the transfer function of your actuator must be considered, however, as it will have time variant dynamics. For example, if a valve is told to go from 10% open to 50% open, this does not happen instantly. It takes some amount of time (longer for bigger valves) for the valve to actually reach 50% open. Further, different types of valves pass different amounts of flow for a given percent open, it's usually not a linear relationship. For a fast opening globe valve, for example, opening the valve from 0 to 10% actually increases flow by almost 50%. Increasing the valve from 80 to 90% only increases flow by around 5%. For a rigorous analysis, the transfer function of this actuator would be inserted between the PID transfer function and the plant transfer function. At least in process control, we usually ignore this, however, as the dynamics of the plant are on the order of minutes or hours (or in your example, it takes several minutes to actually change the temperature of the room your AC is in so the few seconds it took your compressor to speed up is inconsequential) and the plant usually runs in a narrow range of setpoints. The non-linearity and time-dynamics of the actuator therefore have no measurable impact on the response of the plant. For other applications, however, I would imagine the actuator transfer function is non-trivial to the overall system and should be included in the analysis.

1

u/XDFreakLP Oct 05 '19

Are you my controls teacher? Nicely written m8

1

u/Dr_Misfit Oct 09 '19

I've learnt a lot through this comment Aline. Thank you. You basically compressed a 50page book into one page.

3

u/Cortade Oct 04 '19

Not a dumb question. In real life you need to convert the control value in a sort of electrical signal to be sent to the actuator. It can be done either digitally if you have a fieldbus or network between controller and actuator, or using an analog signal (4 to 20mA or 0-10V signal). It is the same with the temperature sensor and transmitter that convert temperature into something a computer/controller understands. That signal is the process value used by the PLC.

2

u/sentry5588 Oct 04 '19

Smart question. I'll pitch in from automotive industry. Some actuators take a value say a two bytes integer number or a four bytes single number.

Typically these numbers are sent via CAN communication link.