modeling and control of the coupled water tankssharif.edu/~nobakhti/resources/linear control...

24
Modeling and Control of the Coupled Water Tanks Department of Electrical Engineering Sharif University of Technology, Tehran,Iran

Upload: others

Post on 26-Jan-2021

1 views

Category:

Documents


0 download

TRANSCRIPT

  • Modeling and Control of

    the Coupled Water Tanks

    Department of Electrical Engineering

    Sharif University of Technology, Tehran,Iran

  • Linear Control Systems Laboratory, Sharif University of Technology

    1 Introduction

    1.1 Overview

    The coupled tank module consists of a pump with a water basin (reservoir) and two tanks of

    uniform cross section. The system is equipped with two level sensors to measure the water level

    of the two tanks.

    Water level control is common in many industries, such as pulp and paper, petro-chemical, and

    water treatment. The aim of this set of experiments is to mathematically model the system using

    first principles, obtain a reliable linearized model for the system, and design feedback controllers

    with desired closed-loop specifications. The system can be configured to work with either a single

    tank or double tank level control feedback loops.

    The coupled tank module operates with a PC-based controller. The PC communicates with

    the sensors and the pump through the data acquisition board and the power interface. The data

    acquisition board is controlled by a realtime software which operates in the MATLAB/Simulink

    RTWT environment. The QUARC software also adds powerful tools and capabilities to MATLAB

    and Simulink to make the prototyping and implementing of sophisticated real-time control systems

    easier. QUARC generates real-time codes directly from Simulink-designed controllers and runs it

    in real-time on the Windows target.

    1.2 General Instructions

    The students are required to •) work through all laboratory exercises, •) carry out the instructions

    indicated in italics, •) and record the results indicated in underlined italic in the results sheet

    provided. Where the instructions state plot and print a signal or function, that signal or function

    should be plotted in MATLAB, labeled appropriately, and submitted with the results sheet.

    Each group is required to submit a full set of prints and the results sheet, individually. Extra

    credit will be awarded to students who make a reasonable attempt at the further experiment

    sections.

    2

  • Linear Control Systems Laboratory, Sharif University of Technology

    Figure 1: Coupled water tank.

    2 Coupled Water Tank

    2.1 Arrangement

    The coupled tank module consists of a pump with a water basin and two tanks of uniform cross

    section. The two tanks are vertically mounted on a platform and positioned in such a way that

    outflow from the top tank serves as inflow for the bottom tank. Outflow from the bottom tank

    drains directly into a reservoir. From each tank, water drains by gravity discharge through a

    small orifice. A disturbance valve is also provided in the apparatus to introduce disturbance to

    the flow exiting the top tank. By opening the disturbance valve, water from the top tank drains

    directly into the reservoir. The water level in each tank is measured by a level sensor located at

    the bottom of each tank. Additionally, a vertical ruler is also placed beside each tank for a visual

    measurement of the water level. The coupled tank module is demonstrated in Figure 1.

    Note: It is convenient to classify process configurations as being either interacting or noninteract-

    ing. The distinguishing feature of a noninteracting process is that changes in a downstream

    unit have no effect on upstream units. By contrast, for an interacting process, downstream

    units affect upstream units, and vice versa. The provided coupled tank is an example of a

    3

  • Linear Control Systems Laboratory, Sharif University of Technology

    noninteracting system. The two storage tanks are connected in series in such a way that

    water level in the second tank does not influence the level in the first tank.

    2.2 Control Signal and Sensed Outputs

    In this set of experiments, a linear voltage-controlled amplifier derives the pump. The coupled-

    water tank pump is a gear pump with a 12V Direct Current (DC) motor. The control signal u(t)

    must satisfy the saturation limits imposed by the amplifier, data acquisition board and the pump.

    The control signal must satisfy |u(t)| ≤ 16V . Moreover, when the amplitude of the input signal is

    too large, an overflow can occur in the tanks. When the upper tank overflows, part of the water

    flows into the lower tank, the rest drains directly into the reservoir. The sensed outputs are,

    1. Water level in the top tank.

    2. Water level in the bottom tank.

    4

  • Linear Control Systems Laboratory, Sharif University of Technology

    Figure 2: Zero, Span, combined zero-span and linearization error.

    3 Calibration

    3.1 Sensors calibration

    A level sensor is located at the base, to measure the level in each tank. The sensor output voltage

    increases proportional to the applied pressure. The output measurements are filtered and amplified

    in the signal conditioning board before they are transmitted to the data acquisition board. This

    signal ranges from 0 to 5V . Calibration of each level sensor is required to keep level measurements

    consistent with the water and conditions used in the experiment.

    Typically, calibration of an instrument is verified at several points on the calibration curve of

    the instrument. The calibration range is defined as the region between the limits within which

    a quantity is measured, received or transmitted. It is expressed by stating the lower and upper

    range values, defined by the zero and span values. The zero value is the lower end of the range.

    Span is defined as the algebraic difference between the upper and lower range values.

    Instrument errors can occur due to a variety of factors: drift, electrical supply, addition of

    components to the output loop, process changes, etc. An error is the algebraic difference between

    the indication and the actual value of the measured variable. Typical errors that can occur in-

    clude, zero error, span error, combined zero-span error and linearization error (shown in Figure

    2). Zero and span errors are corrected by performing a calibration. The zero adjustment is used

    to produce a shift in the input-output curve. The span adjustment is used to change the slope of

    the calibration curve.

    5

  • Linear Control Systems Laboratory, Sharif University of Technology

    1. • Open the Simulink file Tank openloop.mdl. Familiarize yourself with the coupled water

    tank system and how it relates to the Simulink file.

    • Start by running the MATLAB script setup lab tanks for initialization.

    • Build the model by pressing CTRL+B. In the External Mode Control Panel click on

    Connect. Click on Start Real-Time Code to start the real-time execution.

    • The voltage reading from the level sensors can be seen on the numeric display blocks

    (L1 meas(cm) and L2 meas(cm)) and also on the scopes. Plug the top tank outlet and

    apply a voltage within the range 4V − 5V to the pump in the Simulink file. Fill the

    top tank up to 25 cm (Use the ruler attached to the tank). Then switch off the pump

    (Apply 0V to the pump). Read the voltage of the top tank sensor. If it is not 4.15V

    (±0.03 of this value is okay) record the span error of level sensor1.

    Note: Make sure there are no air bubbles over/in the sensor before you start recording

    data.

    Note: A simple low-pass filter is added to the output signal of each tank level level sensor.

    This sensor is necessary to attenuate the high frequency noise content of the level

    measurement.

    2. Unplug the outlet and let the water drain from the tank by gravity discharge. Make sure the

    tank is empty. If the voltage from level sensor1 differs from 0V at zero cm, record the offset

    error of level sensor1 and adjust the offset in your Simulink file.

    Note: Following changes made to the Simulink model or scope parameters, the model should

    be rebuilt (CTRL+B). Otherwise, Simulink will issue an error message that the model

    checksum is invalid and the code must be rebuilt.

    3. Similarly, plug the bottom tank outlet and apply a voltage to the pump in the Simulink file.

    Fill up the bottom tank up to 25 cm. (Use the ruler attached to the tank.) Then switch off

    the pump. (Apply 0V to the pump.) Read the voltage of the bottom tank sensor. If it is not

    4.15V (±0.03 of this value is okay) record the span error of level sensor2.

    4. Unplug the outlet and let the water drain from the tank by gravity discharge. Make sure the

    tank is empty. If the voltage from level sensor2 differs from 0V at zero cm, record the offset

    error of level sensor2 and adjust the offset in your Simulink file.

    6

  • Linear Control Systems Laboratory, Sharif University of Technology

    5. Fill up the top tank up to 25 cm again. Use the disturbance valve to gradually drain water

    from top tank and accordingly record the level sensor voltage readings of the top tank for

    water levels at 25, 20, 15, 10, 5, 0 cm.

    6. Fill up the bottom tank up to 25 cm again. Gradually drain water from bottom tank and record

    the level sensor voltage readings of the bottom tank for water levels at 25, 20, 15, 10, 5, 0 cm.

    7. Plot and print sensor1 and sensor2 output voltages as a function of top tank water level

    and bottom tank water level, respectively.

    8. Determine sensor1 gain KL1 and sensor2 gain KL2 in V/(cm) using a linear approximation.

    Change the calibration gains in Tank openloop.mdl if necessary.

    9. Finally test your calibration to see if what appears on the ruler is reported correctly. If the

    levels are measured correctly, the coupled water tank setup is ready for your experimentation.

    Note: Make notes of any ranges where the linear relationship you have developed is inac-

    curate. You should stay away from these nonlinear regions by operation the system

    at levels well within the linear range of the sensors.

    3.2 Actuator Calibration

    Water is pumped from the reservoir to the top tank by means of a gear pump driven by an electric

    motor. The motor changes speed rapidly in response to changes in input voltage compared to

    the time required for the tank level to change. Therefore motor dynamics will be neglected. This

    means we can assume the motor speed is always proportional to the supply voltage. The relation

    between the pump voltage and flow rate should be determined by measuring the volumetric flow

    rate in the first tank.

    1. Plug the top tank outlet. Make sure the disturbance valve, directly connecting the top tank to

    the main reservoir is closed. For the pump voltages within the range 0V − 12V , record the

    time for the water level to increase from 10 cm to 15 cm. Let the two tanks inside diameter

    be equal to 7 cm. Determine the flow rates in each case.

    Note: Notice that the pump does not respond to inputs less than a small value.

    2. Plot and print flow rates as a function of pump voltage.

    3. Assuming that the flow rate for the pump is proportional to the input voltage, i.e., qi = KpVp,

    determine the pump flow constant Kp using a linear approximation.

    7

  • Linear Control Systems Laboratory, Sharif University of Technology

    4 Parameter Identification

    The aim of this section is to identify the outflow orifice coefficients of the two tanks through simple

    experiments and by measuring only the levels and the flow rates. The orifice coefficient can be

    obtained from steady-state operation.

    Recall that the volumetric inflow rate to the top tank is assumed to be directly proportional to

    the applied pump voltage by,

    qi = KpVp,

    where Vp is the applied voltage, Kp is the pump flow constant calculated in actuator calibration

    procedure (task 3) and qi is the inflow rate to the top tank.

    The water drains from the tank by gravity discharge through a small orifice. The equation

    governing the flow of the water through a restriction such as a small outlet orifice or a valve

    can be derived from the laws of fluid mechanics.

    Applying Bernoulli’s equation for small orifices, the outlet velocity (length/time) of a tank with

    small orifice is given by,

    vo =

    √√√√√√2(P1 − P2)

    ρ

    (1−

    (AoAT

    )2) ,where, Ao is the outlet orifice area, AT is the tank area. Moreover, P1 − P2 is the pressure

    difference between the upstream and downstream water levels, which is given by ρgL. L is the

    water level in tank and g is the acceleration due to gravity (m/s2). Note that for small orifices(1−

    (AoAT

    )2)' 1 and thus the outlet velocity becomes,

    vo =√

    2gL.

    However, the actual flow rates are less than the theoretical flow rates, by a factor, named as the

    coefficient of discharge (α < 1),

    vo = α√

    2gL.

    Thus, the outflow rate from the top tank is given by,

    q12 = αAo√

    2gL1.

    Consequently, we can combine the two terms α and Ao into a single coefficient C, termed the

    orifice coefficient, i.e., C = αAo and represent the outflow rate from the top tank by,

    q12 = C1√

    2gL1.

    1. Use BernoulliÂ’s principle and conservation of mass to write down the relation between the

    pump input voltage and the top tank level at the steady-state.

    8

  • Linear Control Systems Laboratory, Sharif University of Technology

    2. Devise and briefly discuss a simple experiment, a procedure which satisfies the steady-state

    assumption and can be used to identify the orifice coefficient C1. Note that the relation

    between measurement data q12 and L1 is nonlinear. Calculate the orifice coefficient C1.

    Note: You need to determine the maximum pump voltage at which the coupled tanks

    system reaches steady-state (i.e. does not overflow) and also the Minimum pump

    voltage that yields a flow into the top tank.

    3. In a similar manner, calculate the orifice coefficient C2.

    9

  • Linear Control Systems Laboratory, Sharif University of Technology

    Figure 3: Schematic of the coupled tank plant.

    5 Mathematical Model of the Coupled Tank

    A large variety of processes can be modeled with overall and component mass balances, energy

    balances, and momentum balances. The basis for modeling the coupled tanks under study, is an

    overall material balance.

    1. Using Figure 3, Determine the differential equation characterizing the dynamics of the top

    tank. You should find the nonlinear model relating the top tankÂ’s water level(L1), to the

    pump voltage, i.e.,dL1dt

    = f(L, Vp).

    2. Determine the differential equation characterizing the dynamics of the bottom tank. You

    should find the nonlinear model relating the water level in the second tank (L2) to the water

    level in the first tank, i.e.,dL2dt

    = f(L1, L2).

    3. Determine the states of the system and sources of nonlinearities. Discuss whether some

    modes of the system and/or some sources of nonlinearities are neglected in your derived

    model.

    10

  • Linear Control Systems Laboratory, Sharif University of Technology

    4. Determine the parametric state space model of the system in the form of,

    ẋ = f(x, u),

    y = Cx,

    where the output y represents the water levels in each tank. Calculate the coefficients of

    matrices f(x, u) and C using constant parameters in the lab manual, identified parameters

    and calibration results.

    5. Validate the derived nonlinear model using a real-time experiment. With the tanks at some

    steady-state for Vp = 4V , apply a step change in pump voltage to Vp = 5V . Apply the same

    step change in your nonlinear model. Note that it takes some time for the open-loop tanks

    to reach steady-state. Plot and print the responses (water levels) of the derived nonlinear

    mathematical model and the experimental setup on the same pair of axes. Determine the

    steady-state values of the level changes for the derived nonlinear model and the tanks.

    Note: As you can see, this system exhibits a “quasi linear” or weakly nonlinear behavior

    during normal operation, and a hard saturation effect for high peaks of the input

    signal.

    Note: If the scope is not displaying traces, or the amount of data that can be displayed is not

    sufficient, you need to configure the signal & triggering properties from Tools External

    Model Control Panel, Signal and Triggering button. The “Duration” specifies the

    number of points to be plotted. If the buffer is set to 10, 000 points and the controller

    runs at a sampling rate of 1 KHz, then the scope will only plot up to 10 seconds of

    data. To view up to 20 seconds, the duration would have to be changed to 20, 000.

    6. Compare the measured and simulated responses. Does the response of the derived nonlinear

    model reasonably fit the actual response? Explain the differences.

    Note: If the differences are significant, you need to double check your identified values of

    orifice coefficients C1, C2 and pump constant Kp.

    7. • Run the open-loop system by applying Vp = 5V and let the system reach its steady-state.

    While recording data, open the disturbance valve and wait until the levels reach their

    new steady state values. This produces an open-loop disturbance test.

    • Record the steady-state values of the level changes for the tanks.

    • Based on the new steady-state values, try to model the disturbance signal in your

    Simulink model.

    11

  • Linear Control Systems Laboratory, Sharif University of Technology

    • Plot and print the responses (water levels) of the derived nonlinear mathematical model

    and the experimental setup on the same pair of axes. At the end of this experiment,

    close the disturbance valve.

    12

  • Linear Control Systems Laboratory, Sharif University of Technology

    6 Small-Signal Linearization

    In order to design and implement linear level controllers for the tanks, inear open-loop transfer

    functions should be derived first. Therefore, the nonlinear dynamic equations derived in Section

    5 should be linearized around a specific point of operation.

    In case of water level in the top tank, the operating range corresponds to small departure

    heights, δL1, and small departure voltages, δVp, from the desired equilibrium point (L10, Vp0).

    Therefore, L1 and Vp can be expressed as the sum of two quantities given by,

    L1 = L10 + δL1, Vp = Vp0 + δVp.

    Similarly, in the case of the water level in the bottom tank, the operating range corresponds to

    small departure heights δL1 and δL2 , from the desired equilibrium point (L20, L10). Thus, L2

    and L1 can be expressed as,

    L1 = L10 + δL1, L2 = L20 + δL2.

    1. Determine the relationship between the equilibrium pump voltage Vp0 and the top tank’s

    desired equilibrium level L10. Calculate Vp0 for L10 = 15 cm.

    2. Linearize the top tank water level’s state space equations about the operating point (L10, Vp0)

    using Tailor series expansion. For a function, f(x, y), a first-order approximation for small

    variations at a point (x0, y0) is given by the following Taylor’s series approximation,

    f(x, y) = f(x0, y0) +∂

    ∂xf(x, y)

    ∣∣∣x0,y0

    (x− x0) +∂

    ∂yf(x, y)

    ∣∣∣x0,y0

    (y − y0) .

    Determine the linearized model.

    3. Determine the system’s open-loop transfer function Gp1(s) with δVp as input and δL1 as

    output. Determine the steady-state gain and time constant of the model Gp1(s).

    4. Validate the derived linearized model using a real-time experiment. Plot and print the re-

    sponses of the linearized model and the actual top tank response on the same pair of axes by

    applying a small step change from the operating point Vp0 in your Simulink model.

    Note: It is not possible to generate a perfect step input. Process equipment such as pumps

    cannot instantaneously change from one state to another, but must be ramped over

    a period of time. However, the ramp time is small compared to the process time

    constant, and thus a reasonably good approximation to a step input may be obtained.

    5. Compare the results. Does the response of the linearlized model reasonably fit the actual

    response? Explain the differences and revise your derived model if necessary.

    13

  • Linear Control Systems Laboratory, Sharif University of Technology

    6. The linearized model of the top tank can also be determined experimentally. Note that the

    process gain is computed as the steady-state change in the output variable divided by the

    change in manipulated variable. The process time constant is determined as the time it takes

    the step response to reach 63.2% of the output variable change. Adjust the system’s steady-

    state gain and time constant from the step response to fit the measured data. Determine the

    revised transfer function Gp1(s) (for the inner loop control).

    7. Calculate the equilibrium level L20 for L10 = 15 cm.

    8. Linearize bottom tank’s state space equations about the operating point (L20, L10) using Tailor

    series expansion.

    9. Determine the system’s open-loop transfer function Gp2(s) from δL1 to δL2. Determine the

    steady-state gain and time constant of the model Gp2(s).

    Note: Since the provided coupled tank is a noninteracting system, the transfer function

    from δVp to δL2 is simply given by, Gp(s) = Gp1(s)Gp2(s).

    10. Plot and print the responses of the linearized model Gp(s) = Gp1(s)Gp2(s) and the bottom

    tank on the same pair of axes by applying a small step change from the operating point Vp0 .

    You will detect a second-order, sigmoid response at the outlet.

    11. Now that the top tank model matches the top tank open-loop test results, work on the bottom

    tank parameters. Adjust the coupled tanks model’s parameters to fit the measured data. First,

    match the steady-state gain of the coupled tanks. Once it matches the test results, work on

    the transient response by adjusting the time constant of the bottom tank model until you

    get a mach with the actual step response. Determine the revised transfer function Gp(s).

    Plot and print the responses of the revised model and the double tank on the same pair of

    axes.

    Note: Since, the bottom tank’s input comes from the top tanks output and not a step

    change, you cannot get the bottom tank’s time constant by measuring how long it

    takes for the bottom tank to reach 63.2% of its final value. Adjust the time constant

    of the bottom tank model until you get a mach with the actual step response of the

    double tank.

    14

  • Linear Control Systems Laboratory, Sharif University of Technology

    Figure 4: Graphical analysis of the bottom tank step response to obtain parameters of a first-

    order-plus-time-delay model

    7 Further Experiments

    The step response of the double tank, can also be represented as a first-order system with a time

    delay. The dynamic model that would behave this way is called the FODT (first-order-dead-time)

    model, described by,

    Gd(s) =Ke−θs

    (τs+ 1).

    It turns out to be suitable for describing the dynamic response of many industrial processes. To

    obtain the parameters K, θ, and τ , you must carry out the following steps, summarized in Figure

    4.

    • The gain K is found by calculating the ratio of the steady-state change in the output to the

    size of the input step change.

    • A tangent is drawn at the point of inflection of the step response. The intersection of the

    tangent line and the time axis is the time delay θ.

    • If the tangent is extended to intersect the steady-state response line, the point of intersection

    corresponds to time t = θ + τ . Therefore, τ can be found by Subtracting θ from the point

    of intersection.

    1. Try to fit a first order plus dead time (FODT) model, from the actual response of the system.

    Validate the derived FODT model using a real-time experiment. Adjust the FODT model’s

    parameters to fit the measured data. Record K, θ, and τ .

    2. Plot and print the responses of the FODT model and the actual bottom tank response on the

    same pair of axes

    15

  • Linear Control Systems Laboratory, Sharif University of Technology

    Note: The major disadvantage of the time-delay estimation method in Figure 4 is that it

    is difficult to find the point of inflection, as a result of measurement noise. To avoids

    use of the point of inflection, you can use an alternative method, which relies on the

    measurements of the step responses at 35.3% and 85.3% of the final value. The time

    delay and time constant are then calculated from the following equations,

    θ = 1.3t1 − 0.29t2,

    τ = 0.67(t2 − t1).

    3. Determine the sources of lags in the coupled water tank which leads to appearance of dead

    time θ in the transfer function.

    16

  • Linear Control Systems Laboratory, Sharif University of Technology

    8 Controller Design

    In this section you are supposed to control the water levels in the two tanks by designing appro-

    priate controllers for manipulating the control signal applied to the pump. To obtain a sense of

    the level control problem, you are supposed to first control the water levels manually by observing

    the levels using the ruler and adjusting the pump voltage accordingly.

    8.1 Manual Control

    1. Run the open-loop system by applying an appropriate voltage (calculated earlier) and letting

    the system reach its steady-state at L1 = 15cm. Experimenting around the level 15cm, try to

    manually change the pump voltage using the slide bar and achieve a new desired level 17cm

    as fast as possible.

    2. Next, try to keep the level constant when somebody disturbs the system by pouring cups of

    water into the upper tank and/or by opening the disturbance valve. Try to come back to the

    desired level as fast as possible by changing the pump voltage using a slide bar.

    3. Repeat the above investigation, now with the objective of keeping the level at 15cm in the

    lower tank. Is this case more difficult?

    8.2 Top Tank Level Control

    So far, you tried to control the water levels by manually adjusting the pump voltage. Through

    observations of the deviation from the desired level you decided to increase or decrease the voltage.

    A controller makes such decisions automatically. You will in this laboratory use PI-controllers,

    and start with the special case of pure proportional control, also known as P-control.

    The objective of this experiment is to develop a controller for the top tank water level according

    to a set of specifications. The time domain requirements for controlling the top tank water level

    are,

    � Zero steady-state error,

    � Settling time (with a 2% criterion) (Ts) ≤ 7s,

    � Overshoot (PO%) ≤ 10%.

    1. Proportional Control for the top tank: The voltage to top tank level transfer function is

    already derived and denoted by Gp1(s). Let the feedback controller be a proportional gain

    Kc1. Determine the closed-loop transfer function in terms of Kc1. Comment on whether a

    17

  • Linear Control Systems Laboratory, Sharif University of Technology

    proportional controller can simultaneously satisfy the three time domain specifications.

    2. Open the Simulink file coupled tanks.mdl. Familiarize yourself with the control system.

    Start by running the MATLAB script setup lab tanks for initialization. First, we are

    interested in only proportional control. Try to find a reasonable Kc1 value fulfilling the

    following criteria:

    � The steady-state error should be as small as possible.

    � The rise time and the settling time should be as short as possible.

    � The control signal must not reach either limit value for a change in the reference value

    from 15 to 17.

    • Apply the proportional controller using a real-time closed-loop experiment. Set the

    reference signal to a step change from 15cm to 17cm.

    • Explain what each of these criteria imply on the choice of Kc1. Also note how the

    control signal becomes “noisy” for large values of Kc1.

    • Record the experimental value of Kc1 that results in an appropriate response.

    • Compare the steady-state error to its expected value calculated from the obtained transfer

    function.

    • Plot and print the reference signal and the top tank level response, for Kc1 on the same

    pair of axes.

    • Explain why does the tank level never reach the reference value with the P-controller?

    3. The PI compensator to control the top tank level has the following structure,

    ũ1(t) = kp1(βr1(t)− y1(t)) + ki1∫

    (r1(t)− y1(t))dt,

    where kp1 is the proportional control gain, ki1 is the integral control gain, r1(t) is the set-

    point or reference of the water top tank level, β is the setpoint weight, y1(t) is the measured

    water level of the top tank, and ũ1(t) is the control signal.

    In this controller, the proportional term acts only on a fraction β of the reference. Integral

    action acts on the error to make sure the error goes to zero in steady-state. For the choice

    of β = 1, a traditional PI control is achieved.

    Note: In addition to the PI controller, a feed-forward term is necessary to compensate the

    water withdrawal through top tank outlet orifice. Then the PI controller is designed

    18

  • Linear Control Systems Laboratory, Sharif University of Technology

    to only compensate for small variations from the linearized operating point (L10, Vp0).

    The feed-forward term can be characterize by,

    ũ2(t) = Kf1√r1(t).

    The control signal then is given by,

    u1(t) = ũ1(t) + ũ2(t).

    4. Illustrate a control system block diagram including small-signal dynamics of the system,

    control loop, feed-forward gain, reference signal, disturbance signal, control signal and output

    signal.

    5. Determine the voltage feed-forward gain Kf1. Calculate Kf1 for the tank parameters.

    6. Determine the closed-loop transfer function in terms of PI controller parameters, (kp1 and

    ki1) and the top tank time domain characteristics (steady-state gain and time constant).

    Note: The feed-forward gain Kf1 does not influence the closed-loop characteristics.

    7. In case of β = 0, the resulting closed-loop transfer function can be expressed as,

    T (s) =ω2n

    s2 + 2ξωns+ ω2n

    where ωn is the natural frequency and ξ is the damping ratio.

    Now, consider the response of a second-order system subject to a step input. The amount

    of overshoot of the step response depends only on the damping ratio parameter and it can

    be calculated using the equation,

    PO% = 100e

    −πξ√1− ξ2

    .

    The peak response time and the settling time depend on both the damping ratio and natural

    frequency of the system and they can be derived as,

    Tp =π

    ωn√

    1− ξ2,

    and,

    Ts =4

    ξωn,

    respectively.

    • Let β = 0. Determine kp1 and ki1 in terms of ξ and ωn.

    19

  • Linear Control Systems Laboratory, Sharif University of Technology

    • Calculate the control gains needed to satisfy the time domain response requirements.

    The design procedure should be implemented as a MATLAB script or function.

    8. • Verify the PI controller with the developed models (nonlinear and linearized). Find the

    simulating percent of overshoot and settling time. If the response of the system is not

    satisfactory, adjust the controller parameters and try a new controller.

    • State your final suggestions for the control gains.

    • Plot and print the reference signal and the simulated closed-loop response on the same

    pair of axes.

    Note: Make sure to implement both feedback term ũ1(t) and feed-forward term ũ2(t) in

    your simulations.

    Note: The limitations of the actuator must be taken into account when designing the con-

    troller. Moreover, note that for protection purposes, the real-time controller will stop

    if the water level in either top tank or bottom tank goes beyond 30cm and 25cm,

    respectively. This is implemented through the deadzone and stop with error block.

    9. Only after the simulated closed-loop response meets the requirements, apply the PI controller

    in combination with the feed-forward term in a real-time closed-loop experiment. Set the

    signal generator properties to generate a square wave signal of amplitude 1 and frequency

    0.04 Hz. The total level set point for the top tank should be a square wave of ±1cm around the

    desired equilibrium level L10. Due to possible model-plant mismatch, you may need to fine-

    tune the controller by changing the design parameters to meet the performance requirements

    of the system. In this case, state the revised control gains kp1 and ki1.

    Plot and print the top tank level response and the control signal of the PI controller with

    β = 0.

    10. • Adjust β between 0 and 1. Discuss how β affects the step response of the top tank level.

    • In order to assess the performance of the control system to disturbances, apply a

    disturbance to the top tank by opening the disturbance valve. Discuss the effect of β on

    the response of the closed-loop system to disturbances. Justify your observations.

    • Try to find an optimal value for β based on your experiments. State your final sugges-

    tion for β.

    • Plot and print the top tank level response and the control signal of the PI controller

    with optimal selection of β.

    20

  • Linear Control Systems Laboratory, Sharif University of Technology

    Note: In fact, integral action eliminates offset not only for step changes, but also for any

    type of sustained change in disturbance or set point. By a sustained change, we mean

    that eventually settles out at a new steady-state value. However, integral action does

    not eliminate offset for a ramp disturbance.

    8.3 Bottom Tank Level Control

    You will start with the special case of pure proportional control.

    1. Proportional Control for the bottom tank: The voltage to bottom tank level transfer function

    is already derived and denoted by Gp(s). Let the feedback controller be a proportional gain

    Kc2. Determine the closed-loop transfer function in terms of Kc2.

    2. • Apply the proportional controller in a real-time closed-loop experiment. Set the reference

    signal to a step change from 15cm to 17cm.

    • Try to find a reasonable Kc2 fulfilling the following criteria:

    � The steady-state error should be as small as possible.

    � The rise time and the settling time should be as short as possible.

    � The control signal must not reach either limit value for a change in the reference

    value from 15 to 17.

    • Record the experimental value of Kc2 that results in an appropriate response.

    • Compare the steady-state error to its expected value calculated from the obtained transfer

    function.

    • Plot and print the reference signal and the bottom tank level response, for Kc2 on the

    same pair of axes.

    3. The main objective of this section is to develop a PI controller for the bottom tank water

    level according to a set of specifications and based on cascade control loop structure. In this

    structure, shown in Figure 5, the output signal of the outer loop controller serves as the set

    point for the inner loop controller. For the cascade control coupled tank configuration, the

    controlled variable is the pump voltage. The bottom tank controller uses water level in the

    bottom tank as process variable and decides the set point of the top tank controller. The

    top tank controller tries to track the set point.

    The time domain requirements for controlling the bottom tank water level are,

    21

  • Linear Control Systems Laboratory, Sharif University of Technology

    Figure 5: Cascade control structure.

    � Zero steady-state error,

    � Settling time (with a 2% criterion) (Ts) ≤ 30s,

    � Overshoot (PO%) ≤ 10%.

    The voltage-to-bottom tank level transfer function is already derived and denoted by Gp(s).

    Note: The water level in the top tank is already controlled by the designed PI controller.

    Let Gcl1(s) be the closed-loop transfer function of Top tank represented by,

    Gcl1(s) =L1(s)

    R1(s).

    This subsystem represents an inner (nested) level loop. In order to achieve a good

    overall stability and performance, with this configuration, the inner loop (top tank

    closed-loop system) must be much faster than the outer loop. Cascade control should

    generally not be used if the inner loop is not at least three times faster than the outer

    loop.

    For the sake of simplicity, neglect the water level dynamics in the top tank. That is, assume

    that L1(t) = r1(t).

    The PI compensator to control the level of bottom tank system has the following structure,

    ū1(t) = kp2(βr2(t)− y2(t)) + ki2∫

    (r(t)− y2(t))dt,

    where kp2 is the proportional control gain, ki2 is the integral control gain, r2(t) is the set-

    point or reference of the water level in the bottom tank, β is the setpoint weight, y2(t) is

    the measured water level of the bottom tank, and ū1(t) is the control signal.

    Note: In addition to the to be designed PI controller, a feed-forward term is necessary to

    compensate the water withdrawal through bottom tank outlet orifice. Then the PI

    22

  • Linear Control Systems Laboratory, Sharif University of Technology

    controller is designed to compensate for small variations from the linearized operating

    point (L20, L10). The feed-forward term can be characterize by,

    ū2(t) = Kf2r2(t).

    The control signal then is given by,

    u2(t) = ū1(t) + ū2(t).

    4. Illustrate a control system block diagram including small-signal dynamics of the system (rep-

    resent each tank by a separate block), the two control loop, feed-forward gain, reference signal,

    disturbance signal, control signal and output signals.

    5. Determine the voltage feed-forward gain Kf2. Calculate Kf2 for the tank parameters.

    6. Determine the closed-loop transfer function in terms of PI controller parameters, (kp2 and

    ki2).

    Note: The feed-forward gain Kf2 does not influence the closed-loop characteristics.

    7. In case of β = 0, the resulting closed-loop transfer function can be expressed as,

    T (s) =ω2n

    s2 + 2ξωns+ ω2n

    where ωn is the natural frequency and ξ is the damping ratio.

    Let β = 0. Determine kp2 and ki2 in terms of ξ and ωn.

    Calculate the control gains needed to satisfy the time domain response requirements. The

    design procedure should be implemented as a MATLAB script or function.

    8. Verify the PI controller with the developed models (nonlinear and linearized). Find the sim-

    ulated percent overshoot and settling time. If the response of the system is not satisfactory,

    adjust the controller parameters and try a new controller.

    Note: Make sure to apply both feedback term ū1(t) and feed-forward term ū2(t) in your

    simulations.

    State your final suggestions for the control gains.

    Plot and print the reference signal and the simulated closed-loop response on the same pair

    of axes.

    9. Only after the simulated closed-loop response meets the requirements, apply the PI controller

    in combination with the feed-forward term in a real-time closed-loop experiment. Set the

    signal generator properties to generate a square wave signal of amplitude 1 and frequency

    23

  • Linear Control Systems Laboratory, Sharif University of Technology

    0.01 Hz. The total level set point for the bottom tank should be a square wave of ±1cm around

    the desired equilibrium level L20. Because of some model-plant mismatch, you may need to

    fine-tune the controller by changing the design parameters to meet the performance require-

    ments for the system. In this case, state the revised control gains kp2 and ki2. Plot and print

    the closed-loop bottom tank level response with the PI controller for β = 0.

    10. Adjust β between 0 and 1. and state your final suggestion for β.

    Plot and print the closed-loop bottom tank level response with the PI controller with optimal

    selection of β.

    24

    IntroductionOverviewGeneral Instructions

    Coupled Water TankArrangementControl Signal and Sensed Outputs

    CalibrationSensors calibrationActuator Calibration

    Parameter IdentificationMathematical Model of the Coupled TankSmall-Signal LinearizationFurther ExperimentsController DesignManual ControlTop Tank Level ControlBottom Tank Level Control