Multi-motor servo drive software application layer structured variable grouping optimization method and system

By optimizing structured variable grouping of the application layer of multi-motor servo drive software, the problems of high code repetition and complex structure in traditional software design are solved, more efficient resource utilization and system security are achieved, and high standards for modern industrial automation and intelligent manufacturing are met.

CN120143604APending Publication Date: 2025-06-13NANJING CHENGUANG GRP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510127554.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-30
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

Due to the lack of modular design, traditional multi-motor servo drive control software has high code repetition and complex structure, which increases development costs and potential error risks, and affects the system's maintainability, reusability and security.

Method used

The structured variable grouping optimization method is used to analyze the requirements of the application layer of the multi-motor servo drive software, identify key variables, and logically classify and encapsulate the variables according to the functional properties and time periods of the variables, and create corresponding structures and instantiated objects to realize modular design.

Benefits of technology

It simplifies the program structure, improves the readability and maintainability of the code, enhances resource utilization efficiency and system security and scalability, reduces code duplication, improves code reuse, and facilitates porting and reuse between different projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120143604A_ABST
    Figure CN120143604A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-motor servo drive software application layer structured variable grouping optimization method and system, and belongs to the technical field of motor servo control, and the method comprises the following steps: S1, carrying out the demand analysis of a multi-motor servo drive software application layer, and recognizing different types of demands; s2, based on different types of demand analysis results, identifying key variables required for realizing demands; s3, carrying out logic classification on the variables according to the functional attributes and the time periods of the variables; s4, according to a logic classification result, the variables are classified and packaged into a structural body according to the corresponding logic; and S5, creating a corresponding instantiation object by utilizing the packaged structural body, and performing initialization to ensure correct operation and high-efficiency performance of a software application layer. According to the method and the system provided by the invention, the development and maintenance cost is reduced, the safety and the expansibility of the system are enhanced, and the overall performance and the reliability are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of motor servo control, and particularly relates to a method and system for optimizing the structured variable grouping of the application layer of multi-motor servo drive software. Background Art

[0002] In the wave of modern industrial automation and intelligent manufacturing, multi-motor servo drive control systems play an increasingly important role. These systems are widely used in fields such as robotic arms, conveyor systems, printing machinery, and textile machinery, where multiple motors need to work precisely synchronously to achieve complex motion control and meet the requirements of high-precision production. With the growth of application requirements and the progress of technology, the scale and complexity of multi-motor systems are also increasing continuously, which poses new challenges to the development of servo drive control software. Traditional control software design methods, due to the lack of modularity and reusability, result in high code repetition and a chaotic program structure, which not only increases the development workload but also makes the subsequent maintenance and expansion of the program difficult.

[0003] As the number of motors increases, problems in the servo drive control software gradually emerge. The complexity of the program structure makes it difficult to add new functions and modify old functions, affecting the development efficiency. Due to the lack of modular design, the reusability of the code is poor, resulting in difficulties in transplantation and reuse between different projects and increasing the development cost. The complexity of the program increases potential errors and security risks, and loose data encapsulation may lead to illegal access, threatening the stability and security of the system. Therefore, there is an urgent need to improve the existing control software design methods to enhance their maintainability, reusability, and portability. Summary of the Invention

[0004] The purpose of the present invention is to overcome the deficiencies in the prior art and provide a method and system for optimizing the structured variable grouping of the application layer of multi-motor servo drive software.

[0005] To achieve the above purpose, the present invention is implemented by the following technical solutions:

[0006] In the first aspect, the present invention provides a method for optimizing the structured variable grouping of the application layer of multi-motor servo drive software, including the following steps:

[0007] Step S1: Conduct a requirements analysis on the application layer of multi-motor servo drive software and identify different categories of requirements;

[0008] Step S2: Based on the analysis results of different categories of requirements, identify the key variables required to implement the requirements;

[0009] Step S3: Logically classify the variables according to their functional attributes and time periods;

[0010] Step S4: According to the logical classification result, encapsulate the variables into a structure according to the corresponding logic.

[0011] Step S5: Create corresponding instantiated objects with the encapsulated structure and initialize them to ensure the correct operation and high efficiency of the software application layer.

[0012] Furthermore, conduct a requirements analysis on the software application layer of the multi-motor servo drive, including signal acquisition requirements, motor control requirements, drive requirements, monitoring requirements, fault management requirements, pre-charge management requirements, and emergency stop management requirements.

[0013] Furthermore, the motor control requirements include control instructions, control parameters, control period, and control algorithms; the control instructions include motor control instructions and system control instructions;

[0014] The drive requirements include drive algorithms, drive outputs, and executing motors; the requirements for the drive algorithms include the SVPWM algorithm; the requirements for the actuators include motors and actuators;

[0015] The fault management requirements include drive system faults and channel faults; the drive system faults include fault types and fault parameters; the channel faults include fault types and fault parameters.

[0016] Furthermore, identify the variables required to implement the requirements, including variables related to AD acquisition, zero-drift correction, encoder acquisition, switch state acquisition, system control instructions, motor control instructions, control parameters, control period, control algorithms, drive algorithms, drive outputs, actuators, motors, monitoring requirements, drive system faults, drive system fault parameters, channel faults, channel fault parameter configurations, pre-charge management requirements, emergency stop management requirements, PID control-related variables, and SVPWM algorithm-related variables.

