Last change
on this file since 910 was
910,
checked in by Argimiro Resende Secchi, 12 years ago
|
Checking new EML.
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
2.6 KB
|
Rev | Line | |
---|
[84] | 1 | #*------------------------------------------------------------------- |
---|
| 2 | * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. |
---|
[1] | 3 | * |
---|
[84] | 4 | * This LIBRARY is free software; you can distribute it and/or modify |
---|
| 5 | * it under the therms of the ALSOC FREE LICENSE as available at |
---|
| 6 | * http://www.enq.ufrgs.br/alsoc. |
---|
[1] | 7 | * |
---|
[84] | 8 | * EMSO Copyright (C) 2004 - 2007 ALSOC, original code |
---|
| 9 | * from http://www.rps.eng.br Copyright (C) 2002-2004. |
---|
| 10 | * All rights reserved. |
---|
[1] | 11 | * |
---|
[84] | 12 | * EMSO is distributed under the therms of the ALSOC LICENSE as |
---|
| 13 | * available at http://www.enq.ufrgs.br/alsoc. |
---|
[1] | 14 | * |
---|
[84] | 15 | * |
---|
| 16 | *------------------------------------------------------------------- |
---|
| 17 | * Sample file for tanks level control |
---|
| 18 | * |
---|
| 19 | *------------------------------------------------------------------- |
---|
| 20 | * Author: Tiago Osório |
---|
| 21 | * $Id: sample_tanks_pid.mso 910 2010-02-20 03:24:41Z arge $ |
---|
[910] | 22 | *-----------------------------------------------------------------*# |
---|
[1] | 23 | |
---|
| 24 | using "tanksmodel"; |
---|
[7] | 25 | using "controllers/PIDs"; |
---|
[1] | 26 | using "controllers/PIDIncr"; |
---|
| 27 | |
---|
| 28 | |
---|
| 29 | FlowSheet Tanque_inc |
---|
| 30 | DEVICES |
---|
| 31 | Tanque1 as tank; |
---|
[295] | 32 | PIDc as PIDIncr; |
---|
[1] | 33 | |
---|
| 34 | VARIABLES |
---|
[910] | 35 | out LI as control_signal (Brief="Level Indicator"); |
---|
[1] | 36 | |
---|
| 37 | CONNECTIONS |
---|
[910] | 38 | LI to PIDc.Input; |
---|
[1] | 39 | |
---|
| 40 | SET |
---|
[190] | 41 | Tanque1.A = 8 * 'm^2'; |
---|
[910] | 42 | PIDc.MaxInput = 2; |
---|
| 43 | PIDc.MinInput = 0; |
---|
[295] | 44 | PIDc.PID_Select = "Ideal_AWBT"; |
---|
[294] | 45 | |
---|
[558] | 46 | PIDc.tau = 1*'s'; |
---|
| 47 | PIDc.tauSet = 1*'s'; |
---|
| 48 | PIDc.alpha = 0.3; |
---|
| 49 | PIDc.bias = 0; |
---|
| 50 | PIDc.gamma = 1; |
---|
| 51 | PIDc.beta = 1; |
---|
| 52 | PIDc.Action = "Direct"; |
---|
| 53 | PIDc.Clip = "Clipped"; |
---|
| 54 | PIDc.Mode = "Automatic"; |
---|
| 55 | PIDc.intTime=5000*'s'; |
---|
| 56 | PIDc.gain = 3.5; |
---|
| 57 | PIDc.derivTime=1*'s'; |
---|
| 58 | |
---|
[1] | 59 | EQUATIONS |
---|
[558] | 60 | |
---|
[910] | 61 | Tanque1.k = 8*'m^2.5/h'*PIDc.Output; |
---|
[1] | 62 | |
---|
[910] | 63 | "Level sensor" |
---|
| 64 | LI * 'm' = Tanque1.h; |
---|
[1] | 65 | |
---|
[910] | 66 | #Setpoint tracking |
---|
| 67 | PIDc.SetPoint=1; |
---|
| 68 | |
---|
| 69 | #Disturbance rejection |
---|
[481] | 70 | if time<10*'h' then |
---|
[190] | 71 | Tanque1.Fin= 3*'m^3/h'; |
---|
[1] | 72 | else |
---|
[190] | 73 | Tanque1.Fin= 1.5*'m^3/h'; |
---|
[1] | 74 | end |
---|
| 75 | |
---|
| 76 | INITIAL |
---|
| 77 | "altura inicial" |
---|
[190] | 78 | Tanque1.h = 0.2 * 'm'; |
---|
[1] | 79 | |
---|
| 80 | OPTIONS |
---|
[190] | 81 | TimeStep = 0.1; |
---|
| 82 | TimeEnd = 30; |
---|
| 83 | TimeUnit = 'h'; |
---|
[1] | 84 | end |
---|
| 85 | |
---|
| 86 | FlowSheet Tanque |
---|
| 87 | DEVICES |
---|
| 88 | Tanque1 as tank; |
---|
[295] | 89 | PIDx as PID; |
---|
[1] | 90 | |
---|
| 91 | VARIABLES |
---|
[910] | 92 | out LI as control_signal (Brief="Level Indicator"); |
---|
[1] | 93 | |
---|
| 94 | CONNECTIONS |
---|
[910] | 95 | LI to PIDx.Input; |
---|
[1] | 96 | |
---|
| 97 | SET |
---|
[190] | 98 | Tanque1.A = 8 * 'm^2'; |
---|
[910] | 99 | PIDx.MaxInput = 2; |
---|
| 100 | PIDx.MinInput = 0; |
---|
[295] | 101 | PIDx.PID_Select = "Ideal_AWBT"; |
---|
| 102 | |
---|
[558] | 103 | PIDx.tau = 1*'s'; |
---|
| 104 | PIDx.tauSet = 1*'s'; |
---|
| 105 | PIDx.alpha = 0.3; |
---|
| 106 | PIDx.bias = 0; |
---|
| 107 | PIDx.gamma = 1; |
---|
| 108 | PIDx.beta = 1; |
---|
| 109 | PIDx.intTime=5000*'s'; |
---|
| 110 | PIDx.gain =3.5; |
---|
| 111 | PIDx.derivTime=1*'s'; |
---|
| 112 | PIDx.Action = "Direct"; |
---|
| 113 | PIDx.Clip = "Clipped"; |
---|
| 114 | PIDx.Mode = "Automatic"; |
---|
| 115 | |
---|
[1] | 116 | EQUATIONS |
---|
[558] | 117 | |
---|
[910] | 118 | Tanque1.k = 8*'m^2.5/h'*PIDx.Output; |
---|
[1] | 119 | |
---|
[910] | 120 | "Level sensor" |
---|
| 121 | LI * 'm' = Tanque1.h; |
---|
[1] | 122 | |
---|
[910] | 123 | #Setpoint tracking |
---|
| 124 | PIDx.SetPoint=1; |
---|
| 125 | |
---|
| 126 | #Disturbance rejection |
---|
[481] | 127 | if time<10*'h' then |
---|
[190] | 128 | Tanque1.Fin= 3*'m^3/h'; |
---|
[1] | 129 | else |
---|
[190] | 130 | Tanque1.Fin= 1.5*'m^3/h'; |
---|
[1] | 131 | end |
---|
| 132 | |
---|
| 133 | INITIAL |
---|
| 134 | "altura inicial" |
---|
[190] | 135 | Tanque1.h = 0.2 * 'm'; |
---|
[1] | 136 | |
---|
| 137 | OPTIONS |
---|
[190] | 138 | TimeStep = 0.1; |
---|
| 139 | TimeEnd = 30; |
---|
| 140 | TimeUnit = 'h'; |
---|
[1] | 141 | end |
---|
| 142 | |
---|
| 143 | |
---|
| 144 | |
---|
Note: See
TracBrowser
for help on using the repository browser.