Changeset 910 for branches/gui/sample/controllers/sample_tanks_pid.mso
- Timestamp:
- Feb 20, 2010, 1:24:41 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/gui/sample/controllers/sample_tanks_pid.mso
r735 r910 20 20 * Author: Tiago Osório 21 21 * $Id$ 22 *----------------------------------------------------------------- #22 *-----------------------------------------------------------------*# 23 23 24 24 using "tanksmodel"; … … 32 32 PIDc as PIDIncr; 33 33 34 PARAMETERS35 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 38 34 VARIABLES 39 h_ad as Real (Brief="Altura adimensional do nível do tanque", Lower=0,Upper=1);35 out LI as control_signal (Brief="Level Indicator"); 40 36 41 37 CONNECTIONS 38 LI to PIDc.Input; 42 39 43 40 SET 44 41 Tanque1.A = 8 * 'm^2'; 45 h_max = 2 * 'm';46 h_min = 0 * 'm';42 PIDc.MaxInput = 2; 43 PIDc.MinInput = 0; 47 44 PIDc.PID_Select = "Ideal_AWBT"; 48 45 … … 62 59 EQUATIONS 63 60 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; 67 62 68 #Perturbação servo 69 #Nível desejado=1*'m' 70 PIDc.Ports.setPoint=0.5; 63 "Level sensor" 64 LI * 'm' = Tanque1.h; 71 65 72 #Perturbação regulatória 66 #Setpoint tracking 67 PIDc.SetPoint=1; 68 69 #Disturbance rejection 73 70 if time<10*'h' then 74 71 Tanque1.Fin= 3*'m^3/h'; … … 92 89 PIDx as PID; 93 90 94 PARAMETERS95 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 98 91 VARIABLES 99 h_ad as Real (Brief="Altura adimensional do nível do tanque", Lower=0,Upper=1);92 out LI as control_signal (Brief="Level Indicator"); 100 93 101 94 CONNECTIONS 95 LI to PIDx.Input; 102 96 103 97 SET 104 98 Tanque1.A = 8 * 'm^2'; 105 h_max = 2 * 'm';106 h_min = 0 * 'm';99 PIDx.MaxInput = 2; 100 PIDx.MinInput = 0; 107 101 PIDx.PID_Select = "Ideal_AWBT"; 108 102 … … 122 116 EQUATIONS 123 117 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; 127 119 128 #Perturbação servo 129 #Nível desejado=1*'m' 130 PIDx.Ports.setPoint=0.5; 120 "Level sensor" 121 LI * 'm' = Tanque1.h; 131 122 132 #Perturbação regulatória 123 #Setpoint tracking 124 PIDx.SetPoint=1; 125 126 #Disturbance rejection 133 127 if time<10*'h' then 134 128 Tanque1.Fin= 3*'m^3/h';
Note: See TracChangeset
for help on using the changeset viewer.