Research on central air-conditioning terminal controller based on GSM

Publisher:HappyHeartedLatest update time:2011-05-29 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
The central air conditioning terminal controller is one of the most important devices in the central air conditioning system and is of great significance to the energy saving of central air conditioning. The existing central air conditioning terminal air valve start/stop control has two types: manual opening and closing control and fixed time scheduling air volume control. The control strategy after startup often uses PID or fuzzy control method to control the indoor temperature [1, 2]. Although this fixed scheduling algorithm centralized by the central air conditioning control system is easy to implement, it is only suitable for users with fixed loads and work and rest time. How to adjust the terminal air supply device scheduling time according to the actual needs of users is the key to energy saving and maintaining comfort. The existing methods of realizing remote terminal control according to demand include Bluetooth technology and Ethernet. However, the effective transmission distance of Bluetooth is short, and the wiring of Ethernet is complex, which is limited by geographical, environmental, economic conditions, etc. [3].
In order to solve the above problems, this paper designs and implements a remote control module for central air conditioning terminal air valve based on the mobile phone SIM card GSM network. In addition to voice services, GSM also has short message data transmission services [4-8]. This module can not only complete the indoor temperature information to the user in the form of short messages through the GSM network, but also the user can send the desired indoor temperature setting to the terminal controller through this module to complete remote control.
This paper uses Samsung's S3C2410 chip as the processor and Linux2.6 as the embedded operating system. Based on the PID control strategy, this paper remotely controls the central air-conditioning terminal device through mobile phone text messages, realizes the setting and monitoring of indoor temperature, and achieves good practical results.
1 Terminal controller system design
1.1 Controller system hardware design
This paper is based on the ARM9 platform, uses the Linux embedded operating system, and uses the S3C2410 processor as the core. The system hardware mainly consists of the following modules:
(1) GSM/GPRS radio frequency module. The radio frequency module used to communicate with the GPRS network. This paper uses the industrial-grade GSM/GPRS dual-band modem module SIM300 launched by Simcom. It has a complete modem signal and can exist as a modem during network communication. The module uses a serial interface communication and mainly provides a wireless interface for voice transmission, short messages and data services, with GPRS function [9]. The peripheral circuit of the SIM300 chip uses the typical connection of the chip, and uses resistor-capacitor charging and Schmitt trigger shaping to obtain a low-level delay of about 1.5 s after power-on to start.
(2) 16C550 serial interface. 16C550 is a high-speed UART chip used to convert parallel port data into serial port data. It has a built-in 16-bit FIFO cache channel and a selectable baud rate. On the one hand, it can obtain complete modem control, and on the other hand, it is also to obtain accurate UART baud rate. This article uses the 16C550 chip when the SIM300 RF module and the control unit composed of the processor communicate serially. The virtual address of the 16C550 chip is 0xdb000000, and it works in FIFO mode with interrupts; its baud rate is set to 115200, transmission without check, 8 data bits, 1 stop bit, ignoring input BREAK, frame errors and parity errors, and using standard mode transmission.
(3) CPU central processing unit. It uses the 32/16-bit high-performance RISC microprocessor S3C2410 based on the ARM920T core produced by Samsung, which has the characteristics of low power consumption, built-in 8-channel 10-bit ADC and DAC, and support for NAND Flash and SDRAM memory. This unit includes the minimum system of the S3C2410 microcontroller, the clock circuit, the reset circuit and other parts.
(4) Input and output unit: The temperature sensor signal in the simulated room is input to the A/D converter of the processor; the output obtained by the processor through the PID algorithm is output by the D/A converter to control the opening of the air supply actuator valve, adjust the air supply volume in the room and achieve the purpose of regulating the indoor temperature.
Figure 1 is the system hardware block diagram.

