EEE 88: Digital Control Systems Lecture summary # the controlled variable. Example: cruise control. In feedback control, sensors and measurements play an important role. In discrete time systems, the control is updated at discrete time instants. erminology Plant: system/process to be controlled Reference input: desired value for the output. Control error: the difference between the reference input and the measured value of the output Disturbance: undesired input. Controller: a system used to regulate, correct or change the behavior of the controlled system. Measured output: Measurable characteristics of the plant Control input: variable allowing to regulate or change the behavior of the plant Sensor: a transducer allowing to obtain the numerical value of the output so that it is compared with the reference input. Fig.. Open loop vs closed loop control systems his class is about digital controls: we want to regulate the characteristics or behavior of a given system using a feedback controller. he main idea behind feedback control is to use measurements of the system s output to achieve the desired goals. Control systems are an important part of our daily life, they are used every where: In cars In industrial processes In homes... Examples: Cruise control achieves the desired speed by adjusting the acceleration based on the speed measured from the speedometer. A thermostat achieves the desired temperature by adjusting the furnace cycle and fan. An important part of control systems is about understanding the effects of the controller and disturbance on the output of the system. here are two formulations to solve control problems: Open loop control systems: no feedback loop is used. An open-loop controller is usually used to control simple processes because of its simplicity and low cost. Example: conventional washing machine. Closed loop control systems (feedback): the system is self adjusting based on the measured change of CONROL OBJECIVES he most common objectives of a control system are: Regulatory control: ensure that the measured output is equal (or near) to the reference input. Stability, steady state error, and transients are among the most important factors to consider, as illustrated in figures 2, 3, and 4. he goal is to obtain a reasonable settling time, reduce overshoot and steady state error, and guarantee stability. Disturbance rejection: ensure disturbance does not affect the system output. Optimization: achieve the best response with respect to some predefined criteria. Example: minimize the settling time, minimize fuel, etc... his class deals mainly with regulatory control. Most controllers use negative feedback where the controlled variable is compared to the reference value, that is error= desired value- actual value () his error plays an important role in controller design. Car-following problem EXAMPLES OF CONROL SYSEMS Consider a car-following problem where we want vehicle 2 to follow vehicle at constant distance assuming that vehicle moves in a straight line. he block diagram is shown in figure 5 where Reference is r, the desired constant distance
Digital Control Systems, spring 28 Summary.8.7.6.5.4.3.2 Step response Step response 2..5.5 2 2.5 3 3.5 ime (seconds) Fig. 2. ime response illustrating problems in regulatory control: different settling times. Ideally, we want to get a reasonable value for the settling time. hat reasonable value is dictated by the application..8 Steady state error Fig. 5. A simple control problem Output variable (measured output): r(t) Control input: speed of vehicle 2..6.4.2.5.5 2 2.5 3 3.5 ime (seconds) Fig. 3. ime response illustrating problems in regulatory control: non-zero steady state error. Ideally, we want to achieve zero steady state error 2.5.5 DC motor angle control We want to control the angle of a DC motor; the control input is the voltage and the output variable is the angle. A simple proportional controller is used. he block diagram is shown in figure 3 bottom Desired angle position: 42 o. Encoder or potentiometer: sensors that can be used to measure the angle. Proportional controller: v = K(42 θ). As θ 42, v he plant (motor) has a transfer function: transfer function = output input = Θ(s) V (s) How can we obtain the transfer function of a DC motor? he transfer function is a mathematical model that can be obtained using extensive experiments. Several methods exist to approximate the transfer function of a system. Match the mathematical models with the motor s parameters obtained from the manufacturer. Apply a step input and obtain the time response. he type and the characteristics of the response are used to get the frequency domain open loop transfer function. (2).5.5 2 2.5 3 3.5 ime (seconds) Fig. 4. ime response illustrating problems in regulatory control: high percent overshoot. Ideally, damping has to be reduced to a reasonable value I. COMPARISON BEWEEN DIGIAL AND ANALOG CONROLLERS: In a digital control problem, the controller and the controlled process to not speak the same language, for this reason we have the DAC (D/A) and the ADC (A/D) to translate. 2
Digital Control Systems, spring 28 Summary Fig. 6. op: digital controllers and bottom: DC motor example block diagram Fig. 7. Illustration of digital controllers Frequency Domain ransfer function Laplace transform z transform ime Domain State space models differential equations difference equations wo formulations to study control systems: time domain and frequency domain as shown in the table. he z transform is plays important role in digital control and digital signal processing. SAMPLING Continuous controllers are built using analog electronics such as resistor, capacitors, and operational amplifiers. Digital controllers use digital computers (including micro controllers) here exist two representations for signals: ime domain: the system is represented by difference or differential equations Frequency domain: the system is represented by the z-transform or the Laplace transform. Continuous x(t) Laplace transform Digital x(k) z transform Analog to digital conversion (ADC) allows to convert the analog signal x(t) to a discrete signal x(k) as illustrated in figures 8 and 9. he conversion occurs at discrete times where: is the sampling period is the sampling frequency A sampler is basically a switch that closes every seconds, where is the sampling period. he switch closure time is c. In practice and control applications, the switch closure time (3) Fig. 8. Illustration of the ADC c is very small and therefore is neglected. his leads to the ideal sampler. he sampling theorem: he sampling frequency should be at least twice the highest frequency contained in the signal, that is: ω s > 2ω m (4) for band limited signals. In this case, the spectrum of the Fig. 9. Sampling process 3
Digital Control Systems, spring 28 Summary continuous time waveform can be recovered using an ideal low pass filter. A rule of thumb is to choose ω s as ω s = Kω m (5) with 5 K. he choice of K depends on the application and is constrained by the hardware. he samples need to provide good representation of the continuous time signal APPROXIMAION OF HE DERIVAIVE his method uses the definition of the derivative to obtain discrete time models from the continuous models. What is the derivative? ẋ = lim δx as δt (6) δt which can be written as: x(k + ) x(k) ẋ = (7) where k is an integer representing the discrete time. x(k) is the value of x(t) at time k x(k + ) is the value of x(t) at time (k + ) his approximation allows to transform a differential equation to a recursive algebraic equation. Example Convert the following systems to discrete time systems ẋ(t) = 3x(t) + 3u(t) (8) ẋ(t) = sin(x(t)) (9) ) For the first system: Recall that: x(k + ) x(k) ẋ(t) = () from which we can write: x(k + ) x(k) = 3x(k) + 3u(k) () x(k + ) = [ 3x(k) + 3u(k)] + x(k) (2) 2) For the second system: x(k + ) x(k) = sin(x(k)) (3) x(k + ) = [ sin(x(k))] + x(k) (4) Equations (2) and (4) are called difference equations. Can you solve these equations? For example, find x()? No, you need an initial condition. his is an initial value problem. Difference equations can be easily solved numerically: calculate the current sample using the previous ones. How to algebraically solve linear differential equations? One way is to use Laplace transform. In a similar way, linear difference equations can be solved algebraically using the z-transform. HE z-ransform he z-transform is a mathematical operator used for digital systems and signals. It can be seen as the discrete version of the Laplace transform. Difference equations can be solved using the z-transform. he z-transform is an important tool in the analysis and design of discrete time control systems. What is the advantage of the z-transform from system s point of view? In the frequency domain, the convolution becomes a multiplication. Definition Causal system: signal has zero value for negative time. Definition Given a causal sequence {u(), u(), u(2),..., u(k),...}, its z-transform is defined as U(z) = u() + u()z + u(2)z 2 +... + u(k)z k (5) U(z) = k= k= u(k)z k (6) In this case, z can be seen as some kind of delay. Example Obtain the z-transform of the sequence: u(k) = {, 3, 2,, 4} (7) Using the definition of the z-transform, it is possible to write Example 2: Unit impulse U(z) = + 3z + 2z 2 + 4z 4 (8) he unit impulse is given by { for k = u(k) = δ(k) = for k Using the definition again, we get Example 3: Sampled step he sampled step is given by (9) U(z) = (2) u(k) = {,,,,...} (2) 4
Digital Control Systems, spring 28 Summary FINAL VALUE HEOREM We are interested in the final value of the sequence, that is f( ). heorem If a sequence approaches a constant limit as k approaches infinity, then the limit is given by f( ) = lim f(k) = lim k z A. Questions z F (z) = lim(z )F (z) z z (28) What is the keyword in the theorem? he answer is: the limit needs to exist. Does the theorem apply to an oscillatory signal (sine wave for example)? No, because the limit does not exist. Fig.. Some common discrete time signals Using the definition again, we get REMARK How did we get equation (26) from equation (25)? with x < x = + x + x2 + x 3 +... (29) which can be simplified to Example 4: Exponential with a <. u(k) = U(z) = z k (22) U(z) = z (23) { a k for k for k < (24) Proof S = + x + x 2 + x 3 +... (3) S = + x( + x + x 2 + x 3 +...) (3) S = + xs (32) S = x (33) We have U(z) = + az + a 2 z 2 + a 3 z 3 +... + a k z k +... (25) which can be simplified to U(z) = a z = z z a (26) Let then SOME PROPERIES OF HE Z RANSFORM Z{f(k)} = F (z) (27) Linearity: Z{αf (k) + βf 2 (k)} = αf (z) + βf 2 (z) ime delay: Z{f(k n)} = z n F (z) ime advance: Z{f(k + )} = zf (z) zf() Multiplication by an exponential: Z{a k f(k)} = F (a z) 5