[0017] Furthermore, conduct a logical classification of the variables, including the following steps:

[0018] Step S31: Combine the objects, functional purposes, time periods, control characteristics, and monitoring characteristics to which the required variables belong, sort out, analyze, and aggregate the identified required variables of the same category.

[0019] Step S32: Take the motor's channel as the object and the drive system as the object. Without changing the number of variables collected by the drive system, establish a drive system acquisition source class, and the aggregated variables are the acquisition signals of the drive system; establish a channel acquisition source class, and the aggregated variables are the acquisition signals of the channel where the motor is located.

[0020] Step S33: For the drive system acquisition source class and the channel acquisition source class, respectively establish a drive system signal correction class for correcting the bias and slope of the drive system acquisition source class variables and a channel signal correction class for correcting the bias and slope of the channel acquisition source class variables and the encoder zero position bias, so as to realize the correction and calculation of the acquired signals.

[0021] Further, for the logical classification of variables, the following steps are also included:

[0022] Step S321: For the multi-motor control instructions of the multi-motor servo drive system, respectively establish a drive system instruction class and a channel instruction class. The variables aggregated by the drive system instruction class include system-level control instructions, including but not limited to mode instructions and enable instructions. The variables aggregated by the channel instruction class include motor channel-level control instructions, including but not limited to position instructions and speed instructions;

[0023] Step S322: Separate classification is carried out for the high real-time variables in the motor control process:

[0024] Establish a channel control class, and the aggregated variables include key parameters in the motor control process. The included variables are enable status, control current, and electrical angle;

[0025] Establish a motor inherent parameter class, and the aggregated variables are the inherent parameters of the motor, including but not limited to resistance, inductance, and number of pole pairs;

[0026] Establish a servo actuator inherent parameter class, and the aggregated variables are the inherent parameters of the servo actuator, including reduction ratio and stroke range;

[0027] Establish a channel monitoring class, and the aggregated variables include status variables for monitoring the motor and the channel where it is located, including but not limited to brake current and motor power;

[0028] Step S323: Monitor the conditions and performance of the servo drive system, channels, and motors, and separately classify the servo drive system faults and channel faults:

[0029] Establish a drive system fault class, and the aggregated variables include drive system fault types and fault codes;

[0030] Establish a channel fault class, and the aggregated variables include motor and channel fault types and fault codes;

[0031] Step S324: Conduct logical judgment on drive system faults and channel faults, configure fault threshold parameters, establish a channel fault parameter configuration class, and the variables it aggregates include the configuration of channel fault parameters, including but not limited to over-temperature threshold, over-current threshold, etc.; and establish a drive system fault parameter configuration class, and the variables it aggregates include the configuration of drive system fault parameters, including but not limited to over-voltage threshold, under-voltage threshold.

[0032] Further, logically classify the variables, and it also includes the following steps:

[0033] Establish a pre-charge control class, and the variables it aggregates include pre-charge relay control and main relay control, which are used for the soft start of the channel voltage;

[0034] Establish an emergency stop control class, and the variables it aggregates include parameters related to emergency stop control, including step status and timer, which are used for the emergency stop and enable status of the control system;

[0035] Establish a PID control class, and the variables it aggregates include error, proportional coefficient, and integral coefficient, which are used for the three-loop PID closed-loop control operation;

[0036] Establish an SVPWM operation class, and the variables it aggregates are used to implement the SVPWM algorithm and output the duty cycle for controlling the motor.

[0037] Further, encapsulate the variables to form a channel acquisition source structure, a channel acquisition source structure, a drive system signal correction structure, a channel signal correction structure, a drive system instruction structure, a channel instruction structure, a channel control structure, a motor inherent parameter structure, a servo actuator inherent parameter structure, a channel monitoring structure, a channel fault structure, a channel fault parameter configuration structure, a pre-charge control structure, an emergency stop control structure, a PID control structure, and an SVPWM operation structure.

[0038] Further, the member variables of the drive system acquisition source structure include but are not limited to the drive bus voltage, drive bus current, actuator front limit, and actuator rear limit;

[0039] The member variables of the channel acquisition source structure include but are not limited to the channel back-end voltage variable, current variable, motor temperature variable, IGBT temperature variable, brake current variable, encoder single-turn value, and encoder multi-turn value;

[0040] The member variables of the drive system signal correction structure include but are not limited to the bias and slope for correcting the acquisition source variables;

[0041] The member variables of the channel signal correction structure include but are not limited to the bias and slope for correcting the channel acquisition source class variables, as well as the encoder zero-position bias;

[0042] The member variables of the drive system instruction structure include but are not limited to mode instruction, enable instruction, emergency stop instruction, reset instruction, position instruction, speed instruction;

[0043] The member variables of the channel instruction structure include but are not limited to the channel instruction class variables including but not limited to mode instruction, enable instruction, position instruction, speed instruction, torque instruction, voltage amplitude instruction, frequency instruction, reset instruction;

[0044] The member variables of the channel control structure include but are not limited to enable status, channel bus voltage, U-phase current, V-phase current, W-phase current, q-axis current, q-axis current, alfa current, beta current, electrical angle, electrical angular velocity, mechanical position, mechanical speed, reference position, reference speed, reference torque, sine value of electrical angle, cosine value of electrical angle, U-phase PWM output, V-phase PWM output, W-phase PWM output;

