# # matplc.conf - configuration file # # # (c) 2001 Juan Carlos Orozco # # Offered to the public under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # This code is made available on the understanding that it will not be # used in safety-critical situations without a full and competent review. # [PLC] module hmi_gtk2 "../../mmi/hmi_gtk2/hmi_gtk2" module Heater "../../logic/dsp/dsp" module Oven "../../logic/dsp/dsp" module plcshutdown "../../lib/util/plcshutdown" # Configure a larger memory space for the cmm. Default is 2 pages of 4Kbytes. confmap_size = 32000 # P O I N T S # ----------- point quit "quit" hmi_gtk2 point_alias quit_app1 "quit" quit point Automatic "Manual/Automatic" hmi_gtk2 point Start "Start/Stop machine" hmi_gtk2 point oven "Oven Window" hmi_gtk2 point heater "Heater Window" hmi_gtk2 point Flame "Flame on/off" Heater point TFPump "Thermal Fluid Pump on/off" Heater # Heater variables # Variables type f32 point TFTempSP "ThermalFluidTempSP" hmi_gtk2 f32 # Cº point GAValveSP "GasAirValveSP-Manual f32" hmi_gtk2 f32 # % point TFTempSPH "ThermalFluidTempSP-Heater" Heater f32 # Cº point GAValvePID "GasAirValveSP-Automatic" Heater f32 # % point GAValveClipp "Clipped GasAirValve from PID" Heater f32 # % point GAValve "GasAirValveFinalSP" Heater f32 # % point TFTemp "ThermalFluidTemp" Heater f32 init 20.0 # Cº (default value is ambient temperature!) # Constants type f32 point SimulationPeriod "SimulationPeriod" hmi_gtk2 f32 init 0.1 # sec point TFSpecificHeat "ThermalFluidSpecificHeat" hmi_gtk2 f32 init 0.2 # kcal/(kg*Cº) point TFMass "ThermalFluidMass" hmi_gtk2 f32 init 1600.0 # kg point MaxHeaterHeat "MaxHeaterHeat" hmi_gtk2 f32 init 5000.0 # kcal point MinHeaterHeat "MinHeaterHeat" hmi_gtk2 f32 init 500.0 # kcal point PCtoAmbHeatK "PrimCircuitAmbientHeatK" hmi_gtk2 f32 init 20.0 # kcal/(sec*Cº) point AmbientTemp "AmbientTemperature" hmi_gtk2 f32 init 20.0 # Cº point ZERO "Value = 0.0" hmi_gtk2 f32 init 0.0 point UNITY "Value = 1.0" hmi_gtk2 f32 init 1.0 point percent2float "Value = 0.01" hmi_gtk2 f32 init 0.01 # Temporary variables f32 point HeatSpan "HeatSpan" Heater f32 # kcal point HeaterDeltaQ "HeaterDeltaHeat" Heater f32 # kcal point HeaterQ_tmp "Temp var to hold heater Q" Heater f32 # kcal point HeaterQ "HeaterHeat" Heater f32 # kcal point HeaterQSpan "HeaterHeatSpan" Heater f32 # kcal point DeltaTemp "DeltaTemp" Heater f32 # kcal point TFHeatLoss "ThermoFluidHeatLoss" Heater f32 # kcal point TFDeltaT "ThermoFluidTempIncrement" Heater f32 # Cº point TFQ "ThermoFluidHeat" Heater f32 # kcal point TF_MSH "ThermoFluidMassSpecificHeat" Heater f32 # kcal/Cº point TF_MSH_inv "1/ThermoFluidMassSpecificHeat" Heater f32 # Cº/kcal point TempError "TemperatureError" Heater f32 # Cº point Automatic_f32 "Manual/Automatic f32 format" Heater f32 # Oven # Oven control point Z1TempSP "Zone1 TemperatureSP" hmi_gtk2 f32 # Cº point Z2TempSP "Zone2 TemperatureSP" hmi_gtk2 f32 # Cº point Z3TempSP "Zone3 TemperatureSP" hmi_gtk2 f32 # Cº point BeltMotorSpdSP "Speed of belt SP" hmi_gtk2 f32 # m/min point Z1TWV_Position "Zone1 ThreeWayValve Position%" hmi_gtk2 f32 # 0-100 % point Z2TWV_Position "Zone2 ThreeWayValve Position%" hmi_gtk2 f32 # 0-100 % point Z3TWV_Position "Zone3 ThreeWayValve Position%" hmi_gtk2 f32 # 0-100 % # Oven constants point RadiatorFluidMass "Mass of the fluid in radiator" hmi_gtk2 f32 init 20.0 # kg point MaxFlowRadiator "Flow when valve is 100% open" hmi_gtk2 f32 init 10.0 # kg/sec point AirSpecificHeat "Specific heat of air" hmi_gtk2 f32 init 0.5 # kcal/(kg*Cº) point Z1AirMass "Mass of air in zone1" hmi_gtk2 f32 init 10.0 # kg point Z2AirMass "Mass of air in zone2" hmi_gtk2 f32 init 10.0 # kg point Z3AirMass "Mass of air in zone3" hmi_gtk2 f32 init 10.0 # kg point ProductMass "Mass of product in each zone" hmi_gtk2 f32 init 5.0 # kg point ZoneLength "Length of each zone" hmi_gtk2 f32 init 5.0 # m point ProdSpecificHeat "Specific heat of product" hmi_gtk2 f32 init 0.4 # kcal/(kg*Cº) point RadToAirHeatK "Radiator to air heat K" hmi_gtk2 f32 init 3.0 # kcal/(sec*Cº) point AirToProdHeatK "Air to product heat K" hmi_gtk2 f32 init 0.2 # kcal/(sec*Cº) point Z1AirToAmbHeatK "Air to ambient heat K in Z1" hmi_gtk2 f32 init 0.5 # kcal/(sec*Cº) point Z2AirToAmbHeatK "Air to ambient heat K in Z2" hmi_gtk2 f32 init 0.5 # kcal/(sec*Cº) point Z3AirToAmbHeatK "Air to ambient heat K in Z3" hmi_gtk2 f32 init 0.5 # kcal/(sec*Cº) # Oven physical variables point Z1ProductTemp "Product temp in zone1" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z2ProductTemp "Product temp in zone2" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z3ProductTemp "Product temp in zone3" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z1AirTemp "Air temperature in zone1" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z2AirTemp "Air temperature in zone2" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z3AirTemp "Air temperature in zone3" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point BeltMotorSpdC "Speed comand to belt drive" Oven f32 # m/min point BeltMotorFeedBk "Real motor speed" Oven f32 # m/min point Z1RadiatorTemp "Temperature of radiator in Z1" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z2RadiatorTemp "Temperature of radiator in Z2" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) point Z3RadiatorTemp "Temperature of radiator in Z3" Oven f32 init 20.0 # Cº (initial value is the ambient temperature!) # Oven temporary variables point FlowSwitch "Flow on val=1.0, off val=0.0" Oven f32 point Z1RadiatorFlow "Flow in radiator of Zone1" Oven f32 # kg/sec point Z2RadiatorFlow "Flow in radiator of Zone2" Oven f32 # kg/sec point Z3RadiatorFlow "Flow in radiator of Zone3" Oven f32 # kg/sec point Z1RadiatorNewTF "New thermal fluid in the rad" Oven f32 # kg point Z2RadiatorNewTF "New thermal fluid in the rad" Oven f32 # kg point Z3RadiatorNewTF "New thermal fluid in the rad" Oven f32 # kg point Z1TDif_TF_Rad "Temp dif between TF and Rad" Oven f32 # Cº point Z2TDif_TF_Rad "Temp dif between TF and Rad" Oven f32 # Cº point Z3TDif_TF_Rad "Temp dif between TF and Rad" Oven f32 # Cº point Z1RadQInput "Input Q of rad from TF" Oven f32 # kcal point Z2RadQInput "Input Q of rad from TF" Oven f32 # kcal point Z3RadQInput "Input Q of rad from TF" Oven f32 # kcal point Z1TDif_Rad_Air "Temp diff between Rad and Air" Oven f32 # Cº point Z2TDif_Rad_Air "Temp diff between Rad and Air" Oven f32 # Cº point Z3TDif_Rad_Air "Temp diff between Rad and Air" Oven f32 # Cº point Z1RadQOutput "Output Q of rad to hot air" Oven f32 # kcal point Z2RadQOutput "Output Q of rad to hot air" Oven f32 # kcal point Z3RadQOutput "Output Q of rad to hot air" Oven f32 # kcal point Z1RadDeltaQ "Delta Q of radiator in Z1" Oven f32 # kcal point Z2RadDeltaQ "Delta Q of radiator in Z2" Oven f32 # kcal point Z3RadDeltaQ "Delta Q of radiator in Z3" Oven f32 # kcal point Z1RadDeltaT "Delta T of radiator in Z1" Oven f32 # Cº point Z2RadDeltaT "Delta T of radiator in Z2" Oven f32 # Cº point Z3RadDeltaT "Delta T of radiator in Z3" Oven f32 # Cº point RadTLMass_SpHt "Radiator TL mass X Spec Heat" Oven f32 # kcal/Cº point RadTL_SH_inv "Inverse of RadTLMass_SpHeat" Oven f32 # Cº/kcal point Z1TDif_HAir_Amb "Temp dif between hot air and ambient" Oven f32 # Cº point Z2TDif_HAir_Amb "Temp dif between hot air and ambient" Oven f32 # Cº point Z3TDif_HAir_Amb "Temp dif between hot air and ambient" Oven f32 # Cº point Z1HAirToAmb_Q "Heat flow from hot air to ambient" Oven f32 # kcal point Z2HAirToAmb_Q "Heat flow from hot air to ambient" Oven f32 # kcal point Z3HAirToAmb_Q "Heat flow from hot air to ambient" Oven f32 # kcal point Z1TDif_HAir_Prod "Temp dif between hot air and product" Oven f32 # Cº point Z2TDif_HAir_Prod "Temp dif between hot air and product" Oven f32 # Cº point Z3TDif_HAir_Prod "Temp dif between hot air and product" Oven f32 # Cº point Z1HAirToProd_Q "Heat flow from hot air to product" Oven f32 # kcal point Z2HAirToProd_Q "Heat flow from hot air to product" Oven f32 # kcal point Z3HAirToProd_Q "Heat flow from hot air to product" Oven f32 # kcal point Z1HAirDeltaQ "Delta Q for hot air" Oven f32 # kcal point Z2HAirDeltaQ "Delta Q for hot air" Oven f32 # kcal point Z3HAirDeltaQ "Delta Q for hot air" Oven f32 # kcal point Z1HAirMass_SpHt "Hot air mass times its specific heat" Oven f32 # kcal/Cº point Z2HAirMass_SpHt "Hot air mass times its specific heat" Oven f32 # kcal/Cº point Z3HAirMass_SpHt "Hot air mass times its specific heat" Oven f32 # kcal/Cº point Z1HAirM_SpHt_inv "Inverse of hot air mass X SpecificHt" Oven f32 # Cº/kcal point Z2HAirM_SpHt_inv "Inverse of hot air mass X SpecificHt" Oven f32 # Cº/kcal point Z3HAirM_SpHt_inv "Inverse of hot air mass X SpecificHt" Oven f32 # Cº/kcal point Z1HAirDeltaT "Delta T in hot air of zone1" Oven f32 # Cº point Z2HAirDeltaT "Delta T in hot air of zone1" Oven f32 # Cº point Z3HAirDeltaT "Delta T in hot air of zone1" Oven f32 # Cº point Start_f32 "Convert start bit to f32" Oven f32 # bool point BeltSpeed_m_sec "Belt speed in meters per second" Oven f32 # m/sec point ProdInputRate "Rate of transport of product" Oven f32 # kg/sec point ZoneLength_inv "Inverse of zone length" Oven f32 # 1/m point ProdInput "Product input per scan time" Oven f32 # kg point Z1ProdTDif "Temp dif of incoming product at zone1" Oven f32 # Cº point Z2ProdTDif "Temp dif of incoming product at zone2" Oven f32 # Cº point Z3ProdTDif "Temp dif of incoming product at zone3" Oven f32 # Cº point Z1ProdQInput "Product heat transfer from transport" Oven f32 # kcal point Z2ProdQInput "Product heat transfer from transport" Oven f32 # kcal point Z3ProdQInput "Product heat transfer from transport" Oven f32 # kcal point Z1ProdDeltaQ "Delta Q for product at zone1" Oven f32 # kcal point Z2ProdDeltaQ "Delta Q for product at zone2" Oven f32 # kcal point Z3ProdDeltaQ "Delta Q for product at zone3" Oven f32 # kcal point Z1ProdDeltaT "Delta T for product at zone1" Oven f32 # Cº point Z2ProdDeltaT "Delta T for product at zone2" Oven f32 # Cº point Z3ProdDeltaT "Delta T for product at zone3" Oven f32 # Cº point ProdMass_SpHt "Product mass times prod specific heat" Oven f32 # kcal/Cº point ProdMass_SpHt_inv "Inv of product mass times its SpecHt" Oven f32 # Cº/kcal point Z1TempError "Hot air temp error on zone1" Oven f32 # Cº point Z2TempError "Hot air temp error on zone2" Oven f32 # Cº point Z3TempError "Hot air temp error on zone3" Oven f32 # Cº point Z1TWV_PID "Three way valve PID in zone1" Oven f32 # % point Z2TWV_PID "Three way valve PID in zone2" Oven f32 # % point Z3TWV_PID "Three way valve PID in zone3" Oven f32 # % point Z1TWV_PID_clipp "Clipped value of PID output" Oven f32 # % point Z2TWV_PID_clipp "Clipped value of PID output" Oven f32 # % point Z3TWV_PID_clipp "Clipped value of PID output" Oven f32 # % point Z1TWV_pos_out "Three way valve position output" Oven f32 # % point Z2TWV_pos_out "Three way valve position output" Oven f32 # % point Z3TWV_pos_out "Three way valve position output" Oven f32 # % # S Y N C H R O N I S A T I O N C O N F I G # -------------------------------------------- [PLC] synch Oven -> Heater synch Heater -> Oven synch Oven -> hmi_gtk2 synch hmi_gtk2 -> plcshutdown synch_start Heater # S H U T D O W N C O N F I G # ------------------------------ # This module will shutdown the plc when a configured plc point is set. [plcshutdown] quit_pt = quit # D S P C O N F I G # -------------------- # The dsp config has one main parameter (period), and one table (fblock). # The fblock table is used to configure the function blocks the dsp module # will execute. [Heater] # scan_period = x # time in s (seconds) # This has to match the SimulationConstant value, # it would be desirable to use the variable to set this value # but this is not possible for the moment. scan_period = 0.1 [Heater] # THE ADD BLOCK # ------------- #fblock add out_pt in_pt1 in_pt1_mult [in_pt2 in_pt2_mult] ... # THE PID BLOCK # ------------- #fblock pid in_pt out_pt [P [I [D]]] # THE TYPECONV BLOCK # ------------------ #fblock typeconv in_pt in_pt_type out_pt out_pt_type ... # THE NONLINEAR BLOCK # ------------------- #fblock nonlinear in_pt out_pt [cutoff_top xx] [cutoff_bot xx] [deadband_top xx] [deadband_bot xx] [deadband_out xx] [gain xx] # Copy digital variables fblock add Flame Start 1.0 fblock add TFPump Start 1.0 # determining HeaterQ fblock add HeatSpan MaxHeaterHeat 1.0 MinHeaterHeat -1.0 fblock add TempError TFTemp -1.0 TFTempSP 1.0 fblock pid TempError GAValvePID 0.1 0.01 0.005 min_out 0 max_out 100 fblock nonlinear GAValvePID GAValveClipp cutoff_top 100 cutoff_bot 0 gain 1 fblock typeconv Automatic u32 Automatic_f32 f32 fblock multiplexor GAValve Automatic_f32 GAValveSP 1 GAValveClipp fblock mult HeaterQSpan GAValve 0 HeatSpan 0 fblock add HeaterDeltaQ HeaterQSpan 0.01 MinHeaterHeat 1 fblock mult HeaterQ_tmp HeaterDeltaQ 0 SimulationPeriod 0 fblock multiplexor HeaterQ Start_f32 ZERO 1 HeaterQ_tmp # determining TFHeatLoss fblock add DeltaTemp TFTemp 1.0 AmbientTemp -1.0 fblock mult TFHeatLoss DeltaTemp 0 PCtoAmbHeatK 0 SimulationPeriod 0 # determining TFDeltaT. # We are now taking into consideration the heat loss in the radiators. fblock add TFQ HeaterQ 1.0 TFHeatLoss -1.0 Z1RadQInput -1.0 Z2RadQInput -1.0 Z3RadQInput -1.0 fblock mult TF_MSH TFMass 0 TFSpecificHeat 0 fblock pow TF_MSH_inv TF_MSH -1 fblock mult TFDeltaT TFQ 0 TF_MSH_inv 0 fblock add TFTemp TFTemp 1.0 TFDeltaT 1.0 [Oven] # scan_period = x # time in s (seconds) # This has to match the SimulationConstant value, # it would be desirable to use the variable to set this value # but this is not possible for the moment. scan_period = 0.1 [Oven] #fblock add Z1AirTemp Z1TempSP 1.0 # Calculate heat income from the TF to the radiators. fblock multiplexor FlowSwitch Start_f32 ZERO 1 UNITY fblock mult Z1RadiatorFlow Z1TWV_pos_out 0.0 MaxFlowRadiator 0.0 percent2float 0.0 FlowSwitch 0.0 fblock mult Z2RadiatorFlow Z2TWV_pos_out 0.0 MaxFlowRadiator 0.0 percent2float 0.0 FlowSwitch 0.0 fblock mult Z3RadiatorFlow Z3TWV_pos_out 0.0 MaxFlowRadiator 0.0 percent2float 0.0 FlowSwitch 0.0 fblock mult Z1RadiatorNewTF Z1RadiatorFlow 0.0 SimulationPeriod 0.0 fblock mult Z2RadiatorNewTF Z2RadiatorFlow 0.0 SimulationPeriod 0.0 fblock mult Z3RadiatorNewTF Z3RadiatorFlow 0.0 SimulationPeriod 0.0 fblock add Z1TDif_TF_Rad TFTemp 1.0 Z1RadiatorTemp -1.0 fblock add Z2TDif_TF_Rad TFTemp 1.0 Z2RadiatorTemp -1.0 fblock add Z3TDif_TF_Rad TFTemp 1.0 Z3RadiatorTemp -1.0 fblock mult Z1RadQInput Z1TDif_TF_Rad 0.0 Z1RadiatorNewTF 0.0 TFSpecificHeat 0.0 fblock mult Z2RadQInput Z2TDif_TF_Rad 0.0 Z2RadiatorNewTF 0.0 TFSpecificHeat 0.0 fblock mult Z3RadQInput Z3TDif_TF_Rad 0.0 Z3RadiatorNewTF 0.0 TFSpecificHeat 0.0 # Calculate heat loss from radiators to hot air fblock add Z1TDif_Rad_Air Z1RadiatorTemp 1.0 Z1AirTemp -1.0 fblock add Z2TDif_Rad_Air Z2RadiatorTemp 1.0 Z2AirTemp -1.0 fblock add Z3TDif_Rad_Air Z3RadiatorTemp 1.0 Z3AirTemp -1.0 fblock mult Z1RadQOutput RadToAirHeatK 0.0 Z1TDif_Rad_Air 0.0 SimulationPeriod 0.0 fblock mult Z2RadQOutput RadToAirHeatK 0.0 Z2TDif_Rad_Air 0.0 SimulationPeriod 0.0 fblock mult Z3RadQOutput RadToAirHeatK 0.0 Z3TDif_Rad_Air 0.0 SimulationPeriod 0.0 fblock add Z1RadDeltaQ Z1RadQInput 1.0 Z1RadQOutput -1.0 fblock add Z2RadDeltaQ Z2RadQInput 1.0 Z2RadQOutput -1.0 fblock add Z3RadDeltaQ Z3RadQInput 1.0 Z3RadQOutput -1.0 fblock mult RadTLMass_SpHt RadiatorFluidMass 0.0 TFSpecificHeat 0.0 fblock pow RadTL_SH_inv RadTLMass_SpHt -1.0 fblock mult Z1RadDeltaT Z1RadDeltaQ 0.0 RadTL_SH_inv 0.0 fblock mult Z2RadDeltaT Z2RadDeltaQ 0.0 RadTL_SH_inv 0.0 fblock mult Z3RadDeltaT Z3RadDeltaQ 0.0 RadTL_SH_inv 0.0 fblock add Z1RadiatorTemp Z1RadiatorTemp 1.0 Z1RadDeltaT 1.0 fblock add Z2RadiatorTemp Z2RadiatorTemp 1.0 Z2RadDeltaT 1.0 fblock add Z3RadiatorTemp Z3RadiatorTemp 1.0 Z3RadDeltaT 1.0 # Calculate heat flow from air to ambient and from air to product fblock add Z1TDif_HAir_Amb Z1AirTemp 1.0 AmbientTemp -1.0 fblock add Z2TDif_HAir_Amb Z2AirTemp 1.0 AmbientTemp -1.0 fblock add Z3TDif_HAir_Amb Z3AirTemp 1.0 AmbientTemp -1.0 fblock mult Z1HAirToAmb_Q Z1TDif_HAir_Amb 0.0 Z1AirToAmbHeatK 0.0 SimulationPeriod 0.0 fblock mult Z2HAirToAmb_Q Z2TDif_HAir_Amb 0.0 Z2AirToAmbHeatK 0.0 SimulationPeriod 0.0 fblock mult Z3HAirToAmb_Q Z3TDif_HAir_Amb 0.0 Z3AirToAmbHeatK 0.0 SimulationPeriod 0.0 fblock add Z1TDif_HAir_Prod Z1AirTemp 1.0 Z1ProductTemp -1.0 fblock add Z2TDif_HAir_Prod Z2AirTemp 1.0 Z2ProductTemp -1.0 fblock add Z3TDif_HAir_Prod Z3AirTemp 1.0 Z3ProductTemp -1.0 fblock mult Z1HAirToProd_Q Z1TDif_HAir_Prod 0.0 AirToProdHeatK 0.0 SimulationPeriod 0.0 fblock mult Z2HAirToProd_Q Z2TDif_HAir_Prod 0.0 AirToProdHeatK 0.0 SimulationPeriod 0.0 fblock mult Z3HAirToProd_Q Z3TDif_HAir_Prod 0.0 AirToProdHeatK 0.0 SimulationPeriod 0.0 # Calculate the new temperature for hot air in each zone fblock add Z1HAirDeltaQ Z1RadQOutput 1.0 Z1HAirToAmb_Q -1.0 Z1HAirToProd_Q -1.0 fblock add Z2HAirDeltaQ Z2RadQOutput 1.0 Z2HAirToAmb_Q -1.0 Z2HAirToProd_Q -1.0 fblock add Z3HAirDeltaQ Z3RadQOutput 1.0 Z3HAirToAmb_Q -1.0 Z3HAirToProd_Q -1.0 fblock mult Z1HAirMass_SpHt Z1AirMass 0.0 AirSpecificHeat 0.0 fblock mult Z2HAirMass_SpHt Z2AirMass 0.0 AirSpecificHeat 0.0 fblock mult Z3HAirMass_SpHt Z3AirMass 0.0 AirSpecificHeat 0.0 fblock pow Z1HAirM_SpHt_inv Z1HAirMass_SpHt -1.0 fblock pow Z2HAirM_SpHt_inv Z2HAirMass_SpHt -1.0 fblock pow Z3HAirM_SpHt_inv Z3HAirMass_SpHt -1.0 fblock mult Z1HAirDeltaT Z1HAirDeltaQ 0.0 Z1HAirM_SpHt_inv 0.0 fblock mult Z2HAirDeltaT Z2HAirDeltaQ 0.0 Z2HAirM_SpHt_inv 0.0 fblock mult Z3HAirDeltaT Z3HAirDeltaQ 0.0 Z3HAirM_SpHt_inv 0.0 fblock add Z1AirTemp Z1AirTemp 1.0 Z1HAirDeltaT 1.0 fblock add Z2AirTemp Z2AirTemp 1.0 Z2HAirDeltaT 1.0 fblock add Z3AirTemp Z3AirTemp 1.0 Z3HAirDeltaT 1.0 # Belt Transmition. It depends on the start and stop status. fblock typeconv Start u32 Start_f32 f32 fblock multiplexor BeltMotorSpdC Start_f32 ZERO 1 BeltMotorSpdSP fblock ramp BeltMotorSpdC BeltMotorFeedBk dxdt 5 fblock add BeltSpeed_m_sec BeltMotorFeedBk 0.016666 # Calculate the temperature in the product. # Note that this will depend on the speed of the line. fblock pow ZoneLength_inv ZoneLength -1.0 fblock mult ProdInputRate ProductMass 0.0 ZoneLength_inv 0.0 BeltSpeed_m_sec 0.0 fblock mult ProdInput ProdInputRate 0.0 SimulationPeriod 0.0 fblock add Z1ProdTDif Z1ProductTemp 1.0 AmbientTemp -1.0 fblock add Z2ProdTDif Z2ProductTemp 1.0 Z1ProductTemp -1.0 fblock add Z3ProdTDif Z3ProductTemp 1.0 Z2ProductTemp -1.0 fblock mult Z1ProdQInput Z1ProdTDif 0.0 ProdInput 0.0 ProdSpecificHeat 0.0 fblock mult Z2ProdQInput Z2ProdTDif 0.0 ProdInput 0.0 ProdSpecificHeat 0.0 fblock mult Z3ProdQInput Z3ProdTDif 0.0 ProdInput 0.0 ProdSpecificHeat 0.0 fblock add Z1ProdDeltaQ Z1HAirToProd_Q 1.0 Z1ProdQInput -1.0 fblock add Z2ProdDeltaQ Z2HAirToProd_Q 1.0 Z2ProdQInput -1.0 fblock add Z3ProdDeltaQ Z3HAirToProd_Q 1.0 Z3ProdQInput -1.0 fblock mult ProdMass_SpHt ProductMass 0.0 ProdSpecificHeat 0.0 fblock pow ProdMass_SpHt_inv ProdMass_SpHt -1.0 fblock mult Z1ProdDeltaT Z1ProdDeltaQ 0.0 ProdMass_SpHt_inv 0.0 fblock mult Z2ProdDeltaT Z2ProdDeltaQ 0.0 ProdMass_SpHt_inv 0.0 fblock mult Z3ProdDeltaT Z3ProdDeltaQ 0.0 ProdMass_SpHt_inv 0.0 fblock add Z1ProductTemp Z1ProductTemp 1.0 Z1ProdDeltaT 1.0 fblock add Z2ProductTemp Z2ProductTemp 1.0 Z2ProdDeltaT 1.0 fblock add Z3ProductTemp Z3ProductTemp 1.0 Z3ProdDeltaT 1.0 # PIDs to control the temperature of hot air. fblock add Z1TempError Z1AirTemp -1.0 Z1TempSP 1.0 fblock add Z2TempError Z2AirTemp -1.0 Z2TempSP 1.0 fblock add Z3TempError Z3AirTemp -1.0 Z3TempSP 1.0 fblock pid Z1TempError Z1TWV_PID 0.1 0.01 0.005 min_out 0 max_out 100 fblock pid Z2TempError Z2TWV_PID 0.1 0.01 0.005 min_out 0 max_out 100 fblock pid Z3TempError Z3TWV_PID 0.1 0.01 0.005 min_out 0 max_out 100 fblock nonlinear Z1TWV_PID Z1TWV_PID_clipp cutoff_top 100 cutoff_bot 0 gain 1 fblock nonlinear Z2TWV_PID Z2TWV_PID_clipp cutoff_top 100 cutoff_bot 0 gain 1 fblock nonlinear Z3TWV_PID Z3TWV_PID_clipp cutoff_top 100 cutoff_bot 0 gain 1 fblock multiplexor Z1TWV_pos_out Automatic_f32 Z1TWV_Position 1 Z1TWV_PID_clipp fblock multiplexor Z2TWV_pos_out Automatic_f32 Z2TWV_Position 1 Z2TWV_PID_clipp fblock multiplexor Z3TWV_pos_out Automatic_f32 Z3TWV_Position 1 Z3TWV_PID_clipp # NOTES: # # PID output clipping. We should be carefull about PID (I) overshoot, we should # be able to enable, disable PID and reset PID. Also to have a clipp option for # the integral part. # [hmi_gtk2] # Formating for the display (cutting down on those long numbers) GtkLabel BeltMotorFeedBk "%3.1f m/Sec" GtkLabel Z1AirTemp "%3.1f °C" GtkLabel Z2AirTemp "%3.1f °C" GtkLabel Z3AirTemp "%3.1f °C" GtkLabel Z1RadiatorTemp "%3.1f °C" GtkLabel Z2RadiatorTemp "%3.1f °C" GtkLabel Z3RadiatorTemp "%3.1f °C" GtkLabel Z1ProductTemp "%3.1f °C" GtkLabel Z2ProductTemp "%3.1f °C" GtkLabel Z3ProductTemp "%3.1f °C" GtkLabel Z1TWV_Position "%3.2f %%" GtkLabel Z2TWV_Position "%3.2f %%" GtkLabel Z3TWV_Position "%3.2f %%" GtkLabel Z1TWV_PID "%3.2f %%" GtkLabel Z2TWV_PID "%3.2f %%" GtkLabel Z3TWV_PID "%3.2f %%" GtkLabel TFTemp "%3.1f °C" GtkLabel HeaterQ "%4.2f kcal" GtkLabel GAValve "%3.2f %%" GtkLabel GAValvePID "%3.2f %%"