Since the United States introduced a Programmable Logic Controller (PLC) in the 1960s to replace traditional relay control devices, PLC has developed rapidly and has been widely used all over the world. At the same time, the functions of the PLC are constantly improving. With the continuous development of computer technology, signal processing technology, control technology network technology and the continuous improvement of user needs, PLC has added analog quantity processing and motion control functions on the basis of switching quantity processing. Today's PLC is no longer limited to logic control, but also plays a very important role in motion control, process control and other fields. As the product of choice for discrete control, PLC developed rapidly from the 1980s to the 1990s, and the worldwide annual growth rate of PLC remained at 20% to 30%. With the continuous improvement of factory automation and the continuous expansion of PLC market capacity, the growth rate of PLC in developed countries has slowed down in recent years. However, the growth of PLC in developing countries such as China is very rapid. Comprehensive relevant information, the global PLC sales revenue in 2004 was about 10 billion US dollars, occupying a very important position in the field of automation. PLC was developed from the principle of imitating the relay control. In the 1970s, PLC only had switch logic control. The first application was the automobile manufacturing industry. It stores instructions for performing logical operations, sequence control, timing, counting, and operations, and controls various types of machinery or production processes through digital input and output operations. The control program compiled by the user expresses the technological requirements of the production process and is stored in the user program memory of the PLC in advance. Execute one by one according to the contents of the stored program during operation to complete the operations required by the technological process. There is a program counter in the CPU of the PLC that indicates the storage address of the program step. During the program operation, the counter is automatically incremented by 1 every time the program is executed. The program is executed from the initial step (step number is zero) to the final step (usually END). Instruction), and then return to the initial step of cyclic operation. The time required by the PLC to complete a cycle operation is called a scan cycle. Different types of PLC, cycle scanning period is between 1 microsecond to tens of microseconds. PLC programming with ladder diagram shows the advantage of fast in solving logic, in the order of microseconds, solving 1K logic program is less than 1 millisecond. It treats all inputs as switch quantities, 16 bits (and 32 bits) as an analog quantity. Large-scale PLC uses another CPU to complete analog calculations. Send the calculation result to the PLC controller. For systems with the same I/O points, using PLC is cheaper than using DCS (about 40% savings). PLC does not have a dedicated operating station, and its software and hardware are universal, so the maintenance cost is much lower than that of DCS. A PLC controller can receive thousands of I/O points (up to more than 8000 I/O). If the controlled object is mainly equipment interlocking with few circuits, PLC is more appropriate. Because PLC adopts general monitoring software, it is easier to design enterprise management information system. In the past 10 years, with the continuous reduction of PLC prices and the continuous expansion of user demand, more and more small and medium-sized equipment began to use PLC for control. The application of PLC in my country has grown very rapidly. With the rapid development of China's economy and the continuous improvement of basic automation level, PLC will continue to maintain a rapid growth momentum in my country for a period of time. General PLC can be considered as an embedded controller when it is applied to special equipment, but PLC has higher reliability and better stability than general embedded controller. Some users encountered in actual work originally used embedded controllers and are now gradually replacing embedded controllers with general-purpose PLCs or custom PLCs.
What is PLC? It is a real-time system, which is different from the traditional relay-based motor control system of personal computers. Whenever the design is changed, the entire system has to be re-made, which is time-consuming and labor-intensive. There are shortcomings of poor contact, wear, and large size, which cause problems such as increased costs, low reliability, and difficult maintenance. In order to improve these shortcomings, the United States DEC first published a Programmable Controller in 1969. The program controller was called (Programmable Logic-Controller) abbreviated as PLC at the beginning of its publication. The first purpose was to replace the relay, and perform the sequential control of relay logic and other functions such as timing or counting, so it is also called the sequential controller. The structure is also like a microcomputer, so it can also be called a microcomputer programmable controller (MCPC).Until 1976, the American Electrical Manufacturers Association officially named it Programmable Controller, which is a programmable controller, or PC for short, because the current personal computer ( Personal Computer is extremely common, and it is often used in conjunction with programmable controllers. In order to distinguish between the two, it is generally called PLC to make the distinction. There are many types of PLCs on the market, depending on the manufacturer and the applicable place There are differences, but each brand can be divided into large, medium and small according to the complexity of the unit, while general factories and schools usually use small PLCs, among which are the Japanese MITSUBISHI Mitsubishi F series and the A series produced by Shilin Electric PLC is more popular among Chinese people. And this CAI will mainly introduce Mitsubishi FX2 PLC, and hope that users can have a deeper understanding of PLC, and be more comfortable when using PLC. The basic structure of the programmable controller can be represented by the following figure , Its internal processing unit includes three departments: CPU, input module, and output module.The CPU of the PLC will obtain the signal generated by the input component through the input module, and then take out the original input from the program writer one by one from the memory. Control instructions, after the logic calculation of the computing department, the results are passed through the output module to drive the external output components. The internal structure diagram of the PLC program input device is responsible for providing the functions of the operator to input and modify the program. The central processing unit (CPU) is responsible for PLC management, execution, calculation, control and other functions. Program memory, responsible for storing user-designed sequence program parameters and comments. Data memory: responsible for storing input and output device status and sequence program conversion data. System memory Stores the system programs required by the PLC to perform sequential control. The input circuit is responsible for receiving external input component signals. The output circuit is responsible for receiving external output component signals. It is widely used in industry, such as the control of various automated equipment in semiconductor fabs The basic structure of the PLC in the automatic production line of the traffic light conversion control on the roadside of the building elevator mechanical parking equipment PLC is essentially a computer dedicated to industrial control, and its hardware structure is basically the same as that of a microcomputer. a. Central Processing Unit (CPU) Central Processing Unit (CPU) is the control center of PLC. It receives and stores the user program and data entered from the programmer according to the functions given by the PLC system program, checks the status of the power supply, memory, I/O, and watchdog timer, and can diagnose grammatical errors in the user program. When the PLC is put into operation, first it receives the status and data of each input device in the field by scanning, and stores them in the I/O image area respectively, and then reads the user program one by one from the user program memory. After the command is explained, press The result of the execution of logic or arithmetic operation specified by the instruction is sent to the I/O image area or data register. After all the user programs are executed, finally the output status of the I/O image area or the data in the output register is transferred to the corresponding output device, and the cycle runs until it stops. In order to further improve the reliability of the PLC, in recent years, large-scale PLCs have also adopted dual CPUs to form a redundant system, or a voting system with three CPUs. In this way, even if a certain CPU fails, the entire system can still operate normally.
b. Memory The memory that stores the system software is called the system program memory. The memory that stores the application software is called the user program memory. C. Power supply The power supply of PLC plays a very important role in the whole system. Without a good and reliable power supply system, it cannot work properly, so PLC manufacturers also attach great importance to the design and manufacture of power supplies. Generally, the AC voltage fluctuates within +10% (+15%). You can connect the PLC directly to the AC grid without taking other measures. The working principle of PLC 1. Scanning technology When the PLC is put into operation, its working process is generally divided into three stages, namely input sampling, user program execution and output refresh three stages. Completing the above three stages is called a scan cycle. During the whole operation period, the PLC CPU repeatedly executes the above three stages at a certain scanning speed. (1) Input sampling stage In the input sampling stage, PLC reads all input states and data sequentially in a scanning manner and stores them in the corresponding unit in the I/O image area. After the input sampling is over, it shifts to the user program execution and output refresh stage. In these two stages, even if the input status and data change, the status and data of the corresponding unit in the I/O image area will not change. Therefore, if the input is a pulse signal, the width of the pulse signal must be greater than one scan period to ensure that the input can be read under any circumstances. (2) User program execution stage In the user program execution stage, the PLC always scans the user program (ladder diagram) sequentially from top to bottom. When scanning each ladder diagram, the control circuit formed by the contacts on the left side of the ladder diagram is always scanned first, and the logic operation of the control circuit formed by the contacts is performed in the order of left and right, up and down. Then according to the result of the logic operation, refresh the state of the corresponding bit of the logic coil in the system RAM storage area, or refresh the state of the corresponding bit of the output coil in the I/O image area, or determine whether to execute the ladder diagram. The specified special function instructions. That is, during the execution of the user program, only the state and data of the input point in the I/O image area will not change, while other output points and software devices are in the I/O image area or the system RAM storage area. The status and data may change, and the ladder diagram ranked above, the program execution result will have effect on the ladder diagrams that use these coils or data. On the contrary, the ladder diagram ranked below will be refreshed. The status or data of the logic coil can only affect the program above it until the next scan cycle. (3) Output refresh stage After scanning the user program, PLC enters the output refresh stage. During this period, the CPU refreshes all output latch circuits according to the corresponding status and data in the I/O image area, and then drives the corresponding peripherals through the output circuit. At this time, it is the real output of PLC. The same several ladder diagrams have different arrangement orders and the execution results are also different. In addition, the result of scanning the user program is different from the result of parallel operation of the hard logic of the relay control device. Of course, if the time taken by the scan cycle is negligible for the entire operation, there is no difference between the two. Generally speaking, the scan cycle of PLC includes self-diagnosis, communication, etc. As shown in the following figure, a scan cycle is equal to the sum of all times such as self-diagnosis, communication, input sampling, user program execution, and output refresh. The application field of PLC At present, PLC has been widely used in various industries such as steel, petroleum, chemical, electric power, building materials, machinery manufacturing, automobiles, textiles, transportation, environmental protection, culture and entertainment at home and abroad. The use situation can be roughly summarized as follows Several categories. Logic control of switching value This is the most basic and most extensive application field of PLC. It replaces the traditional relay circuit and realizes logic control and sequence control. It can be used for the control of a single device and can also be used for multi-machine group control and automated assembly lines. Such as injection molding machines, printing machines, book-stapling machinery, modular machine tools, grinders, packaging production lines, electroplating lines, etc. Analog quantity control In the industrial production process, there are many continuously changing quantities, such as temperature, pressure, flow, liquid level and speed, etc. are all analog quantities. In order for the programmable controller to process analog quantities, it is necessary to realize the A/D conversion and D/A conversion between the analog quantity (Analog) and the digital quantity (Digital). PLC manufacturers all produce supporting A/D and D/A conversion modules to enable programmable controllers for analog control. Motion control PLC can be used for circular motion or linear motion control. From the control mechanism configuration, in the early days, it was directly used for the switch I/O module to connect the position sensor and the actuator. Now, a dedicated motion control module is generally used. Such as single-axis or multi-axis position control modules that can drive stepper motors or servo motors. The products of major PLC manufacturers in the world almost have motion control functions, which are widely used in various machinery, machine tools, robots, elevators and other occasions. Process control Process control refers to the closed-loop control of analog quantities such as temperature, pressure, and flow. As an industrial control computer, PLC can compile various control algorithm programs to complete closed-loop control. PID adjustment is the most commonly used adjustment method in general closed-loop control systems. Large and medium PLCs have PID modules, and many small PLCs also have this function module. PID processing is generally to run a dedicated PID subroutine. Process control is widely used in metallurgy, chemical industry, heat treatment, boiler control and other occasions.