[0045] The member variables of the motor inherent parameter structure include but are not limited to resistance, inductance, number of pole pairs, rated current, rated speed, rated torque;

[0046] The member variables of the servo actuator inherent parameter structure include but are not limited to reduction ratio, stroke range;

[0047] The member variables of the channel monitoring structure include but are not limited to brake current, enable brake flag, motor power, effective current value, voltage amplitude, output torque, motor temperature, IGBT temperature, U-phase voltage, V-phase voltage, W-phase voltage;

[0048] The channel fault structure, and the member variables under the structure include but are not limited to motor brake fault, encoder fault, drive hardware fault, hardware overcurrent fault, software overcurrent fault, motor overtemperature fault, channel fault code;

[0049] The member variables of the channel fault parameter configuration structure include but are not limited to IGBT overtemperature threshold, motor overtemperature threshold, overcurrent threshold, overspeed threshold;

[0050] The member variables of the drive system fault structure include but are not limited to overvoltage fault, undervoltage fault, communication fault, front limit fault, rear limit fault, hardware overvoltage fault, fault code;

[0051] The member variables of the drive system fault parameter configuration structure include but are not limited to drive system overvoltage threshold, undervoltage threshold, disable enable delay time;

[0052] The member variables of the precharge control structure include but are not limited to precharge relay control, main relay control, main relay status, operation status, timer;

[0053] The member variables of the emergency stop control structure include, but are not limited to, step status, timer, timing setting, brake lock flag, and enable cut-off lock flag;

[0054] The member variables of the PID control structure include, but are not limited to, error, proportional coefficient, integral coefficient, integral output, previous integral output, PID output, previous PID output, integral limit, and PID output limit;

[0055] The member variables of the SVPWM operation structure include, but are not limited to, voltage A, voltage B, voltage C, vector time 1, vector time 2, processing time 1, processing time 2, duty cycle A, duty cycle B, duty cycle C, pwm time 1, pwm time 2, pwm time 3, and sector number.

[0056] In a second aspect, the present invention provides a multi-motor servo drive software application layer structured variable grouping optimization system, including the following modules:

[0057] A requirements analysis module for performing requirements analysis on the multi-motor servo drive software application layer;

[0058] A variable identification module for identifying the variables required to implement the requirements according to the requirements analysis results;

[0059] A logical classification module for logically classifying variables according to variable functional attributes and time periods;

[0060] A variable encapsulation module for encapsulating variables and establishing a structure according to the logical classification results;

[0061] An instance object module for creating corresponding instantiated objects and initializing them using the encapsulated structure.

[0062] In a third aspect, the present invention provides an electronic device, including:

[0063] A processor;

[0064] A memory for storing executable instructions of the processor;

[0065] Wherein, the processor is configured to execute the instructions to implement the multi-motor servo drive software application layer structured variable grouping optimization method as described in any item of the first aspect.

[0066] Compared with the prior art, the beneficial effects achieved by the present invention:

[0067] The multi-motor servo drive software application layer structured variable grouping optimization method and system provided by the present invention, to solve the problems faced by the multi-motor servo drive control software, adopts a modular design method, classifies and encapsulates the application layer variables at the drive system level and channel level, simplifies the program structure, improves the readability and maintainability of the code, enhances the resource utilization efficiency and the security and scalability of the system; the optimized variable classification and structure design reduce code duplication, improve code reusability, and facilitate the transplantation and reuse of the code between different projects; by strengthening data encapsulation, it protects the data from illegal access and enhances the security of the software.

[0068] The modular design method provided by the present invention helps to reduce the development and maintenance costs, simplifies the function development and modification process, reduces repetitive development work, saves costs, and speeds up the project progress; at the same time, it improves the overall performance and reliability of the multi-motor servo drive control system, meeting the high standards of modern industrial automation and intelligent manufacturing. Brief Description of the Drawings

[0069] Figure 1 It is a flowchart of a multi-motor servo drive software application layer structured variable grouping method according to an embodiment of the present invention.

[0070] Figure 2 It is a schematic diagram of the requirements analysis of the multi-motor servo drive software application layer according to an embodiment of the present invention.

[0071] Figure 3 It is a schematic diagram of the composition of an interface platform layer according to an embodiment of the present invention.

[0072] Figure 4 It is a schematic diagram of the composition of a protocol abstraction layer and its relationship with the interface platform layer according to an embodiment of the present invention. Detailed Embodiments

[0073] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and cannot be used to limit the protection scope of the present invention.

[0074] Embodiment

[0075] With the rapid progress of industrial automation and intelligent manufacturing, multi-motor servo drive control systems have become increasingly large and complex, posing new challenges to the development of control software. Traditional design methods lack modularity and reusability, resulting in code redundancy and chaotic structures. This not only increases the development burden but also makes software maintenance and expansion complex. This complexity also affects development efficiency because integrating new functions and modifying existing functions become more difficult. In addition, the lack of modularity leads to poor code reusability, increasing the cost of cross-project transplantation and reuse. A more complex program structure also increases the risk of errors, and improper data encapsulation may lead to illegal access, threatening the stability and security of the system. Therefore, there is an urgent need for a new control software design method to improve development efficiency, reduce costs, and ensure the reliability and security of the system.