1.2 Controller system software design
The operating system uses the real-time Linux2.6 kernel, and the compiler uses gcc 4.0.2 version to complete the interface functions of each functional module. When developing the kernel of an embedded system, if the cross-compilation tool (especially gcc) version is low, it is impossible to compile a higher version kernel, and a higher version is also not acceptable. Therefore, this article customizes the cross-compilation environment to develop the terminal controller in conjunction with the Linux2.6.18 kernel to be used. The details are as follows: crosstool-0.43, binutils-2.16.1.tar.bz2, gcc-4.0.2, glibc-2.3.5, glibc-linuxthreads-2.3.5, linux-libc-headers-2.6.12.0, gdb-6.5, and the generated cross-compilation tool is arm-9tdmi-linux-gcc. The initialization and main loop of the short message communication thread are divided into the following 4 steps:
(1) Complete the serial port initialization. After the system is started and initialized, it begins to repeatedly read the serial port data sent by the 16C550 chip. When the GSM module receives a new text message, it sends a string to the processor through the serial port. The format, length and content of the string are fixed, and it starts with +CMTI, which is used as a basis for judging whether a new text message has arrived.
(2) Send an AT command to read the short message to the SIM300 module to determine the content of the short message. First, use the mobile phone number to determine whether the short message is sent by the user. If the short message is sent by the user, then determine the command sent by the user, otherwise delete it directly.
(3) If the content sent by the user is "Set temperature XX" (XX represents a two-digit temperature value), then "XX" is decoded into ASCII characters through a decoding function, and then the temperature that the user expects to set is obtained through conversion and sent to the temperature control module, and finally the information is deleted. If the content sent by the user is "Query status", the current temperature value and indoor status are sent to the user's mobile phone in the form of a short message, and finally the information is also deleted.
(4) The processor continues to read serial port data.
The short message communication program flow is shown in Figure 2.

The processor communicates with the GSM module through the serial port. The basic parameters of serial communication include: baud rate, data bit, stop bit and check mode. The serial port driver implements the read and write operations of the serial port and provides the application with an interface for sending and receiving data. Before the serial port works normally, it is necessary to initialize and select the serial port working mode, set the baud rate, data format and interrupt, and establish a data queue and semaphore. The application can implement the corresponding function by calling the corresponding function.
Taking the serial port sending a string as an example, the sending program is introduced, where buf represents the string to be sent and nbytes represents the number of characters:
int tty_write(char*buf, int nbytes)
{
int i;
for(i=0;i write(tty_fd,&buf[i],1);
usleep(100);
}
return tcdrain(tty_fd);
}

The reception and transmission of short messages are completed by the processor and the SIM300 module through the serial communication of the 16C550 chip. The processor sends AT commands to the SIM300 module to read or send short messages. When sending Chinese short messages, the UCS2 code of Chinese characters is sent, so when initializing the SIM300 module, the command "AT+CMGF=0" must be sent to set the module's short message working mode to PDU mode and send short messages in UCS2 encoding. Similarly, the short messages received by the SIM300 module are also in PDU encoding. To read the Chinese commands sent by the user, the message content must be decoded into ASCII characters. According to the actual application (the number of Chinese characters to be sent is small and fixed), from the perspective of saving system resources, the UCS2 encoding table of Chinese characters is directly searched, the UCS2 code of the Chinese characters to be sent is found and sent.
To send a short message, the hexadecimal number of the entire short message code digit must be sent to the SIM300 module first, followed by the short message header code "001100D", the code "9168" of the Chinese area code "+86" and the destination mobile phone number. The destination mobile phone number here must be obtained by swapping every two digits. Since the mobile phone number is 11 digits, the last digit is padded with "N", and the content of the short message is written in UCS2 code, so the encoding code "0008A7" is sent continuously, and finally the UCS2 code of the short message body.
When a new message arrives, the received data packet encapsulates the message sending time, the mobile phone number from which it comes, and the message body. If the mobile phone number from which it comes is inconsistent with the pre-set user number, the short message is directly deleted; if they are consistent, the short message body is continued to be judged. Since the received short message is also Chinese processed by UCS2 encoding, the message body content is compared with the pre-agreed "set temperature" and "current status" two UCS2 codes and then transferred to the corresponding processing function respectively. If it is inconsistent with both agreed codes, it is regarded as an error message deletion.
All program codes in this article are written in C language. The short message sending code is as follows:
void gprs_msg(char*number, char*msgr) //SMS sending function
{
char ctl[]={26,0};
char head[]=″0011000D9168″; //SMS header code and China area code
char headmsg[]=″0008A7″; //SMS encoding method code
unsigned int count;
char sum[2];

tty_writecmd(″at″, strlen(″at″));
tty_writecmd(″at″, strlen(″at″));
tty_write(″at+cmgs=″, strlen(″at+cmgs=″));

count=strlen(msgr)/2+14; //Calculate the length of the SMS

sum[0]=(char)(count/10+48);
sum[1]=(char)(count%10+48); //decode the SMS length
//into hexadecimal

tty_writecmd(sum,2);
tty_write(head,strlen(head));
tty_write(number,strlen(number));
tty_write(headmsg,strlen(headmsg)); //send SMS header
tty_write(msgr,strlen(msgr)); //send SMS body

tty_write(ctl, 1);
tty_write(″r″, strlen(″r″)); //Send SMS end code
usleep(300000); //Process sleep
printf(″Message sent.n″);
}
The above function encapsulates the header information and text character length of the short message sent in PDU mode. The parameters are only the PDU code of the destination mobile phone number and the UCS2 code of the short message body. This avoids a lot of repeated code and improves the running efficiency of the program.
1.3 Incremental PID control strategy
PID is a linear controller that forms a control deviation based on the given value r(t) and the actual output y(t):

