[Math] How are the tracking error and plant input related in a PID controller

control theory

I am having trouble understanding a basic relationship in control theory – how the output of the controller is interpreted by the plant. Most control theory tutorials and introductions include a block diagram that shows a controller taking a tracking error input ($e(t)$) and outputting a control signal for the plant ($u(t)$). The tracking error and control signal do NOT have to refer to the same quantity or even use the same units (at least, in the PID control architecture I'm interested in).

How, then, is the output of the controller supposed to be interpreted by the plant? Does it just "work", in that the plant interprets the signal however it would like, and that signal gets properly adjusted based on feedback to the PID controller?

For example, suppose I am trying to keep load on a server under 50% CPU utilization, by controlling the requests/sec that the server handles. If CPU utilization is given by $y(t)$, then how do I interpret the output of my controller ($u(t)$) as requests/sec, when $e(t)$ is in terms of CPU utilization ($y(t) – 50$)?

Best Answer

The plant is a model of the dynamics of the system you are trying to control. The system is described by a number of states, usually denoted by a vector $x_{[k]}$, and the dynamic model describes how these states change in time, so in discrete time domain this would be:

$x_{[k+1]} = f(x_{[k]},u_{[k]})$

where $u_{[k]}$ is your control input. Note that $x_{[k]}$ is the state vector describing the plant, whereas $y_{[k]}$ is the plant output, i.e. something that you measure about the plant. This usually is a certain state or combination of states, but you often can't measure all states directly. This is the reason that usually your control input and the plant output do not have the same unit of measurement: the control input is not necessarily directly affecting the state that you are measuring, but some other state, which indirectly affects the plant output!

Going to your example, let's identify the various vectors:

$u_{[k]} \text{: Requests you send to the server, requests/s} \\ y_{[k]} \text{: CPU load, in.... sorry not my field, what unit is this?} \\ x_{[k]}\text{: ?? Here it depends on your model, how detailed you want to make it. For the sake of example, I'll make up some dynamics (it's not my field, so sorry if the dynamics don't make a lot of sense... I hope it's clarifying though).} $

Let's define the state vector as:

$x_{1[k]}: \text{CPU load} \\ x_{2[k]}: \text{Queue of tasks}$

This implies that $y_{[k]} = x_{1[k]}$. Let's model the dynamics as:

$x_{1[k+1]} = \frac{x_{2[k]}}{P_{[k]}} \\ x_{2[k+1]} = max[(x_{2[k])}+u_{[k]})-P_{[k]},0] \\$

Where $P_{[k]}$ is the processing power (I'm making this up...), or amount of tasks processed at step k. For $x_2$, the tasks left in the cue at step $k+1$ will be the number of tasks at $k$ plus the number of new tasks delivered by the control input $u_{[k]}$, minus the amount of tasks that have been processed ($P_{[k]}$). So you see, since the control input affects only the dynamics of $x_2$, but we are measuring $x_1$, the plant output $y$ has a different unit than control output $u$.

Here we described everything in discrete time, so the dynamics were defined as $x_{[k+1]} = f(x,u)$. In continuous time, this would be described as in your example as $\dot{x}_{(t)} = f(x,u)$. I chose to write it all in discrete time since for a digital system it makes more sense.

However note that the dynamics of a state variable (i.e. it's time-derivative) in anycase has a different measurement unit than the the state itself. This is particularly evident in continuous time: The position $[m]$ state has as a dynamic a velocity $\frac{m}{s}$. Since the control input affects the dynamics, and we usually measure the state, even in a straight-forward case with only 1 state, the units would be different. Hope that clears it up a bit.

Related Question