为温度配置两点控制器

Temperature Two-Point Controller

A control system manages and regulates the behavior of a device or a system. There are many types of control systems: open-loop, closed-loop, logic, two-point, linear, proportional, and PID. This article discusses the two-point controller, also known as a Bang-Bang controller or On-off controller because once a predetermined threshold or parameter’s value is met, it turns off (or turns on). Think of your home’s HVAC and A/C units. When the home’s temperature drops below the value that you have set for it, it kicks on the heater. When it returns to that point, the heater turns off. Simple enough, right?

您如何操作两点控制器?

操作两点温度控制器需要一个能够测量温度和一个数字输出位的数据采集设备。最近被Digilent获取的测量计算plenty of devicesthat do just that. Devices such as the E-TC, TC-32, USB-5201, USB-5203, WEB-TC or WEB-TEMP can run autonomously by usingInstaCal。可以将它们配置为设置传感器类型,温度限制和警报(以控制数字IO)。这些设备一旦没有计算机的电源来衡量温度,并就特定数字位的数字逻辑状态做出决策(听起来像我们上面概述的两点控制器,对吗?)。
这些设备,包括USB-2408系列或USB-2416系列,可以由使用C ++,C#或VB.NET创建的用户创建的程序操作。此外,还可以使用更高级别的程序,例如Dasylab或Ni的LabView。
一些设备还具有模拟输出和数字输出的选项,可用于更复杂的控制系统,例如比例和PID,但我们将在以后介绍这些系统。

HVAC作为两点控制器

让我们回到上述房屋加热系统作为两点控制器的示例。根据恒温器或HVAC控制器的年龄,可能会有或可能不会有时间安排元素。在较旧的房屋中,恒温器由双金属带和玻璃灯泡控制,其中有少量的汞或小铜球。双膜条被校准至温度。当温度下降时,双子条将沿方向弯曲,从而使汞/球与2个电极接触,关闭电路并打开锅炉或炉子。现代的恒温器和HVAC控制器使用“高科技”温度传感器,例如热敏电阻,半导体或热电偶,它们比汞更安全,在模拟或数字电路中更易于使用。他们还使用某种计时器或时间群,以了解读数的频率。
家heating systems usually run on 24 VAC. This is because the control signal can be more than 10 feet from the heating system. A DC signal can show signs of attenuation when running the signal through more than 10 feet of wire. AC voltages can travel much further, but it doesn’t have to be as dangerous as using 120 or 240 VAC. 24 VAC is the standard. FYI, most doorbells run on 24 VAC. You can run the wire as far as you need, and there is no degradation to the signal.

创建自己的两点控制器

以下应用程序适用于E-TC,TC-32,USB-5201,USB-5203,Web-TC或Web-TEMP(使用Instacal)。您可以通过设置或关闭数字IO的温度阈值(警报)来将它们配置为自主工作,然后将它们放置为远程运行。您所需要的只是它们各自的电源。这些设备的数字输出可操作5V或3.3V,并具有各种安培规格。

Figure 1 – Spec Table
InstaCal指这些设置警报,that is one use. Another use is to use them to operate a closed loop system using any of these devices as a two point controller. As stated many HVAC systems require a 24 VAC signal to be operated. Here you see in most cases, the alarm (digital out) signal is a 5 V TTL logic signal, with low current. In all cases, none of the above can output an AC voltage. To remedy this, you can add a transistor driver and/or relay or TRIAC to control an HVAC or any other required control signal.
如果您想使用E-TC的频道0来监视房间的温度并控制加热器以将房间保持在25°C,则可以配置这样的警报对话框:
Figure 2 – InstaCal Board Settings
在这里,我们看到频道0的警报设置为“启用”。它设置为超过阈值时打开,并且输出将使用主动高逻辑。
使用第二个选项设置阈值;当测量温度低于25°C时,打开警报,并在测量值高于26°C以上时关闭。
Once the unit is configured, click OK, and close InstaCal.

Below is a schematic for how you might wire an E-TC to a type T thermocouple, solid state relay and heater.For the purposes of discussion, let’s use a thermocouple input on an E-TC utilizing a T type thermocouple. For control we’ll use a digital output to control a fictional 120 VAC heater. The application will be created first in DASYLab, then LabVIEW, and finally in VB.NET.

The E-TC and external wiring to the heater:
Figure 3 – External Wiring to the Heater

接下来,在dasylab。There are some additional settings and options used here, but lets keep focused on the process itself.

Figure 4 – DASYLab Two Point Control Worksheet
Figure 5 – DASYLab Two Point Control Layout

If you are using LabVIEW, that’s no problem. It doesn’t have a specific two-point controller VI, but that can easily be resolved by using a Less Than/Equal To VI as the decision maker (as seen below):

Figure 7 – And the Front Panel

使用通用库

Writing a program in Visual Basic .NET using the Universal Library provides greater flexibility. In DASYLab and LabVIEW, there are a few more things going on that you don’t see, like what’s being handled by the DASYLab and LabVIEW environments (finding the device, handling of errors, etc.). For device discovery, all the user needs do is pick the device from the list provided. In syntax programming for a VB app, the programmer and user can be the same person, and so the programmer/user has to generate all the code, or get it from another example app. The programmer will usually write the code segment once, and use it in as many places as possible making slight changes along the way. This is exactly what we have done below. Although the device discovery and error handling routines have been written, we’re not going to show them here, but that code can be examined and freely usedHERE。未显示的另一件事是LED,温度计和带状图背后的代码。
这是常规的Timer_tick事件使用to loop through reading the thermocouple, determine if the two-point controller should be on or off, and operate the digital bit controlling the relay and heater:
dim etc_temperature作为double
ulstat = Daqboard.TIn(0, MccDaq.TempScale.Fahrenheit, ETC_Temperature, MccDaq.ThermocoupleOptions.WaitForNewData)
If ulstat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then
errhandler(ulstat)
出口子
End If
温度计1.tempvalue = etc_temperature
StripChart1.AddValue(ETC_Temperature)
lblTemp.Text = ETC_Temperature.ToString(“#0.000”)
If (ETC_Temperature < (130 – vsSetPoint.Value)) Then
ulstat = Daqboard.DBitOut(MccDaq.DigitalPortType.AuxPort, 0, MccDaq.DigitalLogicState.High)
LED1.VALUE = true
Else
ulstat = daqboard.dbitout(mccdaq.digitalporttype.auxport,0,mccdaq.digitallogicstate.low)
LED1.VALUE = false
End If
If ulstat.Value <> MccDaq.ErrorInfo.ErrorCode.NoErrors Then
errhandler(ulstat)
出口子
End If
And the form view, where you can adjust the set point and monitor the performance of your system:
图8 - Visual Basic .NET形式视图

Conclusion

As you can see, using MCC temperature measurement devices and software products provide many ways to resolve the need to implement a two-point temperature controller. Pick the combination of hardware and software to meet your specific needs.

0
Be the 1st to vote.

关于杰夫·格林伯格

View all posts by Jeff Greenberg →

3 Comments on “Configuring A Two-Point Controller for Temperature”

  1. Your examples seem to have neglected to provide hysteresis, which is usually essential to a 2-point controller. You either need two set points (slightly above and slightly below the desired temperature) or some timing delays to keep the output from chattering. The standard mechanical thermostats generally had about 1°–2°F of difference between the two set points (though some were adjustable). When between the set points, the current state (on or off) is maintained—when the temperature drops below the lower set point, the heater is turned on, and when the temperature rises above the upper set point the heater is turned off.

Leave a Reply

Your email address will not be published.