A high-precision motor parameter identification and PID automatic setting method
Patent Information
- Application Number
- CN202611187985.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-06
- Publication Date
- 2026-10-13
AI Technical Summary
[0004]本申请提供一种高精度电机参数辨识与PID自动整定方法,解决了现有技术PID自整定方法采用理想单工况参数进行自整定,导致整定结果与实际运行存在偏差,且适应性较弱,进而使得电机控制综合效率下降的技术问题
[0019]本申请提供一种高精度电机参数辨识与PID自动整定方法,能够通过对非运行状态下电机的进电阻参数和电感参数的多级测定,以及对转动惯量参数和磁链参数的测定,得到电机参数;基于电机参数生成初始的电流环PID参数控制值和速度环PID参数控制值;使用初始的电流环PID参数控制值和速度环PID参数控制值控制电机运行;基于电流环PID参数控制值、速度环PID参数控制值和预先构建的电机数字孪生模型对运行状态下电机的电流环PID参数控制值和速度环PID参数控制值进行调整;通过多级测定能够得到高精度的电阻参数,以及全范围高精度的电感参数,基于这些电机参数设置不同工况下的电机初始PID参数控制值,再配合数字孪生模型在电机的运行过程中对PID控制值进行实时调整,实现了高精度、广范围、自适应调整的电机控制,从而提升了电机控制的综合效率。
Smart Images

