Step coupler for heat elemets based on % input

joggvald
2017-07-28
2017-09-15
  • joggvald - 2017-07-28

    Im upgrading a HVAC control system, i found a decent macro but the macro is for liquid heat battery, and this application has electrical.

    I would like to use the % output from the valve controller to trigger the heat elemets. Total heat is 110kw (2 x 7kW + 1x14kW + 1x27kW + 1x55kW)

    All 5 heat elemets ar triggered by DO, what function could i use to calculate wich outputs at a given time will give the most correct DO to activate?

    Example:
    0% = 0kW
    25% = 27kW (only 27kW aktice)
    50% = 55kW (Only 55kW active)
    75% = 82kW (Only 55kW + 27kW) active
    100% = 110kW (all active)

     
  • Anonymous - 2017-08-15

    Originally created by: scott_cunningham

    A late answer, but here is a basic FB that will do it (assumes your command is 0 to 100):

    FUNCTION_BLOCK HeatControl
    VAR_INPUT
       CmdSignal : INT := 0;
    END_VAR
    VAR_OUTPUT
       Heat7KwA : BOOL := FALSE;
       Heat7KwB : BOOL := FALSE;
       Heat14Kw : BOOL := FALSE;
       Heat27Kw : BOOL := FALSE;
       Heat55Kw : BOOL := FALSE;
    END_VAR
    VAR
    END_VAR
    (*
    0% = 0kW
    25% = 27kW (only 27kW aktice)
    50% = 55kW (Only 55kW active)
    75% = 82kW (Only 55kW + 27kW) active
    100% = 110kW (all active)
    *)
    //turn all off first
    Heat7KwA := FALSE;
    Heat7KwB := FALSE;
    Heat14Kw := FALSE;
    Heat27Kw := FALSE;
    Heat55Kw := FALSE;
    //now see which should be on
    IF CmdSignal >= 100 THEN
       Heat7KwA := TRUE;
       Heat7KwB := TRUE;
       Heat14Kw := TRUE;
       Heat27Kw := TRUE;
       Heat55Kw := TRUE;
    ELSIF CmdSignal >= 75 THEN
       Heat27Kw := TRUE;
       Heat55Kw := TRUE;
    ELSIF CmdSignal >= 50 THEN
       Heat55Kw := TRUE;
    ELSIF CmdSignal >= 25 THEN
       Heat27Kw := TRUE;
    ELSE
       ; //none
    END_IF
     
    
     
  • joggvald - 2017-08-24

    Thanks for your reply.

    Im sorry if my question wasn't crystal clear.

    I would like a function that calculate all the time and then find the nearest combination to match the requested input.

    Is there any pre-made function for this?

     
  • Anonymous - 2017-08-26

    Originally created by: scott_cunningham

    That is what my function block will do based on your information. Call it every scan with your input and it will turn on or off whatever heaters you need.

     
  • joggvald - 2017-09-15

    This is the solution i came up with, in case someone else need this.
    This function calculates the remaining kW wich are given by Heat7KwA with TRIAC.

    FUNCTION_BLOCK HeatControl
    VAR_INPUT
       CmdSignal : INT := 0;
    END_VAR
    VAR_OUTPUT
       Heat7KwA : BOOL := FALSE;
       Heat7KwB : BOOL := FALSE;
       Heat14Kw : BOOL := FALSE;
       Heat27Kw : BOOL := FALSE;
       Heat55Kw : BOOL := FALSE;
      Triacscaled: INT := 0;
    END_VAR
    VAR
       Triac : INT := 0;
    END_VAR
    
    Triacscaled := (CmdSignal - Triac) * 100 / 7;
    IF CmdSignal >= 103 THEN
       Heat7KwB := TRUE;
       Heat14Kw := TRUE;
       Heat27Kw := TRUE;
       Heat55Kw := TRUE;
       Triac := 103;
    ELSIF CmdSignal >= 96 THEN
       Heat14Kw := TRUE;
       Heat27Kw := TRUE;
       Heat55Kw := TRUE;
       Triac := 96;
    ELSIF CmdSignal >= 89 THEN
       Heat7KwB := TRUE;
       Heat27Kw := TRUE;
       Heat55Kw := TRUE;
       Triac := 89;
    ELSIF CmdSignal >= 82 THEN
       Heat27Kw := TRUE;
       Heat55Kw := TRUE;
       Triac := 82;
    ELSIF CmdSignal >= 76 THEN
       Heat7KwB := TRUE;
       Heat14Kw := TRUE;
       Heat55Kw := TRUE;
       Triac := 76;
    ELSIF CmdSignal >= 69 THEN
       Heat14Kw := TRUE;
       Heat55Kw := TRUE;
       Triac := 69;
    ELSIF CmdSignal >= 62 THEN
       Heat7KwB := TRUE;
       Heat55Kw := TRUE;
       Triac := 62;
    ELSIF CmdSignal >= 55 THEN
       Heat55Kw := TRUE;
       Triac := 55;
    ELSIF CmdSignal >= 48 THEN
       Heat7KwB := TRUE;
       Heat14Kw := TRUE;
       Heat27Kw := TRUE;
       Triac := 48;
    ELSIF CmdSignal >= 41 THEN
       Heat14Kw := TRUE;
       Heat27Kw := TRUE;
       Triac := 41;
    ELSIF CmdSignal >= 34 THEN
       Heat7KwB := TRUE;
       Heat27Kw := TRUE;
       Triac := 34;
    ELSIF CmdSignal >= 27 THEN
       Heat27Kw := TRUE;
       Triac := 27;
    ELSIF CmdSignal >= 21 THEN
       Heat7KwB := TRUE;
       Heat14Kw := TRUE;
       Triac := 21;
    ELSIF CmdSignal >= 14 THEN
       Heat14Kw := TRUE;
       Triac := 14;
    ELSIF CmdSignal >= 7 THEN
       Heat7KwB := TRUE;
       Triac := 7;
    END_IF
    
     

Log in to post a comment.