[0076] To solve the problems existing in the prior art, an embodiment of the present invention provides a method for structuring variable grouping in the application layer of multi-motor servo drive software. The specific technical solution is as follows.

[0077] As Figure 1 shown, an embodiment of a method for structuring variable grouping in the application layer of multi-motor servo drive software is provided. In this embodiment, the following steps are included: performing a requirements analysis on the application layer of multi-motor servo drive software; identifying the variables required to implement the requirements according to the results of the requirements analysis; logically classifying the variables according to characteristics such as variable functional attributes and time periods; encapsulating the relevant variables according to the classification results and establishing a structure; creating corresponding instantiated objects using the encapsulated structure and initializing them.

[0078] Step S1. Performing a requirements analysis on the application layer of multi-motor servo drive software:

[0079] A dual-motor servo actuator system, where the rated parameters of the two motors of the dual-motor servo actuator are the same. As Figure 2 shown, a comprehensive requirements analysis is performed on the application layer of multi-motor servo drive software, including signal acquisition requirements, motor control requirements, drive requirements, monitoring requirements, fault management requirements, pre-charge management requirements, and emergency stop management requirements.

[0080] In this embodiment, the signal acquisition requirements include AD acquisition requirements, switch status acquisition, and encoder acquisition requirements. The AD acquisition requirements include, but are not limited to, acquisition channels and zero-drift correction; the encoder acquisition requirements include zero-position offset and calculation coefficients.

[0081] The motor control requirements include control instructions, control parameters, control cycles, and control algorithms. The control instructions include motor control instructions and system control instructions.

[0082] The driving requirements include a driving algorithm, driving output, and an actuator motor. The driving algorithm requirements include the SVPWM algorithm; the actuator requirements include a motor and an actuator.

[0083] The fault management requirements include driving system faults and channel faults. The driving system faults include fault types and fault parameters. The channel faults include fault types and fault parameters.

[0084] Step S2. Identify the variables required to meet the requirements:

[0085] Based on the requirements analysis, identify the variables required to meet the requirements as Figure 3 shown below. The specific variables are as follows:

[0086] Variables related to AD acquisition, variables related to zero-drift correction, variables related to encoder acquisition, variables related to switch status acquisition.

[0087] Variables related to system control instructions, variables related to motor control instructions, variables related to control parameters, variables related to control period, variables related to control algorithms.

[0088] Variables related to driving algorithms, variables related to driving output, variables related to actuators, variables related to motors.

[0089] Variables related to monitoring requirements, variables related to driving system faults, variables related to driving system fault parameters, variables related to channel faults, variables related to channel fault parameter configuration.

[0090] Variables related to pre-charge management requirements, variables related to emergency stop management requirements, variables related to PID control, variables related to SVPWM algorithms.

[0091] Step S3. Logically classify the variables according to their functional attributes and time periods, etc.

[0092] Combining the objects to which the variables belong, functional uses, time periods, control characteristics, monitoring characteristics, etc., sort out, analyze, and group and establish classes for variables of the same category identified in Step 2. Considering that the number of motors in a multi-motor servo drive system may be different, as the number of motors increases, the acquisition variables related to the motors increase, but the number of acquisition variables of the driving system remains unchanged. Classify the acquired signal variables with the motor channels as objects and the driving system as objects. Specifically, establish a driving system acquisition source class, and the variables grouped are the acquisition signals of the driving system; establish a channel acquisition source class, and the variables grouped are the acquisition signals of the channels where the motors are located.

[0093] In order to correct and calculate the acquired signals, corresponding to the driving system acquisition source class and the channel acquisition source class, establish a driving system signal correction class and a channel signal correction class respectively.

[0094] In the channel acquisition source class, the variables that need to be linearly transformed are linearly transformed through the slope variable and the offset variable in the channel correction class. The linear transformation is calculated to obtain the true value by multiplying the variable in the channel acquisition source class by the corresponding correction slope variable in the channel correction class and then adding the corresponding correction offset variable in the channel correction class.

[0095] In the drive system acquisition source class, the variables that need to be linearly transformed are linearly transformed through the slope variable and the offset variable in the drive system correction class. The linear transformation is calculated to obtain the true value by multiplying the variable in the drive system acquisition source class by the corresponding correction slope variable in the drive system correction class and then adding the corresponding correction offset variable in the drive system correction class.

[0096] In this embodiment, the drive system signal correction class, the variables it aggregates are used to correct the offset and slope of the variables in the drive system acquisition source class, and the parameters included in the class are related to the entire drive system.

[0097] The channel signal correction class, the variables it aggregates are used to correct the offset and slope of the variables in the channel acquisition source class, as well as the encoder zero position offset.

[0098] Considering the flexibility of multi-motor control in the multi-motor servo drive system, for the classification of control instructions, it is divided into drive system instruction classes and channel instruction classes.

[0099] The drive system instruction class is established, and the variables it aggregates include system-level control instructions, including but not limited to mode instructions, enable instructions, etc.

[0100] The channel instruction class is established, and the variables it aggregates include motor channel-level control instructions, such as position instructions, speed instructions, etc. These instructions are crucial for achieving precise motion control of the motor, and separate classification helps to achieve fine control at the channel level.

