Design of Intelligent Feeding Control System Based on S7-1200 PLC

. In order to satisfy the needs of pig breeding, an intelligent feeding control system based on S7-1200PLC is designed in this paper. The design scheme selects Siemens S7-1200 PLC as the main controller and MCGS TPC7062TI touch screen as the man-machine interface. The article has carried on the electrical design, including I/O address allocation, the main circuit design, the control circuit design and so on, and has written the PLC control program in the debugging mode and the operation mode, finally has designed the man-machine interface to realize the configuration of the system using MCGS. After the actual operation, the system runs stably, safely and reliably, has achieved the expected goal, and has a certain prospect of popularization and application.


Introduction
Pork plays an important role in the daily diet of Chinese people and is an important source of protein [1]. Since the 1990s, the scale of pig breeding has been expanding and the number of pig breeding has been increasing continuously [2]. The development of pig breeding in China has entered an accelerated period. Modern pig breeding industry is undergoing the transformation of "refinement, equipment and intelligence", especially in pig farm construction, environmental control, intelligent feeding and other aspects compared with the traditional pig industry has undergone earth-shaking changes. New technologies, new standards, new equipment, new processes and new achievements are constantly appearing [3]. In recent years, many domestic large-scale pig farms began to consider using automation, intelligent equipment to improve the production efficiency of pig farms, in order to improve the market competitiveness of pig farms. In view of the demand of intelligent feeding in pig breeding, this paper completed the determination of intelligent feeding control system scheme, electrical design, PLC control program design and man-machine interface configuration, and realized the goal of intelligent feeding in pig farm.

Intelligent feeding system
The schematic diagram of the intelligent feeding system is shown in Figure 1. The motor M1 controls the left and right movement of the feeding car. The motor M2 controls the feeding car into the feeding slot. The motor M3 is the origin feeding motor. When the feeding vehicle has finished feeding, the feeding vehicle will return to this point to reload. The motor M4 is a stirring vibration motor shared by four slots. When the feed comes into the slot, M4 starts stirring vibration. SQ1 and SQ2 are limit protection switches at both ends of the trolley.
After the system starts, the feeding car is driven back to the original position by the motor M1.The feeding motor M3 feeds to the feeding car with high or low speeds. After feeding, the feeding car runs to the right and stops at slot 1. The feeding motor M2 in the feeding car starts to feed into slot 1. The feeding motor feeds at different speeds according to the difference between the set weight in the tank and the actual weight. When there is feed in the tank, the stirring vibration motor M4 begins to work intermittently. When the feed in tank 1 reaches the set requirement, it will be fed into tank 2, and when the feed in tank 2 reaches the set requirement, it will be fed into tank 3, and so on. When all the slots are full, the feeding cart will return to the original position and the system will stop running.

System control scheme design
According to the control function requirement of the system, the motors are selected in the intelligent feeding control system. The left and right operation of the feeding car is driven by the motor M1. Since the feeding car needs precise positioning control, M1 is selected as the servo motor, which is driven by the servo driver. The discharging motor M2 should choose the feeding speed by itself according to the difference between the set weight in the groove and the actual weight, the frequency converter is used to control the feeding speed. The feeding motor M3 for the feeding car needs high and low speed, the twospeed motor is selected to achieve its requirements. Stirred vibration motor M4 only needs positive and negative rotation, ordinary three-phase asynchronous motor is selected.
Through the overall analysis of the intelligent feeding system, the control system selects one S7-1200 PLC as the main controller, expands a digital output module and an analog output module, and the upper computer is equipped with MCGS TPC 7062TI touch screen to control the system. The main electrical controller and circuit components of the system are shown in Table 1. According to the control idea of the system control scheme, the S7-1214C PLC body is responsible for the operation control of the servo motor M1 and the feeding motor M2. The digital output extension module SM1222 is mainly responsible for the start and stop control of the feeding motor M3 and the stirring vibration motor M4, as well as the status display of the indicator light during the system operation. The analog output extension module SM1232 is responsible for the setting of the charging speed of the charging motor M2. The I/O distribution table of the PLC control system is shown in Table 2.

