Let's examine controlling a first order system with a digital control system. In order to get through this material you will need to know a little bit about time constant behavior. In particular, you will need to know how a time-constant (first order linear system) system behaves when it starts from some arbitrary starting point. We will assume that we have a digital control system like the one below.

Here is the differential equation satisfied by a first order linear system (the plant). In this differential equation, the constant, K, accounts for the gain from the control effort to the output, x(t) is the output, and C(t) is the control effort.
tdx/dt + x(t) = KC(t)
Now, assume that the system operates the control loop every T seconds. That way, the system starts out at t = 0, takes a sample (a single measurement) of the output, computes a control effort, and puts out a control effort (voltage) as computed. That cycle repeats at t = T seconds, t = 2T seconds, etc. We will denote a general sample time as t = kT (the kth sample time).
Below is the expression for the response of that first order linear system. The response starts from x(kT) at time, t = kT, and the expression is valid until the digital control system samples the output and recomputes the control effort. During the time interval from kT to time (k+1)T, we assume that the control effort is constant. That's true because when you compute the control effort, you put it through the D/A in the loop, and hold that value until you recompute in the next time interval.
x(t) = e-(t-kT)/t(x(kT) - KC(kT))+ KC(kT)
Now, if we let the system run for T seconds after we compute the control effort, we would have:
x((k+1)T) = e-T/t(x(kT) - KC(kT))+ KC(kT)
And, all this does is give us how the plant responds when we hold the control effort constant for one sample period. It tells us the new output - x((k+1)T) - when we know the old output - x(kT) - and we know the control effort during that period - C(kT).
Now, consider what happens when we implement a proportional control system. In a proportional control system we would have:
C(kT) = KpE(kT)
C(kT) = Kp[xdes(kT)
- x(kT)]
Then, when we put this expression into the response equation above, we have some interesting results.
x((k+1)T) = e-T/t(x(kT) - KC(kT))+ KC(kT)
x((k+1)T) = e-T/t(x(kT) - KKp[xdes(kT) - x(kT)])+ KKp[xdes(kT) - x(kT)]
Collect terms, and we find:
x((k+1)T) = x(kT)[ e-T/t(1 + KKp) - KKp] + xdes(kT)[ KKp - e-T/tKKp]
x((k+1)T) = x(kT)[ KKp(e-T/t - 1) + e-T/tKKp] + xdes(kT)KKp(1 - e-T/t)]
x((k+1)T) = x(kT)[ -KKp(1 - e-T/t) + e-T/t] + xdes(kT)[ KKp(1 - e-T/t)]
While it is not immediately apparent, there is a problem that could arise here. If the factor multiplying x(kT) in this expression becomes larger than 1 (in magnitude - which means actually that the factor is less than -1, as we will soon see), the system will be unstable. If we examine when that happens, we can see the following. Note that the factor becomes more negative as we increase the proportional gain.
-KKp(1 - e-T/t) + e-T/t < -1
-KKp(1 - e-T/t) < -1 - e-T/t
-KKp
< - (1 + e-T/t)/(1
- e-T/t)
or
Kp
> (1 + e-T/t)/[K(1
- e-T/t)]
Makes the system unstable
And, if the proportional
gain is larger than this value, the system will become unstable.
Here is a link
to a simulator that will help you see that.
Example
Assume the following system parameters