A feedback control system can be as simple as taking a measurement, comparing the measured value with the desired value, and then turning an actuator on or off to get closer to the desired value. This typically involves driving a relay or switch that controls the power flowing to an actuator. Everyday air conditioning systems, for example, work in this manner. A temperature reading device (usually your thermostat) monitors the current temperature and engages a relay or switch if the temperature exceeds the desired value. The relay turns the air conditioning unit on until the temperature returns to a comfortable level.
Figure 3 shows an example of a LabVIEW block diagram for creating a basic on/off control system. The DAQmx Read.vi function takes a temperature reading, and the temperature value is compared to the Setpoint value using the Greater? function. If the temperature is greater than the Setpoint value, a TRUE value is sent to the digital output channel controlling the relay with the DAQmx Write.vi function.
Figure 3. Example block diagram of an ON/OFF control system.
Many buildings have both an air conditioner and a heater to help regulate the temperature of a room. While cooling and heating are typically done independently, you can use a PC-based data acquisition system to operate both simultaneously.
Figure 4 shows an example of a LabVIEW block diagram for controlling both cooling and heating. In this block diagram, the measured temperature value is compared to two different setpoints, each connected to either the air conditioner or the heater.
Figure 4. Example block diagram of an ON/OFF control system with two outputs.
With additional logic, you can customize the control system even further and add features such as setpoint scheduling, temperature averaging, and dead band configuration. You can also add data-logging and report generation capabilities to the same PC-based control system.