Configuration | Commisioning the Controller in Stages fWStartUpVeloNeg := 0.1, iMode := eCTRL_ControlMode_HEATING, dwAlarmSupp := 16#FF_FF_FF_FF, bSelCtrlParameterSet:= FALSE, (* tuninig *) iTuningMode := eCTRL_TuneMode_heating, fYTuneHeating := 100.0, fYTuneCooling := -100.0, fEndTunePercentHeating := 80.0, (* switch to closed loop control when X > 0.8*W *) fEndTunePercentCooling := -70.0, (* switch to closed loop control when X iReactionOnFailure := eCTRL_ReactionOnFailure_StopController, TempLow := -50.0, TempLowLow := -100.0, TempHigh := 100.0, TempHighHigh := 155.0, TempAbsoluteHigh := 150.0, TempAbsoluteLow := -95.0, bEnablePreController := FALSE, bEnableZones := FALSE, bEnableCVFilter := FALSE, iFilterType := eCTRL_FilterType_AVERAGE, iControllerType := eCTRL_ControllerType_PID ); Assignment in the code can look like the following in ST:
sControllerParameter.tPWMCycleTime := t#100ms; 5. Set the controller sampling time, the task cycle time and the PWM cycle time. The controller's sampling time must be adapted to the section. It should be selected to be equal to or less than one tenth of the loop's dominant time constants. The task cycle time is specified by the PLC task from which the controller function block has been called. This value can be read from the task configuration (PLC Control: Resources Task Configuration). The PWM cycle time is usually equal to the controller cycle time.
If the task cycle time is 10ms and the PWM cycle time (=controller sampling time) is chosen to be 100ms, then a total of 10 levels (PWM cycle time / task cycle time) are available. 6. Parameterization of TwinCAT Scope. To check the results, make a scope recording of the tuning process and the closed-loop control behavior. To do this, start and parameterize the TwinCAT Scope View. Record the following channels: setpoint (fW1 or fW2), actual value (fX) and the analog control value (fYAnalog). 7. Switch off alarms during the commissioning phase. The alarms can be temporarily switched off during the commissioning phase. Set a corresponding bit mask in the dwAlarmSupp Dword.
If a bit is set in this Dword, the corresponding alarm is disabled. The assignment of the individual alarms is described here [ } 26] . Information: After initial commissioning, switch all required alarms back on. 8. Start the controller with tuning. If the controller parameters are to be determined by tuning, the control mode must be set to eCTRL_MODE_TUNE . A fixed waiting time of 20s first elapses. During this waiting time the temperature is monitored to ensure that it remains within a +-1°C band. If the temperature goes outside this band, the waiting starts again. The process is then subjected to a step excitation with a control value of fYTune.
The process then reacts with the step response. As long as 80% of the setpoint is not reached, the process parameters are determined using the inflectional tangent method. For safety reasons, after 80% of the setpoint has been reached, control is switched over to closed loop control. If the temperature reaches the 80% mark too quickly (with no clear inflection) then the value of fYTune is to be reduced. The parameters determined in this way are used for the PID controller, and are provided in a structure at the output of the controller. TF4110 17 Version: 2.0.3