[0101] To achieve precise motor control, the high real-time variables in the motor control process are classified separately. The channel control class is established, and the variables it aggregates include key parameters in the motor control process, and the variables included are enable status, control current, electrical angle, etc.

[0102] The motor inherent parameter class is established, and the variables it aggregates are the inherent parameters of the motor, including but not limited to resistance, inductance, number of pole pairs, etc. These parameters are crucial for the long-term performance and maintenance of the motor, and separate classification helps to achieve the optimization and maintenance of the motor.

[0103] The servo actuator inherent parameter class is established, and the variables it aggregates are the inherent parameters of the servo actuator, including reduction ratio and stroke range.

[0104] Establish a channel monitoring class. The variables it aggregates include status variables of the monitored motor and the channel it belongs to, including but not limited to brake current, motor power, etc.

[0105] In order to monitor the status and performance of the servo drive system, channels, and motors, classifying servo drive system faults and channels separately helps to achieve real-time monitoring and quick positioning.

[0106] Establish a drive system fault class. The variables it aggregates include drive system fault types and fault codes.

[0107] Establish a channel fault class. The variables it aggregates include fault types and fault codes of the motor and the channel it belongs to.

[0108] In order to make logical judgments on drive system faults and channel faults, parameters such as fault thresholds need to be configured.

[0109] Establish a channel fault parameter configuration class. The variables it aggregates include the configuration of channel fault parameters, including but not limited to over-temperature threshold, over-current threshold, etc.

[0110] Establish a drive system fault parameter configuration class. The variables it aggregates include the configuration of drive system fault parameters, including but not limited to over-voltage threshold, under-voltage threshold, etc.

[0111] Establish a pre-charge control class. The variables it aggregates include pre-charge relay control, main relay control, etc., which are used for the soft start of the channel voltage.

[0112] Establish an emergency stop control class. The variables it aggregates include parameters related to emergency stop control, such as step status, timer, etc., which are used for the emergency stop and enable status of the control system.

[0113] Establish a PID control class. The variables it aggregates include error, proportional coefficient, integral coefficient, etc., which are used for the three-loop PID closed-loop control operation.

[0114] Establish an SVPWM operation class. The variables it aggregates are used to implement the SVPWM algorithm and output the duty cycle for controlling the motor.

[0115] Step S4. Package the relevant variables and establish a structure.

[0116] According to the logical classification in step 3, package the relevant variables and establish a structure.

[0117] Package the drive system acquisition source structure BSW_SRC_DRIVE_type. The member variables under the structure include the drive bus voltage Udc, drive bus current Idc, actuator front limit UpLim, and actuator rear limit DnLim.

[0118] Encapsulate the BSW_SRC_CH_type structure of the channel acquisition source. The member variables under the structure include the channel back-end voltage variable chUdc, current variables Iu, Iv, motor temperature variable MotorTemp, IGBT temperature variable IGBT_Temp, brake current variable Ibk, encoder single-turn value Theta, and encoder multi-turn value Revolution.

[0119] Encapsulate the BSW_CORR_DRIVE_type structure for correcting drive system signals. The member variables under the structure include the correction of the drive bus voltage bias Udc_Bias, the slope of the drive bus voltage Udc_Ratio, the correction of the drive bus current bias Idc_Bias, and the slope of the drive bus current Idc_Ratio.

[0120] Encapsulate the BSW_CORR_CH_type structure for correcting channel signals. The member variables under the structure include the bias ChUdc_Bias for correcting the channel back-end voltage, the slope ChUdc_Ratio for correcting the channel back-end voltage, the bias Iu_Bias for correcting current Iu, the slope Iu_Ratio for correcting current Iu, the bias Iw_Bias for correcting current Iw, the slope Iw_Ratio for correcting Iw, the bias IGBT_Bias for correcting IGBT temperature, the bias Ibk_Bias for correcting the brake current, the slope Ibk_Ratio for correcting the brake current, the bias Revolution_Zero for correcting the encoder multi-turn value, and the bias Theta_Zero for correcting the encoder single-turn value.

[0121] Encapsulate the DRIVE_RUN_type structure of the drive system instructions. The member variables under the structure include the mode instruction Mode, enable instruction Enable, emergency stop instruction Stop, reset instruction Reset, position instruction PosCmd, and speed instruction SpdCmd.

[0122] Encapsulate the CH_RUN_type structure of the channel instructions. The member variables under the structure include the mode instruction DebugMode, enable instruction EnableCmd, position instruction PosCmd, speed instruction SpdCmd, torque instruction TorqueCmd, voltage amplitude instruction VoltAmp, frequency instruction VoltFreq, and reset instruction RESET.

[0123] Encapsulate the channel control structure CH_CTRL_type. The member variables under the structure include the enable status PwmEnState_U, the channel bus voltage Udc_F, the U-phase current Iu_F, the V-phase current Iv_F, the W-phase current Iw_F, the d-axis current Id_F, the q-axis current Iq_F, the alfa current ialfa_F, the beta current ibeta_F, the electrical angle Theta_F, the electrical angular velocity Omega_F, the mechanical position Pos_F, the mechanical speed SpeedRPM_F, the reference position PosRef_F, the reference speed SpeedRef_F, the reference torque TorqueRef_F, the sine value of the electrical angle sinth_F, the cosine value of the electrical angle costh_F, the U-phase PWM output PWM_U_duty_F, the V-phase PWM output PWM_V_duty_F, and the W-phase PWM output PWM_W_duty_F.

