My office has terrible aircon.
We have come to the conclusion that turning it off or on and waiting for the temperature to trend towards ambient is more effective than actually trying to use the controls to determine a goal temperature.
We have to go over to the control panel numerous times a day to press the power button.
We therefore decided to create an environmental monitor using a Raspberry Pi and a temperature sensor.
This then sends a signal to an IoT button pusher that manually presses the power button.
Neat, hey? And a lot of fun to build.
Now for the problem:
We have no way of programatically determining the current state of the aircon.
It could be on or off.
It could be set to heat or cool.
Someone can just manually press the button.
The system is also remotely controlled by building management.
So, I’m looking for a CS approach or algorithm that deals with triggering actions based on know data (current temperature and the recent temperature change) combined with fuzzy data (the inferred state of the aircon).
Two temp sensors - one immediately by outflow of aircon, the other measuring ambient air temp in the room.
If outflow sensor measures hotter than ambient -> on hot;
if outflow sensor measures cooler than ambient -> on cool;
If outflow sensor measures same as ambient -> aircon off.
Measuring difference of > +/- 1 deg C should be enough, but may need tweaking.
Other ways are measuring current draw by aircon, audio, or computer vision. Using 2 sensors would probably be good enough unless rapid switching on and off (debouncing etc should probably be considered).
My masters dealt with fuzzy logic for systems control, but that was a while ago now. I cant think of a off the shelf algorithm that could do this, but the logic seems fairly straight forward.
As dan said, for detecting current state two sensors should work, or just detecting the change over time. What ever you pick be sure not to sample to often or you could end up in a mess. (Imagine the system turns it on, but the aircon hasn’t yet had a noticeable impact on sensor one, therefor you think its still off, so trigger the switch and now its off and repeat over and over…). Having a delay in sampling that is longer that the AirCon takes to start changing the air temp and a limit to ensure you dont get into a loop (if for example the aircon breaks you dont want to keep turning it on and off constantly as they system wonders why its not getting cooler) will be very helpful.
For actually controlling the aircon PID control would be best rather than simply ‘On if too hot, off if too cold’, but the simple rules would get you close to it (it may never hit the temp you want tho and instead dance around it). You can setup a PID to tell you if the A/C should be On or Off then use the the fairly simple logic above to decide the current state and make a change as appropriate.
“The system is also remotely controlled by building management”
Longshot, but if you could get similar remote access from building management or by setting up an additional account just for your office, that would definitely make this easier!
I have fiddled with PID for temperature control and found tuning can sometimes be a pain. Whereas a thermostat (just trigger on on/off within a range) can be good enough with an acceptable degree of variation.
It can certainly be good enough, but it will really depend on the AC unit. I guess if its only ables to be turned on and off without fan control then a thermostat approach is probably fine.