The questions below are due on Friday November 26, 2021; 10:00:00 AM.
You are not logged in.
Please Log
In for full access to the web site. Note that this link will take you to
an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected
back to this page.
Connecting Transfer Functions to State Space: An op-amp example.
The operational amplifier, or the op-amp for the cognosenti, was an early, and remarkably successful, application of continuous-time control theory, and an essential component in most control systems. The first op-amp was introduced more than 80 years ago (using vacuum tubes), the modern op-amp (the 741, an integrated circuit) was introduced more than 50 years ago, and 20 years ago, at the end of the 20th century, the electronics industry consumed five billion op-amps a year. So, the op-amp has a well-deserved place in control theory's history, and is discussed in nearly every introductory class on control.
If op-amps are so important, why haven't we mentioned them earlier? The main reason is that fast microcontrollers, which can run sophisticated DT control algorithms, have displaced the use of op-amp-based CT controllers in all but the very highest frequency applications. For example, we used to have students implement a lead controller using an op-amp, three resistors, and a capacitor, but it is much easier for students to implement using a DT approximation on the Teensy.
Op-amps continue to play an extremely important role in signal processing, because an op-amp, plus a few resistors and capacitors, can implement a wide range of filters and amplifiers. But all those circuits rely on feedback principles, so one should learn a little about op-amps.
A little about op-amps
To understand op-amp theory, recall that when we started discussing continuous time, our first feedback example was the speed control problem. And we saw that when using proportional feedback, we could use any positive proportional gain, and the system would be stable. More precisely, suppose
where is motor speed, is a friction coefficient, is a control input, and is a scaling coefficient. Then if proportional to the difference between the desired () and measured motor speed,
where is the proportional gain, then
and the response to an input step ( and for all ) is a rising exponential
and in steady state (given for all ),
What we discovered is that for first-order CT systems, we can make the proportional feedback gain as large as we want, and the system will just get faster and more accurate. And the step response never overshoots!
A typical high-gain op-amp
Consider a nearly ideal op-amp whose transfer function from input difference ( to output voltage is given by
If we use what is usually referred to as non-inverting configuration, using resistors and to create the feedback network. This op-amp may be modeled using a feedback block diagram, with a 'forward-path' given by and a 'feedback path' scaled by a factor .
This is not our usual tracking configuration, because the output is scaled
by before comparing to the input, but this form is more natural when describing operational amplifier circuits. To analyze this case, we know that based on how the circuit elements are connected,
where is LESS than one, and is determined by the resistor divider
network.
The operational amplifier's output voltage, is determined
by the product of its transfer function and the differential input voltage,
as is also shown in the block diagram above.
Combining,
resulting in a variant of Black's formula,
where we have put the back in the the equation to remind ourselves that
we have a tranfer function with a frequency response. Note that
when .
In the following examples, we we generate state-space models of op-amp circuits, in order to gain a better understanding of the relationship between state-space and the classical transfer function approach to control.
A low-gain op-amp example.
Consider the non-inverting amplifier using an op-amp as in the circuit below.
In the non-inverting op-amp circuit, with primary input, , and
observed output, , the closed-loop gain steady-state gain is
where we say "approximately" because the formula is only exact if the op-amp has infinite open-loop gain.
When we represent the non-inverting amplifier op-amp circuit using block diagrams, we use Laplace transforms to convert dynamics into transfer functions, and organize the feedback structure by separating the open loop gain stage from the subtraction stage. That is, we introduce
and
as in the diagram below.
As an example, suppose , then
and , as in the above diagram, is given by
If we have an ideal op-amp, then the non-inverting amplifier gain, , will be equal to two. If we have a lousy op-amp, one with a steady-state gain of only 20, then the noninverting gain will be less than two. In particular, if the op-amp's transfer function, , is given by
then the closed-loop transfer function, , is given by
To determine the steady-state closed-loop gain, we evaluate at . For this case, the gain is , significantly below the ideal case closed-loop gain of two.
By adding a resistor divider between and , we could convert the approximate gain-of-two amplifier into an exact gain-of-one amplifier, but to do so, we would need to know the op-amp's exact transfer function (at least in steady-state). Such a strategy for designing a gain-of-one amplifier might not be particularly practical, but examining the strategy using a state-space approach will help clarify the roles of the matrices and vectors involved, and provide a concrete example of the often-confusing role of .
The generic State-Space Feedback System.
We can also describe the non-inverting amplifier circuit using a state-space model. The generic form of the state-space model using , and matrices is
and
or after Laplace transformation,
and
Reorganizing the transformed state-space model to more easily recognize the transfer function from the "plant" input, , (distinct from the primary input ) to the state, , we get
and
Applying state feedback to the state-space system yields the block diagram below, where is the state feedback gain and is the scaling of the primary input, .
State-space for Op-amps
How do we connect the block diagram for the op-amp to the block diagram for the state-space system? Let us consider a specific example, and suppose that the operational amplifier's open loop gain is given by
and that
If we write the differential equation for in terms of ,
where
and for the given resistor ratio,
To construct a state-space representation of this closed-loop op-amp circuit, suppose we choose to associate the state-space with the op-amp voltage , then what are the state-space matrices?
For this op-amp example, all the associated state-space matrices are (scalars), so we need only determine those scalar values. And in this case, we have NOT computed a to ensure unity steady-state gain. Instead, we are stuck with the that models the circuit. In fact, since , in this case. Also, we can assume that the observed output, , is equal to , so .
The remaining matrices can then be determined by matching the generic state-space model with the op-amp circuit, please determine , , , and to complete the model. Note, since the matrices are in this case (scalars), give your answers as scalar numbers (For example, use and NOT or ).
E=
Loading...
A=
Loading...
B=
Loading...
K=
Loading...
Focusing On Kr
When we modeled the non-inverting amplifier circuit, had to be equal to one because . But suppose we
insert a resistor divider between and , as in the diagram below.
We can use the divider to scale and thereby change . Suppose we want to select a so that the closed-loop transfer function from input to output,
is exactly one in steady state. At (for steady-state),
or
where we can use fraction notation since is a scalar.
The non-inverting op-amp circuit with implies the circuit was designed to have a steady-state gain of four, but by changing , we can achieve other steady-state gains, including EXACTLY unity. And since we can pick and in the above circuit to set , without altering , , , and , the values for the divider resistors are easily computed.
What is the EXACT value of so that the steady-state gain is EXACTLY one ( is approximately, but NOT EXACTLY, 0.25)!
R2/(R1+R2) =
Loading...
What is the value of so that the steady-state gain is EXACTLY FOUR ( is almost, but NOT EXACTLY, 1)!
=
Loading...
Check Yourself 1:
Can you implement a to get a steady state gain of EXACTLY four using a resistor divider on the input (No, do you see why)?
And what about the Pole?
When , where is the pole of the closed-loop op-amp system?
pole =
Loading...
If we made , where is the pole of the closed-loop op-amp system? And for , what value of will give us a steady-state closed-loop gain of EXACTLY one?
pole for K=10
Loading...
at K=10
Loading...
So, if we use a feedback gain of , meaning , the above op-amp model suggests we can make the closed-loop pole far more negative, and therefore get step responses that are much faster. Though, to maintain a steady-state closed-loop gain of one, we will also have to scale the primary input, , or . If we want a gain-of-one non-inverting amplifier to be ten times faster, we need two extra gain-of-ten amplifiers, hardly a practical trade-off. And if the op-amp's transfer function is more complicated, stability issues will also interfere (see the next example).
Check Yourself 2:
When we implement state feedback using microcontroller, we sense the states and then compute where is the sensed state and is the primary input. For example, could be the desired propeller arm angle, the elements of the vector could be the sensed angle, the sensed rotation rate, and the sensed propeller speed. The gains we multiply each of these sensed states by are much larger than one, but we do not even think about it. When we use a microcontroller to perform state feedback, we do not need an extra amplifiers whenever we want to scale a state by more than one. This simple observation is a big part of why the proliferation of inexpensive microcontrollers has dramatically increased the popularity of state-space controllers.
Three-Pole Op-amp Example in State-Space
Suppose the op-amp has an open-loop gain with the transfer function
For the non-inverting amplifier configuration, what is the smallest integer value for
(the formula for the closed-loop gain in the IDEAL op-amp case) such that the system has a phase margin of degrees, and when using those resistor values, what is the real part of the least stable pole and what is the actual closed-loop steady-state gain.
Lowest Gideal for 45 degrees phase =
Loading...
Real part of least stable pole
Loading...
Actual Steady-State Gain
Loading...
We can model this more complicated op-amp in state-space, and a simple way to derive the state-space model is to introduce a few auxillary variables. We define
and
Then is given by
We can then write a series of differential equations,
What are the state-space matrices for our three-pole op-amp model, assuming , and ,
and that we assign and . Enter the , , and matrices below for the state space representation, (Remember to use Python form, so if is , you should enter [[1,15]], and for a column vector, like
, you should enter [[1],[15]].)
E=
Loading...
A=
Loading...
B=
Loading...
C=
Loading...
Check Yourself 3:
Why are the poles of the open-loop state-space system equal to the diagonals of the matrix? The poles of the open-loop system are the eigenvalues of , since is the identity matrix. And since is triangular, its eigenvalues are its diagonal entries.
The Three Feedback Gains
For the non-inverting amplifier op-amp circuit, you determined the smallest integer value of so the amplifier would have a phase margin of degrees. Note that would be the closed-loop gain if the op-amp had been ideal, and in terms of (shorthand for , what is an expression for the ratio
Steady-State ratio Vout/V- =
Loading...
The state-space model derived above can describe a non-inverting amplifier with ideal-op-amp closed-loop gain of , provided feedback gains are chosen appropriately. Assuming is still the smallest integer such that the closed-loop system has degrees of phase margin, what are the feedback gains , and for the state-space model of that non-inverting amplifier? And, what is the closed-loop system matrix, .
K1
Loading...
K2
Loading...
K3
Loading...
A-BK
Loading...
Notice the location of the non-zero value associated with the one nonzero component of . Does the change in one location of cause a change in all the eigenvalues, or only one?
How many eigenvalues of A-BK are different from the eigenvalues of A?
Loading...
Check Yourself 4:
Notice that the matrix is not triangular, thanks to the fact that . Therefore, the poles are no longer equal to the matrix diagonals.
With the above gains, what value of will give us a steady-state closed-loop gain of EXACTLY one?
=
Loading...
If we can feedback a weighted combination of all three states, we can achieve far faster response times. Using Matlab's place command, find values for , and so that the poles of the closed-loop state-space system are , and . Additionally find the value of so that the steady-state gain is exactly one.
K1
Loading...
K2
Loading...
K3
Loading...
Loading...
And what is the associated ?
A-BK
Loading...
Notice that it was not necessary to use very large gains to produce a dramatic improvement in performance. The performance was achieved by observing all the states in the system, and then acting on that collection of information. With classical control, the feedback was based on a single state (the output in this case), and the results were much poorer.
A quick trick of zero value for E
Suppose the open-loop transfer function for the op-amp gain had a zero,
that is, suppose
Could you update the state-space system above to include the zero by only changing ? And if so, what would that change be?
E=
Loading...
We have used matlab's place command to determine the gains needed to place the closed-loop poles in specified locations. But to use the place command, the system has to be converted to "normal form",
or equivalently, matrix has to be the identity.
What are and for our three-state system?
An=
Loading...
Bn=
Loading...
Find values for , and so that the poles of this new closed-loop state-space system are , and , and find the value of so that the steady-state gain is exactly one.
K1
Loading...
K2
Loading...
K3
Loading...
Loading...
Could you have guessed how the 's would change after including a single zero in the transfer function? We could not.