[0011] see Figure 1 to Figure 3 As shown: the present invention includes an initialization module 1, a functional module 2, and a sub-device 3. The initialization module 1 is connected to the functional module 2, at least one or more sub-devices 3, and the implementation method is: each independent sub-device 3 is controlled by Controlled by software control module, each functional module 2 adopts a state machine method, and runs to a certain module each time. If the current state of the module is not completed, it will switch to another module until it switches back to this module next time. And the current state is completed before it enters the next state to continue running.
[0012] The software loop is a single loop queue timer algorithm.
[0013] The working modes of the air source heat pump air conditioning system include: cooling mode, heat pump mode, air conditioning heat pump mode, slip mode and idle mode.
[0014] The following table shows the control output of various working modes
[0015]
[0016] Note: [1] In the single hot water mode, the switch of the defrosting solenoid valve is determined by the defrosting function. It will be ON when the defrosting is started, otherwise it will be OFF.
[0017] [2] The external fan in the air-conditioning hot water mode is turned on or off by the exhaust temperature.
[0018] Different working modes correspond to different valve switch combinations and motor switch combinations. The switching of the working mode of the air source heat pump air conditioner is actually the switching of the valve switch combination and the motor switch combination. However, in actual engineering applications, there is a certain sequence of switching between the valve switch combination and the motor switch combination. This is mainly done around compressor protection, because the compressor cannot be restarted immediately after it is turned off, and it must be restarted after a delay of at least 3 minutes. In addition, after the compressor is turned off, if the water pump is also turned off, the water pump cannot be turned off immediately at this time, and it must be turned off after a delay of at least 30 seconds. This is done in order to have a certain period of water circulation after the compressor is turned off to take away the waste heat in the heat exchanger, so as to cool the unit.
[0019] Therefore, the control action conversion of the air source heat pump air conditioner becomes complicated. As a control system that conforms to industrial standards, it not only realizes the above conversion control, but also performs various safety tests on the system while achieving the conversion control, such as excessive refrigerant pressure, low refrigerant pressure, excessive current, and no waterway Water flow, compressor temperature is too high, water level probe failure, temperature probe failure, etc. If the system detects the above security alarms, the system will shut down and alarm to protect the safe operation of the system. The entire air source heat pump air conditioning control system is realized according to these principles.
[0020] The polling method multi-task scheduling imitates the principle of real-time operating system (RTOS). The characteristic of the real-time system is that if there is a deviation in logic and timing, serious consequences will occur, which is consistent with the multi-tasking characteristics of the heat pump system. The purpose of polling multi-task scheduling is to enable each task to be executed as soon as possible, and it does not require limiting how long a task can be completed.
[0021] In polling multi-task scheduling, each task has the same priority. Allow a task to be confirmed for a period of time and then switch to another task. Among them, the timing of the time period is realized by a soft timer.
[0022] 1 Polling method multi-task scheduling
[0023] In the water tank controller and the heat pump controller, there are multiple sub-equipment 3 controls. This system has designed a special software control module for the control of each independent sub-equipment 3. In engineering applications, the required module combination can be tailored according to actual needs. Each software function module adopts the state machine method, and runs to a certain module each time. If the current state of the module is not completed, it will switch to another module until the next time it switches back to the module and the current state is completed, Then enter the next state to continue running.
[0024] Each software control module mounted in the main program is equivalent to a task in the program. The management and scheduling between different tasks is related to the execution efficiency of the program. In this system, the polling method is used for multi-task scheduling. That is, allow a task to run for a predetermined period of time, and then switch to another task. In the program, taking into account the problem of task switching, the execution time of the code assigned to each state of each task is not long, and there is no need to perform operations such as operations that occupy a large amount of resources within the task. Most of the time, the task is in the delayed waiting state. Therefore, when a task enters the delayed process, the control program can query and execute other tasks, and then execute the processing program of the task after the delay is completed. This can realize the task cycle switching in a short time. Such as figure 1 , 2 Show.
[0025] 2 Realization of soft timer algorithm
[0026] In the present invention, delay is also an important part of the system output. However, in traditional delay algorithms, most of them let the CPU execute empty statements, which is a waste of system resources. Here we use the single-cycle queue timer algorithm. In theory, a timer can be extended to any number of timers to meet system requirements.
[0027] Such as image 3 : The timing principle of the single-loop queue is as follows: Assuming that the maximum number of timers required by the system is M, set M timer description arrays, and each element in the array corresponds to a timer process. Define a pointer to the first element of the array. When each timing period arrives, the pointer of the circular timing queue goes one bit backward. Each time the loop timing queue pointer points to an element in the array, if the value of the element is non-zero, the value is reduced by 1, and the timing process is judged whether the timing process has been completed by looking up whether the value in the element is zero. If it is completed, the program performs related processing. When the circular timing queue pointer moves to the last element of the array, when the next timing period comes, it will return to the beginning of the array and point to the first element in the array. The pointer moves from the element that points to the beginning to the element that points to the end in the array, and then returns to the beginning of the array for a one-way loop, so it is called the single-loop queue timer algorithm.
[0028] The above are only preferred embodiments of the present invention. Therefore, all equivalent changes or modifications made according to the structure, features and principles described in the scope of the patent application of the present invention are all included in the scope of the patent application of the present invention.