Example 1
Single-output self-locking control circuit
The start signal I0.0 and the stop signal I0.1 are generally ON for short periods. The most important feature of this circuit is its "memory" function.
Example 2
Multi-output self-locking control circuit (set, reset)
Multi-output self-locking control refers to multiple load self-locking outputs, which have various programming methods and can be implemented using set and reset instructions.
Example 3
One-way sequential start/stop control circuit
1. The unidirectional sequential start control circuit operates automatically and orderly according to a pre-defined sequence in the production process, under the influence of various input signals. Q0.1 can only start after Q0.0 has started, and Q0.2 can only start after Q0.1 has finished starting.
2. A one-way sequential stop control circuit requires stopping each executed mechanism in a specific order. Q0.1 can only be stopped after Q0.2 has been stopped. To stop Q0.0, Q0.1 must be stopped first. I0.4 is the emergency stop button.
Example 4
Delay start/stop control circuit
1. Delayed Start Control Design: The delayed start program utilizes the self-locking state of an intermediate relay (internal memory M) to enable the timer to count continuously. When the timer expires, its normally open contact actuates, causing Q0.0 to activate.
2. Delayed stop control: When the timer expires, the device will stop after a delay. I0.0 is the start button, and I0.1 is the stop button.
3. Delayed Start/Stop Control Circuit: This circuit requires that after an input signal is received, the output signal will only turn ON after a certain period of delay; conversely, after an input signal of OFF, the output signal will only turn OFF after a certain period of delay. T37 delays for 3 seconds as the start condition for Q0.0, and T38 delays for 5 seconds as the turn-off condition for Q0.0.
Experience-based design methods and precautions
In the application design process, parameters that reflect changes in the production process should be correctly selected as control parameters; the interrelationships and coordination between various actuators and programming elements, i.e., interlocking relationships, should be properly handled. There are various methods for designing applications, with commonly used methods including empirical design and sequential function charting.
1. Experience-based design method
Experience-based design requires designers to have extensive practical experience and a grasp of the basic components of numerous typical application programs. Based on the requirements of the controlled object for the control system, basic components are selected based on experience and then organically combined. The design process is a gradual refinement, and obtaining the optimal solution is generally not easy. After the initial program design, repeated debugging, modification, and improvement are necessary until the control requirements of the controlled object are met.
The empirical design method is not standardized, lacks a universal rule, and has a certain degree of exploratory and arbitrary nature.
Rules to follow when writing ladder diagram programs:
(1) The state of the “input relay” is driven by the switch signal of the external input device, and the program cannot change it arbitrarily.
(2) The same number of "relay coil" in the ladder diagram can only appear once, and usually cannot appear, but its contacts can be reused an unlimited number of times.
Rules to follow when writing ladder diagram programs:
(3) When several series branches are connected in parallel, the branch with more contacts should be placed on top; when several parallel circuits are connected in series, the branch with more parallel branches should be placed on the left. Ladder diagrams compiled according to this rule can reduce the number of user program steps and shorten program scanning time.
(4) The program is written in order from left to right and from top to bottom. A step starts at the left busbar and ends at the right busbar, and the coil is directly connected to the right busbar.
① The bridge circuit must be modified before the ladder diagram can be drawn.
② Non-bridge complex circuits must be modified before the ladder diagram can be drawn.
2. Precautions
(1) First, compile the I/O allocation table, and then design the ladder diagram. First, number and assign the input, output signals and internal coils, and then determine the actual wiring diagram of each input/output terminal of the PLC.
(2) Arrange the ladder diagram reasonably so that the input/output response lag does not affect the actual response speed. Usually, the output coils can be arranged according to the sequence of actions based on the process flow diagram, while taking into account the arrangement order of internal coils, time relays, etc., so that the input/output delay response does not affect the actual output response speed requirements.
(3) High-speed counting instructions and high-speed pulse output instructions should be placed at the beginning of the entire user program as much as possible. Since the information exchange between the high-speed counter and the high-speed pulse generator and the CPU is carried out during I/O scanning, the execution of other instructions may affect the information exchange between the high-speed counter and the high-speed pulse generator and the CPU, and may even result in the loss of pulses.
(4) In the PLC input terminal wiring diagram, for the same transmitting element, usually only one contact (such as normally open contact or normally closed contact) needs to be selected to connect to the input terminal. That is, for a transmitting element, it can only occupy one input address number.
(5) Properly connect the input signal contacts (normally open or normally closed contacts) to improve the reliability and safety of the equipment. In the actual PLC I/O wiring diagram, whether an input signal (such as a button) is connected to the normally open or normally closed contact of the electrical appliance should be considered from the perspective of equipment reliability and safety. When the input terminal wiring fails and breaks, the equipment status should move towards a safe state. Therefore, the stop button should be connected to the PLC input terminal with a normally closed contact, while the start button should be connected to the PLC input terminal with a normally open contact (for ease of understanding, all diagrams in the previous chapters of this book are treated as normally open contact connections).
(6) For safety reasons, critical safety components are not connected to the PLC input terminals but are handled in hardware. For example, emergency stop buttons, interlock contacts, emergency limit switches, thermal relay control contacts, etc., are connected to the PLC output terminals to directly control the output loads (KM1, KM2) to ensure that the equipment is not damaged and no major safety accidents occur when the PLC fails.
(7) The holding time of a valid input signal must be guaranteed. To ensure the validity of an input signal, the holding time of the input signal must be greater than one scan cycle of the PLC. Unless a pulse capture function is enabled for the digital input signal, which allows the PLC to capture pulses with very short durations.
(8) There is a difference between the signal level valid and the jump valid conditions for PLC instruction execution. This should be noted when programming.
(9) When converting an electrical control diagram to a ladder diagram, the following should be noted: When modifying old equipment, the original relay control circuit diagram can be used as a reference for conversion to a ladder diagram. Most electrical contacts in relay control circuit diagrams are break-before-make type, while the state transitions of normally open and normally closed contacts of "soft relays" in PLC ladder diagrams occur simultaneously. When designing a ladder diagram, delay circuits (such as using internal time relay delays or input/output delay responses generated by the PLC's cyclic scanning operation) can be used to simulate the function of break-before-make type electrical appliances.
Sequential Function Chart and Design Method
Functional diagram and its components
A function chart diagram is a general language that uses a combination of graphical symbols and textual descriptions to comprehensively describe the control processes, functions, and characteristics of control systems, including electrical, hydraulic, pneumatic, and mechanical control systems, or parts of a system. In a function chart diagram, a process cycle is broken down into several clear, consecutive stages called "steps," separated by transitions. When the transition conditions between two steps are met and the transition is completed, the activity of the previous step ends, and the activity of the next step begins. The more steps a process cycle has, the more accurate the description of the process.
1. Step
In a control system's operating cycle, the sequentially connected working stages are called steps or process steps, represented by rectangles and text (or numbers). Steps have two states: "active step," "inactive step," and "initial step." A series of active steps determines the state of the control process. Corresponding to the steps at the beginning of the control process, each function chart has at least one initial step, represented by a double-lined rectangle.
2. Actions
In a function chart, commands or actions are represented by rectangular text and letter symbols, connected to the symbols of their corresponding steps. Activating a step results in the execution of one or more actions or commands; that is, the actions of the active step are executed. If a step is inactive, the corresponding actions return to their state before the step became active. All actions corresponding to the active step are executed; the actions of the active step can be the start, continuation, or end of an action. If several actions are connected to the same step, these action symbols can be arranged horizontally or vertically.
3. Directed connection
Directed lines connect steps in chronological order, linking steps to transitions and vice versa. Directed lines specify the direction and path of progress from the initial step to the active step. Directed lines can be vertical or horizontal. In some cases, diagonal lines are used for clarity. In function charts, progress always flows from top to bottom and left to right, so arrows for directed lines can be omitted. If these rules are not followed, arrows must be added. Vertical and horizontal directed lines are allowed to intersect if there is no inherent connection, but they are not allowed to intersect when they relate to the same progress. When drawing function charts, if the diagram is complex or requires multiple diagrams to represent a single directed line, the next step number and its corresponding page number should be indicated.
4. Conversion
In the function table diagram, the progression of generating active steps follows the paths specified by directed lines, and this progression is accomplished by the implementation of one or more transitions. The symbol for a transition is a short dashed line intersecting the directed line, and the transition separates two adjacent steps. A transition is "enabled" if all preceding steps connected to the transition symbol via the directed line are active; otherwise, it is "disabled". A transition is only implemented when it is enabled and the transition condition is met. In a transition implementation, all subsequent steps connected to the directed line and the corresponding transition symbol are activated, while all preceding steps connected to the directed line and the corresponding transition symbol are inactive.
5. Conversion conditions
Transformation conditions are indicated near the transformation symbol, and transformation conditions can be expressed in three ways.
(1) Text statement: If either contact b or c closes, contact a will close simultaneously.
(2) Boolean expression: a(b+c). (3) Graphic symbol:
The transition condition refers to the logical variable associated with the transition, which can be either true (1) or false (0). If the logical variable is true, the transition condition is "1", and the transition condition is satisfied; if the logical variable is false, the transition condition is "0", and the transition condition is not satisfied. The transition only occurs when the transition condition of an enabling step is satisfied.
The starting point of the chosen sequence is called a branch. Transition symbols can only be marked below the horizontal line. Each branch must have one or more transition conditions and have priority.
The end of a selection sequence is called merging. When several selection sequences are merged into a common sequence, the transition symbol can only be placed above the horizontal line.
Parallel sequences are represented by double horizontal lines, with the transformation symbol above the double horizontal lines representing a common transformation condition.
The end of a parallel sequence is called merging. The transition symbol is below the horizontal line. The next step is activated when all previous steps above the double horizontal lines are active and the transition condition is met. Simultaneously, all previous steps become inactive.
Drawing principles and precautions
1. The drawing of the control system function diagram must meet the following rules.
(1) States cannot be connected and must be separated by transitions.
(2) Transfers cannot be linked together; they must be separated by states.
(3) The connection between a state and a transition, and between a transition and a state, is made using directed line segments. When drawing from top to bottom, the arrow can be omitted. When a directed line segment is drawn from bottom to top, an arrow must be drawn to indicate the direction.
(4) A functional diagram must have at least one initial state.
2. Precautions
(1) Sequential control commands are only valid for element S. Sequential control relay S also has the function of a general relay, so other commands can be used on it.
(2) Whether the SCR segment program can be executed depends on whether the status device(s) is set. The instruction logic between SCRE and the next LSCR does not affect the execution of the next SCR segment program.
(3) The same S bit cannot be used in different programs. For example, if S0.1 is used in the main program, it cannot be used in the subroutine.
(4) JMP and LBL instructions cannot be used in the SCR segment, meaning that jumping in, jumping out, or jumping inside is not allowed, but jump and label instructions can be used near the SCR segment.
(5) FOR, NEXT and END instructions cannot be used in the SCR segment.
(6) After a state transition, all components in the SCR segment should generally be reset. If you wish to continue outputting, you can use the set/reset instruction.
(7) When using a function diagram, the state numbers can be arranged out of order.
Ladder Diagram Design Method Using SCR Instructions
Ladder Diagram Design Method Using SCR Instructions
Programming of single-sequence sequential function charts
This is the simplest function chart, where actions are performed one after another. Each state is connected to only one transition, and each transition is also connected to only one state. The diagram shows a single-flow function chart, ladder diagram, and statement list.
Selective sequence programming
In actual production, for tasks with multiple processes, process selection or branch selection is required. That is, a control flow may transition to one of several possible control flows, but multiple branches are not allowed to execute simultaneously. Which branch to enter depends on which of the transition conditions preceding the control flow is true.
Parallel Sequence Programming
In many instances, a sequential control state flow must be divided into two or more distinct branches; this is called parallel branching. When a control state flow is divided into multiple branches, all branch control state flows must be activated simultaneously. When multiple control flows produce the same result, these control flows can be merged into a single control flow, i.e., a parallel branch connection. When merging control flows, all branch control flows must be completed. This ensures that the transition to the next state occurs only when the transition condition is met. Parallel sequences are generally represented by double horizontal lines, as is the simultaneous termination of several sequences.