The hardware of the system is simple and reliable, and the software has more perfect control functions and anti-interference ability. The system has a very high performance price
1 Controller principle
The system CPU intelligently judges the collected temperature according to the command input by the remote controller or the button, and then performs corresponding cooling, heating or de-cooling operation. Then through the interface circuit, drive the compressor, the reversing valve, the wind direction motor and the indoor fan to perform corresponding actions, and indicate the temperature with the LED. The principle block diagram of the system is shown in Figure 1.
2 hardware design
When designing the system hardware block diagram, it is necessary to consider the convenience of writing the program, and make full use of the function of the software to simplify the hardware structure, that is, to achieve "soft and hard".
2.1 The choice of single chip microcomputer
The system has 3 channels of temperature analog signal input, and 1 channel voltage and 1 channel current analog input, a total of 5 analog input requirements; and the analog signal to be converted into a digital signal can be processed by the microcontroller CPU. In order to improve the performance and price ratio of the system, a single chip microcomputer containing an A/D converter should be used. After a comprehensive comparison of various aspects, we selected the PIC16C72 microcontroller from Microchip Technology of the United States as the control core. It has 5 A/D converters with analog inputs that meet the analog input requirements of the system. In addition, it integrates an 8-bit logic unit and working register, 2KB of program memory, 128 data memories, and 3 ports (A, B, and C) on a single chip. A total of 22 I/O lines 3 timers/counters. In addition, there are only 35 easy-to-learn and efficient RISC (Reduced Instruction Set Computer) instructions. At the same time, the chip has a watchdog function and provides protection against software running errors.
2.2 analog input circuit
The system directly uses the thermistor for temperature measurement, plus a first-order capacitor filter. External exchange temperature detection circuit, due to its large interference, plus diode limiting protection. For the different resistance values ​​of the sensor, the different voltage division values ​​corresponding to the sensor are input to the A/D conversion port of the PIC microcontroller, and converted into a digital signal inside the single chip microcomputer. The detection circuit has a simple structure and a high performance-price ratio. Because the single-chip microcomputer is 8 bits, the temperature conversion accuracy is high, which can be 0.5 °C, which fully satisfies the signal detection accuracy requirements of the air conditioner.
The detection of the overcurrent signal does not need to go through the comparator, which saves resources; instead, it is directly input after the analog signal is rectified and divided, and is detected by the A/D converter that is provided by the MCU once every 500 μs, and the software is executed. Compare to confirm if it is overcurrent.
The detection of the zero-crossing voltage signal is also directly input after the analog signal is rectified and divided. Because the zero-crossing of the two voltage half-waves is detected, bridge rectification is used. The analog input circuit is shown in Figure 2.
2.3 Temperature indicating circuit
The circuit can simultaneously indicate 10 temperature values ​​of the set temperature and room temperature, and the structure is simple, occupying only 2 I/O lines and using one eight-bit shift register 74LS164. The method is to stabilize the set temperature and perform a 1 s interval flashing indication on the room temperature. The temperature signal is taken out every second. If it is 21 °C or 30 °C, directly turn the corresponding position into a low level, so that the corresponding LED light is on. If the upper 22~29 °C, the temperature is converted into the corresponding display code, the CLOCK signal is generated by RB6, and the RB7 serial output is displayed. Code to 8 bit shift register 74LS164, and then LED indication.
2.4 Indoor wind direction motor control circuit
The indoor wind direction blades of the control system have automatic, swinging and five fixed angles. In order to obtain high-precision angle control, we use DC12V four-phase eight-step motor drive. The step control circuit adopts RB2, RB3, RB4 and RB5 of the single-chip microcomputer as the four-phase (A, B, C, D) eight-beat ring line distribution timing, and drives the stepping motor to operate after the power amplifier ULN2003 power amplification. The control method is to output a corresponding number of beats according to the angular difference between the target position and the current position, and control the forward and reverse by outputting different timings of the beats.
2.5 indoor fan control circuit
The amount of cooling and heating is closely related to the speed of the indoor fan. The indoor fan in this system adopts the bidirectional thyristor phase shift control to generate voltage regulation. The control circuit is shown in Figure 3. Inside the MCU, the voltage zero-crossing detected by the RA5 port is the synchronization signal, and then the phase and width of the required pulse are generated by the timer control, output from the RC1 port, then the transistor is amplified, the pulse transformer is isolated, and the bidirectional transistor is triggered. Turn on. In order to reduce the capacity of the pulse transformer, several consecutive narrow pulse sequences are output.
The RA3 port of the single-chip microcomputer system counts the speed feedback pulse of the indoor fan, compares it with the given value, and then performs integral adjustment to control the speed in a closed loop.
2.6 relay real-time control circuit
The control signal is amplified from the general-purpose bidirectional I/O ports RB1, RC4 and RC5 of the microcontroller via the driver ULN2003, and the relay is controlled to cause the compressor, the outdoor fan and the reversing valve to operate as required.
3 software design
The software design adopts analog processing. The main control program includes the following parts: program initialization, test run, data and signal acquisition and processing, temperature LED indication, closed loop integral control of indoor fan, step control of indoor wind direction motor. The function subroutine includes four operating modes of cooling, heating, dehumidification and automatic. The interrupt program includes remote control reception. Various timing interrupt query processing, speed detection, and the like. The main control program flow of the system is shown in Figure 4.
System resource allocation: Timer 0 is used to count the speed feedback pulses, Timer 1 is used for remote processing, and Timer 2 is used for all other timing processing. Since the timing of the timer 2 processing is more than 20, the length of time is ever-changing, short is only 500μs, and long is up to 24h (hours). According to the revelation that a watch can handle multiple events in real life, we design the export-breaking query timing method, that is, the reference interruption time is set to the minimum common divisor of 500μs, and each event is assigned 1 time register, 1 start timing flag and 1 The timing time is up to the flag, and when the timing is required, the start timing flag 1 is set. Each time the 500μs interrupt is detected, each timing flag is detected. If it is 1, the corresponding time register is processed. If the timing expires, the corresponding timing time is set to 1.
The software system's cooling, heating, dehumidification and automatic function subroutine modules, the main function is to intelligently control the operating state of the compressor and the indoor and outdoor fans according to the room temperature and setting difference, and taking into account other conditions. At the same time, sleep and protection are processed in each module.
:
Pwm Wind Solar Hybrid Controller,Waterproof Solar Charge Controller,auto solar charge controller
GuangZhou HanFong New Energy Technology Co. , Ltd. , https://www.hfsolarenergy.com