1 Introduction
Programmable logic controllers (PLCs) have simple and convenient external wiring. Their control primarily relies on program design, with ladder diagrams being the most common programming method. Common methods include empirical design, logic design, relay control circuit transplantation, and sequential control design. Sequential control design, also known as function chart design, uses a function chart to describe the control process and characteristics of a control system. It mainly consists of steps, transitions, transition conditions, arrows, and actions. This is an advanced design method that can save 60% to 90% of design time for complex systems. my country issued a national standard for function charts (GB6988.6-86) in 1986. With a function chart, ladder diagrams can be created in four ways: start-stop programming, step ladder instruction programming, shift register programming, and set-reset programming. This article uses Mitsubishi's F1 series PLC as an example to illustrate these four programming methods for implementing sequential control.
For example, the drilling process controlled by a PLC-controlled rotary table is as follows: When the rotary table is not rotating and the drill bit is rotating, if sensor X400 detects that the workpiece is in place, the drill bit advances downwards via Y430. When it reaches a certain depth, the drill bit sleeve presses against the lower proximity switch X401, and timer T450 starts counting. After 4 seconds, Y431 quickly retracts to the upper proximity switch X402, returning the drill bit to its original position. See Figure 1 for the function table diagram.
2. Programming method using start-stop circuit
The start-stop circuit uses only instructions related to contacts and coils, eliminating the need for intermediate programming elements. Various PLC instruction sets have relevant instructions, and the circuit utilizes self-holding, thus possessing memory functionality. Furthermore, it is fundamentally similar to traditional relay control circuits, leading to its widespread application. This programming method is highly versatile and easy to master, commonly used in the retrofitting of PLCs from existing relay control systems. Figure 2 shows the ladder diagram corresponding to the sequential function chart in Figure 1, programmed using the start-stop circuit method. Figure 2 only contains normally open contacts, normally closed contacts, and the output coil.
3. Programming method using step ladder instructions
Step ladder instructions are specifically designed for sequential control design. Each step can only be represented by the status register 's', which has a power-off retention function. When programming sequential control, it should be used in conjunction with step instructions, and the status register must be set using the 'set' instruction to have control functionality. Only then can the status register 's' provide STL contacts; otherwise, the status register 's' is the same as a general intermediate relay 'm'. In a step ladder diagram, different step segments are allowed to have dual outputs, i.e., duplicate load outputs are permitted. At the end of the step contact, the 'ret' instruction must be used to return the subsequent program to the original bus. Replacing 0-3 in Figure 1 with status registers 's600-s603' and then programming with step ladder instructions, the corresponding ladder diagram is shown in Figure 3. This programming method is easily accepted and mastered by beginners, and it also improves design efficiency for experienced engineers. Program debugging, modification, and reading are also easy, and the program is relatively short. It should be given priority in sequential control design, and this method is widely used in industrial automation control.
4. Programming methods using shift registers
As can be seen from the function table diagram, only one step in steps 0-3 is connected at a certain time while the other steps are disconnected. By replacing each step with intermediate relays m200-m203, it is easy to implement control using a shift register. Figure 4 shows the ladder diagram when programming with a shift register. The first four bits of shift registers m200-m217 (m200-m203) represent four steps, forming a ring shift register. The shift register is mainly used to process three input signals: data, shift, and reset. The ladder diagram designed by this method looks simple and uses fewer instructions, but it is inconvenient for designing more complex control systems. It has poor online modification capabilities during use and is rarely used in industrial control. It is mostly used in color light sequence control circuits.
5. Programming method using set and reset instructions
Figure 5 shows the ladder diagram corresponding to the sequential function chart in Figure 1, programmed using the set-reset method. In this programming method using set-reset instructions, the normally open contacts of all auxiliary relays corresponding to a certain transition step are connected in series with the corresponding contact or circuit of the transition, serving as the condition for setting all auxiliary relays corresponding to subsequent steps and resetting all auxiliary relays corresponding to previous steps. For simple sequential control systems, the output relays can also be set or reset directly. This method has a clear sequential transition relationship, is easy to understand, and is generally used for programming manual control programs in automatic control systems.
The four sequential control programming methods described above each have their own characteristics. You can choose one to create a ladder diagram based on the specific situation. A general comparison of these methods is shown in the attached table. Teaching practice shows that these programming methods are easily accepted and mastered by beginners, allowing them to design arbitrarily complex sequential control programs with ease.
6. Conclusion
Four methods for creating ladder diagrams using function list diagrams can be adapted to different situations, allowing engineers to decide based on process requirements. It is an advanced design method that can save (60~90)% of the time for complex systems.