PLC Parametric Automatic Programming Method and System Based on Electrical Schematic Diagram
By analyzing the electrical schematic, automatically identifying electrical components and control logic, setting key parameters and configuring PLC ports, the automation and parameterization of PLC programming is realized, solving the problems of difficult programming and difficulty in adjustment and modification of traditional PLCs, and improving programming efficiency and system reliability.
Patent Information
- Application Number
- CN202510486765.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Traditional PLC programming has problems such as difficult programming, difficult program adjustment and modification, and difficult to achieve parameterized adjustment in stamping production lines, resulting in low programming efficiency and high system maintenance costs.
By analyzing the electrical schematic diagram of the stamping production line, automatically identifying electrical components and control logic, setting key parameters and configuring PLC ports, and quickly and automatically encoding the PLC control program through parameterization to realize the automation and parameterization of PLC programming.
It realizes automation and parameterization of PLC programming, reduces manual programming workload, improves programming efficiency and accuracy, enhances system flexibility and reliability, and simplifies program adjustment and maintenance processes.
Smart Images

Figure CN120010377B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of industrial automation control, and in particular, to a PLC parameterized automatic programming method and system based on an electrical schematic diagram. Background Art
[0002] The statements in this part merely provide background technical information related to the present invention and do not necessarily constitute prior art.
[0003] In the field of industrial automation, the PLC (Programmable Logic Controller) is widely used as a core controller in various production lines. At present, in the stamping production line of discrete manufacturing, the traditional PLC programming method faces many challenges:
[0004] (1) Traditional PLC programming mainly relies on professional programmers to manually write code. PLC programming involves knowledge in multiple fields such as electricity, control, and computer, and PLC programming languages and tools are also relatively complex. Its programming difficulty is high, requiring programmers to have profound professional knowledge and rich experience. However, professional PLC programmers are scarce, and the programming efficiency is low, making it difficult to meet the rapidly changing market demands;
[0005] (2) The process of stamping production is complex. When facing different products, molds, and production requirements, it is necessary to frequently adjust the control logic. However, due to the professionalism and closedness of PLC programming languages, program modification is difficult and requires professional technicians to operate. Moreover, the process of program modification and debugging is cumbersome, time-consuming, and laborious. Furthermore, once a PLC control system fails, it needs to be repaired and replaced, which may involve relatively complex electrical and mechanical operations, increasing the maintenance cost and possibly affecting the stability of the system;
[0006] (3) There are a wide variety of equipment in the stamping production line, and the difficulty of coordinated control is high. Traditional PLC programming is difficult to achieve flexible parameterized adjustment, resulting in difficulties in further improving production efficiency and quality. Summary of the Invention
[0007] To solve the deficiencies of the above-mentioned existing technologies, the present invention provides a PLC parameterized automatic programming method and system based on an electrical schematic diagram. For the stamping production line in discrete manufacturing, by parsing the electrical schematic diagram of the stamping production line, electrical components and control logics in the schematic diagram are automatically identified, key parameters are set according to the actual requirements of the stamping production line, and PLC ports are configured. According to the port configuration and control logic, a parameterized method is used to quickly and automatically code the PLC control program, so that the PLC control program can be automatically generated or assisted to be generated according to different production requirements and parameters, realizing the automation and parameterization of PLC programming, and solving the problems of difficult PLC control programming, difficult program adjustment and modification, and difficult parameterized adjustment in traditional stamping production lines.
[0008] In the first aspect, the present invention provides a PLC parameterized automatic programming method based on an electrical schematic diagram.
[0009] A PLC parameterized automatic programming method based on an electrical schematic diagram includes:
[0010] Obtain the standardized electrical schematic diagram of the stamping production line, automatically analyze the key information in the electrical schematic diagram, divide the stamping production line into several modules, and extract the control logic and performance requirements of each module;
[0011] According to the operation requirements of the stamping production line and the product specifications, set the basic parameters of the PLC and the key parameters during the stamping process, and perform parameterized configuration on the PLC input and output ports;
[0012] Introduce the key parameters as programming variables into the coding program, and perform PLC automatic programming according to the control logic, performance requirements and parameterized configuration results to obtain the coded PLC control code;
[0013] Perform simulated operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
[0014] In the second aspect, the present invention provides a PLC parameterized automatic programming system based on an electrical schematic diagram.
[0015] A PLC parameterized automatic programming system based on an electrical schematic diagram includes:
[0016] A drawing analysis module, which is used to obtain the standardized electrical schematic diagram of the stamping production line, automatically analyze the key information in the electrical schematic diagram, divide the stamping production line into several modules, and extract the control logic and performance requirements of each module;
[0017] A parametric configuration module, which is used to set the basic parameters of the PLC and the key parameters during the stamping process according to the operation requirements of the stamping production line and the product specifications, and perform parametric configuration on the input and output ports of the PLC;
[0018] An automatic coding module, which is used to introduce the key parameters as programming variables into the coding program, and perform automatic PLC programming according to the control logic, performance requirements and parametric configuration results to obtain the coded PLC control code;
[0019] An optimization and debugging module, which is used to perform simulation operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
[0020] In a third aspect, the present invention also provides an electronic device, including a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the steps of the method described in the first aspect are completed.
[0021] In a fourth aspect, the present invention also provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by the processor, the steps of the method described in the first aspect are completed.
[0022] The above one or more technical solutions have the following beneficial effects:
[0023] 1. The present invention provides a method and system for automatic parametric programming of PLC based on an electrical schematic diagram. For the stamping production line in discrete manufacturing, by analyzing the electrical schematic diagram of the stamping production line, the electrical components and control logic in the schematic diagram are automatically identified, key parameters are set according to the actual requirements of the stamping production line, and the PLC ports are configured. According to the port configuration and control logic, a parametric method is used to perform rapid automatic coding of the PLC control program, so that the PLC control program can be automatically generated or assisted to be generated according to different production requirements and parameters, realizing the automation and parameterization of PLC programming, and solving the problems of difficult PLC control programming, difficult program adjustment and modification, and difficult parametric adjustment in the traditional stamping production line.
[0024] 2. The PLC parameterized automatic programming method provided by the present invention, which can be used as an intelligent auxiliary tool for PLC programming, automatically generates PLC codes that meet standards and specifications according to design drawings and parameterized configurations. On the one hand, it deeply integrates the electrical schematic diagram with PLC programming. By analyzing the component connections, signal flows, and logical relationships in the electrical schematic diagram, it automatically generates corresponding PLC program codes, thus greatly reducing the workload of manual programming, lowering labor costs, and improving programming efficiency and accuracy. On the other hand, by introducing the concept of parameterized programming, the PLC program can be quickly adjusted by modifying preset parameters (such as equipment models, input / output point configurations, control logic parameters, etc.) to meet the requirements of different stamping production lines, improving the efficiency and flexibility of PLC programming, enhancing system performance and reliability, and enabling this method to be widely applied to stamping production lines of various scales.
[0025] 3. The present invention also proposes an automatic generation and verification method. After automatically generating the PLC program, automatic verification is carried out, including steps such as logic verification, signal integrity check, and simulation operation test, to ensure that the generated program meets the design requirements of the electrical schematic diagram and can correctly control the operation of the stamping production line.
[0026] 4. The present invention realizes the modular encapsulation of control logic and algorithms by establishing a standardized model library, improving the standardization degree of programming; adopts a parameterized configuration method to reduce the workload of manual coding and improve programming efficiency; and is convenient to meet the control requirements of different devices by adjusting parameters, improving the flexibility of programming. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The specification drawings forming a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.
[0028] Figure 1 It is the business flow chart of the PLC parameterized automatic programming method described in the embodiment of the present invention;
[0029] Figure 2 It is the flow chart of automatically adjusting and optimizing parameters in the embodiment of the present invention;
[0030] Figure 3 It is the information schematic diagram extracted based on the electrical schematic diagram in the embodiment of the present invention;
[0031] Figure 4 It is the schematic diagram of the logical control relationship extracted based on the electrical schematic diagram in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0032] It should be noted that the following detailed description is exemplary only for the purpose of describing specific embodiments, aiming to provide further explanation of the present invention and not intended to limit the exemplary embodiments according to the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present invention belongs. In addition, it should also be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0033] Embodiment 1
[0034] This embodiment provides a PLC parameterized automatic programming method based on the electrical schematic diagram of a stamping production line. Adopting a modular design concept, the PLC control program of the stamping production line is decomposed into multiple reusable modules. These modules can be flexibly combined and extended according to different production requirements and equipment configurations, reducing programming complexity and development costs, and also facilitating subsequent maintenance and upgrade work. By using a parameterized configuration method, the PLC control program can be automatically generated or assisted to be generated according to different production requirements and parameters, realizing automated PLC programming, improving the programming efficiency of the stamping production line control system, reducing programming complexity, and enhancing the maintainability and scalability of the control system.
[0035] The PLC parameterized automatic programming method based on the electrical schematic diagram applicable to the stamping production line proposed in this embodiment, as Figure 1 shown, includes the following steps:
[0036] Obtain the standardized electrical schematic diagram of the stamping production line, automatically analyze the key information in the electrical schematic diagram, divide the stamping production line into several modules, and extract the control logic and performance requirements of each module;
[0037] According to the operation requirements of the stamping production line and the product specifications, set the basic parameters of the PLC and the key parameters during the stamping process, and perform parameterized configuration on the PLC input and output ports;
[0038] Introduce the key parameters as programming variables into the coding program, and perform PLC automatic programming according to the control logic, performance requirements, and parameterized configuration results to obtain the coded PLC control code;
[0039] Conduct simulation operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
[0040] The above programming method in this embodiment is applicable to various types and brands of PLC devices and supports multiple programming languages and formats, such as ladder diagram, instruction list, SFC (Sequential Function Chart Language), ST (Structured Text Language), etc.
[0041] The PLC parametric automatic programming method proposed in this embodiment is introduced in more detail through the following content.
[0042] In step S1, obtain the standardized electrical schematic diagram of the stamping production line. Considering that the relationship between the electrical part and each component of the production line and the working principle are described in detail in this drawing, the control logic and performance requirements can be extracted through parsing. The final parsing result can be stored in formats such as a database or XML for subsequent invocation and processing by the programming engine. Therefore, in this embodiment, software development is carried out with the help of an existing mature software platform, integrating the parsing design drawing components into the development software, and using the parsing design drawing component tool integrated in this software to automatically identify key information such as each electrical component, the connection control interface with mechanical equipment, and electrical connection circuits (such as electrical circuits composed of connection methods such as series and parallel) in the standardized electrical principle drawing.
[0043] In this embodiment, the drawing format of the standardized electrical schematic diagram is ELX or ELP format. In fact, this drawing is designed by EPLAN software. EPLAN is a professional electrical computer-aided design software that can realize operations such as the creation and management of electrical projects, and the sharing of files and patterns. It is based on electrical design and includes multiple fields such as electrical design, fluid design, instrument design, and machinery.
[0044] Specifically, the key information in the electrical schematic diagram is automatically parsed, including the following steps:
[0045] (1) Use an image recognition algorithm to recognize the electrical symbols in the electrical schematic diagram, and perform symbol matching in a preset symbol database to determine the corresponding electrical components (which can be simply referred to as electrical elements) and their models, functions, characteristics, and typical connection methods, etc.
[0046] Before parsing and recognition, create a database containing various electrical symbols (i.e., symbols of electrical elements) that may appear in the electrical schematic diagram of the stamping production line. This database includes common electrical symbols such as contactors, relays, sensors, motors, PLC modules, etc., and each symbol is described in detail, including its model, function, characteristics, and typical connection methods, etc. For example, the contactor symbol usually represents an element that can control the on / off of a large-current circuit, and it includes two main parts: a coil and a contact.
[0047] The electrical schematic diagram is scanned using an image recognition algorithm to identify various electrical symbols therein. Among them, the image recognition algorithm adopted can identify different symbol shapes, colors, and markings after training; further, considering that text markings are often added to electrical symbols in the electrical schematic diagram, semantic analysis technology can be introduced during the above recognition process to parse the text descriptions in the design drawings and extract key information such as the models, specifications, positional relationships, and electrical parameters of each electrical component. For example, for a specific sensor symbol, it is identified by its unique shape and markings (such as model, parameters, etc.).
[0048] On this basis, according to the identified electrical symbols, symbol matching is performed in a preset symbol database to determine the corresponding electrical components and their models, functions, characteristics, and typical connection methods.
[0049] (2) According to the functional requirements of the stamping production line, determine and mark the connection control interfaces with electrical and mechanical equipment for subsequent analysis. For example, to meet the functional requirements of processing and shaping automobile doors, a servo motor type is needed to provide the power source and precisely control parameters such as pressure, speed, and position. At this time, the connection control interfaces with electrical and mechanical equipment such as stamping machines, feeding equipment, die-changing equipment, and detection equipment can be clarified. Further, at this time, different colors or markings can be used to highlight the connection control interfaces of key parts such as the motor control circuit of the stamping machine, sensors, and drivers of the feeding equipment.
[0050] (3) Identify the main circuit and control circuit in the electrical schematic diagram. In the electrical schematic diagram, the main circuit and control circuit are matched and identified based on the electrical components connected between the power supply and the motor and the drawn lines. Specifically, components such as power switches, main contacts of contactors, fuses, thermal relays, and motors are identified. Usually, these components are mainly used to transmit and control large currents, and the electrical control circuit where the identified above components are located is regarded as the main circuit; in addition to this circuit, the control circuit composed of control electrical appliances such as coils, auxiliary contacts, buttons, switches of relays and contactors, and PLC controllers is usually the control circuit. In addition, the main circuit is usually located at the upper or left side of the drawing and is drawn with thick solid lines, while the control circuit is generally drawn below or to the right of the main circuit and is drawn with thin solid lines. Therefore, matching and identification can be performed based on these two aspects of electrical components + drawn lines to ensure the accuracy of identifying the main circuit and control circuit.
[0051] By distinguishing the main circuit and the control circuit, the working principle and control logic of the entire system can be obtained. For example, when analyzing the electrical schematic diagram of the stamping production line, first determine the main circuit where the stamping machine motor is located, and then determine the control logic of control electrical appliances such as PLC in the control circuit. Based on this control logic, the control of starting, stopping, and speed regulation of the motor is realized.
[0052] In the above - mentioned manner, the key information in the electrical schematic diagram is automatically parsed, including: each electrical component and its model, function, characteristics, and typical connection method; the connection control interface with electrical and mechanical equipment; the main circuit of the control system and the control circuit of the control system, etc.
[0053] As another implementation manner, the stamping production line is divided into several functional modules, including a feeding module, a stamping module, a die - changing module, a detection module, etc. Each module has relatively independent functions and control logics. Extract the control logics and performance requirements of each module, which is convenient for subsequent parametric programming. In this embodiment, the functional library components on the software development tool are used to divide the above - mentioned functional modules. This component is a functional library sealed and packed according to business logic processing and is imported into the software development platform.
[0054] For each of the above - divided modules, adopt the above - mentioned parsing method to extract the control logic and performance requirements of each module. Specifically, according to the connection methods of each circuit element (such as contactors, relays, sensors, PLC input - output points, etc.), logic elements (such as AND gates, OR gates, NOT gates, etc.) and control circuits identified in the electrical schematic diagram, clarify the positions and connection relationships of each element. According to the functional characteristics of each element (such as the on - off logic of contactors, the normally - open and normally - closed contact logics of relays, etc.), deduce the control logic of the module circuit and determine the start, stop, interlock, and mutual - lock relationships between various devices. For example, by analyzing the interlock relationships of multiple relays, determine the start and stop logics of a certain device. Then, according to the control logic and device characteristics, determine various performance requirements required by the system / module. The performance requirements include the measurement range of sensors, the control parameters of actuators (such as the rotational speed and torque of motors, etc.), the set values of timers and counters, etc.
[0055] Regarding the interaction between each functional module, according to the signal transmission relationship between modules, signals can be sent and received through port information in the code. For example, when the feeding module completes the feeding task, it sends a "material has been delivered" signal to the stamping module by setting the status of a specific output port or sharing a variable. The stamping module will detect this signal through the input processing function in its code and start the stamping operation.
[0056] Meanwhile, there is a certain correlation and matching between the performance requirements of different functional modules. For example, parameters such as the feeding speed and feeding length of the feeding module need to match the stamping frequency of the stamping module. If the stamping frequency of the stamping module is relatively high, the feeding speed of the feeding module needs to be correspondingly increased to ensure the continuous supply of materials. The above - mentioned operation logic is processed by manual parameter setting according to actual business needs.
[0057] In step S2, based on the key information in the automatically parsed electrical schematic diagram above, hardware configuration and variable declaration are carried out, that is, according to the functional requirements and product specifications of the stamping production line, the basic parameters of the PLC and the key parameters in the stamping process (such as material thickness, number of stamping times, etc.) are set, and the parameters of the PLC input and output ports are configured parametrically.
[0058] First, according to the functional modules and control logic of the design drawings in step S1, the software parameters (i.e., basic parameters) of the corresponding PLC are set, including defining variable names, data types, storage addresses, etc., so as to reference and modify these parameters during the programming process; at the same time, the communication parameters of the PLC also need to be configured for data transmission with the upper computer or other control systems.
[0059] In addition, for the above basic parameters and key parameters, each key parameter can be manually input in the parameter setting window or menu corresponding to the programming interface, as well as in the corresponding variable addresses in the program block or data block; as another implementation method, data file import can also be carried out through a set Excel template (including column headings such as "parameter name", "parameter value", "unit", etc.) to achieve parameter setting; or, on the parameter setting interface of the HMI (human-machine interface), such as the touch screen setting interface of the press, the parameter value is input through touch operation, and the PLC receives and stores the input parameters for controlling the stamping production line.
[0060] Then, select and configure the input and output ports of the PLC on the development software. Specifically: determine the use of each port (such as input, output, special function, etc.), set the electrical parameters of the port (such as voltage, current, resistance, etc.), and install necessary hardware interfaces (such as expansion modules, communication modules, etc.); according to the use and electrical parameters of each port after setting, create a port mapping table. In this table, the input ports of the PLC are associated with the corresponding external sensors or signal sources (such as the material in-place sensor of the feeding module, the pressure sensor of the stamping module, etc.), and the output ports of the PLC are associated with the corresponding actuators (such as motor drivers, solenoid valves, etc.).
[0061] As another implementation method, a parameter verification mechanism is introduced to ensure that the parameter values input by the user are within a reasonable range and avoid control program errors caused by improper parameter settings. In the port mapping table created in step S2, the electrical parameters of each port are also recorded for determining the data type and value range according to the electrical parameters during the coding process. For example, the voltage range of a certain input port is 0 - 10V, and during coding, the corresponding analog input is converted into an appropriate digital value, and specific conversion formulas are required for some cases.
[0062] Step S3: Introduce the key parameters as programming variables into the coding program, and perform PLC automatic programming according to the control logic and the parameterized configuration results to obtain the coded PLC control code, thereby completing the writing of the modification program.
[0063] For each functional module, use the modular programming method to write the corresponding control program. Combining the above content, according to the design drawings and parameter settings, decompose the control logic of the system into several subroutines or function blocks, and each subroutine or function block completes a specific control task. In the specific automatic coding process, make full use of the PLC parameterization function, introduce the key parameters (including equipment parameters and process parameters, such as stamping speed, pressure setting value, die position, material thickness, number of stamping times, etc.) as programming variables into the program, and perform automatic programming according to the control logic and the parameterized configuration results to obtain the coded PLC control code. By modifying the values of the variables in this code, the flexible adjustment and optimization of the production line operation parameters can be realized.
[0064] First, according to the port configuration in Step S2, obtain the uses and electrical parameters of the PLC input ports, and define the input data structure. Specifically, if there are multiple analog input ports for detecting different physical quantities (such as temperature, pressure, etc.), a structure can be created to store these analog values; if there are multiple digital input ports, bit variables or byte variables are defined to represent their states. For example, for the input ports of the stamping production line, define a structure to store the sensor states of the feeding module (such as whether the material is in place), the states of the stamping module (such as whether it is in the stamping process), etc.
[0065] Second, according to the input data structure, read and process the data of the input ports by specific functions (such as digital input reading function, analog input reading function, communication interface input reading function, etc.). Specifically, for digital input ports, the function can directly read the port state and store it in the corresponding variable; for analog input ports, the function performs conversion calculations according to the electrical parameters. For example, for an analog input port of 0~10V, the analog-to-digital conversion resolution of the PLC is 10 bits, and the function uses the formula to convert the read digital value into the corresponding voltage value, and then judges the state of the corresponding physical quantity (such as whether the pressure is within the normal range) according to the voltage value.
[0066] After that, according to the control logic in the design drawings, automatically write and generate the corresponding logical judgment statements and conditional control statements. The key parameters used as programming variables are introduced into this statement, and according to the changes in the input key parameter data and the current state of the production line, the corresponding control actions can be judged and executed to realize the automatic operation of the production line.
[0067] In PLC programming, for the control of stepping or servo motors, it is necessary to calculate the number of pulses to control the position or speed of the motor. For example, for a stepping motor, to control its rotation by a specific angle, the formula is used to calculate the required number of pulses: ; where the total number of pulses is the number of pulses required for the motor to rotate one full circle, and the target angle is the angle by which the motor is expected to rotate. The above calculation formula is not directly reflected in the PLC program code and serves as a reference basis during system design or debugging. The PLC program mainly realizes the control of production line equipment through logical expressions, ladder diagrams, or structured text, etc.
[0068] In practical applications, PLC programming focuses on writing program code according to specific control requirements and the electrical characteristics of the equipment. When designing the PLC parameterized programming algorithm model, the key is to automatically generate program code that conforms to the PLC programming specifications based on the electrical schematic diagram and control logic.
[0069] Adopting the above idea of parameterized programming, the equipment parameters and process parameters of the stamping production line are used as input variables and processed through the parameterized module in the PLC program to generate the corresponding control logic. By configuring the input equipment parameters and process parameters, such as the stroke, speed, pressure of the punching machine, and the production line process flow, cycle time, etc., the corresponding control logic is automatically generated, including the action control of the punching machine, material conveying control, etc. Among them:
[0070] Regarding the punching machine action control logic, when a start signal is received, according to the set values of the punching machine stroke and speed in the parameters, the slider of the punching machine is controlled to move downward at a specific speed, stop moving downward after reaching the set stroke position, and then quickly rise; if abnormal resistance (which can be fed back by a pressure sensor) is detected during the downward movement and exceeds the set safety threshold, the punching machine action is immediately stopped and an alarm is issued.
[0071] Regarding the material conveying control logic, according to the cycle time of the production line and the material conveying speed parameters, the conveying device is controlled to convey materials from one machine tool to the next at a stable speed; when it is detected that the material reaches a specific position, the corresponding sensor is triggered to notify the PLC to perform the next operation.
[0072] As another implementation method, during the programming process, an error handling and alarm mechanism is added. When an abnormality or failure occurs in the production line, through timers, comparison instructions, or data verification set in the PLC program, digital quantity signals, analog quantity signals, and communication failures, etc. can be detected in a timely manner, and corresponding alarm signals are triggered according to the program settings to prompt the operator to handle them. At the same time, the program should include certain fault tolerance and recovery strategies to ensure the stable operation of the production line.
[0073] Step S4: Simulate the operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
[0074] In this embodiment, debugging is carried out in the PLC programming software. Import the generated PLC code into the PLC programming software to check for syntax errors or logical errors. If any, modify them manually or regenerate them. Then, use the actual equipment to test the functions and performance of the PLC code, simulate the operation process of the production line, verify the logical correctness of the control program and the rationality of the parameter settings, observe the operation status and parameter changes of the production line, and make necessary modifications and optimizations to the control program according to the debugging results. If there are problems, adjust the parameters or regenerate them. Finally, save and deploy the PLC code to the target device.
[0075] Taking a certain automotive parts stamping production line as an example, the above method is further illustrated. The product control requirements are to produce stamping parts of different models of automotive parts, and it is required to ensure product quality and improve production efficiency. As Figure 2 shown, based on the above requirements, the specific operation steps are as follows:
[0076] First, analyze the electrical principle drawing of the stamping production line, extract the key information on the electrical principle drawing (EPLAN format drawing), that is, extract the model, position relationship, electrical parameters, etc. of the electrical components, and combine with the information such as Figure 3 shown about the parameter measuring points, electrical components and logical functions, etc., identify different logical relationships such as AND gates, OR gates, NOT gates as shown in Figure 4 shown, and determine the control logic of the system, such as start, stop, interlock, mutual lock, etc. by tracing the connections of these logic symbols.
[0077] The above design drawings adopt standardized symbols and drawing specifications, and the drawings are analyzed and interpreted through a unified standard in the database to ensure the universality of the drawings within the application scope.
[0078] At the same time, clarify the parameter settings of the product and the product model: selection of multiple automotive parts models; material thickness: [X] mm to [Y] mm; number of stamping times: [Z] times per minute.
[0079] Secondly, according to the requirements of the production line and the product specifications, set the hardware configuration of the PLC, as well as the basic parameters and key parameters during the stamping process, such as material thickness, number of stamping times, etc., and select the corresponding die number. Among them, according to the requirements of the production line and the PLC product model and specifications, the hardware configuration can be edited and imported through EXCEL to complete the setting of the hardware configuration. At the same time, collect and organize the corresponding measuring point variables, and there are various types of these measuring point variables, as shown in Table 1 below.
[0080] Table 1: Measuring Point Variables and Their Types
[0081]
[0082] Finally, call the PLC parametric programming tool. According to the parsing results of the design drawings and the parameter setting information, automatically generate the PLC control program framework, and integrate the custom control logic code segments, including the logic of equipment startup, stop, stamping action control, die switching, etc.
[0083] Among them, through the AutoThink development software tool for classification and editing, generate an EXCEL format that supports import, and then import the measuring point variables to complete the parametric input configuration. For the user interface of the stamping production line, input the production requirements and parameters. The interface includes modules such as product type selection, die parameter setting, stamping process parameter input, etc. By identifying the control relationships between components, such as when the sensor detects the material and sends a signal to the PLC, and the PLC controls the pushing of the material under the stamping machine, convert these control relationships into logical expressions or ladder diagrams that the PLC can understand.
[0084] In addition, it also includes: editing the program, organizing the POU (i.e., program composition unit), using development software tools (AutoThink of Hollysys, TIA Portal of Siemens, GX Works of Mitsubishi, CX-Programmer of Omron, etc.), generating POU by using the measuring point list, parsing the control logic diagram and referring to previous projects, generating the format supported by AT for import by organizing the logical relationships and communication, servo and other special function blocks between the measuring points, and debugging and running the PLC program through these development software.
[0085] As another implementation method, for the parameters that need to be configured and set in the parametric programming, in addition to determining according to the operation requirements and product specifications in the electrical schematic diagram of the stamping production line, it is also possible to connect to an external database, read the parameter information corresponding to a specific stamping production line from the database, and then perform PLC automatic programming. The database can be pre-set by the user and continuously updated to adapt to different production requirements. In addition, use sensors to monitor the operation status of the stamping production line in real time, dynamically adjust the parameters according to the monitored data, and perform PLC programming. For example, obtain the key parameters during the stamping process through pressure sensors, displacement sensors, etc., and automatically optimize the control parameters in the PLC program.
[0086] Embodiment 2
[0087] This embodiment provides a PLC parametric automatic programming system based on an electrical schematic diagram, including:
[0088] A drawing analysis module, which is used to obtain the standardized electrical schematic diagram of a stamping production line, automatically analyze the key information in the electrical schematic diagram, divide the stamping production line into several modules, and extract the control logic and performance requirements of each module;
[0089] A parametric configuration module, which is used to set the basic parameters of the PLC and the key parameters during the stamping process according to the operation requirements of the stamping production line and the product specifications, and perform parametric configuration on the input and output ports of the PLC;
[0090] An automatic coding module, which is used to introduce the key parameters as programming variables into the coding program, and perform automatic PLC programming according to the control logic, performance requirements and the results of parametric configuration to obtain the coded PLC control code;
[0091] An optimization and debugging module, which is used to perform simulation operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
[0092] Embodiment III
[0093] This embodiment provides an electronic device, including a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the steps in a PLC parametric automatic programming method based on an electrical schematic diagram as described above are completed.
[0094] Embodiment IV
[0095] This embodiment also provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by the processor, the steps in a PLC parametric automatic programming method based on an electrical schematic diagram as described above are completed.
[0096] The steps involved in Embodiments II to IV above correspond to those in Method Embodiment I. For specific implementation manners, reference may be made to the relevant description part of Embodiment I. The term "computer-readable storage medium" should be understood to include a single medium or multiple media containing one or more instruction sets; it should also be understood to include any medium that can store, encode, or carry an instruction set for execution by a processor and enable the processor to execute any method in the present invention.
[0097] Those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computer device. Optionally, they can be implemented by program codes executable by a computing device, so that they can be stored in a storage device and executed by the computing device, or they can be separately fabricated into individual integrated circuit modules, or multiple modules or steps among them can be fabricated into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0098] The above are only the preferred embodiments of the present invention. Although the specific implementation manners of the present invention are described in conjunction with the accompanying drawings, it is not a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications or deformations that can be made without creative efforts on the basis of the technical solutions of the present invention are still within the protection scope of the present invention.
Claims
1. A PLC parametric automatic programming method based on an electrical schematic diagram, characterized in that, Including: Obtain the standardized electrical schematic diagram of the stamping production line, automatically analyze the key information in the electrical schematic diagram, divide the stamping production line into several modules, and extract the control logic and performance requirements of each module; the key information includes: various electrical components and their models, functions, characteristics and typical connection methods; connection control interfaces with electrical and mechanical equipment; main control loop of the control system and control loop of the control system; Among them, automatically analyzing the key information in the electrical schematic diagram includes: Using an image recognition algorithm, identify the electrical symbols in the electrical schematic diagram, perform symbol matching in a preset symbol database, and determine the corresponding electrical components and their models, functions, characteristics and typical connection methods; Determine and mark the connection control interfaces with electrical and mechanical equipment according to the functional requirements of the stamping production line; Identify the main loop and control loop in the electrical schematic diagram; Set the basic parameters of the PLC and the key parameters during the stamping process according to the operation requirements of the stamping production line and the product specifications, and perform parameterized configuration on the input and output ports of the PLC; Introduce the key parameters as programming variables into the coding program, and perform automatic PLC programming according to the control logic, performance requirements and parameterized configuration results to obtain the encoded PLC control code, including: according to the port configuration, obtain the uses and electrical parameters of the PLC input ports, and define the input data structure; according to the input data structure, read and process the data of the input ports by specific functions; introduce the key parameter data as programming variables, and combine the control logic and performance requirements extracted from the drawings to automatically write and generate the corresponding logical judgment statements and conditional control statements; During the automatic coding process, introduce key parameters including stamping speed, pressure set value, die position, material thickness, and number of stampings as programming variables into the program, and perform automatic programming according to the control logic and parameterized configuration results to obtain the encoded PLC control code; Conduct simulation operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
2. The PLC parametric automatic programming method based on an electrical schematic diagram according to claim 1, characterized in that, For each module, extract the control logic and performance requirements, including: According to the connection methods of each circuit element, logic element and control loop identified in the electrical schematic diagram, clarify the positions and connection relationships of each element, and deduce the control logic of the module circuit according to the functional characteristics of each element to determine the start, stop, interlock and interlock relationships between various devices; Determine various performance requirements required by the module according to the control logic and equipment characteristics; the performance requirements include the measurement range of sensors, control parameters of actuators, and set values of timers and counters.
3. A PLC parametric automatic programming method based on an electrical schematic diagram according to claim 1, characterized in that, Port parameterized configuration includes: Determine the use of each port, set the electrical parameters of the port, and install the hardware interface; According to the uses and electrical parameters of each port after setting, create a port mapping table. In this port mapping table, the input ports of the PLC are associated with external sensors or signal sources, and the output ports of the PLC are associated with actuating elements.
4. A PLC parametric automatic programming method based on an electrical schematic diagram according to claim 1, characterized in that, Import the generated PLC code into the PLC programming software, check whether there are syntax errors or logical errors, and if so, modify manually or regenerate; Test the PLC code using the actual equipment, simulate the operation process of the production line, verify the logical correctness of the control program and the rationality of parameter settings. Modify and optimize the control program according to the operation status and parameter changes of the production line. If there are problems, adjust the parameters or regenerate them. Save the finally optimized and adjusted PLC code and deploy it to the target equipment.
5. A PLC parametric automatic programming system based on an electrical schematic diagram, which adopts a PLC parametric automatic programming method based on an electrical schematic diagram as described in any one of claims 1-4, characterized in that, Including: A drawing parsing module, which is used to obtain the standardized electrical schematic diagram of the stamping production line, automatically parse the key information in the electrical schematic diagram, divide the stamping production line into several modules, and extract the control logic and performance requirements of each module. A parameterized configuration module, which is used to set the basic parameters of the PLC and the key parameters during the stamping process according to the operation requirements of the stamping production line and the product specifications, and perform parameterized configuration on the input and output ports of the PLC. An automatic coding module, which is used to introduce the key parameters as programming variables into the coding program, and perform automatic PLC programming according to the control logic, performance requirements and parameterized configuration results to obtain the encoded PLC control code. An optimization and debugging module, which is used to simulate the operation of the stamping production line according to the PLC control code, and adjust and optimize the key parameters according to the operation results until the operation results meet the operation requirements.
6. The PLC parametric automatic programming system based on an electrical schematic diagram according to claim 5, wherein The key information includes: each electrical component and its model, function, characteristics and typical connection method; the connection control interface with the electrical and mechanical equipment; the main circuit of the control system and the control circuit of the control system. Among them, automatically parsing the key information in the electrical schematic diagram includes: Using an image recognition algorithm to recognize the electrical symbols in the electrical schematic diagram, and perform symbol matching in a preset symbol database to determine the corresponding electrical component and its model, function, characteristics and typical connection method. Determine and mark the connection control interface with the electrical and mechanical equipment according to the functional requirements of the stamping production line. Identify the main circuit and control circuit in the electrical schematic diagram.
7. An electronic device, characterized in that, Including a memory, a processor, and computer instructions stored on the memory and running on the processor. When the computer instructions are run by the processor, the steps of a method for automatic PLC parameterized programming based on an electrical schematic diagram as described in any one of claims 1-4 are completed.
8. A computer-readable storage medium, characterized in that, For storing computer instructions, when the computer instructions are executed by the processor, the steps of a method for automatic PLC parameterized programming based on an electrical schematic diagram as described in any one of claims 1-4 are completed.
Citation Information
Patent Citations
Method for achieving teaching function of mechanical arm based on instruction of PLC humanoid robot
CN110271009A
Intelligent formal verification method for PLC logic programming
CN110674049A
Generation method of electrical design drawing and generation method of PLC program
CN116300678A