[0124] Encapsulate the motor inherent parameter structure MOTOR_PARAM_type. The member variables under the structure include the resistance Rs, the q-axis inductance Lq, the d-axis inductance Ld, the number of pole pairs Pn, the rated current RatedCurrent, the rated speed RatedSpeed, the rated torque PeakTorque, the moment of inertia Je, and the torque coefficient Kt.

[0125] Encapsulate the servo actuator inherent parameter structure Actualor_PARAM_type. The member variables under the structure include the reduction ratio I and the stroke range Lead.

[0126] Encapsulate the channel monitoring structure CH_MONITOR_type. The member variables under the structure include the brake current Ibk, the enable brake flag BkEn, the motor power MotorPower_F, the effective current value CurrentRMS_F, the voltage amplitude Uamp_F, the output torque TorqueEst_F, the motor temperature MotorTemp_F, the IGBT temperature IgbtTemp_F, the U-phase voltage Uu_F, the V-phase voltage Uv_F, and the W-phase voltage Uw_F.

[0127] Encapsulate the channel fault structure CH_FD_type. The member variables under the structure include the motor brake fault MainBreakFault, the encoder fault EncodeFault, the drive hardware fault HW_DriveFault, the hardware overcurrent fault HW_OCHFault, the software overcurrent fault OverCurFault, the motor overtemperature fault OverTempMotorFault, and the channel fault code FaultCode.

[0128] Encapsulate the channel fault parameter configuration structure CH_FD_SET_type. The member variables under the structure include the IGBT over-temperature threshold, the motor over-temperature threshold TempIGBTLmt, the over-current threshold CurLmt, and the overspeed threshold SpdLmt.

[0129] Encapsulate the drive system fault structure DRIVE_FD_type. The member variables under the structure include, but are not limited to, overvoltage fault OverVoltFault, undervoltage fault UnderVoltFault, communication fault CanLostFault_U, front limit fault UpLim_U, rear limit fault DnLim_U, hardware overvoltage fault HW_OVHFault_U, and fault code FaultCode_U.

[0130] Encapsulate the drive system fault parameter configuration structure DRIVE_FD_SET_type. The member variables under the structure include, but are not limited to, the drive system overvoltage threshold OverVoltLmt, the undervoltage threshold UnderVoltLmt, and the disable delay time DisableDelay.

[0131] Encapsulate the pre-charge control structure RELAY_CTRL_type. The member variables under the structure include pre-charge relay control PreEn, main relay control MainEn, main relay status MainState, operation status State, and timer Cnt.

[0132] Encapsulate the emergency stop control structure DISABLE_type. The member variables under the structure include step status step, timer cnt, timing setting CntSet, brake lock flag BrakeLock_U, and disable lock flag DisEnLock_U.

[0133] Encapsulate the PID control structure PID_type. The member variables under the structure include error Err, proportional coefficient Kp, integral coefficient Ki, integral output OutI, previous integral output OutILast, PID output Out, previous PID output OutLast, integral limit IMax, and PID output limit OutMax.

[0134] Encapsulate the SVPWM operation structure SVPWM_type. The member variables under the structure include, but are not limited to, voltage A, voltage B, voltage C, vector time 1, vector time 2, processing time 1, processing time 2, duty cycle A, duty cycle B, duty cycle C, pwm time 1, pwm time 2, pwm time 3, and sector number.

[0135] Step S5. Create the corresponding instance object and initialize it.

[0136] According to the actual requirements of the multi-motor servo drive system, instantiate the structure variables, define the structure variables, and assign values to the structure variables, as Figure 4 shown.

[0137] Define the structure variable BSWSrcDrive of the drive system acquisition source, and initialize the structure variable to 0.

[0138] Define the structure variables BSWScrCh1 and BSWScrCh1 of the channel acquisition source, and initialize the structure variables to 0.

[0139] Define the structure variable BSWCorrDrive of the drive system signal correction, and initialize and assign values according to the actual situation.

[0140] Define the structure variables BSWCorrCh1 and BSWCorrCh2 of the channel signal correction, and initialize and assign values according to the actual situation.

[0141] Define the structure variable DriveRun of the drive system instruction, and initialize the structure variable to 0.

[0142] Define the structure variables ChRun1 and ChRun2 of the channel instruction, and initialize the structure variables to 0.

[0143] Define the channel control structures ChCtrl1 and ChCtrl2, and initialize the structure variables to 0.

[0144] Define the structure MotorPara of the motor inherent parameters, and initialize and assign values according to the actual situation.

[0145] Define the structure ActualorPara of the servo actuator inherent parameters, and initialize and assign values according to the actual situation.

[0146] Define the channel monitoring structures ChMonitor1 and ChMonitor2, and initialize the structure variables to 0.

[0147] Define the channel fault structures ChFD1 and ChFD2, and initialize the structure variables to 0.

[0148] Define the structure variable DriveFD of the drive system fault, and initialize the structure variable to 0.

