PLC parameterized automatic programming method and system based on electrical schematic diagram
By analyzing the electrical schematic diagram of the stamping production line and performing automatic programming, the problems of difficulty in traditional PLC programming in the stamping production line are solved, and the automation and parameterization of PLC programming are realized, and programming efficiency and system performance are improved.
Patent Information
- Application Number
- CN202510486765.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-04-18
AI Technical Summary
Traditional PLC programming has problems such as high programming difficulty, difficulty in program adjustment and modification, and difficulty in achieving parameterized adjustment in stamping production lines, resulting in low programming efficiency and high 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 programming difficulty and maintenance costs, improves programming efficiency and system performance, and is suitable for stamping production lines of all sizes.
Smart Images

Figure CN120010377A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of industrial automation control technology, 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 section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In the field of industrial automation, 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 industry, the traditional PLC programming method faces many challenges: (1) Traditional PLC programming mainly relies on professional programmers to manually write codes. PLC programming involves knowledge in multiple fields such as electrical, control, and computer. The PLC programming language and tools are also relatively complex. The programming is difficult and requires programmers to have deep 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 needs. (2) The stamping production process is complex. When facing different products, molds and production requirements, the control logic needs to be adjusted frequently. Due to the professionalism and closedness of the PLC programming language, program modification is difficult and requires professional technicians to operate. The program modification and debugging process is cumbersome, time-consuming and laborious. Moreover, once the PLC control system fails, it needs to be repaired and replaced, which may involve more complex electrical and mechanical operations, increase maintenance costs, and may affect the stability of the system; (3) There are many types of equipment in the stamping production line, and coordinated control is difficult. Traditional PLC programming cannot achieve flexible parameterized adjustments, which makes it difficult to further improve production efficiency and quality. Summary of the invention
[0004] In order to address the deficiencies of the above-mentioned prior art, the present invention provides a PLC parametric automatic programming method and system based on an electrical schematic diagram. Aiming at the stamping production line of the discrete manufacturing industry, the method and system automatically identify the electrical components and control logic in the schematic diagram by analyzing the electrical schematic diagram of the stamping production line, set key parameters and configure the PLC port according to the actual needs of the stamping production line, and use a parametric method to quickly and automatically encode the PLC control program according to the port configuration and control logic. In this way, the PLC control program can be automatically generated or assisted in generation according to different production needs and parameters, thereby realizing the automation and parameterization of PLC programming, and solving the problems of difficult PLC control programming of traditional stamping production lines, difficult program adjustment and modification, and difficulty in achieving parametric adjustment.
[0005] In a first aspect, the present invention provides a PLC parameter automatic programming method based on an electrical schematic diagram.
[0006] A PLC parameterized automatic programming method based on an electrical schematic diagram, comprising: 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; According to the operation requirements and product specifications of the stamping production line, set the basic parameters of the PLC and the key parameters in the stamping process, and parameterize the PLC input and output ports; Introduce key parameters into the coding program as programming variables, perform PLC automatic programming according to control logic, performance requirements and parameterized configuration results, and obtain the encoded PLC control code; Perform simulated operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
[0007] In a second aspect, the present invention provides a PLC parameterized automatic programming system based on electrical schematics.
[0008] A PLC parameterized automatic programming system based on electrical schematic diagram, comprising: Drawing parsing module, 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; The parameterized configuration module is used to set the basic parameters of the PLC and the key parameters in the stamping process according to the operation requirements of the stamping production line and product specifications, and to perform parameterized configuration of the PLC input and output ports; Automatic coding module, used to introduce key parameters as programming variables into the coding program, perform automatic PLC programming according to control logic, performance requirements and parameterized configuration results, and obtain the encoded PLC control code; The optimization and debugging module is used to simulate the operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
[0009] In a third aspect, the present invention further provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the steps of the method described in the first aspect are completed.
[0010] In a fourth aspect, the present invention further provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, complete the steps of the method described in the first aspect.
[0011] One or more of the above technical solutions have the following beneficial effects: 1. The present invention provides a PLC parameterized automatic programming method and system based on electrical schematic diagrams. Aiming at the stamping production line of the discrete manufacturing industry, the method and system automatically identify the electrical components and control logic in the schematic diagram by analyzing the electrical schematic diagram of the stamping production line, set key parameters and configure the PLC port according to the actual needs of the stamping production line, and use parameterized methods to quickly and automatically encode the PLC control program according to the port configuration and control logic. In this way, the PLC control program can be automatically generated or assisted in generation according to different production needs and parameters, realizing the automation and parameterization of PLC programming, and solving the problems of difficult PLC control programming of traditional stamping production lines, difficult program adjustment and modification, and difficulty in parameterized adjustment.
[0012] 2. The PLC parametric automatic programming method based on the electrical schematic diagram of the stamping production line provided by the present invention can be used as an intelligent auxiliary tool for PLC programming. According to the design drawings and parametric configuration, it can automatically generate PLC codes that meet standards and specifications. On the one hand, it deeply integrates the electrical schematic diagram with PLC programming, and automatically generates the corresponding PLC program code by analyzing the component connections, signal flows and logical relationships in the electrical schematic diagram, thereby greatly reducing the workload of manual programming, reducing labor costs, and improving programming efficiency and accuracy; on the other hand, by introducing the concept of parametric programming, the PLC program can be quickly adjusted by modifying the preset parameters (such as equipment model, input and output point configuration, control logic parameters, etc.) to adapt to the needs of different stamping production lines, thereby improving the efficiency and flexibility of PLC programming, and improving system performance and reliability, so that the method can be widely used in stamping production lines of various sizes.
[0013] 3. The present invention also proposes an automated generation and verification method. After the PLC program is automatically generated, automatic verification is performed, including steps such as logic verification, signal integrity check, and simulated 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.
[0014] 4. The present invention realizes modular encapsulation of control logic and algorithm by establishing a standardized model library, thereby improving the standardization of programming; adopts a parameterized configuration method to reduce the workload of manual coding and improve programming efficiency; and by adjusting parameters, it is easy to realize the control requirements of different devices and improve programming flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0016] Figure 1 This is a business flow chart of the PLC parameterized automatic programming method according to an embodiment of the present invention; Figure 2 A flow chart of automatically adjusting and optimizing parameters in an embodiment of the present invention; Figure 3 This is a schematic diagram of information extracted based on an electrical schematic diagram in an embodiment of the present invention; Figure 4 It is a schematic diagram of the logical control relationship extracted based on the electrical schematic diagram in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] It should be noted that the following detailed descriptions are exemplary only, are intended to describe specific embodiments, are intended to provide further explanation of the present invention, and are not intended to limit exemplary embodiments according to the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those of ordinary skill in the art 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, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0018] Embodiment 1 The present embodiment provides a PLC parametric automatic programming method based on the electrical schematic diagram of a stamping production line. It adopts a modular design concept to decompose the PLC control program of the stamping production line into multiple reusable modules. These modules can be flexibly combined and expanded according to different production requirements and equipment configurations, thereby reducing programming complexity and development costs, and facilitating subsequent maintenance and upgrades. By adopting a parametric configuration method, the PLC control program can be automatically generated or assisted in generation according to different production requirements and parameters, thereby 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.
[0019] The PLC parameterized automatic programming method based on the electrical schematic diagram applicable to the stamping production line proposed in this embodiment is as follows: Figure 1 As shown, the following steps are included: 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; According to the operation requirements and product specifications of the stamping production line, set the basic parameters of the PLC and the key parameters in the stamping process, and parameterize the PLC input and output ports; Introduce key parameters into the coding program as programming variables, perform PLC automatic programming according to control logic, performance requirements and parameterized configuration results, and obtain the encoded PLC control code; Perform simulated operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
[0020] The above-mentioned programming method of this embodiment is applicable to PLC devices of various types and brands, and supports multiple programming languages and formats, such as ladder diagram, instruction list, SFC (sequential function flow chart language), ST (structured text language), etc.
[0021] The following content introduces the PLC parameter automatic programming method proposed in this embodiment in more detail.
[0022] In step S1, the standardized electrical schematic diagram of the stamping production line is obtained. Considering that the relationship between the electrical part and the various components of the production line and the working principle are described in detail in the drawing, the control logic and performance requirements can be extracted through analysis. The final analysis result can be stored in a database or XML format to facilitate the subsequent calling and processing of the programming engine. To this end, this embodiment uses the existing mature software platform for software development, integrates the parsing design drawing component into the development software, and uses the parsing design drawing component tool integrated in the software to automatically identify and design key information such as various electrical components in the standardized electrical schematic drawings, the connection control interface with the mechanical equipment, and the electrical connection circuit (such as an electrical circuit composed of series connection, parallel connection, etc.).
[0023] In this embodiment, the drawing format of the standardized electrical schematic diagram is ELX or ELP format. In fact, the drawing is designed by EPLAN software. EPLAN is a professional electrical computer-aided design software that can realize the creation and management of electrical projects, sharing of files and patterns, etc. It is based on electrical design, including electrical design, fluid design, instrument design, machinery and other fields.
[0024] Specifically, automatically parsing the key information in the electrical schematic diagram includes the following steps: (1) Use image recognition algorithms to identify electrical symbols in electrical schematics and perform symbol matching in a preset symbol database to determine the corresponding electrical components (which may be referred to as electrical elements) and their models, functions, characteristics, and typical connection methods.
[0025] Before parsing and identification, create a database containing various electrical symbols (i.e., symbols of electrical components) that may appear in the electrical schematic diagram of the stamping production line. The 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. For example, the contactor symbol usually represents a component that can control the on and off of a large current circuit, which includes two main parts: a coil and a contact.
[0026] The electrical schematic diagram is scanned using an image recognition algorithm to identify the various electrical symbols therein. The image recognition algorithm used can be trained to recognize different symbol shapes, colors, and annotations; further, considering that electrical symbols are often annotated with text in electrical schematic diagrams, semantic analysis technology can be introduced in the above recognition process to parse the text description in the design drawings and extract key information such as the model, specification, position relationship, and electrical parameters of each electrical component. For example, for a specific sensor symbol, it is identified by its unique shape and annotation (such as model, parameter, etc.).
[0027] On this basis, according to the recognized electrical symbols, symbol matching is performed in the preset symbol database to determine the corresponding electrical components and their models, functions, characteristics and typical connection methods.
[0028] (2) According to the functional requirements of the stamping production line, determine and mark the connection control interface with the electrical mechanical equipment for subsequent analysis. For example, in order to achieve the functional requirements of processing and forming car doors, it is necessary to use servo motors to provide a power source and accurately control parameters such as pressure, speed, and position. At this time, the connection control interface with electrical mechanical equipment such as stamping machines, feeding equipment, mold replacement equipment, and testing equipment can be clearly identified. Furthermore, at this time, different colors or annotations can be used to highlight the connection control interfaces of key parts such as the motor control circuit of the stamping machine, the sensors and drivers of the feeding equipment, etc.
[0029] (3) Identify the main circuit and control circuit in the electrical schematic. In the electrical schematic, 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, contactor main contacts, fuses, thermal relays, motors, etc. are identified. Usually, these components are mainly used to transmit and control large currents. The electrical control circuit where the above components are located is regarded as the main circuit; other circuits, such as relays, contactor coils, auxiliary contacts, buttons, switches and other control electrical appliances, and PLC controllers, are usually control circuits. In addition, the main circuit is usually located above or on the left side of the drawing and is drawn with thick solid lines, while the control circuit is generally drawn below or on the right side of the main circuit and is drawn with thin solid lines. Therefore, matching and identification can be performed based on the two aspects of electrical components + drawn lines to ensure the accuracy of the main circuit and control circuit identification.
[0030] By distinguishing between the main loop and the control loop, the working principle and control logic of the entire system can be obtained. For example, when analyzing the electrical schematic diagram of a stamping production line, first determine the main loop where the stamping machine motor is located, and then determine the control logic for control electrical appliances such as PLC in the control loop. Based on this control logic, the start, stop and speed regulation of the motor can be controlled.
[0031] Through the above method, the key information in the electrical schematic diagram is automatically parsed out, including: various electrical components and their models, functions, characteristics and typical connection methods; connection control interfaces with electrical mechanical equipment; control system main circuits and control system control circuits, etc.
[0032] As another implementation method, the stamping production line is divided into several functional modules, including a feeding module, a stamping module, a mold replacement module, a detection module, etc. Each module has relatively independent functions and control logic, and the control logic and performance requirements of each module are extracted to facilitate subsequent parameterized programming. In this embodiment, the function library component on the software development tool is used to divide the above functional modules. The component is a function library that is encrypted and packaged according to the business logic and imported into the software development platform.
[0033] For each module divided as above, the above analysis method is used to extract the control logic and performance requirements of each module. Specifically, according to the connection method of each circuit element (such as contactor, relay, sensor, PLC input and output point, etc.), logic element (such as AND gate, OR gate, NOT gate, etc.) and control circuit identified in the electrical schematic diagram, the position and connection relationship of each element are clarified, and according to the functional characteristics of each element (such as the on-off logic of the contactor, the normally open and normally closed contact logic of the relay, etc.), the control logic of the module circuit is derived to determine the start, stop, interlock and interlock relationship between each device. For example, by analyzing the interlock relationship of multiple relays, the start and stop logic of a certain device is determined. After that, according to the control logic and device characteristics, the various performance requirements required by the system / module are determined, which include the measurement range of the sensor, the control parameters of the actuator (such as the speed and torque of the motor, etc.), the setting value of the timer and counter, etc.
[0034] For the interaction between various functional modules, the signal transmission relationship between modules can be used to realize the sending and receiving of signals through port information in the code. For example, when the feeding module completes the feeding task, it sends the "material has been delivered" signal to the stamping module by setting a specific output port state or shared variable. The stamping module will detect the signal through the input processing function in its code and start the stamping operation.
[0035] At the same time, the performance requirements of different functional modules have certain correlation and matching. For example, 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 high, the feeding speed of the feeding module needs to be increased accordingly to ensure the continuous supply of materials. The above operation logic is manually set by the actual business needs.
[0036] In step S2, hardware configuration and variable declaration are performed according to the key information in the electrical schematic diagram automatically parsed above, 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 PLC input and output ports are parameterized.
[0037] First, according to the functional modules and control logic of the design drawing in step S1, set the software parameters (i.e., basic parameters) of the corresponding PLC, including defining variable names, data types, storage addresses, etc., so that these parameters can be referenced and modified during the programming process; at the same time, it is also necessary to configure the communication parameters of the PLC to facilitate data transmission with the host computer or other control systems.
[0038] In addition, for the above-mentioned basic parameters and key parameters, each key parameter can be manually entered in the parameter setting window or menu corresponding to the programming interface, as well as in the corresponding variable address in the program block or data block; as another implementation method, the parameter setting can also be achieved by importing data files through a set Excel template (including column headers, such as "parameter name", "parameter value", "unit", etc.); or, in the parameter setting interface on the HMI (human-machine interface), such as the touch screen setting interface of the press, the parameter value is entered through touch operation, and the PLC receives and stores the input parameters for controlling the stamping production line.
[0039] Then, choose to configure the input and output ports of the PLC on the development software, specifically: determine the purpose of each port (such as input, output, special functions, etc.), set the electrical parameters of the port (such as voltage, current, resistance, etc.), and install the necessary hardware interfaces (such as expansion modules, communication modules, etc.); according to the purpose and electrical parameters of each port after setting, create a port mapping table, in which the input port of the PLC is associated with the corresponding external sensor or signal source (such as the material arrival sensor of the feeding module, the pressure sensor of the stamping module, etc.), and the output port of the PLC is associated with the corresponding actuator (such as a motor driver, a solenoid valve, etc.).
[0040] As another implementation method, a parameter verification mechanism is introduced to ensure that the parameter value input by the user is within a reasonable range to 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 recorded at the same time, which is used to determine the data type and value range according to the electrical parameters during the encoding process. For example, the voltage range of a certain input port is 0~10V. When encoding, the corresponding analog input is converted into a suitable digital value, and some specific conversion formulas are required.
[0041] Step S3, introduce key parameters as programming variables into the encoding program, perform PLC automatic programming according to the control logic and parameterized configuration results, obtain the encoded PLC control code, and complete the writing and modification program.
[0042] For each functional module, a modular programming method is used to write the corresponding control program. In combination with the above content, according to the design drawings and parameter settings, the control logic of the system is decomposed into several subroutines or function blocks, each of which completes a specific control task. In the specific automatic coding process, the PLC parameterization function is fully utilized, and key parameters (including equipment parameters and process parameters, such as stamping speed, pressure setting value, mold position, material thickness, stamping times, etc.) are introduced into the program as programming variables. Automatic programming is performed according to the control logic and parameterization configuration results to obtain the encoded PLC control code. By modifying the value of the variable in the code, flexible adjustment and optimization of the production line operation parameters can be achieved.
[0043] First, according to the port configuration of step S2, obtain the purpose and electrical parameters of the PLC input port 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, define bit variables or byte variables to represent their states. For example, for the input port of the stamping production line, define a structure to store information such as the sensor status of the feeding module (such as whether the material is in place), the status of the stamping module (such as whether it is in the stamping process), etc.
[0044] Secondly, according to the input data structure, a specific function (such as digital input reading function, analog input reading function, communication interface input reading function, etc.) reads and processes the data of the input port. Specifically, for digital input ports, the function can directly read the port status and store it in the corresponding variable; for analog input ports, the function performs conversion calculations based on electrical parameters. For example, for a 0~10V analog input port, the PLC analog-to-digital conversion resolution is 10 bits. The function uses a formula to convert the read digital value into the corresponding voltage value, and then judges the corresponding physical quantity status (such as whether the pressure is within the normal range) information based on the voltage value.
[0045] After that, according to the control logic in the design drawings, the corresponding logical judgment statements and conditional control statements are automatically written and generated. The key parameters as programming variables are introduced in the statement, and the corresponding control actions can be judged and executed according to the changes in the input key parameter data and the current status of the production line to realize the automatic operation of the production line.
[0046] In PLC programming, for the control of stepper 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 stepper motor, it is necessary to control its rotation to a specific angle, and the required number of pulses can be calculated using this formula: ; The total number of pulses is the number of pulses required for the motor to rotate one circle, and the target angle is the angle at which the motor is expected to rotate. The above calculation formula is not directly reflected in the PLC program code, but is used as a reference for system design or debugging. The PLC program mainly controls the production line equipment through logical expressions, ladder diagrams or structured text.
[0047] In practical applications, PLC programming focuses on writing program codes based on specific control requirements and the electrical characteristics of the equipment. When designing PLC parametric programming algorithm models, the focus is on automatically generating program codes that comply with PLC programming specifications based on electrical schematics and control logic.
[0048] Adopting the idea of parametric programming, the equipment parameters and process parameters of the stamping production line are used as input variables, processed through the parametric module in the PLC program, and the corresponding control logic is generated. By configuring the input equipment parameters and process parameters, such as the stroke, speed, pressure, etc. of the punch press, as well as the process flow and cycle time of the production line, the corresponding control logic is automatically generated, including the action control of the punch press, material conveying control, etc. Among them: Regarding the punch press action control logic, when the start signal is received, the punch press slider is controlled to move downward at a specific speed according to the punch press stroke and speed setting values in the parameters, stops moving downward after reaching the set stroke position, and then quickly recovers; if abnormal resistance is detected during the downward process (which can be fed back through a pressure sensor) and exceeds the set safety threshold, the punch press action is stopped immediately and an alarm is issued.
[0049] 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 transport materials from one machine tool to the next at a stable speed; when it is detected that the material has arrived at a specific position, the corresponding sensor is triggered to notify the PLC to proceed to the next operation.
[0050] As another implementation method, error handling and alarm mechanisms are added during the programming process. When an abnormality or failure occurs on the production line, the timer, comparison instruction or data check set by the PLC program can detect digital signals, analog signals and communication failures in a timely manner, and trigger corresponding alarm signals according to the program settings to prompt the operator to handle it. At the same time, the program should include certain fault tolerance and recovery strategies to ensure the stable operation of the production line.
[0051] Step S4, simulate the operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
[0052] In this embodiment, debugging is performed in the PLC programming software, and the generated PLC code is imported into the PLC programming software to check whether there are syntax errors or logic errors. If there are any, they are manually modified or regenerated; then, the function and performance of the PLC code are tested using actual equipment, the operation process of the production line is simulated, the logical correctness of the control program and the rationality of the parameter setting are verified, the operating status and parameter changes of the production line are observed, and the control program is modified and optimized as necessary according to the debugging results. If there are any problems, the parameters are adjusted or regenerated; finally, the PLC code is saved and deployed to the target device.
[0053] Taking a certain automobile parts stamping production line as an example, the above method is further explained. The product control requirement is to produce different types of automobile parts stamping parts, and it is required to ensure product quality and improve production efficiency. Figure 2 As shown, based on the above requirements, the specific steps are as follows: First, the electrical schematics of the stamping production line were parsed to extract key information from the electrical schematics (EPLAN format drawings), that is, the models, position relationships, electrical parameters, etc. of the electrical components were extracted. Figure 3 The information about parameter measurement points, electrical components and logical functions shown in the figure can be used to identify Figure 4 The different logical relationships of AND gate, OR gate, NOT gate, etc. are shown. By tracing the connections of these logical symbols, the control logic of the system, such as start, stop, interlock, interlock, etc., can be determined.
[0054] The above-mentioned design drawings adopt standardized symbols and drawing specifications, and the drawings are analyzed and interpreted through unified database standards to ensure the universality of the drawings within the scope of application.
[0055] At the same time, the product parameter settings and product models are clearly defined: a variety of automotive parts models to choose from; material thickness: [X] mm to [Y] mm; number of stamping times: [Z] times per minute.
[0056] Secondly, according to the needs of the production line and product specifications, set the PLC hardware configuration and basic parameters and key parameters in the stamping process, such as material thickness, stamping times, etc., and select the corresponding mold number. According to the needs 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, the corresponding measurement point variables are sorted and collected. The measurement point variables have multiple types, as shown in Table 1 below.
[0057] Table 1: Measurement point variables and their types
[0058] Finally, the PLC parametric programming tool is called to automatically generate the PLC control program framework based on the design drawing analysis results and parameter setting information, and integrate the customized control logic code segment, including the equipment's start, stop, stamping action control, mold switching and other logic.
[0059] Among them, the AutoThink development software tool is used for classification editing to generate an EXCEL format that can support import, and then the measurement point variables are imported to complete the parameterized input configuration. For the user interface of the stamping production line, the production requirements and parameters are input. The interface includes modules such as product type selection, mold parameter setting, and stamping process parameter input. By identifying the control relationship between each component, such as when the sensor detects the material, it sends a signal to the PLC, and the PLC controls the material to be pushed under the stamping machine, these control relationships are converted into logical expressions or ladder diagrams that the PLC can understand.
[0060] In addition, it also includes: editing programs, organizing POUs (i.e. program components), using development software tools (Hollysys's AutoThink, Siemens's TIA Portal, Mitsubishi's GX Works, Omron's CX-Programmer, etc.), using measurement point lists, analyzing control logic diagrams, and drawing on previous projects to generate POUs, and generating a format that AT supports import by organizing the logical relationships between measurement points and special function blocks such as communication and servo, and using these development software to debug and run PLC programs.
[0061] As another implementation method, for the parameters that need to be configured and set in parametric programming, in addition to being determined according to the operating 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 the specific stamping production line from the database, and then perform PLC automatic programming. The database can be pre-set and continuously updated by the user to meet different production needs. In addition, sensors are used to monitor the operating status of the stamping production line in real time, dynamically adjust parameters according to the monitored data, and perform PLC programming. For example, key parameters in the stamping process are obtained through pressure sensors, displacement sensors, etc., and the control parameters in the PLC program are automatically optimized.
[0062] Embodiment 2 This embodiment provides a PLC parameterized automatic programming system based on an electrical schematic diagram, comprising: Drawing parsing module, 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; The parameterized configuration module is used to set the basic parameters of the PLC and the key parameters in the stamping process according to the operation requirements of the stamping production line and product specifications, and to perform parameterized configuration of the PLC input and output ports; Automatic coding module, used to introduce key parameters as programming variables into the coding program, perform automatic PLC programming according to control logic, performance requirements and parameterized configuration results, and obtain the encoded PLC control code; The optimization and debugging module is used to simulate the operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
[0063] Embodiment 3 This embodiment provides an electronic device, including a memory and a processor, and computer instructions stored in the memory and running on the processor. When the computer instructions are run by the processor, the steps in the PLC parameter automatic programming method based on the electrical schematic diagram as described above are completed.
[0064] Embodiment 4 This embodiment also provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the steps in the PLC parameter automatic programming method based on the electrical schematic diagram as described above are completed.
[0065] The steps involved in the above embodiments 2 to 4 correspond to the method embodiment 1, and the specific implementation methods can refer to the relevant description part of embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including 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.
[0066] Those skilled in the art should understand that the modules or steps of the present invention described above can be implemented by a general-purpose computer device, or alternatively, they can be implemented by a program code 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 made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. The present invention is not limited to any specific combination of hardware and software.
[0067] The above description is only a preferred embodiment of the present invention. Although the specific implementation mode of the present invention is described in conjunction with the accompanying drawings, it is not a limitation of the protection scope of the present invention. Those skilled in the art should understand that on the basis of the technical solution of the present invention, various modifications or variations that can be made by those skilled in the art without creative work are still within the protection scope of the present invention.
Claims
1. A PLC parameterized automatic programming method based on electrical schematic diagram, characterized in that: include: 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; According to the operation requirements and product specifications of the stamping production line, set the basic parameters of the PLC and the key parameters in the stamping process, and parameterize the PLC input and output ports; Introduce key parameters into the coding program as programming variables, perform PLC automatic programming according to control logic, performance requirements and parameterized configuration results, and obtain the encoded PLC control code; Perform simulated operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
2. A PLC parameterized automatic programming method based on an electrical schematic diagram as claimed in claim 1, characterized in that: The key information includes: various electrical components and their models, functions, characteristics and typical connection methods; connection control interfaces with electrical mechanical equipment; control system main circuits and control system control circuits; Among them, the key information in the electrical schematic diagram is automatically parsed, including: Use image recognition algorithms to identify electrical symbols in electrical schematics and match them in a preset symbol database to determine the corresponding electrical components and their models, functions, characteristics, and typical connection methods; According to the functional requirements of the stamping production line, determine and mark the connection control interface with the electrical mechanical equipment; Identify the main and control circuits in electrical schematics.
3. A PLC parameterized automatic programming method based on electrical schematic diagram as claimed in claim 1, characterized in that: For each module, extract the control logic and performance requirements, including: According to the connection mode of each circuit element, logic element and control loop identified in the electrical schematic diagram, the position and connection relationship of each element are clarified. According to the functional characteristics of each element, the control logic of the module circuit is derived to determine the start, stop, interlock and interlock relationship between each device; According to the control logic and the device characteristics, various performance requirements required by the module are determined; the performance requirements include the measurement range of the sensor, the control parameters of the actuator, and the setting values of the timer and counter.
4. A PLC parameterized automatic programming method based on electrical schematic diagram as claimed in claim 1, characterized in that: Port parameterization configuration, including: Determine the purpose of each port, set the electrical parameters of the port, and install the hardware interface; According to the purpose and electrical parameters of each port after setting, a port mapping table is created, in which the input port of the PLC is associated with the external sensor or signal source, and the output port of the PLC is associated with the actuator.
5. A PLC parameterized automatic programming method based on electrical schematic diagram as claimed in claim 1, characterized in that: Key parameters are introduced into the coding program as programming variables, and PLC automatic programming is performed 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 purpose and electrical parameters of the PLC input port and define the input data structure; According to the input data structure, the data of the input port is read and processed by a specific function; Introduce key parameter data as programming variables, combine the control logic and performance requirements extracted from the drawings, and automatically write and generate corresponding logical judgment statements and conditional control statements.
6. A PLC parameterized automatic programming method based on electrical schematic diagram as claimed in claim 1, characterized in that: Import the generated PLC code into the PLC programming software and check whether there are syntax errors or logic errors. If there are any, modify or regenerate them manually. Use actual equipment to test 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, modify and optimize the control program according to the operation status of the production line and parameter changes, and adjust the parameters or regenerate if there are any problems; Save the final optimized PLC code and deploy it to the target device.
7. A PLC parameterized automatic programming system based on electrical schematic diagram, characterized in that: include: Drawing parsing module, 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; The parameterized configuration module is used to set the basic parameters of the PLC and the key parameters in the stamping process according to the operation requirements of the stamping production line and product specifications, and to perform parameterized configuration of the PLC input and output ports; Automatic coding module, used to introduce key parameters as programming variables into the coding program, perform automatic PLC programming according to control logic, performance requirements and parameterized configuration results, and obtain the encoded PLC control code; The optimization and debugging module is used to simulate the operation of the stamping production line according to the PLC control code, and adjust and optimize key parameters according to the operation results until the operation results meet the operation requirements.
8. A PLC parameterized automatic programming system based on electrical schematic diagram as claimed in claim 7, characterized in that: The key information includes: various electrical components and their models, functions, characteristics and typical connection methods; connection control interfaces with electrical mechanical equipment; control system main circuits and control system control circuits; Among them, the key information in the electrical schematic diagram is automatically parsed, including: Use image recognition algorithms to identify electrical symbols in electrical schematics and match them in a preset symbol database to determine the corresponding electrical components and their models, functions, characteristics, and typical connection methods; According to the functional requirements of the stamping production line, determine and mark the connection control interface with the electrical mechanical equipment; Identify the main and control circuits in electrical schematics.
9. An electronic device, characterized in that: The invention comprises a memory and a processor and computer instructions stored in the memory and executed on the processor. When the computer instructions are executed by the processor, the steps of a PLC parameter automatic programming method based on an electrical schematic diagram as claimed in any one of claims 1 to 6 are completed.
10. A computer-readable storage medium, characterized in that: Used to store computer instructions, which, when executed by a processor, complete the steps of a PLC parameter automatic programming method based on an electrical schematic diagram as described in any one of claims 1-6.
Citation Information
Patent Citations
Universal electric-controlled system fault locating method
CN101114164A
Control method of programmable logic controller
CN108932125A
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
Method for compiling delay logic schematic diagram to byte code
CN113608491A
Cited By
Shaft function implementation method and related equipment
CN121433119A
PLC programming method and system based on state machine model in multi-station production line
CN121541560A
Plc programming method and system based on state machine model in multi-station production line
CN121541560B