#*------------------------------------------------------------------- * EMSO Model Library (EML) Copyright (C) 2004 - 2007 ALSOC. * * This LIBRARY is free software; you can distribute it and/or modify * it under the therms of the ALSOC FREE LICENSE as available at * http://www.enq.ufrgs.br/alsoc. * * EMSO Copyright (C) 2004 - 2007 ALSOC, original code * from http://www.rps.eng.br Copyright (C) 2002-2004. * All rights reserved. * * EMSO is distributed under the therms of the ALSOC LICENSE as * available at http://www.enq.ufrgs.br/alsoc. * * *------------------------------------------------------------------- * Sample file for tanks level control * *------------------------------------------------------------------- * Author: Tiago Osório * $Id: sample_tanks_pid.mso 910 2010-02-20 03:24:41Z arge $ *-----------------------------------------------------------------*# using "tanksmodel"; using "controllers/PIDs"; using "controllers/PIDIncr"; FlowSheet Tanque_inc DEVICES Tanque1 as tank; PIDc as PIDIncr; VARIABLES out LI as control_signal (Brief="Level Indicator"); CONNECTIONS LI to PIDc.Input; SET Tanque1.A = 8 * 'm^2'; PIDc.MaxInput = 2; PIDc.MinInput = 0; PIDc.PID_Select = "Ideal_AWBT"; PIDc.tau = 1*'s'; PIDc.tauSet = 1*'s'; PIDc.alpha = 0.3; PIDc.bias = 0; PIDc.gamma = 1; PIDc.beta = 1; PIDc.Action = "Direct"; PIDc.Clip = "Clipped"; PIDc.Mode = "Automatic"; PIDc.intTime=5000*'s'; PIDc.gain = 3.5; PIDc.derivTime=1*'s'; EQUATIONS Tanque1.k = 8*'m^2.5/h'*PIDc.Output; "Level sensor" LI * 'm' = Tanque1.h; #Setpoint tracking PIDc.SetPoint=1; #Disturbance rejection if time<10*'h' then Tanque1.Fin= 3*'m^3/h'; else Tanque1.Fin= 1.5*'m^3/h'; end INITIAL "altura inicial" Tanque1.h = 0.2 * 'm'; OPTIONS TimeStep = 0.1; TimeEnd = 30; TimeUnit = 'h'; end FlowSheet Tanque DEVICES Tanque1 as tank; PIDx as PID; VARIABLES out LI as control_signal (Brief="Level Indicator"); CONNECTIONS LI to PIDx.Input; SET Tanque1.A = 8 * 'm^2'; PIDx.MaxInput = 2; PIDx.MinInput = 0; PIDx.PID_Select = "Ideal_AWBT"; PIDx.tau = 1*'s'; PIDx.tauSet = 1*'s'; PIDx.alpha = 0.3; PIDx.bias = 0; PIDx.gamma = 1; PIDx.beta = 1; PIDx.intTime=5000*'s'; PIDx.gain =3.5; PIDx.derivTime=1*'s'; PIDx.Action = "Direct"; PIDx.Clip = "Clipped"; PIDx.Mode = "Automatic"; EQUATIONS Tanque1.k = 8*'m^2.5/h'*PIDx.Output; "Level sensor" LI * 'm' = Tanque1.h; #Setpoint tracking PIDx.SetPoint=1; #Disturbance rejection if time<10*'h' then Tanque1.Fin= 3*'m^3/h'; else Tanque1.Fin= 1.5*'m^3/h'; end INITIAL "altura inicial" Tanque1.h = 0.2 * 'm'; OPTIONS TimeStep = 0.1; TimeEnd = 30; TimeUnit = 'h'; end