[0149] Define the structure variable DriveFDSet of the drive system fault parameter configuration, and initialize and assign values according to the actual situation.

[0150] Define the pre-charge control structures RelayCtrl1 and RelayCtrl2, and initialize and assign values according to the actual situation.

[0151] Define the emergency stop control structure DisableStop and initialize and assign values according to the actual situation.

[0152] Define the PID control structure variables PosPI1, SpdPI1, CurPI1, PosPI2, SpdPI2, CurPI2 and initialize and assign values according to the actual situation.

[0153] Define the SVPWM operation structure variables Svpwm1 and Svpwm2 and initialize the structure variables to 0.

[0154] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the technical principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be regarded as the protection scope of the present invention.

Claims

1. A method for optimizing structured variable grouping in a multi-motor servo drive software application layer, characterized in that: The steps include: Step S1: Analyze the requirements of the multi-motor servo drive software application layer and identify different categories of requirements; Step S2: Based on the requirements analysis results of different categories, identify the key variables required to achieve the requirements; Step S3: logically classify the variables according to their functional attributes and time periods; Step S4: Based on the logical classification results, encapsulate the variables into structures according to the corresponding logical classifications; Step S5: Use the encapsulated structure to create a corresponding instantiation object and initialize it to enable the software application layer to run correctly.

2. The multi-motor servo drive software application layer structured variable grouping optimization method according to claim 1 is characterized in that: Conduct demand analysis on the multi-motor servo drive software application layer, including signal acquisition requirements, motor control requirements, drive requirements, monitoring requirements, fault management requirements, pre-charge management requirements and emergency stop management requirements.

3. The multi-motor servo drive software application layer structured variable grouping optimization method according to claim 2 is characterized in that: The motor control requirements include control instructions, control parameters, control cycles, and control algorithms; the control instructions include motor control instructions and system control instructions; The driving requirements include driving algorithm, driving output, and executing motor; the driving algorithm requirements include SVPWM algorithm; the actuator requirements include motor and actuator; The fault management requirements include drive system faults and channel faults; the drive system faults include fault types and fault parameters; the channel faults include fault types and fault parameters.

4. The multi-motor servo drive software application layer structured variable grouping optimization method according to claim 1, characterized in that: Identify the variables required to achieve the requirements, including AD acquisition related variables, zero drift correction related variables, encoder acquisition related variables, switch state acquisition related variables, system control instruction related variables, motor control instruction related variables, control parameter related variables, control cycle related variables, control algorithm related variables, drive algorithm related variables, drive output related variables, actuator related variables, motor related variables, monitoring requirement related variables, drive system fault related variables, drive system fault parameter related variables, channel fault related variables, channel fault parameter configuration related variables, pre-charge management requirement related variables, emergency stop management requirement related variables, PID control related variables, and SVPWM algorithm related variables.

5. The method for optimizing structured variable grouping in the application layer of multi-motor servo drive software according to claim 4, characterized in that: Logically classify the variables, including the following steps: Step S31: Combining the objects, functional purposes, time periods, control characteristics and monitoring characteristics of the required variables, sorting out and analyzing the identified required variables and grouping the variables of the same category; Step S32: taking the channel where the motor is located as an object and the drive system as an object, the number of drive system acquisition variables remains unchanged, establishing a drive system acquisition source class, and the variables collected are the acquisition signals of the drive system; establishing a channel acquisition source class, and the variables collected are the acquisition signals of the channel where the motor is located; Step S33: For the drive system acquisition source class and the channel acquisition source class, establish a drive system signal correction class for correcting the offset and slope of the drive system acquisition source class variables and a channel signal correction class for correcting the offset and slope of the channel acquisition source class variables and the encoder zero position offset, respectively, so as to realize the correction and solution of the collected signals.

6. The method for optimizing structured variable grouping in the application layer of multi-motor servo drive software according to claim 5, characterized in that: Logically classifying variables also includes the following steps: Step S321: establishing a drive system instruction class and a channel instruction class for the multi-motor control instructions of the multi-motor servo drive system, respectively, wherein the variables collected by the drive system instruction class include system-level control instructions, including but not limited to mode instructions and enable instructions, and the variables collected by the channel instruction class include motor channel-level control instructions, including but not limited to position instructions and speed instructions; Step S322: Separately classify the high real-time variables of the motor control process: Establish a channel control class. The variables collected include key parameters in the motor control process, including enable status, control current, and electrical angle. Establish a motor intrinsic parameter class, where the variables collected are the intrinsic parameters of the motor, including but not limited to resistance, inductance, and pole pair number; Establish the inherent parameter class of the servo actuator. The variables collected are the inherent parameters of the servo actuator, including the reduction ratio and travel range. Establish a channel monitoring class. The variables collected include the state variables of the monitored motor and the channel, including but not limited to brake current and motor power. Step S323: Monitor the status and performance of the servo drive system, channel and motor, and classify the servo drive system fault and channel fault separately: Establish a drive system fault class, and the collected variables include the drive system fault type and fault code; Create a channel fault class, the variables collected include the fault type and fault code of the motor and the channel where it is located; Step S324: Perform logical judgment on the drive system fault and channel fault, configure the fault threshold parameters, establish a channel fault parameter configuration class, and the collected variables include the configuration of the channel fault parameters, including but not limited to the over-temperature threshold, over-current threshold, etc.; and establish a drive system fault parameter configuration class, and the collected variables include the configuration of the drive system fault parameters, including but not limited to the over-voltage threshold and under-voltage threshold.