Where: KP is the proportional coefficient; TI is the integral time constant; TD is the differential time constant.
Since the computer processes digital quantities and the controller drives the air valve actuator, the control strategy used in the control system is the digital incremental PID.
u(k)=Ae(k)-Be(k-1)+Ce(k-2)
The following is the implementation function of the incremental PID control strategy:
double PID(double feedback)
{
double Err, pErr, dErr, dU;
Err=Command-feedback; //Current error
pErr=Err-ppreErr; //Proportional incremental error
dErr=Err-2*preErr+pre2Err; //Derivative incremental error
dU=Proportion*pErr+pDerivative*dErr+ Integral*Err;
//Control quantity increment
pre2Err=preErr;
preErr=Err;
return dU;
}
2 Experiment
The experimental object takes the physical model of a 1.3-ton central air-conditioning system as an example. The system can simulate multiple operating modes of the central air-conditioning, and can adjust the specific opening of the air valve by inputting analog signals to the execution air valve, so as to adjust the air supply volume sent to the room and achieve the purpose of controlling the cooling capacity of the simulated room. The experimental object has two simulated rooms, in which the driving valve of the terminal device is TANG TECH TM04~24, and the temperature and humidity sensor is VECTOR ADS-H1T1. The 0~4.096 V signal output by the D/A of the embedded controller is amplified to 0~10 V and directly drives the air valve driver. The output range of the temperature and humidity sensor of the simulated room is 1~5 V, which is directly input into the AIN[0] pin of the A/D inside the processor.
The system provides two types of user short message content recognition, namely "Set temperature XX" and "Query status". If the user sends "Query status" and the current indoor status is 23℃, the system automatically returns a short message to the user "Temperature: 23; Status: Normal". If the indoor temperature is abnormal, the system sends a short message to automatically alarm "Temperature 60; Status warning". If the user sends "Set temperature 23", the system changes the current indoor set temperature to 23℃ and replies "The temperature has been set to 23". At this time, the local controller uses PID to control the temperature.
In order to allow users to conveniently turn off the indoor controller without adding other short message content, this article sets a maximum temperature limit of 50°C. When the user sends a "set temperature" greater than 49°C, the system considers that the user requires the controller to be turned off, and then changes the temperature set point to OFF, the air valve is completely closed, and returns a short message "Closed". This method ensures that the system has the function of closing the air valve without adding new short message commands. After the controller is turned off, if the user sends a short message again to set the indoor temperature to a temperature within the normal range, the controller will be turned back on.
See Table 1 for details of the short message command.

In order to test the actual energy-saving effect of the system, the terminal controllers of two simulated rooms are turned on under the condition of outdoor temperature of 9℃, and the expected indoor temperature is set to 23℃. Assuming that there are people in the two rooms, simulated room 1 at 8:00 and simulated room 2 at 9:00; calculations show that turning on the indoor controller of simulated room 2 at 9:00 saves about 7% of the energy consumed throughout the day compared to turning on the indoor controllers of the two simulated rooms at 8:00.
This paper implements the GSM remote control method, which controls the terminal device of the central air-conditioning system and monitors and manages the indoor temperature in real time through mobile phone text messages. The experimental results show that the system can adjust the room temperature conveniently, flexibly, quickly and on demand to achieve energy saving. In addition, the system is highly scalable, and more functions such as terminal energy metering can be realized after software upgrade.

Reference address:Research on central air-conditioning terminal controller based on GSM

Previous article:Design of a new spherical robot controller based on DSP
Next article:Design of Asynchronous General Timer in VxWorks

Latest Industrial Control Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号