discrete time systems discrete time systems & difference equations

44
DIGITAL CONTROL (EEEE 789) DIGITAL CONTROL (EEEE 789) Dr. AbdullaIsmail Professor of Electrical Engineering [email protected]

Upload: ronald-george

Post on 03-Sep-2015

102 views

Category:

Documents


8 download

DESCRIPTION

Discrete Time Systems Discrete Time Systems & Difference Equations

TRANSCRIPT

  • DIGITAL CONTROL (EEEE 789)Dr. AbdullaIsmailProfessor of Electrical [email protected]

  • Introduction to Digital ControlDiscrete Time Systems & Difference EquationsThe Z-transformImpulse Response and Step response of Discrete-Time SystemsFrequency Response of Discrete-Time SystemsModeling Digital Control SystemsSteady-State Error Computation for Digital Control SystemsStability of Digital Control SystemsDigital Control System DesignState-Space Analysis of Discrete-Time SystemsCourse Outline (Topics):Digital Control

    Digital Control

  • Digital Control*Digital control involves systems whose control is updated at discrete time instants.Discrete-time models provide mathematical relations between the system variables at these time instants. Here, we develop the mathematical properties of discrete-time models.Difference Equations are used to model Discrete Time Dynamical Systems.IntroductionDiscrete Time Systems

    Digital Control

  • Digital Control*Analog Systems with Piecewise Constant InputsIn most engineering applications, it is necessary to control a physical system or plant so that it behaves according to given design specifications. Typically, the plant is analog, the control is piecewise constant, and the control action is updated periodically. This arrangement results in an overall system that is conveniently described by a discrete-time model. We demonstrate this concept using a simple example.Discrete Time Systems

    Digital Control

  • Digital Control*Analog Systems with Piecewise Constant InputsExample 1Consider the tank control system of Figure 1. In the figure, lowercase letters denote perturbations from fixed steady-state values. The variables are defined asIt is necessary to maintain a constant fluid level by adjusting the fluid flow rate into the tank. Obtain an analog mathematical model of the tank, and use it to obtain a discrete-time model for the system with piecewise constant inflow qi and output h.Discrete Time Systems

    Digital Control

  • Digital Control*Example 1 .. SolutionAlthough the fluid system is nonlinear, a linear model can satisfactorily describe the systemThe linearized model for the outflow valve is analogous to an electrical resistor and is given byDiscrete Time SystemsAnalog Systems with Piecewise Constant Inputs

    Digital Control

  • Digital Control*Example 1 .. SolutionAssuming an incompressible fluid, the principle of conservation of mass reduces to the volumetric balance: rate of fluid volume increase = rate of volume fluid in rate of volume fluid out:where C is the area of the tank or its fluid capacitance. The term H is a constant and its derivative is zero, and the term Q cancels so that the remaining terms only involve perturbations. Substituting for the outflow q0 from the linearized valve equation into the volumetric fluid balance gives the analog mathematical modelwhere = RC is the fluid time constant for the tank.Discrete Time SystemsAnalog Systems with Piecewise Constant Inputs

    Digital Control

  • Digital Control*Example 1 .. SolutionThe solution of this differential equation where the variables at time kT are denoted by the argument k. This is the desired discrete time model describing the system with piecewise constant control.The obtained model is called a difference equation.For a linear time-invariant analog plant, we have a linear time-invariant difference equation.

    Analog Systems with Piecewise Constant InputsDiscrete Time Systems

    Digital Control

  • Digital Control*Difference Equations Difference equations arise in problems where the independent variable, usually time, is assumed to have a discrete set of possible values. The nonlinear difference equationThe equations we deal with in this text are almost exclusively linear and are of the formwith forcing function u(k) is said to be of order n because the difference between the highest and lowest time arguments of y(.) and u(.) is n.

    Digital Control

  • Digital Control*Difference Equations We further assume that the coefficients ai, bi, i = 0, 1, 2, . . . , are constant. The difference equation is then referred to as linear time invariant, or LTI. If the forcing function or input u(k) is equal to zero, the equation is said to be homogeneous.Difference equations can be solved using iterations.Alternatively, Z-transform method provide a convenient approach for solving LTI difference equations, as discussed in the next section.

    Digital Control

  • Digital Control*Difference Equations ExampleDetermine the order of the equation. Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?(iii)(ii)(i)

    Digital Control

  • Digital Control*Difference Equations Example (i) .. solutionDetermine the order of the equation. Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?Second order. All terms linear and have constant coefficients LTI. A forcing function appears in the equation nonhomogeneous.

    Digital Control

  • Digital Control*Difference Equations Example (ii) .. solutionDetermine the order of the equation. Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?Fourth order. Second coefficient is time-dependent but all the terms are linear linear time varying. No forcing function homogeneous.

    Digital Control

  • Digital Control*Difference Equations Example (iii) .. solutionDetermine the order of the equation. Is the equation (a) linear ? (b) time-invariant ? (c) homogeneous ?First order. RHS is a nonlinear function of y(k) nonlinear.No forcing function homogeneous. No terms depending explicitly on time time invariant.

    Digital Control

  • Digital Control*Solution of Difference Equations Solution by iterations.Solution by Z-transform Method.

    Digital Control

  • Digital Control*Difference Equations Example 1The DT input(sequence) x[k] = 2ku[k] is applied to the discrete time system described by the following difference equation:y[k + 1] 0.4 y[k] = x[k].Solve for y(k) by iteration (0 k 5) given the initial condition y[1] = 4 and the input sequence to be a ramp of amplitude 2, i.e. 2ku(k).DTSx[k]y[k]

    Digital Control

  • Digital Control*Difference Equations Example 1 .. SolutionExpress y[k + 1] 0.4y[k] = x[k] as follows:y[k] = 0.4y[k 1] + x[k 1] = 0.4y[k 1] + 2(k 1) u(k 1)which can alternatively be expressed asDTSInput sequence x[k]Output sequence y[k]

    Digital Control

  • Digital Control*Difference Equations Example 1 .. SolutionBy iterating from k = 0, the output response is computed as follows:DTSInput sequence x[k]Output sequence y[k]

    Digital Control

  • Digital Control*Difference Equations The output response y[k] can be expressed asThe zero-input component yzi[k] for a DT system is the response produced by the system because of the initial conditions, and is not due to any external input.To calculate the zero-input component yzi[k], we assume that the applied input sequence x[k] = 0. On the other hand, the zero-state response yzs[k] arises due to the input sequence and does not depend on the initial conditions of the system.To calculate the zero-state response yzs[k], the initial conditions are assumed to be zero.

    Digital Control

  • Digital Control*Difference Equations Example 2Repeat Example1 to calculate the zero-input response yzi[k], (ii) the zero-state response yzs[k], and (iii) the overall output response y[k] for 0 k 5.y[k + 1] 0.4y[k] = x[k].x[k] = 2ku[k]

    Digital Control

  • Digital Control*Example 2 .. Solution(i) The zero-input response of the system is obtained by solving the following difference equation:y[k + 1] 0.4y[k] = x[k],with input x[k] = 0 and initial condition y[1] = 4. The difference equation reduces towith initial condition yzi[1] = 4.Iterating for k = 0, 1, 2, 3, 4, and 5 yieldsDifference Equations

    Digital Control

  • Digital ControlExample 2 .. Solution(ii) The zero-state response of the system is calculated by solving the following difference equation:Difference Equations with initial condition yzs[1] = 0.Iterating the difference equation for k = 0, 1, 2, 3, 4, and 5 yields

    Digital Control

  • Digital ControlExample 2 .. SolutionDifference Equations (iii) Adding the zero-input and zero-state components obtained in parts (i) and (ii), yieldsNote that the overall output response y[k] is identical to the output response obtained in Example 1.

    Digital Control

  • Digital Control*Impulse response of a systemIn last section, a constant-coefficient difference equation is used to specify the inputoutput characteristics of an LTID system. In this section, we will define the impulse response of DTS and illustrate how the impulse response of an LTID system can be derived directly from the difference equation modeling the LTID system.

    Digital Control

  • Digital Control*Impulse response of a systemDefinition1 The impulse response h[k] of an LTID system is the output of the system when a unit impulse [k] is applied at the input of the LTID system. The impulse response can be expressed as follows:[k] h[k],with zero initial conditions.Note that an LTID system satisfies the linearity and the time-shifting properties.Therefore, if the input is a scaled and time-shifted impulse function a[k k0], the output of the DT system is also scaled by a factor of a and time-shifted by k0, i.e.a[k k0] ah[k k0],for any arbitrary constants a and k0.

    Digital Control

  • Digital Control*Impulse response of a systemExample 3Consider the LTID systems with the following inputoutput relationships:Calculate the impulse responses for the two LTID systems. Also, determine the output responses of the LTID systems when the input is given by x[k] = 2[k] + 3[k 1].

    Digital Control

  • Digital Control*Impulse response of a systemExample 3 .. Solution(i) (a) The impulse response of a system is the output of the system when the input sequence x[k] = [k]. Therefore, the impulse response h[k] of system (i) canbe obtained by substituting y[k] by h[k] and x[k] by [k] in Eq. y[k] = x[k 1] + 2x[k 3]In other words, the impulse response for system (i) is given byh[k] = [k 1] + 2[k 3].

    Digital Control

  • Digital Control*Impulse response of a systemExample 3 .. Solution(b) To evaluate the output response resulting from the input sequence x[k] = 2[k] + 3[k 1], we use the linearity and time-invariance properties of the system. The outputs resulting from the two terms 2[k] and 3[k 1] in the input sequence are as follows:2[k] 2h[k] = 2[k 1] + 4[k 3]and3[k 1] 3h[k 1] = 3[k 2] + 6[k 4].Applying the superposition principle, the output y[k] to input x[k] = 2[k] + 3[k 1] is given by

    Digital Control

  • Digital Control*Impulse response of a systemExample 3 .. Solution2[k] + 3[k 1] 2h[k] + 3h[k 1]ory[k] = (2[k 1] + 4[k 3]) + (3[k 2] + 6[k 4]) = 2[k 1] + 3[k 2] + 4[k 3] + 6[k 4]).(ii) (a) On substituting y[k] by h[k] and x[k] by [k] in Eq. y[k + 1] 0.4y[k] = x[k] , the impulse response of the LTID system (ii) is represented by the following recursive equation: h[k + 1] 0.4h[k] = [k].

    Digital Control

  • Digital Control*Impulse response of a systemExample 3 .. SolutionThe above Eq. is a difference equation, which can be solved by substituting k = m 1. The resulting equation is given by h[m] = [m 1] + 0.4h[m 1]To solve for the delayed response h[m 1], we substitute k = m 2 in Eq. h[k + 1] 0.4h[k] = [k] . The resulting expression is given by h[m 1] = [m 2] + 0.4h[m 2].Substituting the above value of h[m 1] from the Eq. for h[m - 1] in the Eq. h[k + 1] 0.4h[k] = [k] yields h[m] = [m 1] + 0.4[m 2] + (0.4)2h[m 2].

    Digital Control

  • Digital Control*Impulse response of a systemExample 3 .. SolutionThe aforementioned procedure can be repeated for the delayed impulse response h[m 3] on the right-hand side of the equation, then for the resulting h[m 4], and so on. The final result is as follows:ororwhich is the required expression for the impulse response of the system.

    Digital Control

  • Digital ControlImpulse response of a systemExample 3 .. Solution(b) Next, we proceed to calculate the output of the LTID system for the input sequence x[k] = 2[k] + 3[k 1]. Because the system is linear and time-invariant, the output sequence y[k] resulting from input x[k] = 2[k] + 3[k 1] is given by 2[k] + 3[k 1] 2h[k] + 3h[k 1] , or

    Digital Control

  • Digital ControlImpulse response of a systemExerciseThe impulse response of an LTID system is given by h[k] = 0.5ku[k]. Determine the output of the system for the input sequence x[k] = [k 1] + 3[k 2] + 2[k 6].

    Digital Control

  • Digital ControlImpulse response of a systemExercise .. SolutionThe impulse response of an LTID system is given by h[k] = 0.5ku[k]. Determine the output of the system for the input sequence x[k] = [k 1] + 3[k 2] + 2[k 6].Because the system is LTID, it satisfies the linearity and time-shifting properties. The individual responses to the three terms [k 1], 3[k 2], and 2[k 6] in the input sequence x[k] are given by

    Digital Control

  • Digital ControlImpulse response of a systemExercise .. SolutionandApplying the principle of superposition, the overall response to the input sequence x[k] is given byy[k] = h[k 1] + 3h[k 2] + 2h[k 6].

    Digital Control

  • Digital ControlImpulse response of a systemExercise .. SolutionOutput y[k] of the LTID system for inputx[k] = [k 1] + 3[k 2] + 2[k 6].The impulse response h[k] and the resulting output sequence are plotted below

    Digital Control

  • Digital ControlMATLAB APPLICATIONEXAMPLE 1 The DT sequence x[k] = 2ku[k] is applied at the input of an LTID system described by the following difference equation: y[k + 1] 0.4 y[k] = x[k], with the initial condition y[1] = 4. Compute the output response y[k] of the LTID system for 0 k 50 using MATLAB.

    Digital Control

  • Digital ControlMATLAB APPLICATIONEXAMPLE 1

    Digital Control

  • Digital ControlMATLAB APPLICATIONEXAMPLE 2 The DT sequence x[k] = 0.5ku[k] is applied at the input of an LTID system described by the following second-order difference equation:y[k + 2] + y[k + 1] + 0.25y[k] = x[k + 2],with initial conditions y[1] = 1 and y[2] = 2. Compute the output response y[k] of the LTID system for 0 k 50 using MATLAB.

    Digital Control

  • Digital ControlMATLAB APPLICATIONEXAMPLE 2 .. Solution

    Digital Control

  • Digital ControlMATLAB APPLICATIONEXAMPLE 2 .. Solution

    Digital Control

  • Digital Control*MATLAB APPLICATIONEXAMPLE 2 .. Solution

    Digital Control

  • Digital Control*Exercise Problems1. Consider the input sequence x[k]=2u[k] applied to a DT system modeled with the following inputoutput relationship: y[k + 1] 2y[k] = x[k], and initial condition y[1] = 2.2. Repeat Problem 1 for the applied input x[k] = (0.5)k u[k] and the inputoutput relationship y[k + 2] y[k + 1] + 0.5y[k] = x[k], with initial conditions y[1] = 0 and y[2] = 1.3. Repeat Problem 1 for the applied input x[k] = (1)k u[k] and the inputoutput relationship y[k + 2] 0.75y[k + 1] + 0.125y[k] = x[k], with ancillary conditions y[1] = 1 and y[2] = 1.

    Digital Control

  • Digital Control*Exercise Problems4. The MATLAB function impz can be used to determine the impulseresponse of an LTID system from its difference equation representation. Determine the first 50 samples of the impulse response of the LTID systems with the difference equations specified in Problems 1-3.

    Digital Control