1 Introduction
A programmable logic controller (PLC) is a new type of industrial automation control device that emerged and developed with technological advancements and the transformation of modern production methods to meet the needs of diverse product types and high reliability in production systems. Based on a microcomputer, this device has been widely used in industrial automation since its introduction in 1969 due to its versatile and flexible control performance, high reliability adaptable to various industrial environments, ease of use yet capable of controlling large-scale systems, and convenient communication capabilities that allow for the formation of various networks. Some consider programmable logic controller technology, along with numerical control (NC) technology, CAD/CAM technology, and industrial robot technology, to be the four pillars of modern industrial automation technology.
Since the 1980s, my country has imported a large number of programmable logic controllers (PLCs) from foreign brands, with Siemens, Mitsubishi, and Omron being the most prominent. Siemens PLCs are renowned for their comprehensiveness and sophistication, boasting the world's largest variety, type, and controllable scale. Mitsubishi PLCs are characterized by their richness and diversity, offering numerous unique models with distinct features across different series. Omron PLCs are known for their compact design and practicality. Of course, other PLCs also have their own characteristics. While there are many differences between different brands, their functions and applications are generally similar.
Sequential control plays a significant role in industrial control. Automated machine tool processing, automatic production line operation, and robotic arm movements all follow a fixed sequence of actions. Therefore, a thorough understanding of various ladder diagram sequential control design methods is essential. This paper discusses the different programming concepts and characteristics of four sequential control design methods based on the programming features of the MitsubishiFIX series programmable logic controllers (PLCs).
Figure 1 Sequential Function Chart
Figure 2 shows a ladder diagram for sequential control using a start-stop circuit.
Figure 3 shows the sequential control ladder diagram using set and reset instructions.
Figure 4 shows a ladder diagram for sequential control using step instructions.
Figure 5 shows a ladder diagram for sequential control using displacement commands.
2. Sequence control issues and SFC
2.1 Sequential Control Issues
Sequential control refers to a production process where the sequence of actions of each component is predetermined according to the production process. Under the influence of external signals, internal states, or conditions such as time and quantity, each actuator in the production process operates automatically and step-by-step. Sequential control design is a method of designing programmable controller (PLC) ladder diagrams according to specific design rules. The programming elements used in the program are generally status registers (S) or auxiliary relays (M). Essentially, it adds intermediate programming elements between input and output signals to represent different stages of the production process. This design method has advantages such as high programming efficiency, clear design concepts, ease of mastery, and convenient debugging, modification, and maintenance. The cycle from design to use and maintenance is significantly shorter than that of experience-based design methods. Using sequential control design allows the application of structured and modular programming concepts to ladder diagram design, improving the program's logical structure and readability. When designing ladder diagrams using sequential control design, the first step is to design a sequence function chart (SFC) based on the system's technological process, and then write the ladder diagram based on the SFC.
2.2 Regarding the IEC 61131-3 international standard programming language
The IEC 61131-3 international standard programming languages include two main types: graphical programming languages and text-based programming languages. Graphical programming languages include three types: 1. Ladder diagram (LD); 2. Function block diagram (FBD); 3. Sequential function chart (SFC). Text-based programming languages include two types: 1. Instruction list (IL); 2. Structured text (ST).
Sequential Function Chart (SFC), a programming language already incorporated into the IEC 61131-3 international standard, is a standardized PLC-specific international mainstream graphical sequential control programming language used to describe the sequential control process, functions, and characteristics of a control system. SFC is the main tool for designing sequential control programs for programmable logic controllers (PLCs). It consists of steps, actions (or commands), transitions, transition conditions, and directed connections, as shown in Figure 1. The designed SFC must form a closed loop with steps and directed connections, enabling the system to repeatedly execute the same process without interruption.
This article specifically points out that PLCs with direct sequential control programming capabilities implemented using the SFC language are not discussed here. This article only uses SFC concepts to discuss sequential control programming for small PLCs that do not have a dedicated SFC standard sequential control programming language. Although ladder diagram sequential control design for programmable controllers is not the mainstream method for PLC sequential control programming, ladder diagram sequential control programming technology is a common practical problem encountered by many small PLC users, which is why this topic has significant practical implications.
3 Sequential Control Design Method
The drilling process controlled by a programmable logic controller (PLC) using a rotary table is as follows: When the rotary table is stationary and the drill bit is rotating, if sensor x0 detects that the workpiece is in position, the drill bit advances downward by y0. When it reaches a certain depth, the drill bit sleeve presses against the lower proximity switch x1, and timer t0 starts counting. After 4 seconds, the drill bit quickly retracts by y1 to the upper proximity switch x2, returning to its original position. The sequential function chart is shown in Figure 1.
3.1 Sequential control design method using start-stop circuit
The start-stop circuit, also known as the start-hold-stop circuit, is a widely used circuit in ladder diagram design. Its working principle is that when the normally open contact of the input signal is closed, the coil of the output signal is energized, simultaneously causing the input signal to "lock" or "hold," meaning the normally open contact of the input signal loses its function. Figure 2 shows the ladder diagram corresponding to the sequential function chart in Figure 1, designed using the start-stop circuit method. From Figure 2, it is easy to see that s0=m0, s20=m1, s21=m2, and s22=m3. The normally open contacts of m3 and x2 are connected in series as the start circuit for m0. When the programmable controller starts running, m0 should be set to "1"; otherwise, the system cannot work. Therefore, the normally open contact of m8002 is connected in parallel with the start circuit, and the normally open contact of m0 is used for self-holding. The normally closed contact of m1 is then connected in series with the coil of m0. When m1 is in "1," the coil of m0 is "de-energized."
Design method of ladder diagram for sequential control of start-stop circuit: Since the steps are divided according to the state changes of the output variables, the relationship between them is extremely simple and can be handled in the following two cases.
(1) A certain output quantity is "1" only in a certain step. In this example, y0, t0, and y1 all fall into this category. Their coils can be connected in parallel with the auxiliary relays m1, m2, and m3 of the corresponding steps, respectively. Of course, y0 can be used to replace m1, t0 to replace m2, and y1 to replace m3, which can save some programming components. However, the auxiliary relays of the programmable controller are more than sufficient. Using more internal programming components will not increase hardware costs, nor will it take much time to design and type the program. On the contrary, using auxiliary relays to represent all steps has the advantages of clear concepts, standardized programming, easy-to-read ladder diagrams, and easy error checking.
(2) If an output relay is in the "1" state in several steps, the normally open contacts of the auxiliary relays representing each relevant step should be connected in parallel to drive the coil of the output relay. This avoids the problem of dual coil output.
3.2 Sequential Control Design Method Using Set/Reset Instructions
In programming 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 step. This serves as the condition for setting all subsequent auxiliary relays and resetting all preceding auxiliary relays. For simple sequential control systems, output relays can also be set or reset directly. In the ladder diagram of the above example written using this method (as shown in Figure 3), the initialization pulse m8002 sets the initial step auxiliary relay m0. When the contact represented by x0 closes, the next step auxiliary relay m1 is set, and the initial step auxiliary relay m0 is reset. This process continues sequentially, causing m0 to m3 corresponding to all steps to be set and reset regularly, and the actions corresponding to each step to be executed and stopped regularly.
Points to note when using sequential control design methods with set and reset instructions:
(1) Since the programmable controller executes the program instructions step by step from left to right and from top to bottom according to the user program (ladder diagram), the set instruction of each step should be placed above ret in this programming method.
(2) The output relay coil cannot be connected in parallel with the set, rst instruction. This is because the connection time of the series circuit corresponding to the previous step and the conversion condition in the diagram is quite short. After the conversion condition is met, the previous step is immediately reset and the series circuit is disconnected. However, the output relay coil is connected for at least the entire time corresponding to a certain step. Therefore, the output relay coil should be driven by the normally open contact of the auxiliary relay representing the step or their parallel circuit according to the sequential control function diagram.
3.3 Sequential Control Design Method Using Step Instructions
In addition to the basic instructions, the Japanese Mitsubishi programmable controller has added two simple sequential control instructions: [1] step instruction (stl) and [2] step end instruction (ret). Other steps can only be represented by the status register s. The status register has a power-off retention function. When compiling the sequential control program, it should be used together with the sequential control instructions. The status register s must be set by the set instruction so that the provided stl contact can have control function. Otherwise, the status register s is the same as the general intermediate relay m. Different step segments in the step ladder diagram are allowed to have dual outputs, that is, they are allowed to have duplicate load outputs. When the step contact ends, the ret instruction should be used to make the subsequent program return to the original bus. In the ladder diagram of the above example written in this way, as shown in Figure 4. The initial step s0 is set first. Then, when the conversion condition x0 is met, the corresponding step s20 is set, driving the output coil y0. Then it goes down in sequence, so that the corresponding steps s20 to s22 are set and reset regularly. At the same time, the actions corresponding to each step are also executed and stopped regularly.
Figure 6 shows the data shifting and reset processing using a shift register.
Figure 7. Examples of applications of sequential control design method
Figure 8 Simplified Schematic Diagram
3.4 Sequential Control Design Method Using Displacement Commands
Shift instructions are a type of function instruction. Functional instructions, also known as application instructions, are primarily used for data transfer, computation, exchange, and program control. Functional instructions have two forms: one uses function numbers (fnc00~fnc246), and the other uses mnemonics to represent their function. There is a one-to-one correspondence between function numbers and mnemonics.
Figure 5 shows the instruction format and function description of the bit right shift instruction (sftr). (d) is an n1-bit shift register, (s) is an n2-bit data register, and n2≤n1≤1024. When x0 is on, this instruction is executed to shift to the right. Each shift involves 4 bits moving forward together: x3~x0→m15~m12, m15~m12→m11~m8, m11~m8→m7~m4, m7~m4→m3~m0, and m3~m0 are shifted out, meaning bits are shifted in from the high-order bits and out from the low-order bits. sftr(p) is a pulse instruction, performing only one shift operation. sftr is a continuous instruction, performing one shift operation per scan cycle.
`sftl` is a left bit shift instruction, with a similar instruction format and function to `sftr`, except that it shifts bits to the left. Similarly, `sftl(p)` is a pulse instruction, while `sftl` is a continuous instruction. In this example, we use the pulse-executed left bit shift instruction `sftl(p)`.
As can be seen from the sequential function chart, in each step, one step is turned on at a certain time while the other steps are turned off. By replacing each step with auxiliary relays m0 to m3, it is easy to implement control using the bit left shift instruction. Figure 5 shows the ladder diagram programmed using the bit left shift instruction. Auxiliary relays m0 to m3 are used to replace each step, forming a ring shift register. The shift register is used for data shifting and reset processing, as shown in Figure 6.
4. Summary and Discussion
By comparing and analyzing the four programming methods above, we can easily find that the four sequential control design methods introduced in this article have the following characteristics:
4.1 Ladder Diagram Sequential Control Design Method for Start-Stop Circuit
The ladder diagram sequential control design method using start-stop circuits only uses instructions related to contacts and coils, without the need for programming elements as intermediate links. Any programmable controller instruction system has such instructions, so it is a universal programming method. The advantage of this programming method is that it is basically similar to traditional relay control circuits, and it is often used in the process of retrofitting programmable controllers of original relay control systems.
4.2 Sequential Control Design Method for Set and Reset Instructions
The sequential control design method using set and reset instructions is a highly systematic approach. The basic rules governing ladder diagram conversions have strict correspondences, effectively reflecting the conversion principles in SFC (Single Controller Framework). This method is characterized by simple programming, clear logic, and ease of reading, especially for complex sequential control systems. Furthermore, this method uses set (S) and reset (R) instructions, which are generally available in various types of programmable controllers, thus offering good versatility. It is commonly used for manual control programming in automatic control systems. However, because this method does not allow the output coil to be connected in parallel with the set and reset instructions when designing the ladder diagram, the normally open contacts of auxiliary relays representing each step, or their parallel circuits, must be used to drive the output coil. Therefore, the ladder diagram contains more statements, resulting in a slightly longer program execution time.
4.3 Sequential Control Design Method for Step Instructions
Sequential control design using step instructions is a specialized design method. Different programmable logic controllers (PLCs) have different step instructions, and currently, they are not interchangeable. However, it is a built-in design method for some PLCs. Using it in the design of complex sequential control systems can effectively reduce memory usage, shorten program execution time, and improve the PLC's input/output response speed. This programming method is also easy for beginners to accept and master, and experienced engineers can improve design efficiency. Program debugging, modification, and reading are also easy, making it convenient to use and resulting in shorter programs. It should be given priority in sequential control design and is widely used in industrial automation control.
4.4 Sequential Control Design Method for Displacement Commands
The sequential control design method using displacement instructions produces a simple ladder diagram with fewer instructions, but it is inconvenient for designing more complex control systems. It also has poor online modification capabilities during use and is rarely used in industrial control. It is mostly used in sequential control circuits for colored lights.
5 Examples of Sequential Control Design Method
Sequential control is ubiquitous in industrial control; this article takes selective work conveyors as an example.
The selective work conveyor is used to sort large and small balls and send them to two different positions on the right. Its working diagram is shown in Figure 7.
Analysis: According to the symbols marked in the diagram, the selective working conveyor has four different directions: up, down, left, and right, which are executed by the corresponding drive coils y1, y2, y4, and y3, respectively. Y0 activates the magnet to attract the ball. When a small ball is attracted, the mechanism reaches its lower limit, and x2 activates. Otherwise, if x2 has not activated after a certain time, it means the mechanical clamp mechanism cannot reach the lower limit, and a large ball is attracted. Based on this judgment, the ball is then sent to the designated position. A simplified schematic diagram is shown in Figure 8 based on the process requirements. As can be seen from the figure, the selection process of the large and small balls is a selective branching problem, which is a complex sequential control system. Combining the analysis of the characteristics of the four sequential control design methods above, using step instructions to design this sequential control process will greatly simplify the program and enhance readability.
6. Conclusion
It must be pointed out that the mathematical logic essence of the various sequential control programming methods discussed in this paper is essentially an analog of the international standard FSC language. Based on a thorough understanding of ladder diagram sequential control programming methods, the appropriate design method should be selected according to different sequential control systems, considering factors such as the response speed of the programmable controller, the complexity of the system, and design efficiency. This ensures that in practical applications, the appropriate method can be chosen to design the sequential control ladder diagram based on the specific circumstances, resulting in a more concise and readable program.