Electrical schematic diagram design
Main circuit design. According to the control scheme of the system, the whole system includes 4 motors, which are servo motor, three-phase asynchronous motor driven by frequency conversion based on analog quantity signal, two-speed motor and three-phase asynchronous motor running in the positive and negative direction. The main circuit of the four motors designed in this scheme is shown in Figure 1. The motor M1 is driven by the servo motor driver, and the SIGN terminal and PULSE terminal of the driver are respectively connected to the Q0.0 terminal and Q0.1 terminal of PLC through the resistance. The CWL terminal and CCWL terminal are connected with the limit protection switches SQ1 and SQ2, which play the role of limit. When the feeding car accidentally exceeds the limit range during operation, the servo drive will stop working immediately. /SIGN and /PULSE are short connected to the COM terminal of the switching power supply. The SON terminal is connected to the COM-terminal of the servo driver. The servo loop is started, and the servo driver only needs pulse and direction signals to start working. The Motor M2 is driven by Siemens Inverter MM420, terminals 5 and 6 are connected to PLC Q0.4 and Q0.5 terminals respectively, and the positive and negative rotation of motor M2 is controlled by PLC. Terminal 3 and 4 are respectively connected to SM1232 analog output channel 0, 0-10V voltage signal corresponding to motor operating frequency 0-50Hz. The motor M3 is controlled by KM1, KM2 and KM3. When the coil KM1 is powered, the motor M3 is connected with angular type and operates at low speed. When the coil KM2 and KM3 are powered, motor double Y-type connection runs at high-speed. The motor M4 is controlled by KM4 and KM5. When KM4 is powered, M4 starts to turn forward. When KM5 is powered, M4 starts to reverse.
Control circuit design. Referring to the control system I/O allocation table, the electrical control circuit schematic diagram is designed. The hardware wiring diagram of PLC is shown in Figure 2.

The overall design
The operation program of intelligent feeding control system is designed into two working modes, namely, debugging mode and operation mode. After the system is powered on, the touch screen displays the welcome interface and enters the main screen. In this screen, the user can choose to enter different sub-screens. Under the debugging interface, the user can choose the sequence debugging of motor M1 to M4. In run mode, the user can choose automatic mode or manual mode. In manual mode, when the start button is pressed and the slot position is selected, the feeding truck runs to the corresponding slot and feeds. After feeding, the feeding truck returns to the original standby mode. In the automatic mode, when the start button is pressed, the system will automatically complete feeding of feed in each slot according to the preset process. When all the slots are full, the system will automatically stop running. The program flow chart of system design and operation is shown in Figure 3.

PLC control program design
Motor selection in debug mode. When the "SELECT MOTOR" button is pressed, the Motor to be tested is selected. The indicator light of the current debugging motor is on, press the start button SB1, and the selected motor will be debugged. After debugging, the motor indicator light goes out. For this control requirement, in the initial state, Byte selec t Motor Byte is assigned value one. In the PLC program, the motor is selected by using the SHL_B instruction to shift the Select Motor Byte.
Analog quantity processing. The feeding motor M2 is driven by a frequency converter. Four motor speeds can be set on the touch screen to correspond to four feeding speeds. Corcorresponding to different motor set speed, PLC analog output module can output different voltage values, drive the discharge motor to run at different speeds. The AnalogValue Funcion Block is compiled in the PLC program.
The parameter settings and procedures of the Block Interface are shown in Figure 4. Motion control of feeding cart. Feeding car needs to realize forward, backward, back to the origin, positioning movement. When the feeding cart moves to the limit point, the system can reset itself and reverse operation can be performed. When returning to the origin or positioning movement, a signal will be given after the feeding vehicle is in place. Considering the manual/automatic operation modes and motion parameters (motion speed, motion direction, and target position), the AXIS_CONTROL FUNCTION BLOCK is defined in PLC for processing. The Axis_Control input/output parameter table is shown in Figure 5.

HMI Design
Human Machine Interface is a device for the exchange of information between operators and machines [4], which is used to realize the dialogue and interaction between operators and computer control system [5]. In this system, MCGS TPC7062TI touch screen is used as the configuration monitoring device, and MCGS embedded version is used to configure the touch screen. The system mainly includes 4 interfaces, which are the main screen, debugging mode screen, running mode screen and parameter setting screen. The main screen is used for user management and function selection, in which the screen of debugging mode and setting parameters needs to have the authority of administrator group to enter. In the debugging screen, the user can select the motor for debugging successively. Under the screen of operation mode, the user can choose manual or automatic operation, and the screen displays the current running state at the same time. The setting parameters screen can set the amount of material needed for each slot, the speed of the feeding motor, the running speed of the feeding car and the positions of the four slots. The human-machine interface is shown in Figure 6.

Main Screen
Debug Mode Screen Run Mode Screen Set Param Screen

Conclusion
In order to meet the needs of intelligent feeding system, this paper designed and realized an intelligent feeding control system based on S7-1200 PLC. The system is safe, reliable, stable and efficient, which realizes the automatic and intelligent requirements of intelligent feeding system. It has achieved the expected goal of the design and has a certain value of popularization and application.