Method of Design Programmable Controller Control System
First, raise the problem
Programmable controller technology is mainly used in automatic control engineering, how to use the knowledge in front of the knowledge, according to the actual requirements of the project into a reasonable control system, introduced in this system to control the general control system.
Second, the programmable controller control system design of the basic steps
1 . Design the main content of the system
(1) to develop the technical conditions for the design of the control system. The technical conditions are generally determined in the form of a design task book, which is the basis for the entire design;
(2) select the form of electrical transmission and motor, solenoid valve and other implementing agencies;
(3) selected PLC model;
(4) the preparation of PLC input / output allocation table or draw input / output terminal wiring diagram;
(5) according to the requirements of the system design software specifications, and then use the appropriate programming language (commonly used ladder) for program design;
(6) to understand and follow the user cognitive psychology, attention to human-machine interface design, enhance the friendly relationship between people and the machine;
(7) design console, electrical cabinets and non-standard electrical components;
(8) the preparation of design specifications and instructions;
According to specific tasks, the above content can be adjusted accordingly.
2 . Desing the basic steps of system
Programmable controller application system design and debugging of the main steps, as shown in Figure 1.
In the case of Figure 1 Programmable controller application system design and debugging of the main steps
(1) in-depth understanding and analysis of the controlled object of the process conditions and control requirements
a. The controlled object is a controlled machinery, electrical equipment, production line or production process.
b. The control requirements mainly refer to the basic way of control, the action to be completed, the composition of the automatic working cycle, the necessary protection and interlocking. For more complex control systems, control tasks can be divided into several independent parts, this can be simplified, is conducive to programming and debugging.
(2) to determine the I / O device
According to the controlled object to the PLC control system function requirements, determine the system required user input, output device. Commonly used input devices have buttons, selector switches, limit switches, sensors, etc., commonly used output devices are relays, contactors, lights, solenoid valves and so on.
(3) Select the appropriate PLC type
Select the appropriate PLC type, including the selection of the model, the selection of the capacity, the selection of the I / O module, the selection of the power module, etc., according to the determined user I / O device, the required input signal and the number of output signals. The
(4) Assign I / O points
Assign the input and output points of the PLC to compose the input / output assignment table or draw the wiring diagram of the input / output terminals. Then nine can be PLC programming, and can be the control cabinet or console design and site construction.
(5) design application system ladder program
According to the work function chart or state flow chart design ladder diagram that is programming. This step is the core of the entire application system design work, but also a more difficult step, to design a ladder diagram, we must first be very familiar with the control requirements, but also have a certain electrical design experience.
(6) Enter the program into PLC
When using the simple programmer to enter the program into the PLC, you need to first convert the ladder diagram into the instruction mnemonics for input. When programming programmable on the computer using the programmable logic program of the programmable controller, the program can be downloaded to the PLC via the connecting cable of the upper and lower computer.
(7) for software testing
After the program input PLC, should first test work. Because in the process of programming, there will inevitably be omissions. Therefore, before connecting the PLC to the field device, it is necessary to carry out the software test to eliminate the errors in the program, but also lay the foundation for the overall debugging, shorten the overall debugging cycle.
(8) application system overall debugging
In the PLC hardware and software design and control cabinet and site construction is completed, you can conduct the entire system of online debugging, if the control system is composed of several parts, you should first make some local debugging, and then the overall debugging; if the control program More steps, you can first sub-section debugging, and then connected to the total tune. Debugging found in the problem, one by one to exclude, until the success of debugging.
(9) the preparation of technical documents
System technical documents include instructions, electrical schematics, electrical layout, electrical components schedules, PLC ladder diagram.
Third, PLC hardware system design
1 . PLC model selection
Before making a decision on a system control plan, it is necessary to learn more about the control requirements of the controlled object, and decide whether to use the PLC for control.
In the control system logic is more complex (requires a lot of intermediate relays, time relays, counters, etc.), process and product modification more frequently, the need for data processing and information management (data operation, analog control, PID regulation, etc.) , The system requires a higher reliability and stability, ready to achieve factory automation networking, etc., the use of PLC control is necessary.
At present, many domestic and foreign manufacturers to provide a variety of series of different functions of the PLC products, so that users dazzled, at a loss. So a comprehensive balance of pros and cons, a reasonable choice of models in order to achieve economic and practical purposes. General choice of models to meet the needs of the system for the purpose, do not blindly greedy for the whole, so as to avoid investment and equipment resources waste. The choice of models can be considered from the following aspects.
(1) Selection of input / output points
Blindly select the number of models will cause a certain degree of waste.
To find out the total number of I / O points in the control system, and then set the amount of the required PLCs by 15 to 20% of the total number of points required for the actual amount (for the remodeling of the system).
Also note that some high-density input points of the module on the same time the number of input points are limited, generally connected at the same time the input point shall not exceed 60% of the total input point; PLC each output point of the drive capability (A / Is also limited, and some of the PLC's output current per point with the size of the load voltage varies; the general allowable output current PLC with the ambient temperature rise and so on. In the selection to consider these issues.
PLC output points can be divided into common point, grouping and isolation of several connections. Isolation between the output of each group can be used between the different voltage types and voltage levels, but this PLC average price per point higher. If there is no need for isolation between the output signals, the first two output modes should be selected.
(2) the choice of storage capacity
The user storage capacity can only be a rough estimate. In the system that controls only the switching amount, it can be estimated by multiplying the total number of points by 10 words / dot + the total number of points by 5 words / point; the counter / timer is estimated by (3 ~ 5) words; (5 ~ 10) word / volume estimation; in the analog input / output system, you can press each input / (or output) all the analog about (80 ~ 100) word storage capacity to estimate ; There are communication processing by the number of more than 200 words per interface rough estimate. Finally, there is a margin of 50 to 100% of the estimated capacity. For the lack of experience of the designer, select the capacity to stay margin to be larger.
(3) the choice of I / O response time
The I / O response time of the PLC includes the delay of the input circuit, the delay of the output circuit and the time delay caused by the scanning mode (usually 2 to 3 scan cycles). On the switch control system, PLC and I / O response time generally meet the actual engineering requirements, may not need to consider the I / O response problem. But the analog control system, especially the closed-loop system will consider this issue.
(4) according to the characteristics of the output load selection
Different load on the PLC output method has the corresponding requirements. For example, the frequent on-off of the inductive load, should choose the transistor or thyristor output type, and should not use the relay output type. However, the relay output type PLC has many advantages, such as conduction voltage drop is small, there is isolation, the price is relatively cheap, to withstand transient over-voltage and over-current ability, the load voltage is flexible (AC, DC) and Voltage range range and so on. So the action is not frequent, DC load can choose the relay output type PLC.
(5) the choice of online and offline programming
Offline programming means that the host and the programmer share a CPU, through the programmer to select the switch to select the PLC programming, monitoring and operation of the working state. When programming, the CPU only serves the programmer, not on-site control. Special programmer programming is the case. Online programming means that the host and the programmer each have a CPU, the host CPU to complete the control of the scene, at the end of each scan cycle with the programmer, the programmer to modify the program to the host, in the next scan cycle the host will press The new program controls the site. Computer-aided programming enables both on-line programming and online programming. Online programming requires the purchase of a computer and configuration of the programming software. Which programming method should be used as needed.
(6) According to whether the network communication selection
If the PLC-controlled system needs to be connected to the factory automation network, the PLC needs to have the communication networking function, that is to ask the PLC should have the connection to other PLC, the upper computer and the CRT and so on the interface. Large, medium machine has a communication function, most of the minicomputers also have a communication function.
(7) the choice of the form of PLC structure
In the case of the same function and the same I / O point data, the overall lower than the modular price. But the module has a flexible function expansion, easy maintenance (for the module), easy to determine the advantages of failure, according to the actual need to choose the form of PLC.
2 . Assign input / output points
General input points and input signals, output points and output control are one-to-one correspondence.
After the allocation, according to the system configuration of the channel and contact number, assigned to each input signal and the output signal, that is numbered.
In some cases, there are two signals with an input point, that should be in the access point before the input, according to the logical relationship between the good line (such as two contacts in series or parallel), and then received the input point.
(1) Determine the I / O channel range
Different types of PLC, the input / output channel range is not the same, should be based on the selected PLC model, access to the corresponding programming manual, must not "Zhang Guan Li Dai." Must refer to the relevant operating manual.
(2) auxiliary relay
Internal auxiliary relay is not external output, can not directly connect external devices, but in the control of other relays, timer / counter for data storage or data processing.
Functionally speaking, the internal auxiliary relay is equivalent to the traditional electric control cabinet in the middle of the relay.
The input / output relay area of the unassigned module and the link relay area when the 1: 1 link is not used can be used as an internal auxiliary relay. According to the needs of the program design, should be reasonable arrangements PLC internal auxiliary relay, in the design specification should be detailed in the internal auxiliary relay in the program use, to avoid re-use. Refer to the relevant operating manual.
(3) Assign the timer / counter
The number of timer / counters for the PLC is described in the relevant operating manual.
7.3 PLC software system design methods and steps
7.3.1 PLC software system design method
After understanding the PLC program structure, it is necessary to specifically prepare the program. PLC control procedures for the preparation of a lot of ways, here mainly describes several typical programming methods.
1. Graphic programming
Graphic method is by drawing the PLC program design. Commonly there are ladder diagram, logic flow chart method, timing flow chart method and step control method.
(1) ladder method: ladder method is to use ladder language to compile the PLC program. This is a programming method that mimics the relay control system. Its graphics and even component names are very similar to the relay control circuit. This method can easily be the original relay control circuit transplanted into PLC ladder language. This is the most convenient for a person familiar with the control of the relay, a programming method.
(2) logic flow chart method: logic flow chart method is a logical block diagram that the PLC program execution process, the relationship between the input and output. Logical flow chart method is the process flow of the system, with a logical block diagram to form the system logic flow chart. This method of preparation of the PLC control program logical thinking clear, input and output causal relationship and interlocking conditions clear. Logical flow chart will make the whole process clear, easy to analyze the control program, easy to find fault points, easy to debug procedures and maintenance procedures. Sometimes for a complex program, directly with the statement table and the use of ladder programming may find it difficult to start, you can first draw a logical flow chart, and then for the various parts of the logic flow chart and ladder with the preparation of PLC applications.
(3) Timing flow chart method: timing flow chart method to first draw the control system timing diagram (that is, to a certain time should be controlled which control the timing chart), and then according to the timing relationship to draw the corresponding control tasks of the program Block diagram, and finally the program block diagram written in PLC program. Timing flow chart method is very suitable for time-based control system programming method.
(4) step-by-step control method: step-by-step control method is in the sequence command with the design of complex control procedures. Generally more complex procedures, can be divided into a number of relatively simple function of the program, a block can be seen as a whole step in the control process. From the whole point of view, a complex system control process is composed of a number of steps. System-controlled tasks can actually be considered at different times or in different processes to complete the control of each step. To this end, many PLC manufacturers in their own PLC to increase the step sequence control instructions. After drawing the status flow charts of each step, you can use the step sequence command to easily write the control program.
2. Experiential programming
Experience is to use your own or someone else's experience to design. Most of the design before the first choice with their own process requirements similar to the procedures, these procedures as their own "test procedures." Combined with their own engineering situation, these "test procedures" one by one to make it suitable for their own engineering requirements. Here the experience, some from their own experience, some may be someone else's design experience, you need to accumulate, good at summing up.
3. Computer-aided design programming
Computer-aided design is through the PLC programming software on the computer for programming, offline or online programming, offline simulation and online debugging and so on. The use of programming software can be very convenient in the computer off-line or online programming, online debugging, the use of programming software can be very convenient on the computer program access, encryption and the formation of EXE operating files.
7.3.2 PLC software system design steps
In the understanding of the program structure and programming methods, based on the actual preparation of the PLC program. Writing PLC programs and writing other computer programs, you need to go through the following process.
1. Block the system tasks
The purpose of the block is to a complex project, broken down into a number of relatively simple small task. So that a complex big problem into a number of simple small problems. This makes it easy to program.
2. Compile the logical relationship diagram of the control system
From the logical relationship diagram, you can reflect the results of a logical relationship is what the results of the British and what action. This logical relationship can be based on the order of each control activity, or it may be based on the time of the entire activity. The logic diagram reflects the control of the control process and the activities of the controlled object, but also reflects the relationship between input and output.
3. Draw a variety of circuit diagrams
The purpose of drawing a variety of circuits is to set the address and name of the input and output of the system. This is a very critical step. When drawing the input circuit of the PLC, it is necessary to consider not only whether the connection point of the signal is consistent with the naming, but also whether the voltage and current of the input are suitable, and the reliability and stability conditions of the operation under special conditions The Especially to consider whether the high voltage to guide the input to the PLC, the introduction of high voltage into the PLC input, the PLC will cause relatively large damage. When drawing the output circuit of the PLC, it is necessary to consider not only whether the connection point of the output signal is the same as the naming, but also the PLC load module with load capacity and withstand voltage capability. In addition, the output power and polarity of the power supply are also taken into account. In the drawing of the entire circuit, but also consider the principles of design efforts to improve its stability and reliability. Although the control with PLC convenient and flexible. But in the design of the circuit still need to be careful, comprehensive. Therefore, when drawing the circuit diagram to consider the full, where the installed button, where the installation switch, should be meticulous.
4. Prepare the PLC program and carry on the simulation debugging
After drawing the circuit diagram, you can proceed with the preparation of the PLC program. Of course, you can use the above method programming. In programming, in addition to pay attention to the program to be correct and reliable, but also consider the program to be simple, time-saving, easy to read, easy to modify. Compiled a program to simulate the experiment, so easy to find the problem, easy to modify in time, it is best not to complete the whole process after the general ledger.
5. Production console and control cabinet
After drawing the electrical, after the completion of the program, you can make the console and control cabinet. In the time of tension, this work can also be carried out in parallel with the preparation process. In the production of console and control cabinet to pay attention to the choice of switches, buttons, relays and other device quality, specifications must meet the requirements. The installation of the equipment must be safe and reliable. For example, shielding problems, grounding problems, high pressure isolation and other issues must be properly handled.
6. On-site commissioning
On-site commissioning is an important part of the entire control system. Any program design is hard to say that can not be used in the field debugging. Only through the field debugging to find the control loop and control procedures can not meet the system requirements; only through the field debugging can be found in the control circuit and control procedures contradictory; only on-site debugging to the final field test and finally adjust the control circuit and control procedures , To meet the requirements of the control system.
7. Prepare technical documents and run on site
After the field debugging, the control circuit and control procedures are basically determined, the entire system hardware and software is basically no problem. At this time it is necessary to fully rectify the technical documents, including finishing circuit diagrams, PLC programs, instructions and help files. This work is basically over.