7. The method for optimizing structured variable grouping in the application layer of multi-motor servo drive software according to claim 6, characterized in that: Logically classifying variables also includes the following steps: Establish a pre-charge control class, the variables collected include pre-charge relay control and main relay control, which are used for the slow start of the channel voltage; Establish an emergency stop control class. The variables collected include parameters related to emergency stop control, including step status and timer, which are used to control the emergency stop and enable status of the system; Establish a PID control class, the variables collected include error, proportional coefficient and integral coefficient, which are used for three-loop PID closed-loop control operation; Create an SVPWM operation class, and the collected variables are used to implement the SVPWM algorithm and output the duty cycle of the controlled motor.

8. The method for optimizing structured variable grouping in the application layer of multi-motor servo drive software according to claim 7, characterized in that: The variables are encapsulated to form a channel acquisition source structure, a channel acquisition source structure, a drive system signal correction structure, a channel signal correction structure, a drive system instruction structure, a channel instruction structure, a channel control structure, a motor inherent parameter structure, a servo actuator inherent parameter structure, a channel monitoring structure, a channel fault structure, a channel fault parameter configuration structure, a pre-charge control structure, an emergency stop control structure, a PID control structure, and a SVPWM operation structure.

9. The method for optimizing structured variable grouping in the application layer of multi-motor servo drive software according to claim 8, characterized in that: The member variables of the drive system acquisition source structure include but are not limited to the driver bus voltage, the driver bus current, the actuator front limit and the actuator rear limit; The member variables of the channel acquisition source structure include but are not limited to channel back-end voltage variables, current variables, motor temperature variables, IGBT temperature variables, brake current variables, encoder single-turn values, and encoder multi-turn values; The member variables of the drive system signal correction structure include but are not limited to the bias and slope of the correction acquisition source variable; The member variables of the channel signal correction structure include but are not limited to the bias and slope of the correction channel acquisition source class variables, and the encoder zero position bias; The member variables of the drive system instruction structure include but are not limited to mode instruction, enable instruction, emergency stop instruction, reset instruction, position instruction, and speed instruction; The member variables of the channel instruction structure include but are not limited to the channel instruction class variables including but not limited to mode instruction, enable instruction, position instruction, speed instruction, torque instruction, voltage amplitude instruction, frequency instruction, and reset instruction; The member variables of the channel control structure include but are not limited to enable state, channel bus voltage, U phase current, V phase current, W phase current, q axis current, q axis current, alfa current, beta current, electrical angle, electrical angular velocity, mechanical position, mechanical speed, reference position, reference speed, reference torque, electrical angle sine value, electrical angle cosine value, U phase PWM output, V phase PWM output, W phase PWM output; The member variables of the motor inherent parameter structure include but are not limited to resistance, inductance, pole pair number, rated current, rated speed, and rated torque; The member variables of the servo actuator inherent parameter structure include but are not limited to reduction ratio and travel range; The member variables of the channel monitoring structure include but are not limited to brake current, brake enable flag, motor power, current effective value, voltage amplitude, output torque, motor temperature, IGBT temperature, U phase voltage, V phase voltage, and W phase voltage; The channel fault structure, the member variables under the structure include but are not limited to motor brake fault, encoder fault, drive hardware fault, hardware overcurrent fault, software overcurrent fault, motor overtemperature fault, and channel fault code; The member variables of the channel fault parameter configuration structure include but are not limited to IGBT over-temperature threshold, motor over-temperature threshold, over-current threshold, and over-speed threshold; The member variables of the drive system fault structure include but are not limited to overvoltage fault, undervoltage fault, communication fault, front limit fault, rear limit fault, hardware overvoltage fault, and fault code; The member variables of the drive system fault parameter configuration structure include but are not limited to the drive system overvoltage threshold, undervoltage threshold, and disconnection delay time; The member variables of the pre-filling control structure include but are not limited to pre-filling relay control, main relay control, main relay state, operating state, and timer; The member variables of the emergency stop control structure include but are not limited to step status, timer, timing setting, brake lock flag, and disconnection enable lock flag; The member variables of the PID control structure include but are not limited to error, proportional coefficient, integral coefficient, integral output, last integral output, PID output, last PID output, integral limit, PID output limit; The member variables of the SVPWM operation structure include but are not limited to voltage A, voltage B, voltage C, vector time 1, vector time 2, processing time 1, processing time 2, duty cycle A, duty cycle B, duty cycle C, pwm time 1, pwm time 2, pwm time 3, and sector number.

10. A multi-motor servo drive software application layer structured variable grouping optimization system, characterized in that: Includes the following modules: Demand analysis module, used to perform demand analysis on the multi-motor servo drive software application layer; The variable identification module is used to identify the required variables to achieve the requirements based on the requirements analysis results; Logical classification module, used to logically classify variables according to their functional attributes and time periods; The variable encapsulation module is used to encapsulate variables and establish structures according to the results of logical classification; The instance object module is used to create corresponding instantiation objects using encapsulated structures and initialize them.