PLC programming method and system based on state machine model in multi-station production line
By using a PLC programming method based on a state machine model, the problems of global emergency shutdown, inconsistent states, and timing conflicts in large multi-station stamping production lines were solved, enabling flexible shutdown and recovery, improving the high availability and efficiency of the production line, and enhancing equipment synergy and maintainability.
Patent Information
- Application Number
- CN202511443749.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2045-10-10
AI Technical Summary
Traditional PLC control methods in large-scale multi-station stamping production lines suffer from problems such as global emergency shutdown leading to production interruptions, inconsistent states, and timing conflicts. They lack flexible shutdown and global state self-verification capabilities, which affect the overall efficiency and safety of the equipment.
By adopting a PLC programming method based on a state machine model, multi-level control signals are defined and acquired, state variables are initialized, parallel states are updated in real time, safety verification sequences are triggered, control commands are generated, and historical data is stored in real time, thus achieving flexible shutdown and recovery and ensuring the consistency and coordination of equipment states.
It enables flexible shutdown and recovery of multi-station production lines, avoids production failures and safety accidents caused by inconsistent equipment status, improves overall equipment efficiency, reduces restart and debugging time, solves timing conflict problems, and enhances system maintainability and predictive maintenance capabilities.
Smart Images

Figure CN121541560A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of industrial automation control technology, specifically relating to a PLC programming method and system based on a state machine model in a multi-station production line. Background Technology
[0002] Large-scale multi-station stamping production lines are core equipment in manufacturing industries (such as the automotive industry), typically consisting of complex collaborative systems comprised of multiple large presses, loading and unloading robots, conveyors, and turnover machines. These systems place extremely high demands on the safety, reliability, and coordination of control. Traditional PLC control methods face the following problems in such applications: First, there's the conflict between global emergency shutdown and localized handling. In traditional PLC control schemes, a failure in any piece of equipment (such as a robot) will trigger a full-line emergency shutdown. While a full-line emergency shutdown is safe, it disrupts production across the entire line, requiring significant time for reset and debugging upon restart, severely reducing overall equipment efficiency. Second, there's the issue of inconsistent states after a pause. After a production line pauses, each piece of equipment remains at a different process point. Traditional recovery methods include forcing all equipment back to their initial positions, resulting in significant wasted capacity; another method is direct restart, but due to a lack of coordinated verification of the current state of each piece of equipment, this easily leads to mechanical collisions, product scrap, or even equipment damage. Finally, there are timing conflicts in multi-equipment coordination. The actions of presses, robots, and conveyors must have strict sequential timing and interlocking relationships, but in traditional programming, this timing logic is scattered across subroutines, resulting in fragmented design and making it extremely difficult to locate and resolve timing conflicts caused by minute delays during debugging.
[0003] Currently, there is a lack of a PLC control method that can achieve flexible shutdown and recovery and has global state self-verification capabilities to meet the requirements of high availability and high efficiency of current intelligent stamping production lines. Summary of the Invention
[0004] In a first aspect, embodiments of this application provide a PLC programming method based on a state machine model in a multi-station production line, comprising the following steps: S1. Define and collect various input signals required for production line control; the input signals include control signals at the production line level and control and feedback signals at the workstation level; The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; S2. Define and initialize the internal state variables corresponding to the input signals; the internal state variables are used to characterize the operation process, requests, pauses and output ready states of the production line and each workstation; S3. Based on the input signal and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic; Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. S4. When a stop or abort signal is received, the status process at the corresponding level is paused and a verification sequence is triggered. The verification sequence confirms that the associated device has entered a preset safe state by querying the feedback signal at the corresponding workstation level before allowing the setting of the status recovery flag. S5. Based on the updated internal state variables, generate control commands to drive the press and robot to perform corresponding action outputs; S6. Real-time storage of historical data on input signals, internal state variables, and the triggering and execution results of verification sequences.
[0005] Furthermore, the update logic for the production line level running process status boSts_Proc_Line in step S3 is defined by the following Boolean expression:
[0006] Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, " / " represents a logical NOT operation, and boClear_Line represents the production line operating condition signal, which is the aggregated result of the logical AND operation of the operating process status of all workstations.
[0007] Furthermore, the update logic for the robot station's request status boSts_Req_Robot in step S3 is defined by the following Boolean expression:
[0008] Where "·" represents a logical AND operation, "+" represents a logical OR operation, " / " represents a logical NOT operation, and boStart_Press is the press machine start signal, indicating the trigger input; The request status boSts_Req_Robot at the robot workstation is maintained by self-holding logic to suppress signal jitter.
[0009] Furthermore, the specific steps of step S4 are as follows: S41. When the production line level running process status boSts_Proc_Line is valid and the full line stop signal boStop_Line is received, set the production line pause status boSts_Pause_Line to true; S42. Activate a safety status checklist and check in sequence that all robots have returned to the safe standby position, all press slides have stopped at the top dead center, and all conveyor belts have been cleared; S43. When all feedback signals corresponding to the verification items are true, set the production line recoverable flag boSts_PauseCanRst_Line to true; S44. When the production line recoverability flag boSts_PauseCanRst_Line is true, the full-line start signal boStart_Line is true again, and the full-line stop signal boStop_Line is false, clear the production line pause state boSts_Pause_Line and the production line recoverability flag boSts_PauseCanRst_Line.
[0010] Furthermore, step S6 also includes: Record the workstation source and timestamp of each time the full-line emergency stop signal boAbort_Line is triggered; The frequency at which each workstation triggers the full-line emergency stop signal boAbort_Line is counted, and when the frequency exceeds a preset threshold, a predictive maintenance warning signal is generated and output to the corresponding workstation.
[0011] Furthermore, the update logic for the output state boOut_Press of the press station in step S3 is defined by the following Boolean expression:
[0012] Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, and " / " represents a logical NOT operation; boHold is the hold signal, boSts_Proc_Press is the press running process status, boSts_RdyOut_Press is the press running ready output status, boSts_Pause_Line is the production line running paused status, boComp_Robot is the robot gripping completion signal, boCompBypass is the completion bypass signal, and boRelease is the release signal; boClear_Press is the press running condition signal, which is the result of a logical AND operation on the production line running process status boSts_Proc_Line, the robot gripping completion signal boComp_Robot, and the press body safety condition signal.
[0013] Furthermore, the triggering conditions for verifying the sequence in step S4 also include: When a scheduled maintenance instruction or equipment lifecycle count reaches a threshold, the production line is forced into a pause state and a state consistency verification process is triggered for preventative safety inspections.
[0014] Secondly, embodiments of this application also provide a PLC programming system based on a state machine model for a multi-station production line, comprising: The signal input interface is used to define and acquire various input signals required for production line control; the input signals include production line-level control signals and workstation-level control and feedback signals. The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; The state machine processing module is connected to the signal input interface. It is used to define and initialize the internal state variables corresponding to the input signals, and based on the input signals and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic. The internal state variables are used to characterize the operation process, requests, pauses, and output ready status of the production line and each workstation. Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. The state machine processing module is also used to pause the state process at the corresponding level and trigger a verification sequence when a stop or abort signal is received. The verification sequence confirms that the associated equipment has entered the preset safe state by querying the feedback signal of the corresponding workstation level before allowing the setting of the state recovery flag. The output control module, connected to the state machine processing module, is used to generate control commands based on the updated internal state variables, driving the press and robot to perform corresponding action outputs. The storage module, connected to the state machine processing module and the signal input interface, is used to store historical data of input signals, internal state variables, and the triggering and execution results of verification sequences in real time.
[0015] Furthermore, the state machine processing module includes a logic operation unit and a verification unit; The logic unit is used to perform the following Boolean operations to update the state: The update logic for the production line level running process status boSts_Proc_Line is as follows:
[0016] Where “·” represents a logical AND operation, “+” represents a logical OR operation, “ / ” represents a logical NOT operation, and boClear_Line represents the production line operating condition signal, which is the aggregated result of the logical AND operation of the operating process status of all workstations. The logic unit is also used to perform the following Boolean operation to update the output status boOut_Press of the press station:
[0017] Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, and " / " represents a logical NOT operation; boHold is the hold signal, boSts_Proc_Press is the press running process status, boSts_RdyOut_Press is the press running ready output status, boSts_Pause_Line is the production line running paused status, boComp_Robot is the robot gripping completion signal, boCompBypass is the completion bypass signal, and boRelease is the release signal; boClear_Press is the press running condition signal, which is the result of a logical AND operation between the production line running process status boSts_Proc_Line, the robot gripping completion signal (boComp_Robot), and the press body safety condition signal. The verification unit is used to execute the verification sequence, as follows: When the production line level running process status boSts_Proc_Line is valid and the full line stop signal boStop_Line is received, the production line pause status boSts_Pause_Line is set to true; Activate a safety status checklist and verify in sequence that all robots have returned to the safe standby position, all press slides have stopped at the top dead center, and all conveyor belts have been cleared. When all feedback signals corresponding to the verification items are true, set the production line recoverability flag boSts_PauseCanRst_Line to true; When the production line recoverability flag boSts_PauseCanRst_Line is true, the full-line start signal boStart_Line is true again, and the full-line stop signal boStop_Line is false, clear the production line pause state boSts_Pause_Line and the production line recoverability flag boSts_PauseCanRst_Line.
[0018] Furthermore, the storage module is also used to record the workstation source and timestamp of each full-line emergency stop signal boAbort_Line; The state machine processing module also includes an analysis unit, which is used to count the frequency of the trigger stop signals of each workstation, and generate a predictive maintenance early warning signal when the frequency exceeds a preset threshold and output it through the output control module.
[0019] As can be seen from the above technical solutions, this application has the following advantages: The PLC programming method and system based on a state machine model for multi-station production lines provided in this application ensure the consistency and reliability of the equipment states at each station during pauses, recoveries, and multi-device collaboration through the logic design of the state machine, avoiding production failures or safety accidents caused by inconsistent equipment states; it realizes flexible shutdown and recovery functions, avoiding the problem of line interruption caused by emergency shutdowns in traditional PLC control, while reducing restart and debugging time and improving overall equipment efficiency; it solves the problem of timing conflicts between multiple equipment actions, and realizes strict timing constraints and interlocking relationships between equipment through the aggregation logic and parallel updates of the state machine, improving the coordination of the production line; by recording and statistically analyzing emergency shutdown signals and related data, it can identify potential high-risk stations and generate predictive maintenance warnings, reducing the risk of equipment failure during long-term operation; it stores input signals, state variables, and historical data in real time, facilitating problem tracing and optimization, and enhancing the maintainability of the system. Attached Figure Description
[0020] To more clearly illustrate the technical solution of this application, the accompanying drawings used in the description will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the PLC programming method based on a state machine model in a multi-station production line according to the present invention.
[0022] Figure 2 This is a schematic diagram of the PLC programming system based on the state machine model in the multi-station production line of the present invention. Detailed Implementation
[0023] The various embodiments of this disclosure will be described more fully in the following detailed steps of the PLC programming method based on the state machine model in a multi-station production line. This disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of this disclosure to the specific embodiments disclosed herein, but rather this disclosure should be understood to cover all adjustments, equivalents, and / or alternatives falling within the spirit and scope of the various embodiments of this disclosure.
[0024] For example, large-scale multi-station stamping production lines, such as the core processes in automobile manufacturing, consist of equipment like presses, robots, and conveyors, forming a complex collaborative system. Traditional PLC control suffers from the following problems: a single equipment failure causes a complete line shutdown, with restarting taking a long time; after a shutdown, the equipment states are inconsistent, and recovery either wastes production capacity or easily leads to accidents; the timing of multiple equipment actions is dispersed, making debugging difficult. Currently, there is an urgent need for a PLC control method that enables flexible shutdown recovery and global state self-verification to improve the high availability and efficiency of intelligent stamping production lines.
[0025] To address the aforementioned issues, this embodiment provides a PLC programming method based on a state machine model for multi-station production lines. By defining acquisition signals, updating state variables, and triggering verification sequence steps, it achieves flexible shutdown and recovery, ensures global state self-verification, and improves the high availability and efficiency of intelligent stamping production lines.
[0026] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0027] Please see Figure 1 The diagram shows a flowchart of a PLC programming method based on a state machine model in a multi-station production line according to a specific embodiment. The method includes the following steps: S1. Define and collect various input signals required for production line control; the input signals include control signals at the production line level and control and feedback signals at the workstation level; The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; It should be noted that by defining and collecting control signals at multiple levels, including the production line level and the workstation level, basic data support is provided for the subsequent state machine logic; by distinguishing between production line control signals and workstation feedback signals, the control logic is clearly hierarchical, making it easy to expand and debug. S2. Define and initialize the internal state variables corresponding to the input signals; the internal state variables are used to characterize the operation process, requests, pauses and output ready states of the production line and each workstation; It should be noted that defining and initializing internal state variables is crucial for representing the operational, requesting, pausing, and output-ready states of the production line and each workstation, providing a foundation for the implementation of state machine logic. Initializing state variables ensures that the system starts from a consistent initial state, avoiding anomalies caused by inconsistent initial states. S3. Based on the input signal and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic; Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. It should be noted that, based on input signals and state variables, the production line and workstation states are updated in parallel through preset logical rules, which improves the real-time response speed of the control. The production line state depends on the workstation aggregate state, and the workstation state depends on the production line collaborative state, realizing a two-way dependency relationship and enhancing the overall coordination and consistency of the system. S4. When a stop or abort signal is received, the status process at the corresponding level is paused and a verification sequence is triggered. The verification sequence confirms that the associated device has entered a preset safe state by querying the feedback signal at the corresponding workstation level before allowing the setting of the status recovery flag. It should be noted that upon receiving a stop or abort signal, a safety state verification sequence is triggered to ensure that the device enters a safe state before allowing recovery, thus avoiding safety hazards or equipment damage caused by direct recovery; by providing logical management of pause status and recovery flags, the controllability of system pause and recovery is improved. S5. Based on the updated internal state variables, generate control commands to drive the press and robot to perform corresponding action outputs; It should be noted that generating control commands based on the updated state variables achieves an accurate mapping from state to action, ensuring that equipment such as presses and robots perform tasks as expected; the combination of output logic and state machine enhances the flexibility and adaptability of control. S6. Real-time storage of historical data on input signals, internal state variables, and the triggering and execution results of verification sequences; It should be noted that real-time storage of input signals, state variables, and verification results provides a complete historical record of the production process, facilitating problem analysis and system optimization; the storage module also provides a data foundation for subsequent predictive maintenance and data mining.
[0028] This embodiment defines and collects control signals at multiple levels, including production line and workstation levels, providing basic data support for subsequent state machine logic. By distinguishing between production line control signals and workstation feedback signals, the control logic is hierarchically differentiated, making it easy to expand and debug.
[0029] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, in order to fully illustrate the specific implementation process in this embodiment, another PLC programming method based on a state machine model in a multi-station production line is provided. This method includes the following steps: S1. Define and collect various input signals required for production line control; the input signals include control signals at the production line level and control and feedback signals at the workstation level; The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; For example, taking a car body stamping production line (including 3 presses P1-P3, 3 loading and unloading robots R1-R3, and 2 conveyor belts C1-C2) as an example, the specific signal acquisition is as follows: Production line level: When the operator presses the "Start All Lines" button on the control panel, boStart_Line is set to "1" (valid); when the operator presses the "Stop All Lines" button, boStop_Line is set to "1"; when the safety light curtain at any workstation is blocked, boAbort_Line is immediately set to "1". Workstation level: When the "single start" button of press P1 is triggered, its start signal boStart_Press1 is set to "1"; after robot R1 completes workpiece gripping, its completion signal boComp_Robot1 is set to "1"; when the photoelectric sensor of conveyor belt C1 detects a workpiece, its feedback signal boSensor_C1 is set to "1"; when the emergency stop button of press P2 is pressed, its safety condition signal boSafe_Press2 is set to "0" (invalid). S2. Define and initialize the internal state variables corresponding to the input signals; the internal state variables are used to characterize the operation process, requests, pauses and output ready states of the production line and each workstation; For example, for the above-mentioned stamping production line, the internal state variables and their initial values are defined as follows: Production line level: running process status boSts_Proc_Line (initially "0", indicating not running), paused status boSts_Pause_Line (initially "0", indicating not paused), and recoverable flag boSts_PauseCanRst_Line (initially "0", indicating not recoverable).
[0030] Workstation level: the running process status of press P1 boSts_Proc_Press1 (initially "0"), the request status of robot R2 boSts_Req_Robot2 (initially "0"), and the output ready status of conveyor belt C2 boSts_RdyOut_C2 (initially "0"). After initialization, all state variables are in an "inactive" or "safe" state when the system is powered on, to avoid malfunctions at the moment of power-on; S3. Based on the input signal and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic; Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. The update logic for the production line level running process status boSts_Proc_Line in step S3 is defined by the following Boolean expression:
[0031] Where “·” represents a logical AND operation, “+” represents a logical OR operation, “ / ” represents a logical NOT operation, and boClear_Line represents the production line operating condition signal, which is the aggregated result of the logical AND operation of the operating process status of all workstations. The update logic for the robot station's request status boSts_Req_Robot in step S3 is defined by the following Boolean expression:
[0032] Where "·" represents a logical AND operation, "+" represents a logical OR operation, " / " represents a logical NOT operation, and boStart_Press is the press machine start signal, indicating the trigger input; The request status boSts_Req_Robot at the robot workstation is maintained by self-holding logic to suppress signal jitter. The update logic for the output status boOut_Press of the press station in step S3 is defined by the following Boolean expression:
[0033] Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, and " / " represents a logical NOT operation; boHold is the hold signal, boSts_Proc_Press is the press running process status, boSts_RdyOut_Press is the press running ready output status, boSts_Pause_Line is the production line running paused status, boComp_Robot is the robot gripping completion signal, boCompBypass is the completion bypass signal, and boRelease is the release signal; boClear_Press is the press running condition signal, which is the result of a logical AND operation on the production line running process status boSts_Proc_Line, the robot gripping completion signal boComp_Robot, and the press body safety condition signal. For example, the production line level operation process status is updated: Assuming the current boStart_Line=1 (full line start), and the running status of the three presses boSts_Proc_Press1=1, boSts_Proc_Press2=1, and boSts_Proc_Press3=1 (all meeting the running conditions), then the production line running condition signal boClear_Line=boSts_Proc_Press1・boSts_Proc_Press2・boSts_Proc_Press3=1. If boAbort_Line=0 at this time (no emergency stop), according to the logical expression boSts_Proc_Line=((boStart_Line・boClear_Line)+boSts_Proc_Line)・ / boAbort_Line, we can calculate boSts_Proc_Line=((1・1)+0)・1=1, that is, the production line has entered the running state.
[0034] Robot workstation request status update: When the press P2 start signal boStart_Press2=1 (trigger input), boAbort_Line=0, the press P2 safety protection signal boGuard_Press2=1 (safety condition met), and the robot R2 has not completed the grasping (boComp_Robot2=0), according to the logical expression boSts_Req_Robot2=(boStart_Press2+(boSts_Req_Robot2・ / boAbort_Line))・boGuard_Press2・ / boComp_Robot2, substituting it into the equation, we get boSts_Req_Robot2=(1+(0・1))・1・1=1, and the request state of the robot R2 is activated. If boStart_Press2 subsequently becomes 0, but boSts_Req_Robot2 is already 1, and other conditions remain unchanged, then boSts_Req_Robot2=(0+(1・1))・1・1=1, and the request state is maintained through self-holding logic to avoid the request being lost due to instantaneous signal jitter.
[0035] Press station output status update: Assume that the start signal boStart_Press3=1, the hold signal boHold_Press3=0, the running process state boSts_Proc_Press3=1, and the output ready state boSts_RdyOut_Press3=1 for press P3; the production line has no pauses (boSts_Pause_Line=0) and no emergency stops (boAbort_Line=0); robot R3 has completed gripping (boComp_Robot3=1), completed bypass signal boCompBypass=0, and released signal boRelease_Press3=1; the running condition signal boClear_Press3 of press P3 = boSts_Proc_Line・boComp_Robot3・boSafe_Press3=1・1・1=1. According to the logical expression boOut_Press3=(boStart_Press3+(boHold_Press3・boSts_Proc_Press3・boSts_RdyOut_Press3))・ / boSts_Pause_Line・boClear_Press3・ / boAbort_Line・( / boComp_Robot3+boCompBypass)・boRelease_Press3, substituting it into the equation, we get boOut_Press3=(1+(0・1・1))・1・1・1・(0+0)・1=0, meaning that press P3 will not output any action for the time being. If boCompBypass=1 later (enabled to bypass), then ( / boComp_Robot3+boCompBypass)=0+1=1, and at this time boOut_Press3=(1+0)・1・1・1・1・1・1=1, press P3 will perform the stamping action. S4. When a stop or abort signal is received, the status process at the corresponding level is paused and a verification sequence is triggered. The verification sequence confirms that the associated device has entered a preset safe state by querying the feedback signal at the corresponding workstation level before allowing the setting of the status recovery flag. The specific steps of step S4 are as follows: S41. When the production line level running process status boSts_Proc_Line is valid and the full line stop signal boStop_Line is received, set the production line pause status boSts_Pause_Line to true; S42. Activate a safety status checklist and check in sequence that all robots have returned to the safe standby position, all press slides have stopped at the top dead center, and all conveyor belts have been cleared; S43. When all feedback signals corresponding to the verification items are true, set the production line recoverable flag boSts_PauseCanRst_Line to true; S44. When the production line recoverability flag boSts_PauseCanRst_Line is true, the full line start signal boStart_Line is true again, and the full line stop signal boStop_Line is false, clear the production line pause state boSts_Pause_Line and the production line recoverability flag boSts_PauseCanRst_Line. The triggering conditions for verifying the sequence in step S4 also include: When a regular maintenance instruction or equipment lifecycle count reaches a threshold, the production line is forced into a pause state and a state consistency verification process is triggered to perform preventative safety inspections. For example, pause trigger: when the production line is in running state (boSts_Proc_Line=1), when the operator presses the "stop all lines" button (boStop_Line=1), according to step S41, the production line pause state boSts_Pause_Line is set to "1", and the execution process of all workstations is paused.
[0036] Security Verification: The system immediately activates the security status verification list and executes it sequentially: Verify the position feedback signals of robots R1-R3: If the position sensor of R1 shows that it is in the safe standby position (boPos_R1=1), R2 is in the safe standby position (boPos_R2=1), and R3 is in the safe standby position (boPos_R3=1), then the "robot safe position" verification item passes; Verify the slider positions of press P1-P3: If the slider position sensor of press P1 shows that it stops at the top dead center (boSlide_P1=1), P2 stops at the top dead center (boSlide_P2=1), and P3 stops at the top dead center (boSlide_P3=1), then the "press slide safety position" verification item passes. Verify the workpiece detection of conveyor belts C1-C2: If there is no workpiece in the photoelectric sensor of conveyor belt C1 (boSensor_C1=0) and no workpiece in C2 (boSensor_C2=0), then the "Conveyor belt emptying" verification item passes. Recovery flag setting: When all verification items pass (all feedback signals are "1"), according to step S43, the production line recoverable flag boSts_PauseCanRst_Line is set to "1"; State recovery: When the operator presses the "Start All Lines" button again (boStart_Line=1) and the "Stop All Lines" button is reset (boStop_Line=0), and at the same time boSts_PauseCanRst_Line=1, according to step S44, boSts_Pause_Line=0 and boSts_PauseCanRst_Line=0 are cleared, and the production line resumes operation from the paused state; When the production line reaches its 1000th production cycle, the system detects that the number of runs of press P2 has reached the preset maintenance threshold (1000 times). According to the rule in step S4, "periodic maintenance instruction or equipment lifecycle count reaches threshold trigger verification," boSts_Pause_Line is forcibly set to "1," triggering the verification sequence. After the verification passes, the system locks the recovery function and displays a "P2 needs maintenance" prompt on the operation interface. Only after maintenance personnel complete lubrication, parts inspection, and other tasks, and manually reset the maintenance count, can the system clear the paused state, thus achieving preventative safety inspection. S5. Based on the updated internal state variables, generate control commands to drive the press and robot to perform corresponding action outputs; For example, when the output state boOut_Press1=1 of the press P1 calculated in step S3, the output control module generates a "P1 executes stamping" control command and sends a signal to the drive unit of P1 through the digital output port of the PLC to control the slider of P1 to move down to complete the stamping action; when the request state boSts_Req_Robot1=1 of the robot R1 and the production line coordination state allows it, a "R1 grabs workpiece" control command is generated to drive the robotic arm of R1 to move to the designated picking position and trigger the grabbing cylinder action; when the output ready state boSts_RdyOut_C2=1 of the conveyor belt C2, a "C2 starts conveying" control command is generated to drive the motor of C2 to run and convey the workpiece to the next station; S6. Real-time storage of historical data on input signals, internal state variables, and triggering and execution results of verification sequences; Step S6 also includes: Record the workstation source and timestamp of each time the full-line emergency stop signal boAbort_Line is triggered; The frequency at which each workstation triggers the full-line emergency stop signal boAbort_Line is counted, and when the frequency exceeds a preset threshold, a predictive maintenance warning signal is generated and output to the corresponding workstation. For example, the storage module records the following data in 10ms intervals: Input signals: boStart_Line changes from 0 to 1 at 10:05:23.120, boAbort_Line changes from 0 to 1 at 10:08:45.670 (triggered by the safety light curtain of P3), and returns to 0 at 10:08:46.120.
[0037] Internal state variables: boSts_Proc_Line becomes 1 at 10:05:23.130, boSts_Pause_Line becomes 1 at 10:08:45.680, and boSts_PauseCanRst_Line becomes 1 at 10:08:47.230.
[0038] Verification results: In the verification sequence triggered at 10:08:45.680, the verification time for "Robot Safety Position" was 10:08:46.890, the verification time for "Pressure Machine Slider Safety Position" was 10:08:47.110, and the verification time for "Conveyor Belt Emptying" was 10:08:47.230.
[0039] Meanwhile, the system counted the frequency of boAbort_Line triggering at each workstation within one month: the safety light curtain of P3 was triggered 12 times, far exceeding the preset threshold (5 times / month). The analysis unit generated a predictive maintenance warning signal of "P3 safety light curtain needs to be checked", which was displayed in the operation interface through the output control module and sent to the mobile phone of the equipment maintenance personnel via SMS.
[0040] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0041] like Figure 2 As shown, the following is an embodiment of the PLC programming system based on the state machine model in a multi-station production line provided by this disclosure. This system and the PLC programming method based on the state machine model in the multi-station production line in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the PLC programming system based on the state machine model in the multi-station production line, please refer to the embodiments of the PLC programming method based on the state machine model in the multi-station production line described above.
[0042] The system includes: The signal input interface is used to define and acquire various input signals required for production line control; the input signals include production line-level control signals and workstation-level control and feedback signals. The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; The state machine processing module is connected to the signal input interface. It is used to define and initialize the internal state variables corresponding to the input signals, and based on the input signals and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic. The internal state variables are used to characterize the operation process, requests, pauses, and output ready status of the production line and each workstation. Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. The state machine processing module is also used to pause the state process at the corresponding level and trigger a verification sequence when a stop or abort signal is received. The verification sequence confirms that the associated equipment has entered the preset safe state by querying the feedback signal of the corresponding workstation level before allowing the setting of the state recovery flag. The output control module, connected to the state machine processing module, is used to generate control commands based on the updated internal state variables, driving the press and robot to perform corresponding action outputs. The storage module, connected to the state machine processing module and the signal input interface, is used to store historical data of input signals, internal state variables, and the triggering and execution results of verification sequences in real time.
[0043] This embodiment achieves flexible shutdown recovery through the interactive collaboration of the signal input interface, state machine processing module, output control module, and storage module, ensuring consistent status and improving production line efficiency and safety.
[0044] Furthermore, as a refinement and extension of the specific implementation methods described above, and to fully illustrate the specific implementation process in this embodiment, another PLC programming system based on a state machine model for a multi-station production line is provided. This system includes: The signal input interface is used to define and acquire various input signals required for production line control; the input signals include production line-level control signals and workstation-level control and feedback signals. The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; The state machine processing module is connected to the signal input interface. It is used to define and initialize the internal state variables corresponding to the input signals, and based on the input signals and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic. The internal state variables are used to characterize the operation process, requests, pauses, and output ready status of the production line and each workstation. Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. The state machine processing module is also used to pause the state process at the corresponding level and trigger a verification sequence when a stop or abort signal is received. The verification sequence confirms that the associated equipment has entered the preset safe state by querying the feedback signal of the corresponding workstation level before allowing the setting of the state recovery flag. The state machine processing module includes a logic operation unit and a verification unit; The logic unit is used to perform the following Boolean operations to update the state: The update logic for the production line level running process status boSts_Proc_Line is as follows:
[0045] Where “·” represents a logical AND operation, “+” represents a logical OR operation, “ / ” represents a logical NOT operation, and boClear_Line represents the production line operating condition signal, which is the aggregated result of the logical AND operation of the operating process status of all workstations. The logic unit is also used to perform the following Boolean operation to update the output status boOut_Press of the press station:
[0046] Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, and " / " represents a logical NOT operation; boHold is the hold signal, boSts_Proc_Press is the press running process status, boSts_RdyOut_Press is the press running ready output status, boSts_Pause_Line is the production line running paused status, boComp_Robot is the robot gripping completion signal, boCompBypass is the completion bypass signal, and boRelease is the release signal; boClear_Press is the press running condition signal, which is the result of a logical AND operation between the production line running process status boSts_Proc_Line, the robot gripping completion signal (boComp_Robot), and the press body safety condition signal. The verification unit is used to execute the verification sequence, as follows: When the production line level running process status boSts_Proc_Line is valid and the full line stop signal boStop_Line is received, the production line pause status boSts_Pause_Line is set to true; Activate a safety status checklist and verify in sequence that all robots have returned to the safe standby position, all press slides have stopped at the top dead center, and all conveyor belts have been cleared. When all feedback signals corresponding to the verification items are true, set the production line recoverability flag boSts_PauseCanRst_Line to true; When the production line recoverability flag boSts_PauseCanRst_Line is true, the full-line start signal boStart_Line is true again, and the full-line stop signal boStop_Line is false, clear the production line paused state boSts_Pause_Line and the production line recoverability flag boSts_PauseCanRst_Line. The output control module, connected to the state machine processing module, is used to generate control commands based on the updated internal state variables, driving the press and robot to perform corresponding action outputs. The storage module, connected to the state machine processing module and the signal input interface, is used to store historical data of input signals, internal state variables, and the triggering and execution results of verification sequences in real time. The storage module is also used to record the workstation source and timestamp of each full-line emergency stop signal boAbort_Line; The state machine processing module also includes an analysis unit, which is used to count the frequency of the trigger stop signals of each workstation, and generate a predictive maintenance early warning signal when the frequency exceeds a preset threshold and output it through the output control module.
[0047] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A PLC programming method based on a state machine model in a multi-station production line, characterized in that, Includes the following steps: S1. Define and collect various input signals required for production line control; the input signals include control signals at the production line level and control and feedback signals at the workstation level; The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; S2. Define and initialize the internal state variables corresponding to the input signals; the internal state variables are used to characterize the operation process, requests, pauses and output ready states of the production line and each workstation; S3. Based on the input signal and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic; Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. S4. When a stop or abort signal is received, the status process at the corresponding level is paused and a verification sequence is triggered. The verification sequence confirms that the associated device has entered a preset safe state by querying the feedback signal at the corresponding workstation level before allowing the setting of the status recovery flag. S5. Based on the updated internal state variables, generate control commands to drive the press and robot to perform corresponding action outputs; S6. Real-time storage of historical data on input signals, internal state variables, and the triggering and execution results of verification sequences.
2. The PLC programming method based on a state machine model in a multi-station production line according to claim 1, characterized in that, The update logic for the production line level running process status boSts_Proc_Line in step S3 is defined by the following Boolean expression: Where "·" represents a logical AND operation, "+" represents a logical OR operation, " / " represents a logical NOT operation, and boClear_Line represents the production line operating condition signal, which is the aggregated result of a logical AND operation on the operating process status of all workstations.
3. The PLC programming method based on a state machine model in a multi-station production line according to claim 1, characterized in that, The update logic for the robot station's request status boSts_Req_Robot in step S3 is defined by the following Boolean expression: Where "·" represents a logical AND operation, "+" represents a logical OR operation, " / " represents a logical NOT operation, and boStart_Press is the press machine start signal, indicating a trigger input; The request status boSts_Req_Robot at the robot workstation is maintained by self-holding logic to suppress signal jitter.
4. The PLC programming method based on a state machine model in a multi-station production line according to claim 1, characterized in that, The specific steps of step S4 are as follows: S41. When the production line level running process status boSts_Proc_Line is valid and the full line stop signal boStop_Line is received, set the production line pause status boSts_Pause_Line to true; S42. Activate a safety status checklist and check in sequence that all robots have returned to the safe standby position, all press slides have stopped at the top dead center, and all conveyor belts have been cleared; S43. When all feedback signals corresponding to the verification items are true, set the production line recoverable flag boSts_PauseCanRst_Line to true; S44. When the production line recoverability flag boSts_PauseCanRst_Line is true, the full-line start signal boStart_Line is true again, and the full-line stop signal boStop_Line is false, clear the production line pause state boSts_Pause_Line and the production line recoverability flag boSts_PauseCanRst_Line.
5. The PLC programming method based on a state machine model in a multi-station production line according to claim 1 or 4, characterized in that, Step S6 also includes: Record the workstation source and timestamp of each time the full-line emergency stop signal boAbort_Line is triggered; The frequency at which each workstation triggers the full-line emergency stop signal boAbort_Line is counted, and when the frequency exceeds a preset threshold, a predictive maintenance warning signal is generated and output to the corresponding workstation.
6. The PLC programming method based on a state machine model in a multi-station production line according to claim 1, characterized in that, The update logic for the output status boOut_Press of the press station in step S3 is defined by the following Boolean expression: Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, and " / " represents a logical NOT operation; boHold is the hold signal, boSts_Proc_Press is the press running process status, boSts_RdyOut_Press is the press running ready output status, boSts_Pause_Line is the production line running paused status, boComp_Robot is the robot gripping completion signal, boCompBypass is the completion bypass signal, and boRelease is the release signal; boClear_Press is the press running condition signal, which is the result of a logical AND operation on the production line running process status boSts_Proc_Line, the robot gripping completion signal boComp_Robot, and the press body safety condition signal.
7. The PLC programming method based on a state machine model in a multi-station production line according to claim 1, characterized in that, The triggering conditions for verifying the sequence in step S4 also include: When a scheduled maintenance instruction or equipment lifecycle count reaches a threshold, the production line is forced into a pause state and a state consistency verification process is triggered for preventative safety inspections.
8. A PLC programming system based on a state machine model for a multi-station production line, characterized in that, include: The signal input interface is used to define and acquire various input signals required for production line control; the input signals include production line-level control signals and workstation-level control and feedback signals. The control signals at the production line level include the full-line start signal boStart_Line, the full-line stop signal boStop_Line, and the full-line emergency stop signal boAbort_Line; The control and feedback signals at the workstation level include start signals, stop signals, completion signals, safety condition signals, and sensor detection signals for each workstation; the workstations include press workstations and robot workstations; The state machine processing module is connected to the signal input interface. It is used to define and initialize the internal state variables corresponding to the input signals, and based on the input signals and the current internal state variables, update the internal state variables of the production line level and each workstation level in parallel according to the preset state transition logic. The internal state variables are used to characterize the operation process, requests, pauses, and output ready status of the production line and each workstation. Among them, the update of the internal state variables of the production line level depends on the input signals of the production line level itself and the aggregation state of the workstation level, while the update of the internal state variables of the workstation level depends on the input signals of the workstation level itself and the collaborative state of the production line level. The state machine processing module is also used to pause the state process at the corresponding level and trigger a verification sequence when a stop or abort signal is received. The verification sequence confirms that the associated equipment has entered the preset safe state by querying the feedback signal of the corresponding workstation level before allowing the setting of the state recovery flag. The output control module, connected to the state machine processing module, is used to generate control commands based on the updated internal state variables, driving the press and robot to perform corresponding action outputs. The storage module, connected to the state machine processing module and the signal input interface, is used to store historical data of input signals, internal state variables, and the triggering and execution results of verification sequences in real time.
9. The PLC programming system based on a state machine model in a multi-station production line according to claim 8, characterized in that, The state machine processing module includes a logic operation unit and a verification unit; The logic unit is used to perform the following Boolean operations to update the state: The update logic for the production line level running process status boSts_Proc_Line is as follows: Where "·" represents a logical AND operation, "+" represents a logical OR operation, " / " represents a logical NOT operation, and boClear_Line represents the production line operating condition signal, which is the aggregated result of the logical AND operation of the operating process status of all workstations. The logic unit is also used to perform the following Boolean operation to update the output status boOut_Press of the press station: Wherein, "·" represents a logical AND operation, "+" represents a logical OR operation, and " / " represents a logical NOT operation; boHold is the hold signal, boSts_Proc_Press is the press running process status, boSts_RdyOut_Press is the press running ready output status, boSts_Pause_Line is the production line running paused status, boComp_Robot is the robot gripping completion signal, boCompBypass is the completion bypass signal, and boRelease is the release signal; boClear_Press is the press running condition signal, which is the result of a logical AND operation between the production line running process status boSts_Proc_Line, the robot gripping completion signal (boComp_Robot), and the press body safety condition signal. The verification unit is used to execute the verification sequence, as follows: When the production line level running process status boSts_Proc_Line is valid and the full line stop signal boStop_Line is received, the production line pause status boSts_Pause_Line is set to true; Activate a safety status checklist and verify in sequence that all robots have returned to the safe standby position, all press slides have stopped at the top dead center, and all conveyor belts have been cleared. When all feedback signals corresponding to the verification items are true, set the production line recoverability flag boSts_PauseCanRst_Line to true; When the production line recoverability flag boSts_PauseCanRst_Line is true, the full-line start signal boStart_Line is true again, and the full-line stop signal boStop_Line is false, clear the production line pause state boSts_Pause_Line and the production line recoverability flag boSts_PauseCanRst_Line.
10. The PLC programming system based on a state machine model in a multi-station production line according to claim 8, characterized in that, The storage module is also used to record the workstation source and timestamp of each full-line emergency stop signal boAbort_Line; The state machine processing module also includes an analysis unit, which is used to count the frequency of the trigger stop signals of each workstation, and generate a predictive maintenance early warning signal when the frequency exceeds a preset threshold and output it through the output control module.
Citation Information
Patent Citations
PLC parameterized automatic programming method and system based on electrical schematic diagram
CN120010377A
Dynamic interaction prompt sequence control method for chemical production
CN120276296A
PLC logical configuration real-time updating method based on state machine and related device
CN120560145A
Transmission line digital twinning virtual debugging system and method based on B / S (Browser / Server) architecture
CN120669627A
Communication unit, communication system, control method, and program
JP2014119906A