r/controlengineering • u/SuccessfulBrain2451 • Feb 14 '23
Algorithm for Control System
Hello. I just wanna ask if anyone who knows about algorithms. Can you provide any example of algorithm that can be used for indoor agri-climate control systems?
1
u/itzsnitz Feb 15 '23
Define your states:
Off - do nothing
Standby - waiting for change of state
Running - controlling various inputs
Alarm - controlling various inputs reporting minor errors
Fault - do nothing reporting major errors
Define your events:
System Set to Off Mode
System Set to Auto Mode
Temperature Below Threshold
Temperature Above Threshold
Humidity Below Threshold
Humidity Above Threshold
Moisture Below Threshold
Moisture Above Threshold
Alarm Reset
Fault Reset
Define which events are monitored in which state
Off - [2]
Standby - [1, 3-8]
Running - [1, 3-8]
Alarm - [1, 3-9]
Fault - [1, 10]
Define what happens for each change of state event in each event:
Off
System Set to Auto Mode == True | Action = Set State Machine to [2] Standby
Fault
System Set to Off Mode == True | Action = Set State Machine to [1] Off
Fault Reset == True | Action = Set State Machine to [2] Standby
Standby, Running, Alarm
System Set to Off Mode == True | Action = Set State Machine to [1] Off
Temperature Below Threshold == True | Action = Set State Machine to [3] Running
Temperature Above Threshold == True | Action = Set State Machine to [3] Running
Humidity Below Threshold == True | Action = Set State Machine to [3] Running
Humidity Above Threshold == True | Action = Set State Machine to [3] Running
etc
Define actions for each unique event and combination of events:
If (Temperature Below Threshold & Humidity Below Threshold & Moisture Below Threshold) Then (Operate Heater, Operate Humidifier, Operate Waterer)
If (Temperature Above Threshold & Humidity Above Threshold & Moisture Above Threshold) Then (Operate Ventilation, Delay, Operate Chiller)
etc.
Note: be sure to fully capture and nest these so that the proper sequence of events is taken; there are other methods better suited than this basic example but my expertise gets more limited at this depth
Define the exact requirements for each action item:
Operate Heater
On/Off/Disabled item state, with setpoint, deadband, and control limits
Note: the disable item state may triggered by fault conditions (heater feedback not responding or not above minimum requirement) or by other item state checks (heaters disabled when chillers are running)
etc.
3
u/kalos97 Feb 14 '23
I think PID is more than enough, just apply some gains to the tracking error, its derivative and integral and use the sum of these as control input for your actuator. You can tune the gains via trial and error