water tank manual

Upload: luisfegf

Post on 28-Feb-2018

249 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Water Tank Manual

    1/17

    Coupled Water Tank Experiments

  • 7/25/2019 Water Tank Manual

    2/17

    Coupled Tanks 1

    Small Orifice

    Large Orifice

    Out 2 Out 1

    PUMP

    L1

    L2

    REGULATE L2

    gamma = 0.36

    Configuration #3

    Medium Orifice

    Medium Orifice

    Out 2 Out 1

    PUMP

    L1

    L2

    REGULATE L2

    Configuration #2

    Medium Orifice

    Medium

    Out 2 Out 1

    PUMP

    L1

    L2

    REGULATE L1

    Water Basin

    Configuration #1

    Coupled Water Tank ExperimentsQuanser Consulting Inc.

    1 Description

    The Two Tank Module consists of a pump with a water basin .The pump pumps water vertically to two quick connect, normallyclosed orifices Out1" and Out2". These two orifices havedifferent diameters. Two tanks mounted on the front plate areconfigured such that flow from the first tank flows into the secondtank and outflow from the second tank flows into the main waterbasin. The outflows from the two tanks are variable by changinginserts that screw into the tapped holes. Rubber tubing withappropriate couplings are supplied such that the pump can pumpinto one or both tanks. The selection of outputs from the pump

    controls the flow ratio between the two outputs.

    This single system can be configured into 3 types of experimentseach with various parameters.

    Configuration #1: SISO system. The pump feeds into tank1 andyou design a controller that regulates the level in Tank 1. Tank2 isnot used at all.Configuration #2:State coupled SISO system. The pump feeds into tank1 which inturn feeds into tank 2. Design a controller that regulates the levels in tank #2. Trydifferent orifices in tank #1 and tank #2

    Configuration #3:State coupled and input coupled SISO system. The pump feeds intoand into tank 2 using a split flow. Tank1 also feeds into tank 2. Design a controller thatregulates the levels in tank #2.

  • 7/25/2019 Water Tank Manual

    3/17

    Coupled Tanks 2

    d11

    d12

    Out 2 Out 1

    PUMP #1

    L11

    L12 L22

    L21

    PUMP #2

    Out 1Out 2

    d23

    d21

    If you would like to perform more complex experiments, you may couple several TwoTank Modules as shown in Figure 5.

  • 7/25/2019 Water Tank Manual

    4/17

    Coupled Tanks 3

    2 Mathematical Models

    2.1 Single tank

    Consider the single tank system shown n Configuration 1.

    The inflow to the tank is:

    Fin KmVp cm3/sec

    where Km is the pump constant and Vp is the voltage applied to the pump.

    The outflow velocity is given by the Bernoulli equation for small orifices:

    Vo 2g L1cm/sec

    where g is the gravitational acceleration in cm / sec2and L1is the height of the waterlevel in the tank in cm.

    The outflow rate is then :

    where a1is the outflow orifice diamaterFout a1 2g L1cm3/sec

    The flow rate through the tank is then given by

    Fin Fout KmVp a1 2g L1cm3/sec

    The change in level is then given by

    L1 a1

    A12g L1

    Km

    A1Vpcm/sec

    where A1is the diameter of the tank

    Linearizing about a quiescent point Lowe obtain:

    L1 a1

    A1

    g

    2LoL

    Km

    A1Vp

  • 7/25/2019 Water Tank Manual

    5/17

    Coupled Tanks 4

    For a given level Lo, we need a constant voltage applied to the pump in order tomaintain the level. That means an integrator is required in the control loop tocompensate for the constant(relatively) disturbance due to the outflow orifice. We writethe final state space eqautions for the single tank control problem as:

    L1

    1

    a1A1

    g2Lo

    0

    1 0

    L

    1

    Km

    A1

    0

    Vp

    we have introduced an integrator for the the level .1 L1

    The quiescent voltage required to maintain the level at Lo is obtained using:

    0 KmVp0 a1 2g L0

    Vp0 a12g L0

    Km

    2.2 Two tank system : State coupling only

    Consider Configuration #2 ehere the pump feeds Tank 1 and Tank 1 feeds Tank 2. ForTank1 #1 the same equations developed above apply.

    As for tank #2, the inflow is equal to the outflow from Tank 1:

    F2in a1 2g L1cm3/sec

    and the outflow is:

    F2out a2 2g L2cm3/sec

    So the level in Tank 2 is written as:

    L2a1

    A22g L1

    a2

    A2

    2g L2

    which can be linearized about L10& L20

    to obtain:

  • 7/25/2019 Water Tank Manual

    6/17

    Coupled Tanks 5

    L2 a2

    A2

    g

    2L20L2

    a1

    A2

    g

    2L10L1

    The complete system in can be written as 2 2ndorder systems:

    Tank 1 uses the pump voltage as input:

    L1

    1

    a1

    A1

    g

    2L100

    1 0

    L1

    1

    Km

    A1

    0

    Vp

    and Tank2 uses the height in L1 as an input:

    L2

    2

    a2

    A2

    g

    2L200

    1 0

    L2

    2

    a1

    A2

    g

    2L10

    0

    L1

    We can then design a two loop system to regulate the level in L2.

    Note that for quiescent conditions the heights remain constant:

    0 a1

    A2

    2g L1 a2

    A22g L2

    which when solved for L20results in:

    L10 a

    2

    2

    a2

    1

    L20

    That means could technically regulate L2 using L1 alone BUT since the ratio is notprecisely known a closed loop system that feeds back L2 would improve performance.

    the quiescent voltage required to maintain the level at L1 is obtained using:

  • 7/25/2019 Water Tank Manual

    7/17

    Coupled Tanks 6

    0 KmVp a1 2g L10

    Vp a12g L10

    Km

    2.3 Two tank system with state and input coupling

    Configuration #3 accommodates for the pump flow to split to tank #1 and tank #2.

    Let o1be the diameter of outflow #1 (Out1) and o2be the diameter of outflow #2 (Out2)which are coming from the pump. Let

    If you attach only one connector, the flow is controlled directly by the voltage applied tothe pump. When you attach two connectors as in configuration 3 you then have twoflows coming out. The total flow is still controlled by the pump and the individual flowsare split up in proportion to the areas o1 and o2 as given below:

    Fp1 ao1

    ao1ao2KmVp KmVp cm

    3/sec

    Fp2 ao2

    ao1ao2KmVp (1)KmVp cm

    3/sec

    For configuration #3, we feedFp1 (Out1) Directly to Tank #2and Out #2 Directly toTank #1.

    By combining the state space equations obtained in section 2 with the above twoequations we have:

    L1

    L2

    2

    a1

    A1

    g

    2L100 0

    a1

    A2

    g

    2L10

    a2

    A2

    g

    2L200

    0 1 0

    L1

    L2

    2

    (1)Km

    A1

    Km

    A2

    0

    Vp

    For quiescence we have:

    0 a1 2g L10 (1)KmVp

  • 7/25/2019 Water Tank Manual

    8/17

    Coupled Tanks 7

    and

    0 a1 2g L10 a2 2g L20 KmVp

    which result in:

    L10 a

    2

    2

    a2

    1

    (1)2 L20

    and

    Vp0 a2

    Km2g L20

  • 7/25/2019 Water Tank Manual

    9/17

    Coupled Tanks 8

    3 Control Systems Design

    Note the configurations for these experiments. You must use the appropriate exitorifice for each tank and the appropriate feed from the pump. Note that forconfiguration #3, Out #1 feeds to Tank #2 and Out #2 feeds to Tank #1

    Configuration a1 L10 a2 L20 Out1 Out2 ControlTank Level

    1 Medium 15 cm Medium N/A Tank1 N/A L1

    2 Medium Compute Medium 15 cm Tank1 N/A L2

    NOTE REVERSED FEED AND ORIFICE CHANGE IN CONFIGURATION #3

    3 Small Compute Large 10 cm Tank2 Tank1 L2

    3.1 Configuration #1

    The open loop system is:

    L1

    1

    a1

    A1

    g

    2Lo0

    1 0

    L

    1

    Km

    A1

    0

    Vp

    The controller is obtained by running the m file d_level1.mfrom MATLAB which

    performs LQR design to obtain the feedback gains:

    Vp kp1 (L1 L1c) ki1 (L1 L1c) a12 g L1c

    Km

    where L1cis the commanded level to the tank in cm. This is a PI controller thatcommands the voltage to the motor based on the error signal and a feedforward term(in brackets = Vqas calculated in section 2.1) that pre-computes the desired voltage forthe desired level. The feedforward term ensures reduces the windup in the integrator.

    The controller is implemented using SIMULINK model q_level1.mdland run in realtimeusing WinCon.

    The response is shown in Figure below.

  • 7/25/2019 Water Tank Manual

    10/17

    Coupled Tanks 9

    0 5 10 15 20 250

    2

    4

    6

    8

    10

    12

    14

    16

    18

    20

    Time

    3.1 Configuration #2

    The open loop system consists of two systems:

    which is the first tank

    L1

    1

    a1

    A1

    g

    2Lo0

    1 0

    L

    1

    Km

    A1

    0

    Vp

    and second system which is the second tank and whose input is the level of Tank #1:

    L2

    2

    a2

    A2

    g

    2L200

    1 0

    L2

    2

    a1

    A2

    g

    2L10

    0

    L1

    The first system is controlled using te controller designed in section 3.1.

    (inner Loop)Vp

    kp1

    (L1

    L1c

    ) ki1

    (L1

    L1c

    ) a1

    2 g L1c

    Km

    The command to that controller is derived from the controller for the second tank. Thesecond tank controller is also designed using lqr to obtain the feedback gains for thefeedback equation:

  • 7/25/2019 Water Tank Manual

    11/17

    Coupled Tanks 10

    0 10 20 30 40 50 60-5

    0

    5

    10

    15

    20

    25

    30

    Time

    (outer loop)L1c

    kp2 (L2 L2c) ki2 (L2 L2c)

    a2

    2

    a2

    1

    L2c

    The controller is obtained by running the m file d_level2.mfrom MATLAB whichperforms LQR design to obtain the feedback gains.

    The idea is then to control the level of Tank 1 such that tank 2 tracks the desiredcommand. From section 2.2 we know that if the outflow orifices are the same, thesteady state condition is that the two levels should be the same. It is good practicehowever to limit the command L1cto within the bounds of the tanks so that the waterdoes not flow out in case you have some kind of instability in the outer loop.

    The controller is implemented using SIMULINK model q_level2.mdland run in realtimeusing WinCon.

    The response is shown in Figure below.

    3.1 Configuration #3

    In this case, the two tank equations cannot be written independently since the input Vpaffects both tanks directly and it is the only control input. The state space equation is:

  • 7/25/2019 Water Tank Manual

    12/17

    Coupled Tanks 11

    L1

    L2

    2

    a1

    A1

    g

    2L100 0

    a1

    A2

    g

    2L10

    a2

    A2

    g

    2L20

    0

    0 1 0

    L1

    L2

    2

    (1)Km

    A1

    Km

    A2

    0

    Vp

    Note that we introduced an integrator for L2since we want to regulate L2. We thendesign a controller of the form:

    Vp k1 (L1) k2 (L2 L2c)k3 (L2 L2c) a

    2

    Km2 g L2c

    This controller may be implemented as is but note that L1 is free and uncontrolled.

    We can rewrite the feedback component as:

    Vp k1 L1 k2

    k1(L2L2c)

    k3

    k2(L2L2c)

    Vp kp1 L1 L1c

    L1c kp2 (L2L2c)ki2 (L2L2c)

    which is a proportional + integral outer loop to control L2by commanding L1cand aproportional inner loop to control L1to track L1c. This way we can limit L1cnot to exceedthe tank dimensions. We can also add on a quiescent feedforward term for L1cderivedfrom (see section 2.3)

    L10

    a2

    2

    a2

    1(

    1)

    2

    L20

    resulting in :

  • 7/25/2019 Water Tank Manual

    13/17

    Coupled Tanks 12

    0 10 20 30 40 50 60-5

    0

    5

    10

    15

    20

    25

    Time

    L1c

    kp2 (L2L2c)ki2 (L2L2c)

    a2

    2

    a2

    1

    (1)2 L2c

    and

    Vp

    kp1

    L1

    L1c

    a2

    Km2g L2c

  • 7/25/2019 Water Tank Manual

    14/17

    Coupled Tanks 13

    5 Wiring and Calibration

    Use UPM2405 amplifier for this experiment

    From To Cable Function

    Level sensors S1 & S2 on UPM2405 6 pin mini Din/ 6 pin mini Din

    Measure V1 &V2via S1 &S2

    To/ A/D on UPM MultiQAnalog inputs 0,1,2,3

    5 pin Din4 x RCA

    V1 to A/D #0V2 to A/D #1

    MultiQ D/A # 0 UPM From D/A RCA5 Pin Din Mono

    Signal to amplifier

    To Load Motor Connector 6 pin Din / 4 pin DinGain = 5 ( green marker)

    Power to pump

    Using this wiring S1 senses V1 from Tank 1 and S2 senses V2 from Tank 2

    5.1 Calibration

    To calibrate:

    Wire the system as described and power up the amplifier.

    a) calibrate the zero

    Run WinCon - load project cal_tank.wcp -this displays the voltages from the twosenors. With no water in the tanks adjust the offset potentiometersobtain 0.0 volts.Click stop when you are done and close WinCon.

    b) calibrate the maximum voltage

    Run WinCon - load project tank_cal.wcp- this displays the voltages from the twosensors. Plug the outflow of tank 1 with your finger or use the supplied screw . FillTank1 up to 25 cm. Adjust the gain potentiometerfor tank1 to obtain anywherebetween 4.0 to 4.2volts on the position sensor. Click stop when you are done andclose WinCon. Release the water out of the tank. The measurement should be zero.

    Repeat for Tank 2.

    Click stop when you are done and close WinCon.

    c) Run the test controllerfor configuration 1

    MAKE SURE THE TUBE FROM OUT 1 IS INSERTED INTO THE TANK1. Do not use

  • 7/25/2019 Water Tank Manual

    15/17

    Coupled Tanks 14

    a tube to OUT 2.

    Start WinCon, load q_level1.wcl and run it . The tank should fill up to 15 cm andmaintain its level. Be ready to stop the controller if the water level rises above 25cm!Check wiring and calibration if the system does not perform as expected.

    6 Software

    File Software needed

    Function Output /Input filenames( I = input file,O = Output file)

    I/O

    d_level1.m MATLAB Derive gains for conf 1 Workspace IO

    q_level1.mdl SIMULINKWinCon

    Controller diagramImplement controller q_level1.wcl O

    q_level1.wcp WinCon Run controller q_level1.wcl O

    d_level1.m MATLAB Derive gains for conf 1 Workspace IO

    q_level1.mdl SIMULINKWinCon

    Controller diagramImplement controller

    q_level1.wcl O

    q_level1.wcp WinCon Run controller q_level1.wcl O

    d_level1.m MATLAB Derive gains for conf 1 Workspace IO

    q_level1.mdl SIMULINKWinCon

    Controller diagramImplement controller

    q_level1.wcl O

    q_level1.wcp WinCon Run controller q_level1.wcl O

    tank_cal.wcp WinCon Calibrate for 0 level tank_cal.wcl & mdl I

    tank_cal.wcp WinCon Calibrate for 25 cmlevel

    tank_cal.wcl & mdl I

  • 7/25/2019 Water Tank Manual

    16/17

    Coupled Tanks 15

    7 System parameters

    Name Symbol Value Units

    PumpFlow constant Km 4.6 (cm3/sec)/Volt

    Maximum Voltage Vmax 22 Volts

    Maximum flow Fmax 100 cm3/sec

    Out1 Orificediameter

    o1 .635 cm

    Out2 Orificediameter

    o2 .4763 cm

    Tank1

    Height Lmax 30 cm

    Inside Diameter 4.445 cm

    Cross sectionarea

    A1 15.5179 cm2

    Sensor sensitivity 5 cm/volt

    Tank2Height Lmax 30 cm

    Inside Diameter 4.445 cm

    Cross sectionarea

    A2 15.5179 cm2

    Sensor sensitivity 5 cm/volt

    Outflow OrificesDiameters

    Small d1 0.3175 cm

    Medium (Typical) d1& d2 0.47625 cm

    Large d2 0.555625 cm

  • 7/25/2019 Water Tank Manual

    17/17

    Coupled Tanks 16

    Outflow OrificesAreas

    Small a1 0.0791729767 cm

    Medium (Typical) a1& a2 0.17813919765 cm

    Large a2 0.24246724125 cm

    Sensors

    Pressure Range 0 - 1 PSI

    Water level range 0 - 30 cm

    Sensitivity Ks 6.25 * cm / Volt

    Calibration nominal. You may need to recalibrate when you receive the system.

    Configurations

    Configuration a1 L10 a2 L20 Out1 Out2 ControlOutput

    1 Medium 15 cm Medium N/A Tank1 N/A L1

    2 Medium Compute Medium 15 cm Tank1 N/A L2

    3 Small Compute Large 10 cm Tank2 Tank1 L2