Ignore:
Timestamp:
Feb 20, 2010, 1:24:41 AM (14 years ago)
Author:
Argimiro Resende Secchi
Message:

Checking new EML.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/gui/sample/controllers/sample_tanks_pid.mso

    r735 r910  
    2020* Author: Tiago Osório
    2121* $Id$
    22 *-----------------------------------------------------------------#
     22*-----------------------------------------------------------------*#
    2323
    2424using "tanksmodel";
     
    3232        PIDc     as PIDIncr;
    3333       
    34         PARAMETERS     
    35         h_max as Real (Brief="Altura máxima do nível do tanque", Unit='m');
    36         h_min as Real (Brief="Altura mínima do nível do tanque", Unit='m');
    37 
    3834    VARIABLES
    39         h_ad  as Real (Brief="Altura adimensional do nível do tanque", Lower=0,Upper=1);
     35out     LI as control_signal (Brief="Level Indicator");
    4036
    4137        CONNECTIONS
     38        LI to PIDc.Input;
    4239       
    4340        SET
    4441        Tanque1.A = 8 * 'm^2';
    45         h_max = 2 * 'm';
    46         h_min = 0 * 'm';
     42        PIDc.MaxInput = 2;
     43        PIDc.MinInput = 0;
    4744        PIDc.PID_Select = "Ideal_AWBT";
    4845       
     
    6259        EQUATIONS
    6360
    64         PIDc.Ports.input = h_ad;
    65         h_ad = (Tanque1.h-h_min)/(h_max-h_min);
    66         Tanque1.k = 8*'m^2.5/h'*PIDc.Ports.output;     
     61        Tanque1.k = 8*'m^2.5/h'*PIDc.Output;   
    6762
    68         #Perturbação servo
    69         #Nível desejado=1*'m'
    70         PIDc.Ports.setPoint=0.5;
     63        "Level sensor"
     64        LI * 'm' = Tanque1.h;
    7165
    72         #Perturbação regulatória
     66        #Setpoint tracking
     67        PIDc.SetPoint=1;
     68
     69        #Disturbance rejection
    7370        if time<10*'h' then
    7471                Tanque1.Fin= 3*'m^3/h';
     
    9289        PIDx     as PID;
    9390       
    94         PARAMETERS     
    95         h_max as Real (Brief="Altura máxima do nível do tanque", Unit='m');
    96         h_min as Real (Brief="Altura mínima do nível do tanque", Unit='m');
    97 
    9891    VARIABLES
    99         h_ad  as Real (Brief="Altura adimensional do nível do tanque", Lower=0,Upper=1);
     92out     LI as control_signal (Brief="Level Indicator");
    10093
    10194        CONNECTIONS
     95        LI to PIDx.Input;
    10296       
    10397        SET
    10498        Tanque1.A = 8 * 'm^2';
    105         h_max = 2 * 'm';
    106         h_min = 0 * 'm';
     99        PIDx.MaxInput = 2;
     100        PIDx.MinInput = 0;
    107101        PIDx.PID_Select = "Ideal_AWBT";
    108102       
     
    122116        EQUATIONS
    123117       
    124         PIDx.Ports.input = h_ad;
    125         h_ad = (Tanque1.h-h_min)/(h_max-h_min);
    126         Tanque1.k = 8*'m^2.5/h'*PIDx.Ports.output;     
     118        Tanque1.k = 8*'m^2.5/h'*PIDx.Output;   
    127119
    128         #Perturbação servo
    129         #Nível desejado=1*'m'
    130         PIDx.Ports.setPoint=0.5;
     120        "Level sensor"
     121        LI * 'm' = Tanque1.h;
    131122
    132         #Perturbação regulatória
     123        #Setpoint tracking
     124        PIDx.SetPoint=1;
     125
     126        #Disturbance rejection
    133127        if time<10*'h' then
    134128                Tanque1.Fin= 3*'m^3/h';
Note: See TracChangeset for help on using the changeset viewer.