Every engineered component has some function. A function can be described as a transformation of inputs to outputs. For example it could be an amplifier that accepts a signal from a sensor and amplifies it. Or, consider a mechanical gear box with an input and output shaft. A manual transmission has an input shaft from the motor and from the shifter. When analyzing systems we will often use transfer functions that describe a system as a ratio of output to input.
Transfer functions are used for equations with one input and one output variable. An example of a transfer function is shown below in Figure 9.1 A transfer function example. The general form calls for output over input on the left hand side. The right hand side is comprised of constants and the 'D' operator. In the example 'x' is the output, while 'F' is the input.
Figure 9.1 A transfer function example
If both sides of the example were inverted then the output would become 'F', and the input 'x'. This ability to invert a transfer function is called reversibility. In reality many systems are not reversible.
There is a direct relationship between transfer functions and differential equations. This is shown for the second-order differential equation in Figure 9.2 The relationship between transfer functions and differential equations for a mass-spring-damper example. The homogeneous equation (the left hand side) ends up as the denominator of the transfer function. The non-homogeneous solution ends up as the numerator of the expression.
Figure 9.2 The relationship between transfer functions and differential equations for a mass-spring-damper example
The transfer function for a first-order differential equation is shown in Figure 9.3 A first-order system response. As before the homogeneous and non-homogeneous parts of the equation becomes the denominator and the numerator of the transfer function.
Figure 9.3 A first-order system response
Figure 9.4 An automotive cruise control system shows a transfer function block for a car. The input, or control variable is the gas pedal angle. The system output, or result, is the velocity of the car. In standard operation the gas pedal angle is controlled by the driver. When a cruise control system is engaged the gas pedal must automatically be adjusted to maintain a desired velocity setpoint. To do this a control system is added, in this figure it is shown inside the dashed line. In this control system the output velocity is subtracted from the setpoint to get a system error. The subtraction occurs in the summation block (the circle on the left hand side). This error is used by the controller function to adjust the control variable in the system. Negative feedback is the term used for this type of controller.
Figure 9.4 An automotive cruise control system
There are two main types of feedback control systems: negative feedback and positive feedback. In a positive feedback control system the setpoint and output values are added. In a negative feedback control the setpoint and output values are subtracted. As a rule negative feedback systems are more stable than positive feedback systems. Negative feedback also makes systems more immune to random variations in component values and inputs.
The control function in Figure 9.4 An automotive cruise control system can be defined many ways. A possible set of rules for controlling the system is given in Figure 9.5 Example control rules. Recall that the system error is the difference between the setpoint and actual output. When the system output matches the setpoint the error is zero. Larger differences between the setpoint and output will result in larger errors. For example if the desired velocity is 50mph and the actual velocity 60mph, the error is -10mph, and the car should be slowed down. The rules in the figure give a general idea of how a control function might work for a cruise control system.
Figure 9.5 Example control rules
In following sections we will examine mathematical control functions that are easy to implement in actual control systems.
The Proportional Integral Derivative (PID) control function shown in Figure 9.6 A PID controller equation is the most popular choice in industry. In the equation given the 'e' is the system error, and there are three separate gain constants for the three terms. The result is a control variable value.
Figure 9.6 A PID controller equation
Figure 9.7 A PID control system shows a basic PID controller in block diagram form. In this case the potentiometer on the left is used as a voltage divider, providing a setpoint voltage. At the output the motor shaft drives a potentiometer, also used as a voltage divider. The voltages from the setpoint and output are subtracted at the summation block to calculate the feedback error. The resulting error is used in the PID function. In the proportional branch the error is multiplied by a constant, to provide a longterm output for the motor (a ballpark guess). If an error is largely positive or negative for a while the integral branch value will become large and push the system towards zero. When there is a sudden change in the error value the differential branch will give a quick response. The results of all three branches are added together in the second summation block. This result is then amplified to drive the motor. The overall performance of the system can be changed by adjusting the gains in the three branches of the PID function.
Figure 9.7 A PID control system
There are other variations on the basic PID controller shown in Figure 9.8 Some other control equations. A PI controller results when the derivative gain is set to zero. (Recall the second order response.) This controller is generally good for eliminating long term errors, but it is prone to overshoot. In a P controller only the proportional gain in non-zero. This controller will generally work, but often cannot eliminate errors. The PD controller does not deal with longterm errors, but is very responsive to system changes.
Figure 9.8 Some other control equations
A block diagram for a system is not unique, meaning that it may be manipulated into new forms. Typically a block diagram will be developed for a system. The diagram will then be simplified through a process that is both graphical and algebraic. For example, equivalent blocks for a negative feedback loop are shown in Figure 9.9 A negative feedback block reduction, along with an algebraic proof.
Figure 9.9 A negative feedback block reduction
Other block diagram equivalencies are shown in Figure 9.10 A positive feedback block reduction to Figure 9.16 Moving summation function past blocks. In all cases these operations are reversible. Proofs are provided, except for the cases where the equivalence is obvious.
Figure 9.10 A positive feedback block reduction
Figure 9.11 Reversal of function blocks
Figure 9.12 Moving branches before blocks
Figure 9.13 Combining sequential function blocks
Figure 9.14 Moving branches after blocks
Figure 9.15 Moving summation functions before blocks
Figure 9.16 Moving summation function past blocks
Recall the example of a cruise control system for an automobile presented in Figure 9.4 An automotive cruise control system. This example is extended in Figure 9.17 An example of simplifying a block diagram to include mathematical models for each of the function blocks. This block diagram is first simplified by multiplying the blocks in sequence. The feedback loop is then reduced to a single block. Notice that the feedback line doesn't have a function block on it, so by default the function is '1' - everything that goes in, comes out.
Figure 9.17 An example of simplifying a block diagram
The function block is further simplified in Figure 9.18 An example of simplifying a block diagram (continued) to a final transfer function for the whole system.
Figure 9.18 An example of simplifying a block diagram (continued)
Consider the example of a DC servo motor controlled by a computer. The purpose of the controller is to position the motor. The system in Figure 9.19 A motor feedback control system shows a reasonable control system arrangement. Some elements such as power supplies and commons for voltages are omitted for clarity.
Figure 9.19 A motor feedback control system
The feedback controller can be represented with the block diagram in Figure 9.20 A block diagram for the feedback controller.
Figure 9.20 A block diagram for the feedback controller
The transfer functions for each of the blocks are developed in Figure 9.21 Transfer functions for the power amplifier, potentiometer and motor shaft. Two of the values must be provided by the system user. The op-amp is basically an inverting amplifier with a fixed gain of -2.2 times. The potentiometer is connected as a voltage divider and the equation relates angle to voltage. Finally the velocity of the shaft is integrated to give position.
Figure 9.21 Transfer functions for the power amplifier, potentiometer and motor shaft
The basic equation for the motor is derived in Figure 9.22 Transfer function for the motor using experimental data. In this case the motor was tested with the full inertia on the shaft, so there is no need to calculate 'J'.
Figure 9.22 Transfer function for the motor
The individual transfer functions for the system are put into the system block diagram in Figure 9.23 The system block diagram, and simplification. The block diagram is then simplified for the entire system to a single transfer function relating the desired voltage (setpoint) to the angular position (output). The transfer function contains the unknown gain value 'Kp'.
Figure 9.23 The system block diagram, and simplification
The value of 'Kp' can be selected to 'tune' the system performance. In Figure 9.24 Calculating a gain Kp the gain value is calculated to give the system an overall damping factor of 1.0, or critically damped. This is done by recognizing that the bottom (homogeneous) part of the transfer function is second-order and then extracting the damping factor and natural frequency. The final result of 'Kp' is negative, but this makes sense when the negative gain on the op-amp is considered.
Figure 9.24 Calculating a gain Kp
System error is often used when designing control systems. The two common types of error are system error and feedback error. The equations for calculating these errors are shown in Figure 9.25 Controller errors. If the feedback function 'H' has a value of '1' then these errors will be the same.
Figure 9.25 Controller errors
An example of calculating these errors is shown in Figure 9.26 System error calculation example for a step input. The system is a simple integrator, with a unity feedback loop. The overall transfer function for the system is calculated and then used to find the system response. The response is then compared to the input to find the system error. In this case the error will go to zero as time approaches infinity.
Figure 9.26 System error calculation example for a step input
Figure 9.27 Drill problem: Calculate the system error for a ramp input
Figure 9.28 Drill problem: Calculate the errors
The PID controller, and simpler variations were discussed in earlier sections. A more complete table is given in Figure 9.29 Standard controller types.
Figure 9.29 Standard controller types
When a model of a system is well known it can be used to improve the performance of a control system by adding a feedforward function, as pictured in Figure 9.30 A feed forward controller. The feedforward function is basically an inverse model of the process. When this is used together with a more traditional feedback function the overall system can outperform more traditional controllers function, such as the PID controller.
Figure 9.30 A feed forward controller
State variable matrices were introduced before. These can also be used to form a control system, as shown in Figure 9.31 A state variable control system.
Figure 9.31 A state variable control system
An example is shown in Figure 9.32 A second order state variable control system that implements a second order state equation. The system uses two integrators to integrate the angular acceleration, then the angular velocity, to get the position.
Figure 9.32 A second order state variable control system
The previous block diagrams are useful for simulating systems. These can then be used in feedforward control systems to estimate system performance and then predict a useful output value.
Figure 9.33 A state based feedforward controller
When controlling a multistep process a cascade controller can allow refined control of sub-loops within the larger control system. Most large processes will have some form of cascade control. For example, the inner loop may be for a heating oven, while the outer loop controls a conveyor feeding parts into the oven.
Figure 9.34 A cascade controller
- if a feedback control function is to be implemented in software the transfer function can be converted to a C subroutine.
- the method shown here is crude - more mature methods use the z-transforms
- consider the implementation of the following control function as a subroutine.
Figure 9.35 Converting Transfer Functions to C Code
· Transfer functions can be used to model the ratio of input to output.
· Block diagrams can be used to describe and simplify systems.
· Controllers can be designed to meet criteria, such as damping ratio and natural frequency.
· System errors can be used to determine the long term stability and accuracy of a controlled system.
· Other control types are possible for more advanced systems.
1. Develop differential equations and then transfer functions for the mechanical system below. There is viscous damping between the block and the ground. A force is applied to cause the mass the accelerate.
2. Develop a transfer function for the system below. The input is the force `F' and the output is the voltage `Vo'. The mass is suspended by a spring and a damper. When the spring is undeflected y=0. The height is measured with an ultrasonic proximity sensor. When y = 0, the output Vo=0V. If y=20cm then Vo=2V and if y=-20cm then Vo=-2V. Neglect gravity.
3. Find the transfer function for the systems below. Here the input is a torque, and the output is the angle of the second mass.
4. Find the transfer functions for the system below where Vi is the input and Vo is the output.
5. Given the transfer function, G(s), determine the time response output Y(t) to a step input X(t).
6. Given the transfer function below, develop a mechanical system that it could represent. (Hint: Differential Equations).
7. Given a mass supported by a spring and damper, find the displacement of the supported mass over time if it is released from neutral at t=0sec, and gravity pulls it downward.
a) develop a transfer function for y/F.
b) find the input function F.
c) solve the input output equation to find an explicit equation of the position as a function of time for Ks = 10N/m, Kd = 5Ns/m, M=10kg.
d) solve part c) numerically.
8. a) What is a Setpoint, and what is it used for? b) What does feedback do in control systems?
9. The block diagram below is for a servo motor position control system. The system uses a proportional controller.
a) Draw a sketch of what the actual system might look like. Identify components.
b) Convert the system to a transfer function.
10. Simplify the block diagram below to a transfer function.
11. Simplify the block diagram below. (Note: Vn is an input and cannot be combined in a transfer function.)
12. a) Develop an equation for the system below relating the two inputs to the output. Put it in block diagram format. (Hint: think of a summation block.)
b) Develop an equation for the system below relating the input to the output. Put the result in block diagram format.
c) The equation below can be used to model a permanent magnet DC motor with an applied torque. An equivalent block diagram is given. Prove that the block diagram is equivalent to the equation.
d) Write the transfer function for the system below relating the input torque to the output angle theta2. Then write the transfer function for the angular velocity of mass 2.
e) The system below is a combination of previous components, and a tachometer for velocity feedback. Simplify the block diagram.
13. Find the system output, feedback error and system error when the input is a ramp with the function c(t) = 0.5t. Sketch the system errors as a function of time.
14. Given the block diagram below, select a system gain K that will give the overall system a damping ratio of 0.7 (for a step input). What is the resulting damped frequency of the system?
15. The following system is a feedback controller for an elevator. It uses a desired height `d' provided by a user, and the actual height of the elevator `h'. The difference between these two is called the error `e'. The PID controller will examine the value `e' and then control the speed of the lift motor with a control voltage `c'. The elevator and controller are described with transfer functions, as shown below. all of these equations can be combined into a single system transfer equation as shown.
a) Find the response of the final equation to a step input. The system starts at rest on the ground floor, and the input (desired height) changes to 20 as a step input.
b) Calculate the damping factor and natural frequency of the results in part a).
16. Study the circuit below. Assume that for t<0s the circuit is discharged and off. Starting at t=0s an input of Vi=5sin(100,000t) is applied.
a) Write a differential equation and then a transfer function describing the circuit.
b) Find the output of the circuit using explicit integration (i.e., homogeneous and particular solutions).
17. Write a C subroutine to implement the control system that is shown inside the dashed line. The subroutine arguments are the setpoint, C, and the feedback value, F. the subroutine returns the new controller output value, U.
18. Convert the following block diagram to state equations. Pick a K value that would leave the system critically damped.
19. Write a function in C that implements a PID function using the following function prototype. The function accepts the desired and current values and returns the controller output.
20. Simplify the block diagram below to a transfer function.
21. Write the differential equation for the control system below.
1. Develop a transfer function for the circuit below.
2. Given the transfer functions and input functions, F, use a numerical method to calculate the output of the system as a function of time for 0 to 0.5 seconds in 0.05 second intervals. Record the values in a table.
3. Simplify the following block diagram.
4. Simplify the following block diagram.
5. Simplify the following block diagram.
6. Simplify the following block diagram.
7. Simplify the following block diagram.
8. Simplify the following block diagram for a crane gantry position control system. The system also includes a negative feedback loop to control the sway of an attached load
9. Write a C subroutine to implement the control system that is shown inside the dashed line. The subroutine arguments are the setpoint, C, and the feedback value, F. the subroutine returns the new controller output value, U.
10. Write C subroutines to implement the control system that is shown inside the dashed line. The subroutine arguments are the setpoint, C, and the feedback value, F. the subroutine returns the new controller output value, U.
11. Simplify the block diagram below and find the overall transfer function for the system.
12. Given the following negative feedback control system, calculate a new controller transfer function (Gc) to get the desired response for the system.
13. Write a C subroutine that implements the control function below. (Hint: Convert it to state equations first.)
14. Develop a transfer function for the following system. The input is Vd and the output is the motor shaft speed. Assume all components are ideal. The motors are identical with a resistance of 10 ohms. With an input voltage of 4V the motors spin at 4000RPM (steady state), and have a time constant of 0.1s.
15. Develop a transfer function for the following system. The input is Vd and the output is the motor shaft position. Assume all components are ideal. The motor has a resistance of 10 ohms. With an input voltage of 4V the motor spins at 4000RPM (steady state), and has a time constant of 0.1s. When the potentiometer is rotated +180 degrees the output is 5V, a rotation of -180 degrees results in an output of -5V.