Figure CN122908650A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of intelligent motor control technology, specifically a high-precision motor parameter identification and PID automatic tuning method. Background Technology
[0002] Permanent magnet synchronous motors (PMSMs) have been widely used in high-end manufacturing fields such as industrial servo systems, new energy vehicles, robotics, and aerospace due to their advantages of high efficiency, high power density, and fast response. As these applications increasingly demand higher control precision, dynamic response speed, and system robustness, performance optimization of motor drive control systems has become a core issue of common concern to both academia and industry.
[0003] Most existing PID self-tuning methods employ model-based tuning. These methods typically use motor parameters measured under ideal conditions during offline parameter determination, and usually only perform parameter measurements under a single operating condition. The motor parameters obtained under ideal conditions often deviate from the actual operating parameters of the motor, and the results from a single operating condition cannot cover the actual states of different operating conditions such as heavy load and light load. When the motor load changes, the fixed gain obtained from tuning based on parameters under a single operating condition cannot adapt to the new operating conditions, resulting in poor system adaptability. Furthermore, when motor parameters continuously drift due to factors such as temperature rise and magnetic saturation during operation, the fixed gain cannot achieve adaptive dynamic adjustment. These problems lead to difficulties in maintaining optimal control performance across the entire operating range, causing deterioration in motor dynamic response, decreased steady-state accuracy, and even oscillation instability, thus reducing the overall efficiency of PID self-tuning. Therefore, a high-precision motor parameter identification and PID automatic tuning method is urgently needed. Summary of the Invention
[0004] This application provides a high-precision motor parameter identification and PID automatic tuning method, which solves the technical problem that the existing PID self-tuning method uses ideal single-condition parameters for self-tuning, resulting in deviations between the tuning results and actual operation, and has weak adaptability, thus reducing the overall efficiency of motor control.
[0005] To achieve the above objectives, this application adopts the following technical solution: Firstly, a high-precision method for motor parameter identification and PID automatic tuning is provided, including: The parameters of the motor are measured when it is not in operation, and several corresponding motor parameters are obtained. The motor parameters include resistance parameters, inductance parameters, flux linkage parameters and moment of inertia parameters. The parameter measurement includes multi-level measurement of resistance parameters and inductance parameters, as well as measurement of moment of inertia parameters and flux linkage parameters. Initial current loop PID control values and speed loop PID control values are generated based on motor parameters; the motor operation is controlled using the initial current loop PID control values and speed loop PID control values. The PID control values of the current loop and speed loop of the motor are adjusted based on the PID control values of the current loop and speed loop, and a pre-built digital twin model of the motor.
[0006] Based on the above technical solution, in the high-precision motor parameter identification and PID automatic tuning method provided in this application, motor parameters are obtained by multi-level measurement of the motor's resistance and inductance parameters in non-operating states, as well as measurement of rotational inertia and flux linkage parameters. Initial current loop PID parameter control values and speed loop PID parameter control values are generated based on the motor parameters. The motor operation is controlled using the initial current loop PID parameter control values and speed loop PID parameter control values. The current loop PID parameter control values, speed loop PID parameter control values, and a pre-built digital twin model of the motor are used to adjust the current loop PID parameter control values and speed loop PID parameter control values of the motor in operating states. High-precision resistance parameters and high-precision inductance parameters across the entire range can be obtained through multi-level measurement. Based on these motor parameters, initial PID parameter control values for different operating conditions are set. Then, in conjunction with the digital twin model, the PID control values are adjusted in real time during motor operation, achieving high-precision, wide-range, and adaptive motor control, thereby improving the overall efficiency of motor control.
[0007] In conjunction with the first aspect above, in one possible implementation, the multi-stage measurement of the resistance parameter includes: S1: Obtain the set current test sequence; the current test sequence includes several test currents for testing; specifically, the test current is a set number of test current values, such as 5% of the rated current as a test current, that is, 5% of the rated current value is the current value corresponding to the first test current, 10% of the rated current is the current value corresponding to the second test current, and so on until 100% is the current value corresponding to the last test current. S2: Generate the first differential current corresponding to each test current, and use the first differential current as the test differential current; it can be understood that the current value corresponding to the test differential current is the circuit size of the input differential current, and after passing through the differential circuit, two stable differential DC small currents will be output. S3: Test the motor in non-operational state based on the test differential current to obtain several corresponding compensation voltages; compensate the voltage based on the compensation voltages and calculate several corresponding first resistance parameters; S4: Calculate the dispersion of several first resistance parameters; determine whether the dispersion is less than the set dispersion threshold; if yes, proceed to S6; if no, proceed to S5. S5: Based on several first differential currents and their corresponding first resistance parameters, identify several second differential currents; use the second differential currents as test differential currents to enter S3; S6: Generate the final resistance parameters based on several of the first resistance parameters.
[0008] Because the dead zone voltage is significant and noise has a large impact when a small current is applied, the measured resistance changes greatly. When a large current is applied, the resistance value fluctuates due to temperature and deviates from the true value. Therefore, the stable resistance that is least affected by these factors can be calculated through the above operations. This application injects two sets of differential currents with similar values into the motor using the differential current method and measures the corresponding terminal voltages. By taking advantage of the fact that the dead zone voltage remains basically unchanged in the two measurements, the dead zone voltage is eliminated by subtracting the two equations, thus fundamentally eliminating the contamination of the inverter dead zone effect on the resistance measurement. On this basis, through a closed-loop optimization process of multi-level measurement and dispersion screening, the variance of each measurement interval is calculated to automatically identify the most stable current interval. After further subdivision within this interval, the average value is taken, effectively avoiding the dual effects of dead zone nonlinear interference in the small current region and temperature rise drift in the large current region. The resistance parameters closest to the true value are obtained with the fewest number of measurements.
[0009] In conjunction with the first aspect above, in one possible implementation, determining a plurality of second differential currents based on a plurality of first differential currents and their corresponding first resistance parameters includes: Obtain the number corresponding to each first resistor parameter, and the number corresponding to the first resistor parameter is consistent with the number of the corresponding test differential current. Obtain the set number of parameters, and select several consecutively numbered first resistor parameters from each first resistor parameter to form a test group based on the number of parameters, and obtain several test groups in sequence. Calculate the dispersion of each first resistance parameter in each test group. The dispersion can be variance or other parameters that can represent the degree of dispersion of each first resistance parameter in the test group. In this embodiment, variance is used as the dispersion. The smaller the variance, the more concentrated the resistances corresponding to each first resistance parameter are, and the smaller the dispersion. Obtain the test differential current corresponding to each first resistance parameter in the test group with the smallest dispersion. Obtain the minimum and maximum values of the test currents corresponding to each test differential current, as well as the number of test differential currents corresponding to the first resistance parameters in the test group. Obtain the set subdivision factor; record the product of the quantity and the subdivision factor as the subdivision quantity; divide the current corresponding to the minimum and maximum values to obtain the second differential current corresponding to the subdivision quantity.
[0010] In conjunction with the first aspect above, in one possible implementation, the multi-level measurement of the inductance parameters includes: S1: Obtain the set current test sequence; the current test sequence includes several test currents used for testing; S2: Generate the first differential current and the first bias current corresponding to each test current, and use the first differential current as the test differential current and the first bias current as the test bias current. S3: Test the motor in non-operational state based on the test differential current to obtain the corresponding compensation voltage; test the motor in non-operational state based on the test bias current, and calculate several corresponding first inductance parameters based on the compensation voltage. S4: Calculate the direct-axis dispersion of the direct-axis inductance parameter and the cross-axis dispersion of the quadrature-axis inductance parameter among several first inductance parameters respectively; calculate the corresponding comprehensive dispersion based on the direct-axis dispersion and the quadrature-axis dispersion; determine whether the comprehensive dispersion is less than the set dispersion threshold; if yes, proceed to S6; if no, proceed to S5; specifically, the dispersion can be the variance. S5: Based on several first DC biases and their corresponding first inductance parameters, several second test currents are determined; the second test currents are used as test currents, and the process proceeds to S2; S6: Output the first inductance parameter corresponding to each bias test current, and use the first inductance parameter as the inductance parameter of the test current corresponding to the bias test current; the inductance parameter includes direct-axis inductance parameter and quadrature-axis inductance parameter.
[0011] In conjunction with the first aspect above, in one possible implementation, the motor in a non-operating state is tested based on the first bias current, and several corresponding first inductance parameters are calculated based on the compensation voltage, including: Each test bias current is numbered in ascending order of its corresponding current value. This means the current value corresponding to the test bias current is the magnitude of the input DC bias current. The test bias currents are sequentially applied to the non-operating motor according to their corresponding numbers, and a high-frequency voltage pulse of a set amplitude is superimposed. It is understood that the amplitude and duration of the high-frequency voltage pulse need to be coordinated to control the current response increment in the motor windings within a small range of the rated current, thus avoiding a significant shift in the magnetic circuit operating point. As a preferred embodiment, the current response increment is generally set to be less than 5% of the rated current, for example, 3% of the rated current. In this case, if the current test bias current is 10% of the rated current, the instantaneous current amplitude in the windings will fluctuate between 7% and 13% of the rated current after the high-frequency pulse is superimposed. The corresponding pulse voltage change, current change, and pulse duration are then obtained. Obtain the corresponding compensation voltage, compensate the voltage based on the compensation voltage, and calculate the first inductor parameter corresponding to the test bias current based on the pulse voltage, current change, and pulse duration; the pulse voltage includes the rising phase voltage and the falling phase voltage, the current change includes the rising phase current change and the falling phase current change, and the pulse duration includes the rising phase pulse time and the falling phase pulse time; the first inductor parameter includes the direct-axis inductance parameter and the quadrature-axis inductance parameter. Specifically, apply a DC bias of the current test bias current to the motor. After the magnetic circuit flux stabilizes, input alternating high-frequency voltage pulses and record the voltage, current change, and pulse duration during the rising phase of the pulses, as well as the voltage, current change, and pulse duration during the falling phase. Through the rising phase voltage Current change during the rising phase Rising phase pulse time Calculate the rising edge inductance; then there exists Therefore, the rising edge inductance can be obtained: ; in, For rising edge inductance; This is the voltage during the rising phase, i.e., the actual voltage, and the voltage after compensation. ,in, Command voltage, This is the compensation voltage; it can be understood that the compensation voltage here is the compensation voltage under the test of the first differential current generated by the test current corresponding to the test bias current. The falling edge inductance is calculated using the falling phase voltage, falling phase current change, and falling phase pulse time. It is understandable that the calculation method for falling edge inductance is the same as that for rising edge inductance. The average value of the rising edge inductance and falling edge inductance is calculated as the corresponding electrical parameters. Taking the average value can eliminate sampling noise. Using the above method, the direct-axis inductance and quadrature-axis inductance under the current test bias current can be obtained separately. The corresponding direct-axis inductance and quadrature-axis inductance are recorded as the first inductance parameters. It is worth noting that after each inductance test of a test bias is completed, a fixed cooling time needs to be waited before the next test bias can be applied. Secondly, the application time of the high-frequency pulse should be very short to avoid the accumulation of winding heat, which changes the magnetic circuit characteristics and the winding voltage sampling reference.
[0012] In conjunction with the first aspect above, in one possible implementation, determining a plurality of second test currents based on a plurality of first DC biases and their corresponding first inductance parameters includes: Obtain the number corresponding to each first inductor parameter, and the number corresponding to the first inductor parameter is consistent with the number of its corresponding test bias current; Obtain the set number of parameters, and select several consecutively numbered first inductor parameters from each first inductor parameter to form a test group based on the number of parameters, and obtain several test groups in sequence; Calculate the direct-axis dispersion of the direct-axis inductance parameter and the quadrature-axis dispersion of the quadrature-axis inductance parameter in each test group; calculate the corresponding comprehensive dispersion based on the direct-axis dispersion and quadrature-axis dispersion. Specifically, the comprehensive dispersion can be the average of the direct-axis dispersion and the quadrature-axis dispersion. Obtain test groups whose overall dispersion is greater than a set dispersion threshold; it is understood that the dispersion threshold can be set to the same value or different values, and the specific value is set by experts based on experience; obtain the test bias current corresponding to each first inductor parameter in the test group; obtain the minimum and maximum values of the test currents corresponding to each of the test bias currents, as well as the number of test bias currents corresponding to the first inductor parameters in the test group; Obtain the set subdivision factor; record the product of the quantity and the subdivision factor as the subdivision quantity; divide the interval between the minimum and maximum values of the test current evenly to obtain the second test current corresponding to the subdivision quantity.
[0013] In conjunction with the first aspect above, in one possible implementation, the motor in a non-operating state is tested based on the test differential current to obtain several corresponding compensation voltages, including: Each test differential current is numbered in ascending order of its corresponding current value. The test differential currents are then sequentially applied to the motor in a non-operating state according to their corresponding numbers, and the corresponding differential voltages are measured. The compensation voltage corresponding to the test differential current is calculated based on the differential voltage and its corresponding test differential current.
[0014] In conjunction with the first aspect above, in one possible implementation, the determination of the moment of inertia parameter includes: The system acquires a set electromagnetic torque and controls the motor to output a constant electromagnetic torque for accelerated rotation; it acquires the motor speed in real time, and when the speed reaches the set speed value, it controls the motor to output a constant reverse electromagnetic torque for decelerated rotation; and it acquires the first angular acceleration during the motor's accelerated rotation and the second angular acceleration during the decelerated rotation. The moment of inertia parameters are calculated based on the first angular acceleration, the second angular acceleration, and the electromagnetic torque.
[0015] In conjunction with the first aspect above, in one possible implementation, the generation of initial current loop PID parameter control values and speed loop PID parameter control values based on motor parameters includes: Obtain the target operating current, and based on the target operating current, query the motor parameters to obtain the corresponding inductance parameter. Specifically, obtain the inductance parameter corresponding to the test current that is closest to the target operating current, and use it as the inductance parameter corresponding to the target operating current. The initial current loop PID control value is generated based on the resistance parameter in the motor parameters and the inductance parameter obtained by query. The speed loop PID parameter control values are generated based on the rotational inertia parameter and flux linkage parameter in the motor parameters.
[0016] In conjunction with the first aspect above, in one possible implementation, the current loop PID parameter control values and speed loop PID parameter control values of the motor under operating conditions are adjusted based on the current loop PID parameter control values, the speed loop PID parameter control values, and a pre-built digital twin model of the motor, including: The initial current loop PID parameter control values and speed loop PID parameter control values are used to control the motor digital twin model for simulation operation; various operating parameters of the motor are obtained and input into the motor digital twin model, so that the motor digital twin model can simulate the operating state of the motor. It can be understood that the operating parameters of the motor are input once at a certain time interval, such as 1 second; and various simulation monitoring parameters of the motor digital twin model are obtained. Various simulated monitoring parameters, along with the motor digital twin model or the motor's current loop PID control values and speed loop PID control values, are input into the control value adjustment model to obtain the corresponding adjusted current loop PID control values and speed loop PID control values. The actual motor is then adjusted based on these adjusted values, and the motor digital twin model is simultaneously adjusted. That is, the motor digital twin model and the motor's current loop PID control values and speed loop PID control values should be synchronized. The control value adjustment model is obtained through training with an artificial intelligence model.
[0017] In conjunction with the first aspect above, in one possible implementation, the control value adjustment model is obtained through training an artificial intelligence model, including: Acquire several historical first current loop PID parameter control values and first speed loop PID parameter control values, corresponding to various monitoring parameters of the motor, as well as the adjusted second current loop PID parameter control values and second speed loop PID parameter control values of the motor. The adjusted second current loop PID parameter control values and second speed loop PID parameter control values of the motor are the values after experts have adjusted the current loop PID parameter control values and speed loop PID parameter control values of the motor based on various monitoring parameters of the motor. Integrate several corresponding first current loop PID parameter control values, first speed loop PID parameter control values, various monitoring parameters of the motor, and second current loop PID parameter control values and second speed loop PID parameter control values into several training data and test data. The artificial intelligence model is trained using training data and tested using validation data. The final input consists of various simulated monitoring parameters, as well as the PID control values of the current loop and speed loop of the motor. The output is the control value adjustment model of the corresponding adjusted PID control values of the current loop and speed loop. The artificial intelligence model includes deep neural network models or convolutional neural network models, etc.
[0018] In conjunction with the first aspect mentioned above, one possible implementation also includes generating an early warning signal by comparing the deviations between various monitoring parameters of the motor and the corresponding simulated monitoring parameters of the motor's digital twin model, including: The values corresponding to each monitoring parameter are integrated into an actual feature vector according to a set order; The numerical values corresponding to each simulated monitoring parameter are integrated into a simulated feature vector according to a set order; The Euclidean distance between the actual feature vector and the simulated feature vector can be calculated, or other parameters that can represent the difference between the vectors can be used; when the Euclidean distance is greater than the corresponding set threshold, a deviation alarm signal is generated, which is triggered by abnormal operation of the motor by the staff or abnormal operation of the motor digital twin model.
[0019] This application provides a high-precision motor parameter identification and PID automatic tuning method. It obtains motor parameters by multi-level measurement of the motor's resistance and inductance parameters during non-operation, as well as by measuring the moment of inertia and flux linkage parameters. Based on these motor parameters, initial current-loop and speed-loop PID control values are generated. The motor is then controlled using these initial values. During operation, the current-loop and speed-loop PID control values are adjusted using the current-loop, speed-loop, and a pre-built digital twin model of the motor. Through multi-level measurement, high-precision resistance parameters and high-precision inductance parameters across the entire range are obtained. Based on these motor parameters, initial PID control values are set for different operating conditions. Furthermore, the PID control values are adjusted in real-time during motor operation using the digital twin model, achieving high-precision, wide-range, and adaptive motor control, thereby improving the overall efficiency of motor control.
[0020] It should be understood that the descriptions of technical features, technical solutions, beneficial effects, or similar language in this application do not imply that all features and advantages can be achieved in any single embodiment. Rather, it is understood that the description of a feature or beneficial effect means that a specific technical feature, technical solution, or beneficial effect is included in at least one embodiment. Therefore, the descriptions of technical features, technical solutions, or beneficial effects in this specification do not necessarily refer to the same embodiment. Furthermore, the technical features, technical solutions, and beneficial effects described in this embodiment can be combined in any suitable manner. Those skilled in the art will understand that embodiments can be implemented without one or more specific technical features, technical solutions, or beneficial effects of a particular embodiment. In other embodiments, additional technical features and beneficial effects may be identified in specific embodiments that do not embody all embodiments. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram illustrating the steps of the high-precision motor parameter identification and PID automatic tuning method in this application. Figure 2 This is a schematic diagram of the multi-stage resistance measurement process in this application; Figure 3 This is a schematic diagram of the multi-stage inductance measurement process in this application; Figure 4 This is a schematic diagram illustrating the steps for adjusting the PID parameter control values during operation in this application. Detailed Implementation
[0023] The technical solutions of this application will be clearly and completely described below with reference to the embodiments. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] Please see Figure 1 The first aspect of this application provides a high-precision motor parameter identification and PID automatic tuning method, including: The parameters of the motor are measured when it is not in operation, and several corresponding motor parameters are obtained. The motor parameters include resistance parameters, inductance parameters, flux linkage parameters and moment of inertia parameters. The parameter measurement includes multi-level measurement of resistance parameters and inductance parameters, as well as measurement of moment of inertia parameters and flux linkage parameters. Specifically, the non-operating state refers to an offline testing environment where the motor is stationary, powered off, or mechanically decoupled from the load. This state eliminates interference from external load disturbances and complex operating conditions on parameter identification, providing a pure test benchmark for obtaining the inherent characteristics of the motor itself. The multi-level measurement strategy for resistance and inductance parameters is employed to address the inherent nonlinear physical characteristics of the motor: resistance measurements exhibit significant nonlinear distortion due to inverter dead-zone effects and low-current noise, while temperature rise drift under high current also causes resistance values to deviate from their true values; inductance parameters dynamically change with the degree of magnetic circuit saturation, and measurements at a single operating point cannot characterize the inductance-electricity ratio across the entire current range. The flow characteristic curve; therefore, by multi-level measurement, the variation law of parameters under different excitation levels can be captured and the stable range can be screened out, thereby obtaining high-precision electromagnetic parameters; in addition, the rotational inertia parameter and flux linkage parameter are measured simultaneously to complete the physical model describing the electromechanical energy conversion process of the motor, and to avoid the principle deviation in the subsequent control gain calculation due to the lack of key mechanical or magnetic field parameters; it should be understood that although this embodiment classifies the measurement of the above four types of parameters into the non-operation stage, in other embodiments, the measurement order of each parameter can be flexibly adjusted according to the constraints of the test equipment, as long as all necessary parameters are obtained before the initial control parameters are generated.
[0025] Initial current loop PID control values and speed loop PID control values are generated based on motor parameters; the motor operation is controlled using the initial current loop PID control values and speed loop PID control values. Specifically, this step establishes an explicit analytical mapping relationship between the motor's physical parameters and the control gain, changing the traditional method's reliance on engineering experience or repeated trial and error to determine the initial gain. Using the static parameters such as resistance, inductance, moment of inertia, and flux linkage accurately identified in this step, initial PID parameters with clear physical meaning can be directly calculated through theories such as internal model control or pole placement. For permanent magnet synchronous motors, their electromagnetic torque equations constitute the core of the physical model.
[0026] In the formula: For electromagnetic torque, This represents the number of pole pairs of the motor. It is a permanent magnet flux chain. For quadrature axis current, , These are direct-axis and quadrature-axis inductors, respectively. It is the direct-axis current.
[0027] In the equation, the first term on the right-hand side is the permanent magnet torque component, which is proportional to the flux linkage parameter and the quadrature-axis current; the second term is the reluctance torque component, reflecting the contribution of the difference between the direct-axis and quadrature-axis inductances to the torque. This equation clearly reveals how various static parameters jointly determine the motor's torque output capability, and also explains the flux linkage parameter... The precise determination of the flux linkage is crucial for subsequent control gain calculations. Deviations in flux linkage directly lead to inaccurate torque prediction, causing the speed loop gain to deviate from its optimal value. This initialization method, based on a measured physical model, enables the control system to possess a basic dynamic response capability matching the actual characteristics of the motor immediately upon power-up, significantly shortening the on-site commissioning cycle. It should be noted that the initial PID parameter control values generated here are not the final optimal control parameters, but rather serve as a reliable starting point and safety boundary for subsequent dynamic adjustment stages, preventing overcurrent or oscillation during motor startup due to severe initial gain mismatch.
[0028] The current loop PID parameter control values, speed loop PID parameter control values, and a pre-built digital twin model of the motor are used to adjust the current loop PID parameter control values and speed loop PID parameter control values of the motor under operating conditions. Specifically, the operating state refers to the online working stage where the motor is connected to the actual load and performs a predetermined task. During this stage, motor parameters drift in real time due to factors such as temperature rise, increased magnetic saturation, and mechanical wear, causing the fixed PID gain calculated based on static parameters to gradually become ineffective. This application introduces a pre-constructed digital twin model of the motor as a bridge for virtual-real interaction. This model faithfully reproduces the dynamic behavior of the real motor in virtual space. During adjustment, the digital twin model receives real-time operating data from the real motor and outputs simulated monitoring parameters. These parameters, combined with the current PID parameter control values, are input into the control value adjustment model to predict the appropriate adjustment parameters for the current operating conditions. The optimal parameter combination is achieved through a mechanism that yields two levels of technical benefits: firstly, by verifying the effectiveness of parameter adjustments in a virtual environment, the safety risks and equipment damage that may arise from online trial and error directly on the real motor are avoided; secondly, by utilizing artificial intelligence models to learn from expert parameter tuning experience or historical optimization data, the control system can intelligently perceive runtime parameter perturbations and autonomously complete gain compensation, ensuring that the motor maintains optimal dynamic performance and steady-state accuracy across the entire operating range. It should be understood that strict timing synchronization and parameter consistency should be maintained between the digital twin model and the real motor to ensure the effective transfer of adjustment strategies.
[0029] Please see Figure 2 In one possible implementation, the multi-stage determination of the resistance parameter includes: S1: Obtain the set current test sequence; the current test sequence includes several test currents for testing; specifically, the test sequence covers the typical operating conditions that the motor windings may experience. For example, test points can be set at certain percentage intervals of the rated current, such as starting from 5% of the rated current and setting a test current every 5% until 100% of the rated current; this initial sequence design covering the entire range aims to provide sufficient data support for subsequent screening of stable measurement intervals and avoid missing potential linear operating areas; it should be understood that the 5% interval is only an illustrative example, and in actual applications, it can be adjusted to other step sizes according to the motor power level and test accuracy requirements, as long as it can characterize the overall trend of resistance changing with current; S2: Generate the first differential current corresponding to each test current, and use the first differential current as the test differential current; specifically, the differential current is not a single current value, but a current pair composed of two currents with similar values. For example, for a certain test current point, generate two differential currents with amplitudes of I1 and I2, and the difference between I1 and I2 is much smaller than their average value; the core purpose of this design is to take advantage of the physical characteristic that the inverter dead zone voltage remains basically unchanged in two measurements, and eliminate the interference of the dead zone effect on the resistor identification through mathematical calculations; S3: Based on the test differential current, test the motor in the non-operating state to obtain several corresponding compensation voltages; compensate the voltage based on the compensation voltages and calculate several corresponding first resistance parameters; combining the specific implementation method of obtaining several corresponding compensation voltages based on the test differential current to test the motor in the non-operating state, number each test differential current according to its corresponding current value from smallest to largest, and sequentially apply it to the motor in the non-operating state according to the order of the corresponding numbers of the test differential currents, and measure the corresponding differential voltages; calculate the compensation voltage corresponding to the test differential current based on the differential voltage and its corresponding test differential current; specifically, when the above two differential currents are sequentially injected into the motor windings... and The corresponding terminal voltages were measured respectively. and Since the two currents obtained through the differential circuit have only a tiny difference in value, the instantaneous winding resistance at the two measurements can be considered equal. The dead zone voltage remains unchanged. It is also basically constant; for the two differential currents and their corresponding terminal voltages, the following relationship exists: ; ; in, This is the voltage deviation caused by the dead zone effect under the differential current, i.e., the compensation voltage; By subtracting the two equations above, the unknown compensation voltage can be eliminated, and the corresponding high-precision resistor can be obtained. ; This resistance is denoted as the first resistance parameter; substituting the first resistance parameter back into any equation yields the compensation voltage: ; It is worth noting that a certain amount of time needs to be waited before the next test differential current can be applied each time a test differential current is applied, in order to ensure that the current loop is stable and the winding temperature has not changed significantly, so as to avoid measurement errors caused by the transient response not ending or heat accumulation; secondly, the application time of the differential current should be very short to avoid measurement errors caused by heat accumulation.
[0030] S4: Calculate the dispersion of several first resistance parameters; determine whether the dispersion is less than the set dispersion threshold; if yes, proceed to S6; if no, proceed to S5. Specifically, dispersion is a statistical indicator that measures the consistency of resistance parameters within the same test interval, typically characterized by variance or standard deviation. Taking variance as an example, its calculation formula is:
[0031] in, This refers to variance, or dispersion. To test the number of resistor parameters in the group, For the first One resistance parameter, The above formula is used to calculate the dispersion of resistance parameters within the same test group, which is the mean value of the resistance parameters in the test group. In the low current range, due to the large proportion of dead zone nonlinearity and low signal-to-noise ratio, the measured resistance value often fluctuates drastically and has a large dispersion. In the high current range, although the signal-to-noise ratio improves, the positive temperature coefficient effect caused by winding heating will cause the resistance value to drift over time, which also manifests as increased dispersion. By setting a reasonable dispersion threshold, the system can automatically identify the "stable measurement window" that is neither severely affected by the dead zone nor has a significant temperature rise drift. This is the key criterion for achieving high-precision identification.
[0032] S5: Based on several first differential currents and their corresponding first resistance parameters, identify several second differential currents; use the second differential currents as test differential currents to enter S3; The specific implementation of confirming several second differential currents based on several first differential currents and their corresponding first resistance parameters includes: obtaining the number corresponding to each first resistance parameter, wherein the number corresponding to the first resistance parameter is consistent with the number of its corresponding test differential current. The set number of parameters is obtained, and based on the number of parameters, several consecutively numbered first resistor parameters are selected from each first resistor parameter to form a test group, and several test groups are obtained in sequence. It can be understood that the number of parameters is set by experts, such as 5 parameters as a group, there are 20 parameters, the 1st to the 5th are as a test group, the 2nd to the 6th are as a test group, and so on. Calculate the dispersion of each first resistance parameter in each test group. The dispersion can be variance or other parameters that can represent the degree of dispersion of each first resistance parameter in the test group. In this embodiment, variance is used as the dispersion. The smaller the variance, the more concentrated the resistances corresponding to each first resistance parameter are, and the smaller the dispersion. Obtain the test differential current corresponding to each first resistance parameter in the test group with the smallest dispersion. Obtain the minimum and maximum values of the test currents corresponding to each test differential current, as well as the number of test differential currents corresponding to the first resistance parameters in the test group. Obtain the set subdivision factor; record the product of the quantity and the subdivision factor as the subdivision quantity; divide the current corresponding to the minimum and maximum values to obtain the second differential current corresponding to the subdivision quantity.
[0033] Specifically, for example, the number of parameters is set to 5, and the subdivision factor is 4. The system iterates through all groups consisting of 5 consecutive test points and calculates the variance of the resistance value within each group. The group with the smallest variance is determined to be the most stable measurement interval. Subsequently, within the upper and lower limits of the current in this interval, the original number of test points is multiplied by the subdivision factor of 4 to generate a denser second differential current sequence for secondary testing. The rationale for this design is that, on the one hand, setting the window size to 5 can achieve a balance between statistical validity and local sensitivity. A window that is too small is easily misled by single-point outliers, while a window that is too large may cross the boundary between the stable and unstable regions. On the other hand, setting the subdivision factor to 4 means that the sampling density is increased to 4 times the original within the stable region, which is sufficient to further suppress random noise through multi-point averaging, while not causing excessive expansion of the test time. It should be understood that the window size and subdivision factor are not fixed. Those skilled in the art can make adaptive adjustments according to the motor type, sensor accuracy, and test cycle requirements. For example, in the testing of servo motors with extremely high accuracy requirements, the subdivision factor can be increased to 8 or higher.
[0034] S6: Generate the final resistance parameters based on several of the first resistance parameters.
[0035] Specifically, when the dispersion after iteration meets the threshold requirement or reaches the preset maximum number of iterations, the system will calculate the arithmetic average or weighted average of multiple measurements within the stable interval as the final resistance parameter output. The calculation formula is as follows: ; in, For the final resistance parameters, The number of valid measurement points within the stable interval. For the first The first resistance parameter corresponding to each effective measurement point; this parameter not only eliminates the systematic deviation of the dead zone voltage, but also avoids the interference of the nonlinear region and the temperature rise region, representing the most realistic DC resistance value of the motor winding at the reference temperature, and at the same time provides a reliable physical basis for subsequent PID tuning and inductance identification.
[0036] Please see Figure 3 In one possible implementation, the multi-level measurement of the inductance parameters includes: S1: Obtain the set current test sequence; the current test sequence includes several test currents for testing; specifically, the test sequence covers the full current range of the motor from no-load to full-load, aiming to initially scan the macroscopic trend of inductance change with current; similar to the resistance test sequence, the rated current percentage can also be used as the step size here, but considering the nonlinear characteristics of the inductance saturation curve, the distribution of the initial test points can be appropriately densified near the estimated saturation region based on prior knowledge to improve the capture efficiency of the initial scan.
[0037] S2: Generate the first differential current and the first bias current corresponding to each test current, and use the first differential current as the test differential current and the first bias current as the test bias current. Specifically, this step reflects the essential difference between inductance identification and resistance identification at the physical excitation level. Resistance measurement only requires differential current to eliminate dead zone, while inductance measurement must introduce the first bias current to establish a specific magnetic circuit operating point. This is because the permeability of the motor core changes dynamically with the magnetic field strength, and the inductance has a definite instantaneous value only under a certain DC bias. It should be understood that although this embodiment describes the bias current and differential current separately, in actual hardware implementation, the two can be generated by the same power converter through time-division multiplexing or superposition modulation, as long as functional decoupling is satisfied.
[0038] S3: Test the motor in non-operating state based on the test differential current to obtain the corresponding compensation voltage; test the motor in non-operating state based on the test bias current, and calculate several corresponding first inductance parameters based on the compensation voltage; the specific implementation of testing the motor in non-operating state based on the first bias current and calculating several corresponding first inductance parameters based on the compensation voltage includes: numbering each test bias current according to its corresponding current value from smallest to largest. It can be understood that the current value corresponding to the test bias current is the magnitude of the input DC bias current. The test bias current is sequentially applied to the motor in non-operating state according to the order of the corresponding numbers, and a high-frequency voltage pulse excitation with a set amplitude is superimposed. It can be understood that the amplitude and duration of the high-frequency voltage pulse need to be set in a coordinated manner so that the current response increment generated in the motor winding is controlled within a small range of the rated current to avoid a large deviation of the magnetic circuit operating point. As a preferred embodiment, the current response increment is generally set to be less than 5% of the rated current, for example, 3% of the rated current. In this case, if the current test bias current is 10% of the rated current, the instantaneous current amplitude in the winding will fluctuate between 7% and 13% of the rated current after the high-frequency pulse is superimposed. The corresponding pulse voltage change, current change, and pulse duration are obtained. Obtain the corresponding compensation voltage, compensate the voltage based on the compensation voltage, and calculate the first inductor parameter corresponding to the test bias current based on the pulse voltage, current change, and pulse duration; the pulse voltage includes the rising phase voltage and the falling phase voltage, the current change includes the rising phase current change and the falling phase current change, and the pulse duration includes the rising phase pulse time and the falling phase pulse time; the first inductor parameter includes the direct-axis inductance parameter and the quadrature-axis inductance parameter. Specifically, apply a DC bias of the current test bias current to the motor. After the magnetic circuit flux stabilizes, input alternating high-frequency voltage pulses and record the voltage, current change, and pulse duration during the rising phase of the pulses, as well as the voltage, current change, and pulse duration during the falling phase. Through the rising phase voltage Current change during the rising phase Rising phase pulse time Calculate the rising edge inductance; then there exists Therefore, the rising edge inductance can be obtained: ; in, For rising edge inductance; This is the voltage during the rising phase, i.e., the actual voltage, and the voltage after compensation. ,in, Command voltage, This is the compensation voltage; it can be understood that the compensation voltage here is the compensation voltage under the test of the first differential current generated by the test current corresponding to the test bias current. The falling edge inductance is calculated using the falling phase voltage, falling phase current change, and falling phase pulse time. It is understandable that the calculation method for falling edge inductance is the same as that for rising edge inductance. The average value of the rising and falling edge inductances is calculated as the corresponding inductance parameters. Averaging these values helps eliminate sampling noise. Using this method, the direct-axis and quadrature-axis inductances under the current test bias current can be calculated separately, and these are recorded as the first inductance parameters. It is worth noting that after each inductance test for a given bias level, a fixed cooling time, such as 2 seconds, must be allowed, and the high-frequency pulse input time should be extremely short, for example, with a pulse width not exceeding 100μs. This timing constraint is to prevent the accumulated heat from the windings from altering the magnetic circuit characteristics and resistance reference, and also to avoid interference from eddy current effects caused by prolonged high-frequency excitation on inductance measurements. It should be understood that the above cooling time and pulse width values are only typical examples; in practical applications, they can be adaptively adjusted according to the motor's heat dissipation conditions and the characteristics of the core material.
[0039] S4: Calculate the direct-axis dispersion of the direct-axis inductance parameter and the cross-axis dispersion of the cross-axis inductance parameter among several first inductance parameters; calculate the corresponding comprehensive dispersion based on the direct-axis dispersion and cross-axis dispersion; determine whether the comprehensive dispersion is less than the set dispersion threshold; if yes, proceed to S6; if no, proceed to S5; specifically, the dispersion can be the variance; specifically, this embodiment introduces "comprehensive dispersion" as the criterion for adaptive encryption, which is defined as the mean or other weighted combination of the direct-axis dispersion and the cross-axis dispersion, and its calculation formula is:
[0040] in, To account for the overall dispersion, The direct-axis dispersion of the direct-axis inductance parameters. This refers to the quadrature-axis dispersion of the quadrature-axis inductance parameters. For common topologies such as built-in permanent magnet synchronous motors, the direct-axis magnetic circuit enters saturation earlier due to the presence of permanent magnets, while the quadrature-axis magnetic circuit may only exhibit significant nonlinearity at higher currents. If only the direct-axis dispersion is relied upon for judgment, the saturation inflection point of the quadrature-axis inductance in a specific range may be missed, leading to distortion of the q-axis inductance curve fitting. By comprehensively evaluating the data stability of both the d and q axes, the severity of the nonlinear changes in the magnetic circuit can be perceived more comprehensively, ensuring that the encryption mechanism can be triggered when a parameter mutation occurs on any axis.
[0041] S5: Based on several first DC biases and their corresponding first inductor parameters, determine several second test currents; use the second test currents as test currents and proceed to S2; specifically, determining several second test currents based on several first DC biases and their corresponding first inductor parameters includes: obtaining the number corresponding to each first inductor parameter, the number corresponding to the first inductor parameter being consistent with the number of its corresponding test bias current; obtaining a set number of parameters, selecting several consecutively numbered first inductor parameters from each first inductor parameter based on the number of parameters to form test groups, and sequentially obtaining several test groups; calculating the direct-axis dispersion corresponding to the direct-axis inductor parameter and the quadrature-axis dispersion corresponding to the quadrature-axis inductor parameter in each test group; calculating the corresponding comprehensive dispersion based on the direct-axis dispersion and the quadrature-axis dispersion, specifically, the comprehensive dispersion can be the average value corresponding to the direct-axis dispersion and the quadrature-axis dispersion; obtaining test groups whose comprehensive dispersion is greater than a set dispersion threshold; it is understood that the dispersion threshold can be set to the same value or different values, the specific value being determined by... Experts set the following based on experience: Obtain the test bias current corresponding to each first inductor parameter in the test group; obtain the minimum and maximum values of the test currents corresponding to each test bias current, and the number of test bias currents corresponding to the first inductor parameters in the test group; obtain the set subdivision factor; record the product of the number and the subdivision factor as the subdivision quantity; uniformly divide the interval between the minimum and maximum values of the test current to obtain the number of second test currents corresponding to the subdivision quantity; it is understood that each test group with a comprehensive dispersion greater than the set dispersion threshold will enter S2 as a separate loop quantity; this method avoids the test time redundancy caused by blindly encrypting across the entire current range, while ensuring sufficient data resolution under critical operating conditions such as deep magnetic saturation, ultimately forming a high-precision inductance and current mapping relationship under all operating conditions; it should be understood that the selection of the subdivision factor and window size needs to balance test time and fitting accuracy. For high dynamic response scenarios such as servo systems, the subdivision factor can be appropriately increased to obtain a smoother control gain scheduling curve.
[0042] S6: Output the first inductance parameter corresponding to each bias test current, and use the first inductance parameter as the inductance parameter of the test current corresponding to the bias test current; the inductance parameter includes direct-axis inductance parameter and quadrature-axis inductance parameter.
[0043] After the aforementioned multi-level measurement and adaptive encryption iteration, the system outputs a set of discrete, high-precision data pairs. These data not only eliminate coupling interference from resistance voltage drop and dead-zone voltage, but also suppress random noise through dual-edge averaging. More importantly, they possess sufficient sampling density in the nonlinear sensitive region. This inductance mapping can be directly used for lookup interpolation in subsequent PID parameter generation, or fitted as an analytical function for real-time control, laying a solid model foundation for precise vector control of the motor across the entire speed and load range.
[0044] In one possible implementation, the determination of the moment of inertia parameter includes: acquiring a set electromagnetic torque, controlling the motor to output a constant electromagnetic torque for accelerated rotation; acquiring the motor speed in real time, and when the speed reaches a set speed value, controlling the motor to output a constant reverse electromagnetic torque for decelerated rotation; and acquiring the first angular acceleration during the motor's accelerated rotation and the second angular acceleration during the decelerated rotation. The moment of inertia parameters are calculated based on the first angular acceleration, the second angular acceleration, and the electromagnetic torque. Specifically, during the motor's accelerated rotation, the electromagnetic torque, moment of inertia, and the first angular acceleration satisfy the motor shaft's mechanical motion equations: ; in, It is the moment of inertia; For electromagnetic torque, For the first angular acceleration, The drag torque is a comprehensive sum including Coulomb friction, viscous friction, and wind resistance; During the deceleration and rotation of the motor, the electromagnetic torque, moment of inertia, and second angular acceleration satisfy the mechanical motion equation of the motor shaft: ; in, It is the moment of inertia; For electromagnetic torque, This is the second angular acceleration. The drag torque is a comprehensive sum including Coulomb friction, viscous friction, and wind resistance; adding the two equations above, we get: ; From this, the resistance torque can be calculated: ; Substituting the resistance torque into the mechanical motion equation of the motor shaft during acceleration, we obtain the corresponding moment of inertia: ; It should be understood that during acceleration and deceleration within the same speed range, the resistance torque... The magnitude and direction are symmetrical or at least constant about the zero velocity point; since the acceleration and deceleration processes cover the same speed range and take very short time, this assumption has sufficient accuracy in engineering; the significant advantage of this method is that it completely decouples mechanical parameter identification from friction model identification, avoids the cumulative error in inertia estimation caused by friction model mismatch in traditional methods, and provides a high-confidence physical benchmark for subsequent speed loop PID tuning.
[0045] Regarding electromagnetic torque, it is typically selected between 30% and 70% of the motor's rated torque. If the electromagnetic torque is too small, the generated angular acceleration signal will be weak and easily drowned out by sensor noise; if the electromagnetic torque is too large, approaching or exceeding the rated torque, it may cause current regulator saturation or deep magnetic circuit saturation, resulting in the actual output electromagnetic torque deviating from the commanded value, thus violating the premise that the electromagnetic torque is a known constant in the formula. Therefore, the 30%-70% range ensures sufficient dynamic response amplitude while leaving sufficient linear margin. Furthermore, to accurately extract angular acceleration, high resolution of the position sensor is required; for example, for low-line-count encoders, the speed signal obtained by direct differential often contains significant glitches and must be processed using a low-pass filter or a sliding window polynomial fitting algorithm. However, it should be noted that filtering introduces phase lag, which may cause the measured angular acceleration to not correspond to exactly the same speed point. Therefore, zero-phase digital filtering should be used during data processing, or data within the same speed window during acceleration and deceleration should be selected for paired calculations to ensure the effectiveness of elimination.
[0046] In terms of the overall test procedure timing, the moment of inertia measurement step described in this embodiment should preferably be performed after the resistance parameter measurement and inductance parameter measurement, and before the flux linkage parameter measurement. This is because inertia identification relies only on the mechanical motion equation and torque command, and does not depend on the precise values of electromagnetic parameters. However, its test results can provide the necessary mechanical model support for the uniform rotation control in the subsequent flux linkage measurement, ensuring that the motor can be stably maintained at the target speed for back electromotive force observation. It should be understood that although this embodiment describes a specific sequence of acceleration followed by deceleration, in other embodiments, deceleration followed by acceleration or other symmetrical excitation sequences can also be used, as long as paired acceleration and deceleration data are obtained within the same speed range to achieve the purpose of friction torque elimination.
[0047] In conjunction with the first aspect above, in one possible implementation, the determination of the flux linkage parameter includes: controlling the motor to enter a uniform rotation state, collecting the quadrature-axis voltage under the uniform rotation state, and calculating the flux linkage parameter using the following formula: ; in, It is a permanent magnet flux chain. It is the quadrature axis voltage. For resistance parameters, For the direct-axis inductance in the electrical parameters, For quadrature axis current, For direct-axis current, This represents the angular velocity during uniform rotation; it is particularly important to emphasize the resistance parameter in this formula. and direct-axis inductance parameters The high-precision measured values obtained through multi-level adaptive measurement must be used directly, rather than the nominal values on the motor nameplate or empirical estimates; this is because in the back electromotive force observation equation, the resistance voltage drop term... and inductive coupling terms With back electromotive force Numerically on the same order of magnitude, if or There is an identification error, which will be directly transmitted and amplified in the flux linkage calculation result, causing the subsequent velocity loop gain to deviate from the optimal value. It should be understood that although this embodiment describes a flux linkage measurement method based on steady-state back electromotive force, alternative solutions such as high-frequency injection method or integral method can be used in other embodiments, as long as an accurate flux linkage reference value can be obtained.
[0048] After completing the measurement of all static parameters, including resistance, inductance, moment of inertia, and flux linkage, the next step is to generate initial current loop PID control values and speed loop PID control values based on the motor parameters. This step establishes an explicit analytical mapping from the physical model to the control gain, changing the traditional method's reliance on manual trial and error to determine initial parameters. The specific implementation includes the following sub-steps.
[0049] First, the target operating current is obtained, and the corresponding inductance parameter is retrieved from the motor parameters based on this target operating current. Specifically, due to the nonlinear saturation characteristics of the motor's magnetic circuit, the inductance value dynamically changes with the current magnitude. If a single fixed inductance value is used to calculate the PID gain, the performance of the control system will degrade under non-rated operating conditions. Therefore, this embodiment introduces an inductance matching mechanism based on the operating point. The target operating current is usually set according to the typical application scenario of the motor. For example, it can be set to 60% of the rated current for fan and water pump loads, and 40% of the rated current for servo feed systems. In the inductance-current mapping relationship, the system finds the inductance value corresponding to the test point closest to the target operating current as the current calculation benchmark. For example, when the target operating current is 60% of the rated current, if there are only two adjacent test points, 59% and 62%, in the mapping table, the test point corresponding to the closest 59% is selected. and The value can be obtained by linear interpolation, or a more accurate inductance estimate can be obtained. This on-demand lookup table strategy ensures that the initial PID parameters match the motor characteristics under actual operating conditions, significantly improving the control robustness under wide speed range and variable load conditions.
[0050] Specifically, based on motor parameters, current loop PID parameter control values and speed loop PID parameter control values are generated, including: The current loop PID parameter control values are generated based on the resistance and inductance parameters in the motor parameters. The current loop PID parameter control values include proportional gain and integral gain. The proportional gain is: ; The integral gain is: ; in, , These are the proportional gains of the direct-axis and quadrature-axis current loops, respectively. , These are the integral gains of the direct-axis and quadrature-axis current loops, respectively. For the current loop bandwidth, , For the direct-axis and quadrature-axis inductances under the target operating current, For resistance parameters; current loop bandwidth This directly determines the response speed of current tracking; in practical engineering, The selection is usually limited by the inverter's switching frequency. To ensure system stability and avoid aliasing effects caused by discretization, a bandwidth of 1 / 20 to 1 / 10 of the switching frequency is generally selected. ; Based on the moment of inertia and flux linkage parameters in the motor parameters, speed loop PID parameter control values are generated, which include proportional gain and integral gain. The proportional gain is: ; The integral gain is: ; in, For the velocity loop proportional gain, For velocity loop integral gain, For the speed loop bandwidth, The measured moment of inertia parameters, This represents the number of pole pairs of the motor. These are the magnetic flux linkage parameters measured previously.
[0051] The speed loop bandwidth introduced here It reflects the system's ability to suppress mechanical disturbances, i.e., system stiffness. The value is usually the current loop bandwidth. The value should be 1 / 10 to 1 / 5 to achieve a reasonable separation of the inner and outer ring frequency bands and avoid double-ring coupling oscillations; the formula numerator... This represents the load inertia, in the denominator This represents the motor's torque coefficient, and the ratio of these two factors constitutes the physical gain from speed error to torque demand. The speed loop parameters generated by this analytical formula naturally adapt to the motor's electromechanical characteristics, achieving good disturbance rejection performance and tracking accuracy without the need for additional step response testing.
[0052] It should be understood that the initial PID parameter control values generated in this embodiment are not the final optimal solution, but rather serve as a reliable starting point and safety boundary for the subsequent dynamic adjustment stage. Because motors experience resistance changes due to temperature rise, inductance drift caused by deepening magnetic saturation, and inertia perturbations due to mechanical wear during actual operation, controllers with fixed parameters struggle to maintain optimal performance throughout their entire lifecycle. Therefore, this set of initial values, calculated based on high-precision static parameters, primarily serves to provide a physically meaningful and stable initial value for the adaptive adjustment of the digital twin drive, preventing overcurrent, oscillation, or runaway risks during motor startup due to severe initial gain mismatch. It also significantly reduces the convergence time of the AI model and the computational load of online optimization.
[0053] Please see Figure 4 In one possible implementation, the current loop PID control values and speed loop PID control values of the motor under operating conditions are adjusted based on the current loop PID control values, speed loop PID control values, and a pre-built digital twin model of the motor, including: The initial current loop PID control values and speed loop PID control values are used to control the motor digital twin model for simulation operation. Various operating parameters of the motor are acquired and input into the motor digital twin model, allowing the model to simulate the motor's operating state. These operating parameters include, but are not limited to, three-phase current, bus voltage, rotor position, speed, and winding temperature. The motor's operating parameters are input at regular intervals, such as 1 second. It is understood that motor digital twin model construction is a relatively existing technology, and will not be elaborated upon here. It is worth noting that some parameters in the motor digital twin model construction in this embodiment can be obtained from measured motor parameters. This yields various simulation monitoring parameters for the motor digital twin model. Various simulated monitoring parameters, along with the motor digital twin model or the motor's current loop PID control values and speed loop PID control values, are input into the control value adjustment model to obtain the corresponding adjusted current loop PID control values and speed loop PID control values. The actual motor is then adjusted based on these adjusted values, and the motor digital twin model is simultaneously adjusted. That is, the motor digital twin model and the motor's current loop PID control values and speed loop PID control values should be synchronized. The control value adjustment model is obtained through training with an artificial intelligence model.
[0054] In one possible implementation, the control value adjustment model is trained using an artificial intelligence model, including: acquiring several historical first current loop PID parameter control values and first speed loop PID parameter control values, corresponding to various monitoring parameters of the motor, and adjusted second current loop PID parameter control values and second speed loop PID parameter control values of the motor. The adjusted second current loop PID parameter control values and second speed loop PID parameter control values are values adjusted by experts based on various monitoring parameters of the motor. Several corresponding first current loop PID parameter control values, first speed loop PID parameter control values, various monitoring parameters of the motor, and second current loop PID parameter control values and second speed loop PID parameter control values are integrated into several training data and verification data. The training data is used to train the artificial intelligence model, and the verification data is used to verify the trained artificial intelligence model. The final result is a control value adjustment model with inputs consisting of various simulated monitoring parameters and the current current loop PID parameter control values and speed loop PID parameter control values of the motor, and output consisting of the corresponding adjusted current loop PID parameter control values and speed loop PID parameter control values. The artificial intelligence model includes deep neural network models or convolutional neural network models, etc.
[0055] In one possible implementation, a warning signal is generated by comparing the deviations between various monitoring parameters of the motor and the corresponding simulated monitoring parameters of the motor's digital twin model, including: The values corresponding to each monitoring parameter are integrated into an actual feature vector according to a set order; The numerical values corresponding to each simulated monitoring parameter are integrated into a simulated feature vector according to a set order; The Euclidean distance between the actual feature vector and the simulated feature vector can be calculated, or other parameters that can represent the difference between the vectors can be used; when the Euclidean distance is greater than the corresponding set threshold, a deviation alarm signal is generated, indicating abnormal motor operation by the staff or a mismatch between the motor digital twin model and the actual motor operating state.
[0056] Specifically, the Euclidean distance, as a quantitative indicator representing the consistency between the virtual and real worlds, is calculated using the following formula:
[0057] in: For Euclidean distance, The number of feature dimensions. The first eigenvector of the actual feature vector One portion, For the simulated eigenvector of the th Each component.
[0058] When the Euclidean distance exceeds a set threshold, the system determines that the confidence level of the current digital twin is insufficient or that the motor is malfunctioning. It then generates a deviation alarm signal, prompting staff to intervene or automatically switching to a conservative default control strategy. The threshold is typically calibrated based on the statistical distribution of the virtual-to-real deviation under normal motor operating conditions. For example, three times the standard deviation of the mean Euclidean distance under normal operating conditions is used as the trigger limit to suppress false alarms caused by sensor noise while maintaining sensitivity. This mechanism provides a robust safety boundary for AI-driven adaptive adjustments, ensuring that the system maintains basic safe operation even under extreme conditions or model failure.
[0059] Finally, the actual motor is adjusted based on the adjusted PID control values of the current loop and speed loop. It is particularly important to emphasize that the adjusted PID parameters are not only sent to the actual motor controller for execution, but also simultaneously updated in the motor's digital twin model, ensuring strict consistency between the twin's control strategy and the actual motor. This bidirectional synchronization mechanism guarantees that the digital twin model can still accurately predict the behavior of the actual motor in the next adjustment cycle, avoiding the accumulation of prediction deviations caused by the divergence between virtual and real control strategies. This application achieves intelligent evolution of motor control parameters throughout its entire lifecycle, avoiding the oscillation and overcurrent risks that may arise from online self-tuning, and significantly improving the system's robustness and energy efficiency under varying operating conditions, aging, and environmental disturbances. It should be understood that although this embodiment describes a warning method based on Euclidean distance, in other embodiments, Mahalanobis distance, cosine similarity, or other multidimensional spatial metrics can also be used to evaluate the virtual-real deviation, as long as effective monitoring of model confidence can be achieved.
[0060] Some of the data in the above formula are calculated by removing dimensions and taking their numerical values. The formula is the closest to the real situation obtained by software simulation of a large amount of collected data. The preset parameters and preset thresholds in the formula are set by those skilled in the art according to the actual situation or obtained through simulation of a large amount of data.
[0061] The above embodiments are only used to illustrate the technical methods of this application and are not intended to limit it. Although this application has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical methods of this application without departing from the spirit and scope of the technical methods of this application.
Claims
1. A high-precision method for motor parameter identification and PID automatic tuning, characterized in that, include: The parameters of the motor are measured when it is not in operation, and several corresponding motor parameters are obtained. The parameter measurement includes multi-level measurement of resistance and inductance parameters, as well as measurement of rotational inertia and flux linkage parameters. Initial current loop PID control values and speed loop PID control values are generated based on motor parameters; The PID control values of the current loop and speed loop of the motor are adjusted based on the PID control values of the current loop and speed loop, and a pre-built digital twin model of the motor.
2. The high-precision motor parameter identification and PID automatic tuning method according to claim 1, characterized in that, The multi-stage measurement of the resistance parameter includes: S1: Obtain the set current test sequence; the current test sequence includes several test currents used for testing; S2: Generate the first differential current corresponding to each test current, and use the first differential current as the test differential current; S3: Test the motor in non-operational state based on the test differential current to obtain several corresponding compensation voltages; compensate the voltage based on the compensation voltages and calculate several corresponding first resistance parameters; S4: Calculate the dispersion of several first resistance parameters; determine whether the dispersion is less than the set dispersion threshold; if yes, proceed to S6; if no, proceed to S5. S5: Based on several first differential currents and their corresponding first resistance parameters, identify several second differential currents; use the second differential currents as test differential currents to enter S3; S6: Generate the final resistance parameters based on several of the first resistance parameters.
3. The high-precision motor parameter identification and PID automatic tuning method according to claim 2, characterized in that, The determination of several second differential currents based on several first differential currents and their corresponding first resistance parameters includes: Obtain the number corresponding to each first resistor parameter, and the number corresponding to the first resistor parameter is consistent with the number of the corresponding test differential current. Obtain the set number of parameters, and select several consecutively numbered first resistor parameters from each first resistor parameter to form a test group based on the number of parameters, and obtain several test groups in sequence. Calculate the dispersion of each first resistor parameter in each test group; obtain the test differential current corresponding to each first resistor parameter in the test group with the smallest dispersion; obtain the minimum and maximum values of the test currents corresponding to each test differential current, and the number of test differential currents corresponding to the first resistor parameters in the test group; Obtain the set subdivision factor; record the product of the quantity and the subdivision factor as the subdivision quantity; divide the current corresponding to the minimum and maximum values to obtain the second differential current corresponding to the subdivision quantity.
4. The high-precision motor parameter identification and PID automatic tuning method according to claim 1, characterized in that, The multi-level measurement of the inductance parameters includes: S1: Obtain the set current test sequence; the current test sequence includes several test currents used for testing; S2: Generate the first differential current and the first bias current corresponding to each test current, and use the first differential current as the test differential current and the first bias current as the test bias current. S3: Test the motor in non-operational state based on the test differential current to obtain the corresponding compensation voltage; test the motor in non-operational state based on the test bias current, and calculate several corresponding first inductance parameters based on the compensation voltage. S4: Calculate the direct-axis dispersion of the direct-axis inductance parameter and the quadrature-axis dispersion of the quadrature-axis inductance parameter among several first inductance parameters respectively; calculate the corresponding comprehensive dispersion based on the direct-axis dispersion and quadrature-axis dispersion; determine whether the comprehensive dispersion is less than the set dispersion threshold; if yes, proceed to S6; if no, proceed to S5. S5: Based on several first DC biases and their corresponding first inductance parameters, several second test currents are determined; the second test currents are used as test currents, and the process proceeds to S2; S6: Output the first inductance parameter corresponding to each bias test current, and use the first inductance parameter as the inductance parameter of the test current corresponding to the bias test current; the inductance parameter includes direct-axis inductance parameter and quadrature-axis inductance parameter.
5. The high-precision motor parameter identification and PID automatic tuning method according to claim 4, characterized in that, The motor in its non-operational state is tested based on the first bias current, and several corresponding first inductance parameters are calculated based on the compensation voltage, including: Each test bias current is numbered in ascending order of its corresponding current value. The test bias currents are then sequentially applied to the non-operating motor in the order of their corresponding numbers, and a high-frequency voltage pulse excitation of a set amplitude is superimposed. The corresponding pulse voltage change, current change, and pulse duration are then obtained. Obtain the corresponding compensation voltage, compensate the voltage based on the compensation voltage, and calculate the first inductance parameter corresponding to the test bias current based on the pulse voltage, current change, and pulse duration; the first inductance parameter includes direct-axis inductance parameter and quadrature-axis inductance parameter.
6. The high-precision motor parameter identification and PID automatic tuning method according to claim 4, characterized in that, The determination of several second test currents based on several first DC biases and their corresponding first inductance parameters includes: Obtain the number corresponding to each first inductor parameter, and the number corresponding to the first inductor parameter is consistent with the number of its corresponding test bias current; Obtain the set number of parameters, and select several consecutively numbered first inductor parameters from each first inductor parameter to form a test group based on the number of parameters, and obtain several test groups in sequence; Calculate the direct-axis dispersion of the direct-axis inductance parameter and the quadrature-axis dispersion of the quadrature-axis inductance parameter in each test group; calculate the corresponding comprehensive dispersion based on the direct-axis dispersion and the quadrature-axis dispersion. Obtain test groups with a comprehensive dispersion greater than a set dispersion threshold; obtain the test bias current corresponding to each first inductor parameter in the test group; obtain the minimum and maximum values of the test currents corresponding to each test bias current, and the number of test bias currents corresponding to the first inductor parameters in the test group; Obtain the set subdivision factor; record the product of the quantity and the subdivision factor as the subdivision quantity; divide the interval between the minimum and maximum values of the test current evenly to obtain the second test current corresponding to the subdivision quantity.
7. A high-precision motor parameter identification and PID automatic tuning method according to claim 2 or 4, characterized in that, Based on the aforementioned differential current, the motor in a non-operating state is tested to obtain several corresponding compensation voltages, including: Each test differential current is numbered in ascending order of its corresponding current value. The test differential currents are then sequentially applied to the motor in a non-operating state according to their corresponding numbers, and the corresponding differential voltages are measured. The compensation voltage corresponding to the test differential current is calculated based on the differential voltage and its corresponding test differential current.
8. The high-precision motor parameter identification and PID automatic tuning method according to claim 1, characterized in that, The determination of the moment of inertia parameter includes: The system acquires a set electromagnetic torque and controls the motor to output a constant electromagnetic torque for accelerated rotation; it acquires the motor speed in real time, and when the speed reaches the set speed value, it controls the motor to output a constant reverse electromagnetic torque for decelerated rotation; and it acquires the first angular acceleration during the motor's accelerated rotation and the second angular acceleration during the decelerated rotation. The moment of inertia parameters are calculated based on the first angular acceleration, the second angular acceleration, and the electromagnetic torque.
9. The high-precision motor parameter identification and PID automatic tuning method according to claim 1, characterized in that, The generation of initial current loop PID parameter control values and speed loop PID parameter control values based on motor parameters includes: Obtain the target operating current, and based on the target operating current, query the corresponding inductance parameters from the motor parameters; The initial current loop PID control value is generated based on the resistance parameter in the motor parameters and the inductance parameter obtained by query. The speed loop PID parameter control values are generated based on the rotational inertia parameter and flux linkage parameter in the motor parameters.
10. The high-precision motor parameter identification and PID automatic tuning method according to claim 1, characterized in that, The current loop PID control values and speed loop PID control values of the motor under operating conditions are adjusted based on the current loop PID control values, speed loop PID control values, and a pre-built digital twin model of the motor, including: The initial current loop PID parameter control values and speed loop PID parameter control values are used to control the motor digital twin model for simulation operation; various operating parameters of the motor are obtained and input into the motor digital twin model to obtain various simulation monitoring parameters of the motor digital twin model; Various simulated monitoring parameters, as well as the current loop PID parameter control values and speed loop PID parameter control values of the motor digital twin model, are input into the control value adjustment model to obtain the corresponding adjusted current loop PID parameter control values and speed loop PID parameter control values. The real motor is then adjusted based on the adjusted current loop PID parameter control values and speed loop PID parameter control values. The control value adjustment model is obtained through training an artificial intelligence model.