Digital Controllers Inside Analog Feedback Loops

 

Back to Overview

 

Problem Definition

            You can define the feedback controller problem in terms of what sort of systems you put into the dashed rectangle below:

 

 

(Even though not all control systems employ unity feedback of the output as this one does, systems with non-unity feedback can be transformed into equivalent systems with unity feedback.)  The mathematics you will use to treat this problem depends on whether the dashed rectangle contains a sample and hold system or not:  if it does, you must use the z-transform, and if not, you can use the LaPlace Transform.

 

Analog (Continuous) Controller Design as a Starting Point

            Straightforward application of LaPlace transform concepts leads to a general analog controller design if you put this system

in the dashed box above.  First, we model the plant transfer function G(s) (blue box), using fundamental knowledge about the equations governing its operation and/or experimental measurements of its transfer function and time response together with the SysID software.   Then,we design a cascade controller transfer function C(s) (orange box) to meet design specifications as best we can.  These specifications may be given in terms of the continuous transfer function,

,

 but more commonly they are given in terms of the time domain response o(t), as for example:

·        Percent steady-state error:  the percent difference between the desired and actual response after a long time, i.e.

 

·        + x% risetime:  the time the output  takes to enter and stay within + x % of its final value.

·        Percent overshoot:  the percentage difference between the output’s maximum and final values, i.e.

If you are willing and able to build your controller in analog form, your design work is finished when you have a transfer function C(s) that causes the closed-loop system to meet these and any other additional specifications.

 

The sample & hold

            No digital controller can be implemented without a sample & hold,  so it’s critical to understand what a sample & hold does to a feedback control system and how it changes the procedure we use for analysis.  Suppose you used this system in the dashed rectangle:

You haven’t yet added anything digital, but you have added something non-linear, the sample & hold.  You can no longer use LaPlace transforms for the analysis: now z-transforms are necessary.  Handout H2 shows that the transfer function for the system above (without feedback) is

where the symbol, , denotes the process of:

  1. converting the quantity in {}brackets to residue-pole form ,
  2. forming the z-transform of the sum-of exponentials, to get .  

 

The H(z) you get this way will produce a sequence of samples that follow the time response of C(s)G(s), no matter how slow the sampling frequency.

 

            For high enough sampling frequency, the sequence of values representing the output should accurately track the output of the continuous system, as shown in the example below:

Sampling frequency

 

 

 

The front panel of this LabVIEW VI shows the continuous transfer function H(s) and the sampling frequency,  input by the user,  and the calculated step-function responses as a continuous time function and as a sampled-data sequence.  Also shown is a calculated rational polynomial form for H(z).  Even if the sampling frequency is chosen ridiculously low,  the sampled-data sequence always lies on the continuous function, even though reconstructing the continuous from the samples would not give good results, as shown in the example below:

 

 

Note that H(z) depends on sampling frequency, even though H(s) has not changed.

 

Designing a Digital Controller

            A digital controller within an analog feedback loop must have a sample & hold, along with A/D and D/A converters upstream and downstream respectively from the digital part of the system.  In this case, the system in the loop looks like this:

 

 

Such a system can never be exactly equivalent to the original analog system,

 

except at very high sampling frequencies.  However, it can be equivalent to the system,

at any sampling frequency.  This equivalence is achieved if the H(z)=O(z)/I(z) are the same for the digital system and for the analog system with the sample & hold.  A mathematical statement of this equivalence is

,

 

which can be solved for the needed digital filter transfer function,

.

Note that in applying this formula, you must perform the steps implied in the  operation before dividing.

 

This equation provides a way to calculate the digital filter transfer function, D(z), equivalent to the continuous transfer function C(s), at least within the limitations imposed by a finite sampling frequency.

 

The Digital Controller in a Feedback Loop

            With the digital controller substituted for the analog one, the feedback control system looks like this:

 

Taking the results from the open-loop system without feedback in the dashed box,

where I(z) is still the input to the sample & hold.  But now the input is

Substituting for I(z) and solving for O(z) yields a transfer function that looks like the one for an analog feedback loop:

.

Summary

In summary,  you can find the digital filter transfer function, D(z), that substitutes for an analog transfer function, C(s), at any sampling frequency using

.

The substitution will not be perfect:  only at a very high sampling frequency will you be unable to tell the difference.

 

You can also find the transfer function for an analog plant, G(s), controlled by a digital controller, D(z), in the z-domain as

 

.

 

back to Overview