Top Banner

of 19

Lab 2 Report control systems

Feb 23, 2018

Download

Documents

Danny Tran
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
  • 7/24/2019 Lab 2 Report control systems

    1/19

    Experiment 1:

    1.1. Requirements of the Experiment:

    This experiment focused on understanding the system errors within all control systems. Observing

    how the steady state error is affected with different function inputs. Looking specifically at step,

    ramp and parabolic inputs and their associated outcomes.

    For the second order transfer functions we were to determine the system type, constant errors for

    different inputs and the steady state errors of inputs of various types. Furthermore, to easily

    represent these characteristics, MATLAB scripts were used to calculate all error types and values.

    To observe how different values and inputs altered the system response and steady state error this

    was done with two different control systems.

  • 7/24/2019 Lab 2 Report control systems

    2/19

    1.2. Introduction:

    In real life applications of control systems, because of non ideal configurations, input applied and

    non-linear sources, errors in systems are likely to appear. The steady state error is an error for stable

    systems is the difference between the input command and the actual response of the system. An

    example is shown below.

    Graph 1: Example of steady state error

    To calculate the steady state error, first the static error constants must be determined. Position (Kp),

    velocity (Kv) and acceleration (Ka) error constants depend on what input type the systems receives.

    It will determine which of these values are finite or not. The three input types directly relate to

    which type of error will be in the system. The three input types are step, ramp and parabolic.

    With the static error constants calculated, it is possible to determine the steady state error (Ess) for

    each type of input

    Step:

    Ramp:

    Parabolic:

  • 7/24/2019 Lab 2 Report control systems

    3/19

    The type of a system depends on the number of pure integrations in the forward path. This is the

    coefficient of sof the denominator of the systems transfer function. The table below shows how all

    systems types and their errors relate to the type of input of the system.

    Table 1:Relationship of inputs, errors and system types.

  • 7/24/2019 Lab 2 Report control systems

    4/19

    1.3. Solution Description:

    For each of the systems shown below, We were to calculate the steady state error for each the step,

    ramp and parabolic inputs. To calculate the errors within each system first we need to simplify the

    system into a open loop transfer function.

    System 1:

    Where K = 10

    () =

    ()

    1 + ()()

    After transferring the G(s) and H(s) functions of system one into matlab we computed the combined

    transfer function, T(s). This can be easily achieved using the matlab function "feedback", the function

    takes both G and H as inputs and returns the combined transfer function, Ge with unity feedback.

    This line of code is seen in appendix 1, Code 1.

    After calculating the unity transfer function, it is used to determine the position, velocity and

    acceleration constant errors. This is done with the "dcgain" matlab function, it takes in Ge and

    returns the constant error values. For the velocity and acceleration errors Kv and Ka, the transfer

    function is first multiplied by a transfer function with value and 2respectively before using the

    "dcgain" function to alter the input from a step to instead a ramp and parabolic input.

    With the error constants calculated, we can now use the pre defined formulas of steady state error

    for each input, giving us Ess for each type of input. All code working can be found in Appendix 1.

    System 2:

  • 7/24/2019 Lab 2 Report control systems

    5/19

    To convert system 2 into a single transfer function with unity feedback the system needed to be

    broken up into sections and simplified. First G2(s) and 10 were combined to give G3(s) using the

    same method as the previous system. The next step was to combine the newly formed G3(s) and

    G1(s). This is done by simply multiplying the functions together to form Gt(s). Finally Gt(s) and H(s)

    were combine to give the transfer function T(s) in which the steady state errors were calculated

    from. A step by step diagram can be seen below.

    Figure 1: Step by step process of simplify system 2

  • 7/24/2019 Lab 2 Report control systems

    6/19

    1.4. Test Results:

    Table 1:

  • 7/24/2019 Lab 2 Report control systems

    7/19

    1.5. Discussion & Conclusions:

    From the data recorded in the rest results section it is apparent that the system type and input have

    a direct affect on the type of error in the system.

    With both systems being type 0 systems we can observe that the system will only have a positionstatic error constant, Kp. All other input types result in 0 static error and steady state value of

    infinity. A correlation between the steady state error and static error is clear. From the derived

    formulas we can state that as the value of the steady state error decreases, the static error will

    increase.

    Given the values of Kp, Kv and Ka you can determine what type the system is and the input of the

    system. If any value of the error constants is a constant the related system type and input is know.

    Kp is a constant - System is type 0 with step input

    Kv is a constant - System is type 1 with ramp input

    Ka is a constant - System is type 2 with parabolic input.

    From the systems in this experiment these statements are proved to be true.

    The steady state error indicates the error between the input response and actual output. This can be

    either a positive or negative value. A positive value indicating the system has fallen below the

    expected output. On the other hand if the value is negative the system has overshot the desired

    output of the system and the output is larger than the input.

    This experiment has shown that there are many methods errors that may occur in real life

    applications of systems. While these errors can be calculated and compensated for they also can

    easily represent the system and input type. Furthermore a direct relationship between the type oferror present in a systems characteristics can be formed.

  • 7/24/2019 Lab 2 Report control systems

    8/19

    1.6. References:

    Goodwin, G.C., Virtual Laboratories for Control System Design Laboratory Book : Laboratory 1

    Electromechanical Servomechanism University of Newcastle Research Associates (TUNRA), 2007.

  • 7/24/2019 Lab 2 Report control systems

    9/19

    1.7. Appendix:

    Matlab code 1: System 1:

    clear allclose allclc

    num = [10 70];den = poly([0 -4 -8 -12]);

    num2 = [1 10];den2 = poly([-5 -15 -20]);

    G=tf(num, den)H=tf(num2, den2)

    Ge=feedback(G,(H-1)); %tf with unity

    %Ge=tf(Ge)%T=feedback(Ge,1); %tf with closed loop

    %step inpitKp=dcgain(Ge) % Evaluate Kp=numg/deng for s=0.essstep= 30/(1+Kp) % Evaluate ess for step input.%ramp intputs = tf([1 0], 1);sGe = Ge*s;

    sG=minreal(sGe); % Cancel common 's' in

    numerator(numsg)

    Kv=dcgain(sG) % Evaluate Kv=sG(s) for s=0.essramp=30/Kv % Evaluate steady-state error for

    % parabolic input.s2 = tf([1 0 0], 1);s2Ge = Ge*s2;

    s2G=minreal(s2Ge); % Cancel common 's' in

    numerator(numsg)

    Ka=dcgain(s2G) % Evaluate Kv=sG(s) for s=0.esspara=30/Ka

  • 7/24/2019 Lab 2 Report control systems

    10/19

    Matlab code 2: System 2:

    clear allclose allclc

    G1num = [1 7];G1den = poly([0 -4 -8 -12]);

    G2num = 5*(poly([-9 -13]));G2den = poly([-10 -32 -64]);

    Hnum2 = 1;Hden2 = [1 3];

    G1=tf(G1num, G1den)G2=tf(G2num, G2den)G3=feedback(G2, 10)

    Gt=G1*G3H=tf(Hnum2, Hden2)

    Ge=feedback... %tf with unity(Gt,(H));

    %Ge=tf(Ge)%T=feedback(Ge,1); %tf with closed loop

    %step inpitKp=dcgain(Ge) % Evaluate Kp=numg/deng for s=0.essstep= 30/(1+Kp) % Evaluate ess for step input.%ramp intputs = tf([1 0], 1);

    sGe = Ge*s;

    sG=minreal(sGe); % Cancel common 's' in

    numerator(numsg)

    Kv=dcgain(sG) % Evaluate Kv=sG(s) for s=0.essramp=30/Kv % Evaluate steady-state error for

    % parabolic input.s2 = tf([1 0 0], 1);s2Ge = Ge*s2;

    s2G=minreal(s2Ge); % Cancel common 's' in

    numerator(numsg)

    Ka=dcgain(s2G) % Evaluate Kv=sG(s) for s=0.esspara=30/Ka

  • 7/24/2019 Lab 2 Report control systems

    11/19

    Laboratory 2 Experiment 2A2.1 Requirements

    Obverse the steady state errors of a transfer function using MATLAB and the ESVL.

    Use MATLAB to determine the ideal transfer function with unity feedback. From this determine the

    system type, Kposition, Kvelocity and Kacceleration which in result calculate the steady state error of

    step, ramp and parabolic functions.

    Use ESVL to describe the non-ideal system behaviour on the steady state error and obverse the

    output of the step signal, increase in input voltage and changes in the gain, K, of the system.

    2.2 Introduction

    ESVL

    In this and future laboratories, we make use of Virtual Laboratory software developed by the

    University of Newcastle. This series of programs aims to expose students to real world control

    systems engineering problems, within the time and physical constraints of a typical teaching

    laboratory. Further, it gives students the capacity to test ideas in a realistic setting but without fear

    of costly failure. The Virtual Laboratory used in this experiment, the ELECTROMECHANICAL

    SERVOMECHANISM VIRTUAL LABORATORY (ESVL), is designed to emulate the operation of a DC

    motor servomechanism within a feedback control system. Many of the previously described non-

    ideal features of a physical setup have been replicated in this virtual laboratory including the power

    amplifier output limits, potentiometer wrap-around and signal noise.1

    Steady State Error

    Steady state error, in closed feedback loop, is the difference in the output signal to the desired input

    signal. The steady state error is defined by equation 1.

    Equation 1: Steady State Error

    From equation 1, it is clear that the steady state error depends on the input of R(s) and the transfer

    function G(s).There are three types of inputs that will be investigated, Step, Ramp and Parabolic.

    For the step function, R(s) = R/s we can define the equation 1 as:

    Equation 2: Steady State Error of Step Function

    1(Vlacic, 2015)

  • 7/24/2019 Lab 2 Report control systems

    12/19

    For the ramp function, R(s) = R/s2we can define the equation 1 as:

    Equation 3: Steady State Error for Ramp Function

    For the parabolic function, R(s) = R/s3we can define the equation 1 as:

    Equation 4: Steady State Error for Parabolic Function

    Kp, Kv and Ka are static error constants and can be used to determine what system type the transfer

    function (see table 1).

    Table 1: System Type and Static Error Constant Relationship

  • 7/24/2019 Lab 2 Report control systems

    13/19

    2.3 Solution description

    Using MATLAB a forward transfer function with unity feedback was determined using figure _. To

    achieve this, first unity gain was placed into the function by adding -1 and +1 feedback. The new

    function was now: the

    Kp, Km and Ktheta were multiplied into a new variable Gt and Gp and -1 were added into a new

    variable H. Gt and H were then combined to obtain a transfer funtion, Ge, with unity feedback by

    using the MATLAB function feedback (appendix). Kp, Kv and Ka were obtained using MATLAB

    function dcgain with the appropriate transfer function Ge for Kp, s*Ge for Kv and s2*Ge for Ka.

    From there the Error steady states could be easily be determined using equations _.

    The system used in MATLAB was placed into the ESVL to give an indictation of the effect of non-ideal

    system behaviour on steady-state error. The function Ge was placed into the ideal second order

    system by using the calculated Natural Frequency and Damping Ratio obtained in MATLAB. These

    parameters were also placed into the ESVL:

  • 7/24/2019 Lab 2 Report control systems

    14/19

    1 volt was placed into the signal generator and changed to 2 volts to obtain a step response. Also

    whilst there was a constant 1 volt input, the value of Kp was changed to 1, 2, 4, 8 and 16. The output

    was observed.

    2.4 Results

    Table 2: MATLAB Results of Gp = Kp = 2

    Figure 1: ESVL Response of 1V Input

  • 7/24/2019 Lab 2 Report control systems

    15/19

    Figure 2: ESVL Step Response of 2V Input

    Figure 3: ESVL Response of Changing Gain (Kp)

  • 7/24/2019 Lab 2 Report control systems

    16/19

    2.5 Discussion and Conclusion

    From the transfer function in table 1 we can determine that the system type is type 0, as the value of

    n is 0 and in result can determine the static error constants. Kp is a constant, Kv is zero and Ka is zero

    from table 1. These values determine the steady state error of each input, step, ramp and parabolic.

    From table 2, Kp is 1 therefore the Essstep is 0.5. Which is also consistent with the ESVL as in figure

    1. The blue line is the input of 1V and the potentiometer is the green output on the CRO which is

    stable at 0.5V giving error of 0.5V.

    Although the potentiometer was stable around 0.5V there was a lot of noise to the signal. Which

    could be due to other disturbances such as potentiometers (which wrap around their value with

    each rotation), will generate and be susceptible to signal and measurement noise, and may beeffected by other external disturbances. These all have an effect on the response to an input signal.

    As the input signal magnitude was increased, we can see in the figure 2 that the step response; an

    increase of 1V to 2V increased the steady state error by 0.5V to 1V. This trend continued with input

    of 3V increasing the steady state error again by 0.5V to 1.5V and 4V input, Ess was 2V. It can be

    concluded that the steady state error increases linearly with the increase of the magnitude input

    signal. This means for any given input signal, the error is input signal times 0.5.

    As the gain of the transfer function is increased from 1 to 4 to 8 to 16 it is clear that the stability of

    the function is becoming less stable, oscillating greatly at Kp = 16. The peak to peak value of thesignal at Kp = 16 is much greater than that of Kp = 4. If this trend continues, it can predicted that as

  • 7/24/2019 Lab 2 Report control systems

    17/19

    Kp increases the transfer function will become less stable and more stable as Kp decreases. Although

    the steady state error does not change with the gain (Kp) and remains the same at 0.5V per volt.

    This transfer function is of order zero and therefore has constant error with a step signal. The gain of

    the transfer function determines the stability of the function but does not change the steady state

    error of 0.5V per input volt.

    Appendix

  • 7/24/2019 Lab 2 Report control systems

    18/19

    Figure 4: MATLAB Code to determine Steady State Error

  • 7/24/2019 Lab 2 Report control systems

    19/19

    ReferencesVlacic, P. L. (2015). Laboratory No.2 - Steady State Error. 3304ENG - Control Systems, 1-9.