Posted Thu, 26 Jun 2014 11:48:19 GMT by Claus Vieira Andersen
Hello WEST Forum

I'm trying to control the aeration of four tanks using an average of the DO concentration in the four tanks. The overall DO setpoint 1.5. Thus, if of one of the tanks has a DO concentration of the 2 and the three others has a DO concentration of 1 the aeration will increase as the average is only 1.25. Anybody has a good idea of how to do this?

I hope this is clear.

Kind regards,
Claus Vieira B. Andersen
Posted Fri, 27 Jun 2014 12:31:09 GMT by Enrico Remigi WEST Product Owner
The easiest may be to create a new control model that takes 4 input signals and computes their average - that is then sent out as control action.
Here's a template:
[code]
CLASS Average04
(* icon = "ICONNAME" *)
SPECIALISES PhysicalDAEModelType :=
  {:
    comments <- "A model for a proportional-integral controller with saturation";
    interface <-
    {
      OBJ y_M1 (* terminal = "in_1" *) "Input No.1" : Concentration := {: causality <- "CIN" ; group <- "Measurement data" :};
      // SAME FOR THE OTHER 3 SIGNALS
      OBJ u (* terminal = "out_1" *) "Controlled variable" : Concentration := {: causality <- "COUT" ; group <- "Control action" :};
    };

    independent <-
    {
    OBJ t "Time" : Time := {: group <- "Time" :};
    };

    equations <-
    {
    interface.u = (interface.y_M1 + interface.y_M2 + interface.y_M3 + interface.y_M4) / 4 ;
    };
  :};
[/code]

The signal out ("u") can then be used as input for another control model - that will provide the actual control action you need (i.e. based on the average of 4 DO measurements).
If the latter controller is one of the default WEST control models (P, PI, ..), you could even create a [b]coupled model[/b] which is much more "elegant" and reusable solution - but may also be tricky.

You must be signed in to post in this forum.