A virtual debugging method for a servo driving device based on a new energy lithium battery industry
By constructing a virtual simulation runtime environment and using VBA to generate servo driver messages, the issues of universality and cost in servo controller simulation debugging in the lithium battery industry were resolved, enabling the discovery of early design problems and safe and reliable virtual debugging.
Patent Information
- Application Number
- CN202310206226.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2043-03-07
AI Technical Summary
In the existing technology, the simulation and debugging methods of servo controllers are not widely applicable in the lithium battery industry. They require many external software links and have high construction costs, which cannot meet the needs of non-standard virtual simulation.
A virtual debugging method for servo drive devices based on the new energy lithium battery industry is adopted. By constructing a virtual simulation environment, using VBA to generate servo drive messages, and adding logic function blocks and intelligent components in the virtual simulation environment, joint testing is carried out in conjunction with a PLC simulator.
It enables the early detection of design problems, reduces on-site commissioning time, lowers risks, improves safety and reliability, and reduces construction costs.
Smart Images

Figure CN116795660B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of industrial virtual simulation devices. BACKGROUND
[0002] At present, under the driving of the rapid growth of the global electric vehicle market, the new energy lithium battery industry is developing rapidly, and a large number of servo driving devices are used in equipment. The simulation debugging of the servo controller generally adopts the method of externally connecting the simulation function library software of the virtual 3D engine.
[0003] The problems of the method are: first, the universality is not strong for other non-standard functional blocks or non-functional library brand devices; second, there are many external software links, the construction cost is high, the construction period is long, and it cannot adapt to the virtual simulation demand of the non-standardization of the lithium battery industry. SUMMARY
[0004] In order to solve the above problems existing in the method of externally connecting the simulation function library software of the virtual 3D engine, the present application provides a servo driving device virtual debugging method based on the new energy lithium battery industry.
[0005] The technical scheme adopted by the present application to achieve the above-mentioned purpose is: a servo driving device virtual debugging method based on the new energy lithium battery industry, comprising the following steps:
[0006] Step 1, constructing a virtual simulation running environment;
[0007] Step 2, generating a servo driver message through VBA one key;
[0008] Step 3, writing the function logic block of the virtual simulation running environment:
[0009] Step 4, writing the intelligent component of the virtual simulation running environment;
[0010] Step 5, joint testing of the virtual simulation running environment and the PLC simulator.
[0011] In the step 1,
[0012] Step 11, using a data format conversion tool to convert mechanical design 3D data into a data format specified by a virtual simulation engine on a PC end, and importing it into the virtual simulation engine;
[0013] Step 12, adjusting the position and direction of the mechanical design 3D data in the virtual simulation engine according to the scheme layout on the PC end;
[0014] Step 13, splitting the motion mechanism and defining the posture of the mechanical design 3D data in the virtual simulation engine on the PC end.
[0015] In the step 2,
[0016] Step 21, by analyzing the hardware configuration in the PLC program, the first address of the servo drive device is obtained;
[0017] Step 22, using the VBA development tool in EXCEL to make plug-ins, input the first address obtained in step 21, and generate servo driver messages on the PC side with one key;
[0018] Step 23, import the servo message generated in step 23 into the PLC program symbol table and virtual simulation running environment;
[0019] In step 3,
[0020] Step 31, create a functional logic block in the virtual simulation running environment;
[0021] Step 32, create STW1_Bit0 control word in the input pin of the functional logic block;
[0022] Step 33, create ZSW1-ZSW5 status word in the output pin of the functional logic block;
[0023] Step 34, add logical relationship to the ZSW1-ZSW5 status word of the functional logic block;
[0024] In step 4,
[0025] Step 41, create intelligent components for mechanical design data in step 13 in the virtual simulation running environment;
[0026] Step 42, create STW1_Bit8, STW1_Bit9 and other control words in the input pin of the intelligent component;
[0027] Step 43, create ZSW1_Bit10, ZSW1_Bit13 and other status words in the output pin of the intelligent component;
[0028] Step 44, create two modes of point motion and position motion in the action editing of the intelligent component, and add corresponding logical relationship with input and output pins.
[0029] In step 5,
[0030] Step 51, download the PLC offline program or field program to the PLC simulator on the PC side;
[0031] Step 52, establish the IO signal link between the PLC simulator on the PC side and the virtual simulation running environment;
[0032] Step 53, complete the PLC program verification of the servo drive device through simulation running.
[0033] A servo drive device virtual debugging device based on a new energy lithium battery industry, characterized by: comprising a memory and a processor, the memory is used for storing a computer program, the computer program is used for being loaded by the processor to execute the above-mentioned method.
[0034] A computer readable storage medium of a servo drive device virtual debugging method based on a new energy lithium battery industry, characterized by: the storage medium has a computer program stored therein, and the computer program is adapted to be loaded by a processor to execute the above-mentioned method.
[0035] The servo drive device virtual debugging method based on the new energy lithium battery industry of the application generates the required message of the servo drive device by one key through the development of the VBA module in EXCEL, directly imports into the virtual simulation environment, and completes the virtual debugging of the servo drive device by adding logical function blocks and intelligent components to the mechanical design data in the virtual simulation environment. The method can be used for the servo drive device mechanical design interference verification, electrical design program verification and other work in the new energy lithium battery industry, provides early verification, discovers design problems in advance, reduces field changes, and reduces the construction cost, construction period and other shortcomings of the traditional method. The application of the virtual debugging technology reduces the on-site debugging time, reduces the collision risk, and is more safe and reliable. BRIEF DESCRIPTION OF DRAWINGS
[0036] Figure 1 It is a virtual simulation running environment construction flowchart in the embodiment of the application.
[0037] Figure 2 It is a function call flowchart in the VBA development environment in the embodiment of the application. DETAILED DESCRIPTION
[0038] The servo drive device virtual debugging method based on the new energy lithium battery industry of the application is as shown in Figure 1 The method comprises the following specific steps:
[0039] Step 1, constructing a virtual simulation running environment:
[0040] Step 11, using a data conversion format tool to convert the mechanical design 3D data from the.stp format to the.jt format on the PC side, and packaging it into the.cojt format to import into the virtual simulation engine;
[0041] Step 12, importing the layout.dwg format of the scheme stage into the virtual simulation engine, and adjusting the position and direction of the mechanical design 3D data in the virtual simulation engine;
[0042] Step 13, with each joint of motion is independently split into axis, and according to the mechanical limit and motion position point, define the relevant posture.
[0043] Step 2, through the VBA written Excel plug-in one key generation servo driver message, see Figure 2 :
[0044] Step 21, through the analysis of the hardware configuration in the Bot program, get the servo drive device configuration in the Siemens 111 message, PZD-12 / 12 first address;
[0045] Step 22, open the one key generation message tool developed by VBA language, fill in the servo drive device name, first address and variable table path obtained, one key generation.xlsm file.
[0046] The file format is shown in the following table:
[0047]
[0048] Among them, PLC1_STW1_Bit0 represents PLC1 device, STW1 control word, 0.0 output Boolean variable PLC1_ZSW1_Bit0, representing PLC1 device, ZSW1 status word, 0.0 input Boolean variable.
[0049] Replace What() function is used in VBA development environment to replace the name, after calculating the offset of the first address, using Round function() to take the remainder operation, and using Format$() function to attach IO variable type to the address, the calculation result is automatically added to the template table, through SaveAs Filename() function to save to the current directory, the file name is automatically associated with the servo drive device name.
[0050] Step 23, the symbol table generated by this method can be directly imported into the Bot program;
[0051] Step 3, the writing of virtual simulation running environment function logic block:
[0052] Step 31, create a function logic block in the virtual simulation running environment;
[0053] Step 32, create the running enable STW1_Bit0 status bit of the axis in the input pin of the function logic block;
[0054] Step 33, create running ready ZSW1_Bit1, running enable ZSW1_Bit2, pulse enable ZSW5_Bit13, controller enable ZSW5_Bit11, pulse enable ZSW4_Bit10 and other status bits in the output pin of the function logic block;
[0055] Step 34, add logical relationship to the state word of the function logic block. Where the output pin run ready ZSW1_Bit1, run enable ZSW1_Bit2, pulse enable ZSW5_Bit13, controller enable ZSW5_Bit11, pulse enable ZSW4_Bit10 add logical and input pin run ready STW1_Bit0 state synchronization, output pin alarm in the allowable range ZSW1_Bit8, control request ZSW1_Bit9, reference point setting ZSW1_Bit11, turn on ready ZSW1_Bit0, glide down not activated ZSW1_Bit4, fast stop not activated ZSW1_Bit5, MDI activated ZSW2_Bit15, speed actual running value deviation within the tolerance ZSW5_Bit8, driver ready ZSW5_Bit12, ramp up / ramp down complete ZSW5_Bit0, actual torque less than torque limit value ZSW5_Bit1, actual speed absolute value less than speed limit value ZSW5_Bit3, over temperature alarm ZSW5_Bit6, power unit thermal overload alarm ZSW5_Bit7 are always given high level signal.
[0056] Step 41, create intelligent components for mechanical design data in step 13 in a virtual simulation running environment;
[0057] Step 42, create point 1 command STW1_Bit8, point 2 command STW1_Bit9, etc. control word in the input pin of the intelligent component;
[0058] Which includes MDI speed STW8_9_MDI_VELOCITY, MDI position setting value STW6_7_MDI_TARPOS, MDI acceleration STW10_MDI_ACC, MDI deceleration STW11_MDI_DEC, etc. Position control required pins;
[0059] Convert the MDI position setting value STW6_7_MDI_TARPOS from long integer data to floating point variable PS_TARPOS, the conversion process is STW6_7_MDI_TARPOS divided by 1000, and the result is the target position of the mechanism action;
[0060] Convert the MDI speed STW8_9_MDI_VELOCITY from long integer data to floating point variable PS_VELOCITY, the conversion process is STW8_9_MDI_VELOCITY divided by 1000, and the result is the target speed of the mechanism action;
[0061] STW10_MDI_ACC is converted from integer data to floating-point variable PS_ACC by dividing STW10_MDI_ACC by 1000, and the result is used as the acceleration of the mechanism;
[0062] STW11_MDI_DEC is converted from integer data to floating-point variable PS_DEC by dividing STW11_MDI_DEC by 1000, and the result is used as the deceleration of the mechanism;
[0063] STW1_Bit6 (activation program step task) is defined as the high-level set signal of the drive device start variable PS_START, and the reset signal is the or operation result of PS_ATTARPOS (reaching target position) and non-STW1_Bit4 (stop task);
[0064] The high-level trigger condition of the reaching target position variable PS_ATTARPOS is to judge whether Axis (current axis position) and PS_TARPOS (target axis position) are equal;
[0065] Step 43, create ZSW1_Bit10, ZSW1_Bit13, etc. state words in the output pin of the intelligent component;
[0066] The actual value of the position ZSW6_7_XIST_A pin is fed back by multiplying Axis (current axis position) by 1000 and converting it from a floating-point variable to a long integer variable;
[0067] The actual value of the speed ZSW8_9_XIST_A is consistent with the value of the MDI speed STW8_9_MDI_VELOCITY;
[0068] The high-level trigger condition of the reaching target position ZSW1_Bit10 and the speed limit value ZSW1_Bit13 is the or operation result of non-STW1_Bit8 (jog1 command) and non-STW1_Bit9 (jog2 command) and the and operation result of non-PS_START (drive device start variable);
[0069] The high-level trigger condition of ZSW2_Bit10 (jog activation) is the or operation result of STW1_Bit8 (jog1 command) and STW1_Bit9 (jog2 command);
[0070] The high-level trigger condition of ZSW3_Bit15 (run command activation) is the or operation result of STW1_Bit8 (jog1 command) and STW1_Bit9 (jog2 command) and the or operation result of PS_START (drive device start variable);
[0071] Wherein about the output pin ZSW3_Bit4 (axis positive direction movement), first determine whether PS_TARPOS (axis target position) is greater than Axis (axis current position) is true, the result and PS_START (drive start variable) and operation, and STW1_Bit8 (jog1 command) or operation, the final result as the high level trigger condition of ZSW3_Bit4 (axis positive direction movement);
[0072] Wherein about the output pin ZSW3_Bit5 (axis reverse direction movement), first determine whether PS_TARPOS (axis target position) is less than Axis (axis current position) is true, the result and PS_START (drive start variable) and operation, and STW1_Bit9 (jog2 command) or operation, the final result as the high level trigger condition of ZSW3_Bit5 (axis reverse direction movement);
[0073] Wherein the high level trigger condition of ZSW3_Bit2 (set fixed point) and ZSW5_Bit2 (actual speed value is less than speed limit value) is the inverse of the or operation result of STW1_Bit8 (jog1 command), STW1_Bit9 (jog2 command) and PS_START (drive start variable);
[0074] Step 44, create both jog movement and position movement in the intelligent component action editor, and add corresponding logic relationship with input and output pins;
[0075] The trigger condition of its jog movement is STW1_Bit8 (jog1 command) or STW1_Bit9 (jog2 command), its positive direction movement takes STW1_Bit8 (jog1 command), negative direction movement takes STW1_Bit9 (jog2 command), and the jog control speed can be determined by the running servo drive speed in manual mode;
[0076] The trigger condition of its position movement is PS_START (drive start variable), and the movement target position point is associated with PS_TARPOS (axis target position), and the acceleration, deceleration and target speed are kept synchronous with the values of PS_ACC (MDI acceleration), PS_DEC (MDI deceleration) and PS_VELOCITY (MDI speed) respectively.
[0077] Step 5, test the virtual simulation running environment and PLC simulator jointly:
[0078] Step 51, download the PLC offline program or field program to the PLC simulator PLCSIM advanced or PLCSIM on the PC end;
[0079] Step 52, the signal link between the PLC emulator of the PC end and the virtual simulation running environment is established, which can be communicated directly through the API interface between the PLC SIM Advanced software or the real PLC device and the virtual simulation running environment, or the signal can be transferred to the OPC server;
[0080] Step 53, the simulation running is realized through the above mode, and the logic verification of the servo driving device in the PLC program and the interference verification work on the layout space are completed.
[0081] The application is described through embodiments, and those skilled in the art know that various changes or equivalent replacements can be made to the features and embodiments without departing from the spirit and scope of the application. In addition, the features and embodiments can be modified to adapt to specific conditions and materials under the guidance of the application without departing from the spirit and scope of the application. Therefore, the application is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of the application belong to the protection scope of the application.
Claims
1. A virtual debugging method for a servo drive device in the new energy lithium battery industry, characterized by: It comprises the following steps: Step 1, constructing a virtual simulation running environment; Step 2, generating servo driver messages through VBA one key, In step 2, Step 21, obtaining the first address of the servo drive device by analyzing the hardware configuration in the PLC program; Step 22, using the VBA development tool in EXCEL to make plug-ins, input the first address obtained in step 21, and quickly generate servo driver messages on the PC side one key; Step 23, importing the servo server message generated in step 22 into the PLC program symbol table and the virtual simulation running environment; Step 3, writing the function logic block of the virtual simulation running environment, In step 3, Step 31, creating a function logic block in the virtual simulation running environment; Step 32, creating STW1_Bit0 control word in the function logic block input pin; Step 33, creating ZSW1-ZSW5 state word in the function logic block output pin; Step 34, adding logical relationship to the ZSW1-ZSW5 state word of the function logic block; Step 4, writing the intelligent component of the virtual simulation running environment, Step 41, creating an intelligent component for the mechanical design data in step 13 in the virtual simulation running environment; Step 42, creating STW1_Bit8, STW1_Bit9 control word in the input pin of the intelligent component; Step 43, creating ZSW1_Bit10, ZSW1_Bit13 state word in the output pin of the intelligent component; Step 44, creating two modes of point motion and position motion in the action editing of the intelligent component, and adding corresponding logical relationship with the input and output pins; Step 5, joint testing of the virtual simulation running environment and the PLC simulator. 2.The virtual debugging method of a servo drive device based on a new energy lithium battery industry according to claim 1, characterized in that: In step 1, Step 11, using a data format conversion tool to convert the mechanical design 3D data into the data format specified by the virtual simulation engine on the PC side, and import it into the virtual simulation engine; Step 12, adjusting the position and direction of the mechanical design 3D data in the virtual simulation engine according to the scheme layout on the PC side; Step 13, splitting the motion mechanism and defining the posture of the mechanical design 3D data in the virtual simulation engine on the PC side. 3.The virtual debugging method of a servo drive device based on a new energy lithium battery industry according to claim 1, characterized in that: In step 5, Step 51, downloading the PLC offline program or field program to the PLC simulator on the PC side; Step 52, establishing the IO signal link between the PLC simulator on the PC side and the virtual simulation running environment; Step 53, completing the PLC program verification of the servo drive device through simulation running.
4. The virtual debugging device for the servo drive device based on the new energy lithium battery industry according to any one of claims 1-3, characterized in that: The memory is used to store a computer program, and the computer program is used to execute the method of any one of claims 1-3 when loaded by the processor.
5. The computer readable storage medium for use in the virtual commissioning method of the servo drive device based on the new energy lithium battery industry according to any one of claims 1-3, characterized in that: The storage medium stores a computer program, and the computer program is adapted to execute the method of any one of claims 1-3 when loaded by the processor.
Citation Information
Patent Citations
Robot offline programming information processing system and method
CN110625615A
Simulation device, simulation method, and program
CN113767348A