Motor drive control method, device and drive motor
Patent Information
- Application Number
- CN202611324112.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]然而,现有技术存在明显缺陷:多数方案仅优化单一固定载频或仅对随机载频进行开关控制,未将两个核心参数同时作为连续在线优化变量;基于固定规则或离线MAP表的方法缺乏闭环自适应能力;在线优化算法计算复杂度过高,无法在微秒级控制周期内于嵌入式控制器中实时求解
[0031](1)本申请所述的电机驱动控制方法,通过将预设学习模型部署于电机控制器本地,实现随机载频参数的在线实时决策,无需依赖外部上位机或云端实时计算,避免通信延迟,保证控制实时性和系统自主性;且预设学习模型能够根据实时工况参数动态输出适配的随机载频参数,使载波频率跟随工况变化自适应调整,克服固定载频方案无法响应工况瞬变的缺陷;同时,完整的闭环控制链路使随机载频控制从开环模式升级为全闭环自适应模式,提高系统的可靠性和安全性。
Smart Images

Figure CN123019541A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motor drive control technology, and in particular to a motor drive control method, device and drive motor. Background Technology
[0002] Permanent magnet synchronous motors widely employ pulse width modulation (PWM) technology for driving. The selection of the carrier frequency directly affects three key indicators: system efficiency, vibration and noise performance (NVH), and thermal management of power devices. To improve the harmonic concentration problem caused by fixed carrier frequencies, random carrier frequency technology diffuses harmonic energy by randomly varying the carrier frequency within a certain range. Its control effect depends on two core parameters: the center frequency and the frequency fluctuation range.
[0003] However, existing technologies have obvious drawbacks: most schemes only optimize a single fixed carrier frequency or only switch random carrier frequencies, without using both core parameters as continuous online optimization variables simultaneously; methods based on fixed rules or offline MAP tables lack closed-loop adaptive capabilities; and the computational complexity of online optimization algorithms is too high to be solved in real time in embedded controllers within microsecond-level control cycles.
[0004] Furthermore, existing solutions generally rely on accurate physical models and expert experience, resulting in poor portability and long development cycles. Therefore, how to achieve low-latency online adaptive optimization of random carrier frequency dual parameters on resource-constrained embedded platforms while comprehensively balancing efficiency, vibration noise, and thermal management is a pressing technical challenge in this field. Summary of the Invention
[0005] In view of this, this application aims to propose a motor drive control method, device and drive motor to achieve online real-time adaptive optimization of random carrier frequency dual parameters, and to achieve a comprehensive balance between system efficiency, vibration and noise performance and thermal management.
[0006] To achieve the above objectives, the technical solution of this application is implemented as follows:
[0007] A motor drive control method, applied to a motor controller, includes:
[0008] Obtain the current operating parameters of the motor, including at least one of motor speed, load torque, DC bus voltage, phase current, and power device temperature;
[0009] The operating condition parameters are input into a preset learning model deployed in the motor controller, and the preset learning model outputs random carrier frequency parameters that are adapted to the operating condition parameters.
[0010] The carrier frequency for the current motor control cycle is generated based on the random carrier frequency parameters, and the motor is driven based on the carrier frequency.
[0011] Furthermore, the random carrier frequency parameters include the center frequency and the frequency fluctuation range.
[0012] Furthermore, the preset learning model is obtained through the following process:
[0013] Construct a dataset, which includes the motor's operating parameters under various preset operating conditions, the random carrier frequency parameters corresponding to the operating parameters, and preset index parameters reflecting the motor's operating performance.
[0014] A lightweight machine learning model is trained using the dataset and a preset multi-objective loss function, wherein the multi-objective loss function is used to weigh at least two conflicting preset index parameters.
[0015] The preset learning model is obtained after the lightweight machine learning model has been trained.
[0016] Furthermore, the construction of the dataset includes:
[0017] The operating parameters of the motor are traversed across the entire operating range, and the operating parameters under different combinations of operating conditions are collected. The operating parameters include the operating condition vector and the corresponding preset index parameters.
[0018] A multi-objective optimization algorithm is adopted to solve the Pareto optimal solution set for each working condition with the goal of optimizing at least two preset index parameters.
[0019] According to the preset strategy, the optimal random carrier frequency parameters are selected from each Pareto optimal solution set, and associated with the corresponding operating condition vector to form labeled sample data, thus constructing the dataset.
[0020] Furthermore, the multi-objective loss function is composed of at least two of the following: efficiency cost term, vibration and noise cost term, and thermal management cost term;
[0021] The efficiency cost is related to motor switching losses;
[0022] The vibration and noise cost term is related to the noise performance, which is jointly determined by the carrier frequency parameter and the motor speed.
[0023] The thermal management cost item is related to the junction temperature of the power devices in the motor controller.
[0024] Furthermore, the lightweight machine learning model adopts a lightweight gradient boosting machine model based on a tree model.
[0025] Furthermore, after obtaining the preset learning model, the motor drive control method further includes:
[0026] The obtained preset learning model is optimized, and the optimization includes at least one of model pruning, parameter quantization, and generating embedded code.
[0027] Furthermore, after obtaining the current operating parameters of the motor, the motor drive control method further includes:
[0028] The acquired working condition parameters are preprocessed to construct a feature vector that is consistent with the input feature vector format of the preset learning model;
[0029] The preprocessing includes normalization.
[0030] Compared with related technologies, this application has the following advantages:
[0031] (1) The motor drive control method described in this application realizes online real-time decision-making of random carrier frequency parameters by deploying a preset learning model locally on the motor controller. It does not rely on external host computer or cloud real-time calculation, avoids communication delay, and ensures control real-time performance and system autonomy. Moreover, the preset learning model can dynamically output adapted random carrier frequency parameters according to real-time operating condition parameters, so that the carrier frequency can adaptively adjust with changes in operating conditions, overcoming the defect that the fixed carrier frequency scheme cannot respond to transient changes in operating conditions. At the same time, the complete closed-loop control link upgrades the random carrier frequency control from open-loop mode to full closed-loop adaptive mode, improving the reliability and safety of the system.
[0032] (2) By expanding the control dimension of random carrier frequency from a single parameter to a dual-parameter coordinated control of center frequency and frequency fluctuation range, the control freedom of random carrier frequency is improved. The center frequency determines the overall position of the spectrum, and the frequency fluctuation range determines the spread width of the spectrum. The synergy between the two makes the frequency domain distribution of harmonic energy more flexible and controllable, and can be used for targeted optimization of vibration and noise sensitive frequency bands under different operating conditions, so as to achieve a more refined dynamic trade-off between efficiency, vibration and noise and thermal management.
[0033] (3) By constructing a dataset covering all working conditions for offline training, the model learns the optimal mapping relationship before leaving the factory, without the need for on-site online self-learning or manual tuning, simplifying the debugging process; the multi-objective loss function enables the model to have multi-objective optimization capabilities, automatically finding the Pareto optimal compromise solution among conflicting indicators, without relying on repeated weighing of manual experience; a lightweight model is used to replace deep neural networks or online solvers, reducing the amount of inference computation while ensuring accuracy, so that it can be deployed in resource-constrained embedded controllers.
[0034] (4) By collecting data across the entire operating range, the training samples cover all operating areas of the motor, avoiding deviations caused by extrapolation of the model under uncovered operating conditions, and ensuring the reliability of the output across the entire operating range; a multi-objective optimization algorithm is used to solve the Pareto optimal solution set, and the optimal compromise solution is systematically searched among multiple conflicting objectives to obtain higher quality supervision labels; the introduction of preset strategies makes the dataset construction have a clear engineering orientation, which can support multiple working modes, and one framework can adapt to different application needs; labeled samples are used for supervised learning, so that online inference only needs one forward calculation to obtain the optimal solution, avoiding the computational burden of online iterative solution.
[0035] (5) The efficiency cost term enables the model to perceive the impact of different carrier frequencies on system efficiency and learn to prioritize the selection of parameters with lower switching losses to achieve energy saving and consumption reduction; the vibration and noise cost term enables the model to understand the nonlinear influence of carrier frequency parameters on noise performance and automatically select better parameters to reduce noise and vibration under vibration and noise sensitive conditions; the thermal management cost term introduces the thermal accumulation effect through a first-order RC thermal equivalent network, enabling the model to have forward-looking thermal management capabilities and avoid long-term thermal accumulation exceeding the standard due to short-term performance optimization; the three cost terms can be flexibly adapted to different application scenarios through configurable weight coefficients without redesigning the algorithm framework.
[0036] (6) By adopting a lightweight gradient booster model, the model has a small size and low inference computation, which can effectively adapt to the limited storage and computing resources of the motor controller. At the same time, the model has a good fitting ability for tabular data and can accurately establish the mapping relationship between multidimensional operating condition parameters and random carrier frequency parameters, thus meeting the microsecond-level real-time response requirements of motor control while ensuring decision accuracy.
[0037] (7) By performing optimization processes such as pruning, parameter quantization and embedded code generation on the pre-trained learning model, the storage space occupied by the model can be further reduced and the computational overhead during online inference can be reduced. This allows the model, which originally needs to run on the cloud or a high-performance platform, to be deployed efficiently and stably in a resource-constrained embedded motor controller without relying on an additional interpreter or inference framework.
[0038] (8) By filtering and normalizing the original sensor data before model inference, filtering eliminates noise interference and instantaneous spikes, avoiding outliers that cause model misjudgment; normalization maps the features of each dimension to a specified interval, eliminating the influence of dimensional differences on model decision-making, and ensuring that the distribution of input features is consistent with that during offline training; the preprocessed feature vectors are completely matched with the training data format, ensuring the correctness and reliability of online model inference.
[0039] Another objective of this application is to provide a motor drive control device, applied to a motor controller, comprising:
[0040] The acquisition module is used to acquire the current operating parameters of the motor;
[0041] The processing module is used to input the operating condition parameters into a preset learning model deployed in the motor controller, and the preset learning model outputs random carrier frequency parameters that are adapted to the operating condition parameters.
[0042] The drive control module is used to generate the carrier frequency of the current motor control cycle according to the random carrier frequency parameters, and drive the motor based on the carrier frequency.
[0043] This application also proposes a drive motor, including a motor controller, the motor controller including a memory and a processor;
[0044] The memory stores computer programs;
[0045] The processor executes the computer program, enabling the implementation of the motor drive control method described above.
[0046] The motor drive control device of this application forms a closed-loop adaptive control system by having three modules that all run locally on the motor controller without relying on external computing power; the modular design makes the device highly portable and can be integrated into different models of motor controller hardware platforms. Attached Figure Description
[0047] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0048] Figure 1 This is a schematic diagram of the overall process of the motor drive control method described in the embodiments of this application;
[0049] Figure 2 This is a flowchart of the offline training phase of the preset learning model described in the embodiments of this application;
[0050] Figure 3 This is a block diagram of the overall architecture of the motor drive control device described in the embodiments of this application.
[0051] Figure label:
[0052] 610. Acquisition module; 620. Processing module; 630. Drive control module. Detailed Implementation
[0053] To make the technical solution and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0055] Furthermore, it should be noted that in the description of this application, if terms such as "upper," "lower," "inner," or "outer" appear, indicating orientation or positional relationship, these are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation on this application. In addition, if terms such as "first" or "second" appear, they are also used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0056] Furthermore, in the description of this application, unless otherwise expressly defined, the terms "installation," "connection," "joining," and "connector" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection between two components. Those skilled in the art can understand the specific meaning of the above terms in this application in light of the specific circumstances.
[0057] In this application, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0058] The present application will now be described in detail through exemplary embodiments. However, it should be understood that, without further description, elements, structures, and features in one embodiment may be advantageously incorporated into other embodiments.
[0059] An embodiment of the first aspect of this application provides a motor drive control method applied to a motor controller for adaptive random carrier frequency control of the pulse width modulation (PWM) process driving a permanent magnet synchronous motor by a voltage source inverter. The motor drive control method proposed in this application deploys an offline-trained lightweight machine learning model in the motor controller to achieve online real-time adaptive optimization of random carrier frequency parameters. This synergistically improves system efficiency, enhances vibration and noise performance, and optimizes thermal management (vibration and noise performance is assessed by analyzing the noise spectrum with a spectrum analyzer and combining it with subjective evaluation by professionals; a lower score indicates better vibration and noise performance).
[0060] In related technologies, the selection of carrier frequency in pulse width modulation control of motor drive systems directly affects three key indicators: system efficiency, vibration and noise performance, and thermal management of power devices.
[0061] However, in actual operation, the motor's operating conditions (such as speed and torque) have significant time-varying characteristics. For example, it is in steady-state cruise condition during some periods, while it is in transient conditions such as rapid acceleration and heavy-load climbing during other periods.
[0062] If carrier frequency control is performed using uniform rules or fixed parameters for all operating conditions in accordance with the methods described in related technologies, on the one hand, in order to meet the response speed and performance requirements under transient operating conditions, a highly complex online optimization algorithm is required, which would place an excessive computational burden on the control process under steady-state operating conditions; on the other hand, if simplified rules or fixed MAP tables are used to reduce the computational complexity under steady-state operating conditions, the control effect under transient operating conditions will suffer a significant performance loss, making it impossible to achieve a dynamic optimal balance between efficiency, vibration noise, and thermal management.
[0063] In view of this, in order to overcome the shortcomings of related technologies, the motor drive control method in this embodiment combines... Figure 1 The overall design comprises two main phases: an offline training phase and an online deployment and operation phase. The offline training phase, executed on a cloud server or high-performance computing platform, generates a lightweight machine learning model and its internal parameters. The online deployment and operation phase is executed within the embedded processor (e.g., a digital signal processor (DSP) or microcontroller unit (MCU)) of the motor controller, performing model inference based on real-time operating conditions and outputting optimal random carrier frequency parameters. Specifically, this includes steps S110 to S130.
[0064] Step S110: Obtain the current operating parameters of the motor.
[0065] Specifically, step S110 is executed within each control cycle of the motor controller, collecting operating parameters of the motor and power module through various sensors, which are the real-time operating parameters during the online inference phase. These operating parameters include, but are not limited to, motor speed (Spd), load torque (Tq), phase current, DC bus voltage (Vdc), and the temperature of power devices (such as IGBTs).
[0066] The peak phase current Ipeak is obtained as follows: During each PWM control cycle, the three-phase currents are sampled by an ADC using a current Hall sensor, with the sampling time synchronized with the peak or trough of the PWM carrier cycle. The maximum absolute value of the sampled three-phase instantaneous currents ia, ib, and ic is taken as the peak phase current for that cycle, i.e., Ipeak = max(|ia|, |ib|, |ic|). To eliminate sampling noise, the Ipeak values from three consecutive cycles are filtered using a moving average and then used as the input features for subsequent models.
[0067] The rotational speed can be obtained through a rotary transformer or a Hall sensor, the torque can be estimated through a torque sensor or a current-based observer, the phase current can be obtained through a current Hall sensor or a shunt resistor, and the temperature can be obtained through a negative temperature coefficient thermistor (NTC) or a temperature sensor arranged on the power module substrate or chip surface.
[0068] It should be noted that the system efficiency and vibration noise performance scores are only used as evaluation criteria for generating the optimal carrier frequency labels during the offline training phase, and are not real-time input features for the online inference phase. They cannot and do not need to be collected by sensors during the online operation of the actual vehicle.
[0069] In step S110, the acquisition frequency is consistent with the control cycle. For example, when the control cycle is 100 microseconds, step S110 is executed once every 100 microseconds to acquire the current operating parameters in real time.
[0070] Step S120: Input the operating condition parameters into the preset learning model deployed in the motor controller, and have the preset learning model output random carrier frequency parameters that are adapted to the operating condition parameters.
[0071] The process includes preprocessing, which includes data filtering and normalization, before inputting the operating parameters into the preset learning model deployed in the motor controller.
[0072] Specifically, the collected raw operating parameters are first digitally filtered to eliminate noise and transient interference. This embodiment can use a first-order low-pass filter or a median filter for filtering. The filtered data is smoother and more stable, which is beneficial for improving the accuracy of subsequent model inference. The filtered operating parameters are then constructed into a feature vector consistent with the preset learning model input feature vector format. Specifically, in this embodiment, the motor speed (Spd), load torque (Tq), DC bus voltage (Vdc), peak phase current (Ipeak), and IGBT junction temperature (T) are arranged in a preset order to construct the online inference input feature vector X=[Spd, Tq, Vdc, Ipeak, T]. Subsequently, the normalization parameters determined during offline training (i.e., the minimum value Xmin and maximum value Xmax of each feature in the training samples) are used to uniformly map each feature to the range [0, 1]. The normalization process uses the following formula:
[0073] Xnorm=(Xraw-Xmin) / (Xmax-Xmin).
[0074] Where Xraw is the original feature value after filtering, Xmin and Xmax are the minimum and maximum values of the feature in the offline training samples, respectively, and Xnorm is the normalized feature value.
[0075] Therefore, the preprocessed feature vectors are completely consistent with the input format in the offline training stage, ensuring that the preset learning model can correctly identify and process the input data. At this point, the constructed normalized feature vectors are input into the preset learning model that has been deployed in the non-volatile memory of the motor controller to perform forward inference calculations.
[0076] The preset learning model is the LightGBM model, which has been trained offline and optimized for lightweight performance. This model uses a lightweight gradient booster as its core algorithm and is deployed in the motor controller after optimization steps such as pruning, quantization, and embedded code generation.
[0077] Specifically, the model inference process is as follows: After the normalized feature vector is input into the model, each decision tree in the model is traversed sequentially. For each tree, starting from the root node, a conditional judgment is made based on the feature index and split threshold of the current node to determine whether to move to the left or right subtree, until a leaf node is reached and the predicted value of that leaf node is obtained. The predicted values of all trees are summed to obtain the final model output.
[0078] The model outputs the optimal random carrier frequency parameters for the current moment, namely the optimal center carrier frequency (Fcopt) and the optimal frequency fluctuation range (ΔFopt). It should be noted that the model output values are normalized values within the range [0, 1], and need to undergo denormalization to map them to the actual physical range allowed by the controller hardware. Denormalization uses the following formula:
[0079] Fcactual=Fcnorm×(Fcmax-Fcmin)+Fcmin;
[0080] ΔFactual=ΔFnorm×(ΔFmax-ΔFmin)+ΔFmin.
[0081] Where Fcnorm and ΔFnorm are the normalized values of the model output, Fcmin and Fcmax are the minimum and maximum values of the center frequency within the hardware allowable range, respectively, and ΔFmin and ΔFmax are the minimum and maximum values of the frequency fluctuation range within the hardware allowable range, respectively.
[0082] Among the aforementioned denormalization parameters, Fcmin, Fcmax, ΔFmin, and ΔFmax are consistent with the normalization extremum parameters used during offline training. Their values depend on the hardware design constraints of the motor controller and the specifications of the power devices. In this embodiment, the example value ranges are: Fcmin = 2kHz (minimum carrier frequency, limited by audio noise and current ripple requirements), Fcmax = 16kHz (maximum carrier frequency, limited by power device switching losses and heat dissipation capabilities), ΔFmin = 0.5kHz (minimum fluctuation range, ensuring basic harmonic diffusion effects), and ΔFmax = 4kHz (maximum fluctuation range, limited by control bandwidth and current loop response capabilities). These parameters need to be calibrated according to the actual IGBT model and the motor controller's heat dissipation conditions. If changes to the hardware platform lead to adjustments in the parameter range, only the mapping parameters of the denormalization stage need to be modified; retraining the model is not required.
[0083] According to actual tests, after INT8 quantization, the number of parameters of a LightGBM model containing 50 trees with no more than 31 leaves per tree can be controlled within 100KB. The inference latency on a Cortex-M7 processor with a main frequency of 100MHz is less than 10 microseconds, which meets the real-time control requirements.
[0084] Step S130: Generate the carrier frequency of the current motor control cycle according to the random carrier frequency parameters, and drive the motor based on the carrier frequency.
[0085] Specifically, based on the optimal center carrier frequency and the optimal frequency fluctuation range, a random algorithm is used to generate the actual carrier frequency used in the current motor control cycle. The actual carrier frequency changes randomly within an interval with the optimal center frequency and the optimal frequency fluctuation range as its width.
[0086] In one preferred embodiment, the random carrier frequency is generated in the following manner:
[0087] First, random number generation uses a Linear Congruential Generator (LCG) to generate uniformly distributed random numbers r within the interval [0, 1). The recursive formula for the LCG is:
[0088] r{n+1}=(a×rn+c)modm.
[0089] Where a, c, and m are preset constants, rn is the current random number, and r{n+1} is the next random number.
[0090] To ensure the unpredictability of the random sequence after each power-on, the initial seed r0 of the LCG random number generator is dynamically generated during the initialization of the motor controller each time it is powered on. Specifically, the current count value of the hardware timer is read and XORed with the lower 32 bits of the chip's unique identifier (UID), and the result is used as the initial seed. Using a dynamic seed avoids the repeated concentration of harmonic energy at specific frequency points caused by a fixed seed, ensuring the long-term effectiveness of the harmonic diffusion effect of the random carrier frequency.
[0091] Secondly, random frequency mapping maps the generated random number r to the interval [Fcopt-1 / 2×ΔFopt, Fcopt+1 / 2×ΔFopt]. Based on the optimal center frequency Fcopt and optimal frequency fluctuation range ΔFopt output by the preset learning model in step S120, the mapping formula is as follows:
[0092] Fopt = Fcopt + (r - 0.5) × ΔFopt.
[0093] Therefore, the actual carrier frequency fluctuates uniformly and randomly around the center frequency, and the generated carrier frequency Fopt must satisfy the following constraints:
[0094] Fopt∈[Fcopt-1 / 2×ΔFopt, Fcopt+1 / 2×ΔFopt].
[0095] It should be noted that the randomization algorithm used in this embodiment must be consistent with the randomization algorithm used in the offline training phase. Specifically, the randomization algorithm uses the Linear Congruential Generator (LCG) described above in this embodiment to generate uniformly distributed random numbers, and then maps the random numbers to the aforementioned interval range. Using a consistent randomization algorithm ensures that the performance evaluation in the offline training phase matches the actual performance in the online running phase.
[0096] In this embodiment, a random carrier frequency is generated independently for each PWM cycle, so that the switching frequency of each cycle is randomly distributed near the center frequency, thereby spreading the discrete harmonic energy to the continuous frequency band and effectively reducing the noise peak at a specific frequency point.
[0097] In some exemplary embodiments, driving a motor based on a carrier frequency includes two sub-steps: vector control and power drive.
[0098] Specifically, vector control synchronously updates the sampling trigger time of the analog-to-digital converter (ADC) for the motor angle signal and three-phase current based on the carrier frequency generated in step S120. In particular, changes in the carrier frequency affect the counting period of the PWM timer, thus affecting the synchronization timing of the ADC sampling. This embodiment synchronizes the ADC sampling trigger time with the counting period of the PWM timer to ensure that the current sampling time maintains a fixed phase relationship with the PWM carrier period, avoiding sampling errors.
[0099] As one preferred embodiment, the motor vector control module performs closed-loop control in the following manner.
[0100] Current sampling and coordinate transformation are performed when the PWM timer count reaches a specific phase point (e.g., at the peak or trough of the carrier cycle), triggering the ADC to sample the three-phase currents. The sampled instantaneous current values ia, ib, and ic are then transformed by Clark to obtain the currents iα and iβ in the two-phase stationary coordinate system.
[0101] iα=ia;
[0102] iβ=(ia+2×ib) / √3.
[0103] The currents id and iq in the two-phase rotating coordinate system (dq coordinate system) are obtained through Park transformation:
[0104] id=iα×cos(θ)+iβ×sin(θ);
[0105] iq=-iα×sin(θ)+iβ×cos(θ).
[0106] Where θ is the rotor position electrical angle (obtained in real time by a rotary transformer or encoder).
[0107] Based on the torque command Tref given by the upper-level system, the q-axis current command iqref is calculated. For a surface-mounted permanent magnet synchronous motor (SPMSM), iqref = Tref / (1.5 × p × ψf), where p is the number of pole pairs and ψf is the permanent magnet flux linkage. For an interior permanent magnet synchronous motor (IPMSM), the reluctance torque component must also be considered, and the d-axis and q-axis current commands are allocated using the Maximum Torque Per Ampere (MTPA) algorithm.
[0108] The difference between idref and id is input into the d-axis PI controller to obtain the d-axis voltage command Vd; the difference between iqref and iq is input into the q-axis PI controller to obtain the q-axis voltage command Vq. Vd and Vq are then subjected to Park inverse transform to obtain the voltage commands Vα and Vβ in the two-phase stationary coordinate system, and then subjected to Clark inverse transform to obtain the three-phase voltage commands Va, Vb, and Vc. The three-phase voltage commands are divided by the DC bus voltage Vdc to obtain the three-phase duty cycle commands Da, Db, and Dc, whose values are between 0 and 1. The duty cycle commands are written into the PWM timer's compare register. When the count value of the carrier period reaches the compare value, the output level is toggled, generating the PWM signal to drive the power switching transistor.
[0109] It is important to note that when the carrier frequency Fopt changes, the PWM timer's period register (which determines the carrier period) is updated synchronously. Simultaneously, the ADC sampling trigger time also needs to be recalculated based on the new carrier period to ensure that the sampling time always falls within the peak or trough of the PWM period, thus guaranteeing sampling accuracy.
[0110] Specifically, the power drive outputs the calculated PWM duty cycle command to the PWM timer's compare register. Simultaneously, it updates the PWM timer's period register parameters to ensure the period value corresponds to the generated carrier frequency. Based on the settings in the period register and compare register, the PWM timer generates a PWM wave with the expected period and duty cycle, driving the power switching transistors (such as IGBTs or MOSFETs) to turn on and off, thereby driving the motor to output torque.
[0111] In addition, all operating parameters (including operating condition parameters, model output parameters, actual carrier frequency, system efficiency, temperature, and other performance indicators) are synchronized to the cloud-based model management platform via communication interfaces (such as CAN bus, Ethernet, or wireless communication modules). The cloud-based model management platform, located on a cloud server, is responsible for storing and managing the key operating parameters uploaded by the system, for subsequent continuous iterative optimization and version updates of the model.
[0112] After completing all operations in the current control cycle, return to step S110 to continue adaptive optimization for the next control cycle, thus forming a closed-loop adaptive control loop.
[0113] In some embodiments of this application, such as Figure 2 As shown, the preset learning model described in step S120 is obtained through the following steps S121 to S123. These steps are performed offline on a cloud server or high-performance computing platform.
[0114] Step S121: Construct the dataset.
[0115] In step S121, the dataset includes the motor's operating parameters under various preset operating conditions, the random carrier frequency parameters corresponding to the operating parameters, and preset index parameters reflecting the motor's operating performance.
[0116] Specifically, the operating parameters of the motor under all operating conditions are first iterated. In a high-fidelity simulation environment or experimental platform, operating points covering the entire operating range of the target motor (i.e., different combinations of speed, torque, center carrier frequency, and carrier frequency fluctuation range) are traversed, and the operating parameters are recorded. The operating parameters include operating condition vectors (speed Spd, torque Tq, center carrier frequency Fc, carrier frequency fluctuation range ΔF, IGBT junction temperature T) and corresponding preset index parameters (system efficiency Eff, DC bus voltage Vdc, peak phase current Ipeak, vibration and noise performance score).
[0117] As one preferred embodiment, the vibration and noise performance evaluation index is obtained in the following manner:
[0118] When the motor is operating in a steady state, a microphone or sound pressure sensor is placed at a specific measuring point on the motor casing (e.g., 1 meter away from the motor casing, in a horizontal direction parallel to the motor axis). Simultaneously, an accelerometer is placed on the surface of the motor casing to collect vibration signals. The acquisition time is no less than 5 seconds to obtain a sufficient number of periodic samples. The acquired time-domain noise and vibration signals are then converted to the frequency domain using a Fast Fourier Transform (FFT) to obtain the noise spectrum and vibration spectrum. Special attention is paid to the spectral energy distribution within the frequency band sensitive to human hearing (e.g., the 1000Hz to 5000Hz band).
[0119] The following vibration and noise features are extracted: peak amplitude of each harmonic (especially peak values at integer multiples of the switching frequency), total harmonic distortion (THD), and psychoacoustic parameters (such as loudness, sharpness, and roughness). Professional personnel perform a weighted fusion of subjective evaluation and objective indicators based on these features to obtain the final vibration and noise performance score. A higher score indicates worse vibration and noise performance (louder noise and more severe vibration), while a lower score indicates better performance. In this embodiment, the vibration and noise score ranges from 0 to 10, where 0 represents completely imperceptible noise and vibration, and 10 represents extremely harsh noise and severe vibration. This score serves as a vibration and noise performance indicator in the offline training data samples and as a reference for evaluating the model output during online operation.
[0120] For example, the vibration and noise performance score uses an objective calculation formula, as follows:
[0121] A Fast Fourier Transform (FFT) was performed on the acquired noise time-domain signal to obtain the 1 / 3 octave band sound pressure level spectrum. Based on this, the various psychoacoustic objective parameters were calculated as follows:
[0122] Loudness was calculated using the Zwicker model, with 1 / 3 octave band sound pressure level as the base data. The concept of critical band (Bark scale) was introduced to correct for the human ear masking effect, resulting in the distribution of characteristic loudness N'(z) along the critical band ratio z. The total loudness N (unit: sone) was obtained by integrating the characteristic loudness over the entire frequency band.
[0123] .
[0124] Where z is the critical bandwidth, ranging from 0 to 24 bar.
[0125] Sharpness is calculated based on the loudness spectrum and reflects the proportion of high-frequency components in the total loudness. Sharpness S (unit: acum) is calculated using the following formula:
[0126] .
[0127] Where N is the total loudness, N'(z) is the distribution of characteristic loudness along the critical frequency band, g(z) is the weighting function (the value is 1 in the frequency band above 15 Bark, and the value decreases as the frequency decreases below the critical frequency band), and k is the normalization coefficient.
[0128] Roughness reflects the modulation amplitude and modulation frequency characteristics of sound. Roughness R (unit: asper) is calculated using the following formula:
[0129] .
[0130] Where fmod is the modulation frequency, and ΔLE(z) is the change in the excitation stage for each critical frequency band.
[0131] The formula for calculating the overall score is as follows:
[0132] Each of the above objective parameters is subjected to Min-Max normalization and mapped to the [0, 1] interval. The vibration and noise comprehensive score (NVHscore) is calculated using a weighted formula:
[0133] NVHscore=w1×Apeak, norm+w2×THDnorm+w3×Nnorm+w4×Snorm+w5×Rnorm.
[0134] Where Apeak is the maximum harmonic peak amplitude at integer multiples of the switching frequency, THD is the total harmonic distortion, N is the loudness, S is the sharpness, and R is the roughness; the subscript "norm" indicates the value after Min-Max normalization; w1~w5 are preset weighting coefficients. In this embodiment, the example values are w1=0.25, w2=0.15, w3=0.25, w4=0.20, and w5=0.15 (the sum of each weighting coefficient is 1). The specific values can be adaptively adjusted according to the sensitivity of each dimension of vibration and noise in different application scenarios.
[0135] The NVHscore score ranges from 0 to 10 (the weighted calculation result above multiplied by 10), where 0 represents completely imperceptible noise and vibration, and 10 represents extremely harsh noise and severe vibration. A lower score indicates better vibration and noise performance, while a higher score indicates worse performance. This score serves as a vibration and noise performance indicator in the offline training data samples and as a reference for evaluating the model output during online operation.
[0136] It should be noted that the specific calculation of the above psychoacoustic parameters can be performed using known and mature algorithms (such as the loudness calculation method specified in the ISO 532 standard). Those skilled in the art can directly calculate the above parameters using actual software tools (such as the MATLAB audio processing toolbox, ArtemiS and other sound quality analysis software) without excessive labor.
[0137] Secondly, a multi-objective optimization algorithm is used to solve for the Pareto optimal solution set. For each operating condition, a multi-objective optimization algorithm (such as the NSGA-III algorithm) is used to solve for the Pareto optimal solution set under each operating condition, with the objective of optimizing at least two preset index parameters. For example, optimization can be performed with the objectives of maximizing system efficiency, optimizing vibration and noise performance, and minimizing IGBT junction temperature.
[0138] In this embodiment, the multi-objective optimization algorithm used is NSGA-III (Nondominated Sorting Genetic Algorithm III), and its specific process is as follows:
[0139] An initial population of size N is uniformly and randomly generated within the decision variable space (i.e., the two-dimensional space consisting of the center frequency Fc and the carrier frequency fluctuation range ΔF). Each individual contains a set of decision variables (Fc, ΔF). For each individual in the population, three objective function values are calculated based on the collected operating parameters (or high-fidelity simulation output): system efficiency Eff (larger is better, transforming into a minimization problem of negative efficiency), vibration noise score (smaller is better), and IGBT junction temperature T (smaller is better). The NSGA-III fast non-dominated sorting method is used to divide the population into different levels of Pareto fronts. Simultaneously, a set of uniformly distributed reference points is generated in the objective space, and each individual in the population is associated with the nearest reference point to maintain population diversity. Parent individuals are selected from the current population using a tournament selection method, and offspring individuals are generated using simulated binary crossover and polynomial mutation operators. Parent and offspring are merged, and non-dominated sorting and reference point association are performed again. The top N individuals are selected as the new generation population. The above steps are executed iteratively until the preset maximum number of iterations is reached or the population converges, ultimately yielding the Pareto optimal solution set.
[0140] Throughout the optimization process, NSGA-III is able to find a series of Pareto optimal solutions among three conflicting objectives (efficiency, vibration and noise, and thermal management) for subsequent preset strategy selection.
[0141] It should be noted that in this embodiment, the parameters of the NSGA-III algorithm are configured as follows: population size N=100, maximum number of iterations=200, simulated binary crossover probability=0.9, polynomial mutation probability=0.1, number of reference points=20. These parameters can be adaptively adjusted according to actual computing resources.
[0142] Subsequently, the optimal random carrier frequency parameters are selected according to a preset strategy. That is, based on the preset strategy (e.g., prioritizing efficiency in economic mode and vibration and noise performance in comfort mode), the optimal random carrier frequency parameters (center carrier frequency Fcopt and carrier frequency fluctuation range ΔFopt) are selected from each Pareto optimal solution set, and associated with the corresponding operating condition vector to form labeled sample data, thus constructing the dataset.
[0143] It is worth noting that in the aforementioned data acquisition and annotation process, the system efficiency and vibration noise performance scores serve as key performance indicators for evaluating the control effect under the current operating conditions. Their role is to guide the generation of optimal random carrier frequency parameter labels (Fcopt, ΔFopt) through a multi-objective optimization algorithm. That is, system efficiency and vibration noise are supervisory signals in the offline annotation process, rather than online input features of the pre-defined learning model deployed in the motor controller. In the online inference stage, the pre-defined learning model can complete inference solely based on the physical operating condition parameters (Spd, Tq, Vdc, Ipeak, T) acquired in real time in step S110, without relying on real-time measurements of efficiency and vibration noise.
[0144] In this embodiment, multiple system operating modes are supported, each corresponding to a different objective priority. For example: Economic mode (efficiency priority), which selects the solution with the highest system efficiency from the Pareto optimal solution set; Comfort mode (vibration and noise performance priority), which selects the solution with the lowest vibration and noise score from the Pareto optimal solution set; and Custom mode, which configures weight coefficients according to actual needs and selects the solution with the best overall score.
[0145] Finally, the input and output feature vectors are constructed. The labeled samples are processed to construct the input feature vector X and output vector Y for training the lightweight gradient booster model.
[0146] The extreme value parameters (Xmin, Xmax, Ymin, Ymax) used in the above normalization are jointly determined by the hardware design constraints of the motor controller and the specifications of the power devices. The extreme values of the output vector correspond to the inverse normalization parameters in step S120, specifically Ymin=[Fcmin, ΔFmin] and Ymax=[Fcmax, ΔFmax]. These extreme value parameters are fixed along with the model after being determined during the model training phase and can be directly called during online inference.
[0147] The input feature vector X contains only the physical condition parameters that can be obtained in real time by sensors during the online inference phase, specifically:
[0148] X=[Spd, Tq, Vdc, Ipeak, T].
[0149] Where Spd is the motor speed, Tq is the load torque, Vdc is the DC bus voltage, Ipeak is the peak phase current, and T is the IGBT junction temperature.
[0150] It is important to note that the system efficiency and vibration noise performance scores (NVHscore) are not used as input features in this dataset. Instead, they serve as objective function values in a multi-objective optimization algorithm. These scores are used to evaluate the performance of different combinations of carrier frequency parameters during the Pareto algorithm's solution process and guide the generation of optimal random carrier frequency parameter labels (Fcopt, ΔFopt). In other words, the system efficiency and vibration noise performance scores are supervisory signals from the offline annotation phase, rather than input features of the pre-defined learning model deployed in the motor controller. This design ensures that the model input format during offline training is completely consistent with the real-time input format during the online inference phase.
[0151] The output vector Y is:
[0152] Y = [Fcopt, ΔFopt]
[0153] Where Fcopt is the optimal center carrier frequency, and ΔFopt is the optimal frequency fluctuation range.
[0154] The numerical values of each dimension in the input feature vector X and output vector Y above need to be normalized and uniformly mapped to the interval [0, 1] to eliminate the influence of different units on model training.
[0155] Step S122: Train a lightweight machine learning model using the dataset and a preset multi-objective loss function.
[0156] Based on the dataset constructed in step S121, a lightweight machine learning model (LightGBM model) is trained using a preset multi-objective loss function. In this embodiment, the multi-objective loss function is composed of a weighted average of at least two of the following: efficiency cost, vibration noise cost (LNVH), and thermal management cost (Lthermal). Preferably, a three-term weighted combination is used in this embodiment, and its expression is:
[0157] .
[0158] In the formula, Efficiency is the efficiency cost term, which is related to the estimated value of system losses (switching losses); LNVH is the vibration and noise cost term, which is related to the vibration and noise performance of a specific frequency band (such as the frequency band sensitive to the human ear); Lthermal is the thermal cost term, which is related to the risk of the IGBT junction temperature (T) exceeding the safety threshold; α, β, γ: these are configurable weighting coefficients used to adjust the priority of different performance indicators (for example, the economy mode focuses on efficiency, the comfort mode focuses on vibration and noise performance, etc.).
[0159] It should be noted that LightGBM, as a gradient-based tree model, guides tree splitting during training by calculating the first-order gradient (g) and second-order gradient (h) of the loss function with respect to the predicted values. Although the multi-objective loss function L in this application involves multiple physical quantities, it is treated as a single scalar loss function during training. Using LightGBM's custom objective function interface, the aforementioned weighted loss function and its first and second derivatives are passed as parameters to the trainer. For the two output dimensions (Fc and ΔF), the gradient of the loss with respect to each output is calculated separately, and then combined for tree splitting decisions. This allows the model to simultaneously perceive the optimization directions of efficiency, vibration noise, and thermal management during training.
[0160] The efficiency cost is related to motor switching losses and is calculated using the following empirical formula:
[0161] .
[0162] In the formula, Fopt is the actual carrier frequency of the current cycle generated by [Fcopt, ΔFopt] output by the model; Ipeak is the peak phase current of the current cycle (which can be obtained from the input feature vector); Vdc is the DC bus voltage (which can be obtained from the input feature vector); k, ε, ζ are empirical coefficients obtained by fitting from the power device (IGBT) datasheet.
[0163] This formula estimates the instantaneous switching power loss generated at a certain carrier frequency (Fopt) under the current operating conditions [Ipeak, Vdz]. The lower the efficiency, the more efficient the parameters selected in the model.
[0164] In this embodiment, the empirical coefficients k, ε, and ζ in the efficiency cost term are obtained as follows: First, the switching loss data of the power device (IGBT) under specific test conditions is obtained by consulting the datasheet. Switching losses generally include turn-on loss Eon and turn-off loss Eoff, measured in joules (J) or millijoules (mJ). Eon and Eoff are usually expressed as exponential functions of phase current Ic and bus voltage Vce. Second, the least squares method is used to fit the data from the datasheet, and the fitting model is: Esw = ksw × Ic^ε × Vce^ζ, where Esw is the total loss of a single switching event (Eon + Eoff), and ksw, ε, and ζ are the coefficients to be fitted. Finally, the single switching loss is converted into switching loss power. Since the switching loss power is equal to the single switching loss multiplied by the carrier frequency, i.e., Psw = Esw × Fsw, k = ksw in the efficiency cost term, and ε and ζ are consistent with the fitting results from the datasheet. For applications lacking datasheets or requiring higher precision, the switching losses at different current and voltage levels can be measured using a DoublePulseTest experimental setup, and then fitting can be performed based on the measured data.
[0165] The vibration and noise performance (LNVH) cost term is related to the noise performance determined by both the carrier frequency parameters and the motor speed. This cost term establishes a mapping relationship between the carrier frequency parameters (Fcopt, ΔFopt, Spd) and vibration and noise performance through an auxiliary prediction model, and uses the predicted values as the cost term. Specifically, firstly, the database samples from the offline training phase are further processed to obtain vibration and noise evaluation scores under different combinations of (Fcopt, ΔFopt, Spd); then, multinomial fitting is performed, using carrier frequency features and speed features as inputs and the predicted vibration and noise performance score as output, thereby establishing a mapping relationship between the carrier frequency parameters and vibration and noise performance; finally, when training the main model, the output of this auxiliary prediction model is introduced as the cost term LNVH into the loss function. The smaller the LNVH, the better the parameters selected by the model in terms of vibration and noise performance.
[0166] For example, using a second-order polynomial fitting, with [Fcopt, ΔFopt, Spd] as input and vibration noise performance score as output, the fitting formula is:
[0167] NVHpred=a0+a1×Fc+a2×ΔF+a3×Spd+a4×Fc×ΔF+a5×Fc×Spd+a6×ΔF×Spd+a7×Fc²+a8×ΔF²+a9×Spd².
[0168] Where a0~a9 are the coefficients obtained by least squares fitting, which are obtained by fitting the sample data in the offline training phase using least squares. During fitting, the sample data is divided into a training set (80%) and a validation set (20%), and the mean squared error (MSE) between the predicted value NVHpred and the true NVHscore is minimized using least squares.
[0169] .
[0170] Where M is the number of training set samples. After fitting, the above polynomial model is used as an auxiliary prediction model. When training the main model (LightGBM), the output NVHpred of this auxiliary prediction model is introduced into the loss function as the cost term LNVH. The smaller the LNVH, the better the parameters selected by the model are in terms of vibration and noise performance.
[0171] It is important to clarify that the second-order polynomial auxiliary model used to predict vibration and noise performance is only built during the offline training phase. Its purpose is solely to provide a continuous vibration and noise cost gradient signal to the Lightweight Gradient Boosting Machine (LGBM) main model, guiding the main model to learn the nonlinear influence trend of carrier frequency parameters on vibration and noise. This auxiliary model does not participate in online deployment and inference; only the pruned and quantized LightGBM main model is run during the online phase, thus not introducing any additional online computational burden.
[0172] Furthermore, the fitting data for the auxiliary multinomial model and the training data for the main model LightGBM come from the same dataset, but a strict data partitioning strategy is employed: the entire dataset is randomly divided into training, validation, and test sets in an 8:1:1 ratio. The auxiliary multinomial model only fits to the training set, and its fitting accuracy is monitored through the validation set to avoid overfitting. When training the main model, the LNVH term uses the predictions from the auxiliary model on the training set samples, not the predictions on the test set, thus eliminating information leakage issues. The auxiliary model essentially transforms discrete NVH score samples into continuous cost gradient signals, guiding the main model to learn the nonlinear influence trend of carrier frequency parameters on vibration noise.
[0173] The thermal management cost term Lthermal is related to the junction temperature of the power devices in the motor controller. Different operating conditions lead to different system heat generation, resulting in different temperature rises of the power devices. The junction temperature of the power devices depends not only on the instantaneous power consumption at the current moment, but also on the cumulative effect of historical power consumption, exhibiting obvious time inertia characteristics. This application's embodiments employ a junction temperature prediction method based on the thermal dynamic cumulative effect, modeling the junction temperature changes of the IGBT through a first-order RC thermal equivalent network.
[0174] For example, the thermal characteristics of an IGBT module can be described as follows:
[0175] .
[0176] Where Rth and Cth represent the thermal resistance and thermal capacity from the semiconductor PN junction to the chip package, respectively, the specific values are determined based on the transient thermal impedance curve in the selected IGBT module datasheet. In this embodiment, taking a certain type of IGBT module as an example, its junction-to-case thermal resistance Rth = 0.61 K / W, thermal capacity Cth ≈ 0.02 J / K, and time constant τth = Rth × Cth ≈ 0.012 s. Rth and Cth vary for different IGBT models; specific parameters should be obtained from the corresponding datasheet in practical applications. T(t) is the junction temperature (unit: °C), and Lefficiency(t) is the instantaneous switching loss (unit: W). This differential equation reveals the inertial delay characteristic of junction temperature change relative to power loss, with a time constant τth = Rth × Cth (unit: s).
[0177] To achieve junction temperature prediction in a digital controller, the aforementioned continuous-domain differential equation needs to be discretized. In this embodiment, the backward Euler method is used for discretization, resulting in the following difference equation:
[0178] .
[0179] In the formula, T[k] is the predicted junction temperature of the k-th control cycle, T[k-1] is the predicted junction temperature of the (k-1)-th control cycle, and Ts is the control cycle.
[0180] In practical embedded systems, the control cycle Ts (in microseconds) is generally much smaller than the IGBT module's time constant τth (in seconds), meaning Ts / τth << 1. Using Taylor expansion, the above difference equation can be simplified to the following more efficient and sufficiently accurate approximation. In actual engineering deployments, operators can flexibly choose either the exact difference equation or this simplified approximation formula for junction temperature iterative prediction, depending on the computing power and storage resources of the motor controller's main control chip (such as a DSP or MCU).
[0181] .
[0182] In practical applications, the exact difference equation or the simplified approximate formula mentioned above can be selected for junction temperature prediction based on the computing power of the controller.
[0183] During model training, the system maintains a virtual junction temperature state Tj (i.e., T[k]) synchronized with the training data sequence. For each set of carrier frequency parameters proposed by the lightweight gradient booster model, the virtual junction temperature caused by it is calculated according to the above model, and the thermal cost term Lthermal is calculated according to the following formula:
[0184] .
[0185] Where Tj is the virtual junction temperature calculated by the training model, and Tref is the temperature safety threshold of the IGBT. The value of Tref is determined based on the maximum allowable junction temperature Tj,max of the selected power device. In this embodiment, a certain type of IGBT is selected, whose datasheet specifies a maximum junction temperature Tj,max = 175℃. Considering engineering margin, Tref is set to Tj,max - 25℃ = 150℃. For different types of IGBTs, Tref should be determined according to the principle of "maximum junction temperature in the datasheet minus a margin of 20~30℃".
[0186] Unlike the NSGA-III stage, which directly uses the absolute value of junction temperature as the optimization objective, the rationale for adopting the over-limit penalty in this step is that the Pareto front exploration stage needs to comprehensively evaluate the impact of junction temperature amplitude to generate a diverse set of optimal solutions; while the supervised learning stage uses an over-limit penalty relative to the safety threshold, which can guide the model decision to maximize efficiency and optimize vibration and noise within the thermal safety margin, avoiding the model being overly conservative within the safety range, while ensuring that thermal risks are effectively constrained.
[0187] Furthermore, when the junction temperature is below the set safety threshold, there is no overheating risk, and the thermal cost term is 0. When the junction temperature exceeds the set safety threshold, the greater the exceedance, the larger the thermal cost term becomes, and it grows rapidly with a squared relationship. This method enables the model to not only assess the instantaneous thermal impact of decisions but also understand their long-term thermal cumulative effects, thereby learning to make forward-looking thermal management decisions, avoiding thermal risks at their source, and improving system reliability.
[0188] In addition, the lightweight machine learning model employs a tree-based Lightweight Gradient Boosting Machine (LightGBM) model. During training, the maximum depth of the tree is limited to 3 to 6 layers, and early stopping and cross-validation are used to prevent overfitting.
[0189] Step S123: After the lightweight machine learning model is trained, the preset learning model is obtained.
[0190] Combination Figure 2 As shown, after the offline training phase is completed, the following pre-deployment optimization steps need to be performed. These optimizations include at least one of model pruning, parameter quantization, and generating embedded code. Specifically, they include:
[0191] Model pruning involves removing subtrees in LightGBM that contribute little to the overall prediction, i.e., unimportant branches in the decision tree, based on feature importance or node contribution, thereby reducing model size. Parameter quantization converts model weights and activation values from high-precision floating-point numbers (e.g., FP32) to low-precision integers (e.g., INT8), reducing memory usage and computational cost. Generating embedded code converts the optimized model into pure C code or a static library that can run efficiently on embedded controllers.
[0192] Specifically, the model pruning is based on LightGBM's built-in feature importance evaluation (by number of splits or gain), and a pruning threshold is set to remove nodes whose feature importance is less than 5% of the maximum feature importance. The parameter quantization adopts the post-training INT8 quantization scheme, converting model weights from 32-bit floating-point numbers (FP32) to 8-bit integers (INT8). In practice, the numerical range of the split threshold for each node of each tree is statistically analyzed, and the quantization scale factor scale=(max-min) / 255 is calculated to quantize the threshold into an 8-bit integer. After pruning and quantization, a LightGBM model containing 50 trees, each with no more than 31 leaves, can have its parameter size controlled within 100KB, and its inference latency less than 10 microseconds (taking a 100MHz Cortex-M7 processor as an example), meeting the requirements of embedded real-time control. Finally, a model transcoding tool is used to convert the quantized model into pure C99 code, eliminating the need to deploy an interpreter or inference framework on the controller, and directly burning it into the non-volatile memory of the motor controller.
[0193] After completing the above optimization, the solidified lightweight model code and parameters are burned into the non-volatile memory of the motor controller, which is the preset learning model deployed in the motor controller as described in step S120.
[0194] An embodiment of the second aspect of this application provides a motor drive control device, applied to a motor controller, such as... Figure 3 As shown, it includes an acquisition module 610, a processing module 620, and a drive control module 630.
[0195] The acquisition module 610 is used to acquire the current operating parameters of the motor. The processing module 620 is used to input the operating parameters into a preset learning model deployed in the motor controller, and the preset learning model outputs random carrier frequency parameters adapted to the operating parameters. The drive control module 630 is used to generate the carrier frequency of the current motor control cycle based on the random carrier frequency parameters, and drive the motor based on the carrier frequency.
[0196] This application also provides a drive motor, which includes a motor controller. The motor controller includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to control the motor controller to perform online inference and drive control of random carrier frequency parameters, thereby realizing the motor drive control method described in the first aspect embodiment above.
[0197] The above descriptions are merely some embodiments of this application and are not intended to limit this application. The technical features or structures in the foregoing different embodiments can be arbitrarily combined to form other specific technical solutions as needed. For those skilled in the art, this application can have various modifications and variations. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the protection scope of the claims of this application.
Claims
1. A motor drive control method, applied to a motor controller, characterized in that, include: Obtain the current operating parameters of the motor; The operating condition parameters are input into a preset learning model deployed in the motor controller, and the preset learning model outputs random carrier frequency parameters that are adapted to the operating condition parameters. The carrier frequency for the current motor control cycle is generated based on the random carrier frequency parameters, and the motor is driven based on the carrier frequency.
2. The motor drive control method according to claim 1, characterized in that: The random carrier frequency parameters include the center frequency and the frequency fluctuation range.
3. The motor drive control method according to claim 1, characterized in that, The preset learning model is obtained through the following process: Construct a dataset, which includes the motor's operating parameters under various preset operating conditions, the random carrier frequency parameters corresponding to the operating parameters, and preset index parameters reflecting the motor's operating performance. A lightweight machine learning model is trained using the dataset and a preset multi-objective loss function, wherein the multi-objective loss function is used to weigh at least two conflicting preset index parameters. The preset learning model is obtained after the lightweight machine learning model has been trained.
4. The motor drive control method according to claim 3, characterized in that, The constructed dataset includes: The operating parameters of the motor are traversed across the entire operating range, and the operating parameters under different combinations of operating conditions are collected. The operating parameters include the operating condition vector and the corresponding preset index parameters. A multi-objective optimization algorithm is adopted to solve the Pareto optimal solution set for each working condition with the goal of optimizing at least two preset index parameters. According to the preset strategy, the optimal random carrier frequency parameters are selected from each Pareto optimal solution set, and associated with the corresponding operating condition vector to form labeled sample data, thus constructing the dataset.
5. The motor drive control method according to claim 3, characterized in that: The multi-objective loss function is composed of at least two of the following: efficiency cost, vibration and noise cost, and thermal management cost. The efficiency cost is related to motor switching losses; The vibration and noise cost term is related to the noise performance, which is jointly determined by the carrier frequency parameter and the motor speed. The thermal management cost item is related to the junction temperature of the power devices in the motor controller.
6. The motor drive control method according to claim 3, characterized in that: The lightweight machine learning model adopts a lightweight gradient boosting machine model based on a tree model.
7. The motor drive control method according to claim 6, characterized in that, After obtaining the preset learning model, the motor drive control method further includes: The obtained preset learning model is optimized, and the optimization includes at least one of model pruning, parameter quantization, and generating embedded code.
8. The motor drive control method according to any one of claims 1 to 7, characterized in that, After obtaining the current operating parameters of the motor, the motor drive control method further includes: The acquired working condition parameters are preprocessed to construct a feature vector that is consistent with the input feature vector format of the preset learning model; The preprocessing includes normalization.
9. A motor drive control device, applied to a motor controller, characterized in that, include: The acquisition module (610) is used to acquire the current operating parameters of the motor; The processing module (620) is used to input the operating condition parameters into a preset learning model deployed in the motor controller, and the preset learning model outputs random carrier frequency parameters that are adapted to the operating condition parameters. The drive control module (630) is used to generate the carrier frequency of the current motor control cycle according to the random carrier frequency parameters, and drive the motor based on the carrier frequency.
10. A drive motor, comprising a motor controller, characterized in that: The motor controller includes a memory and a processor; The memory stores computer programs; The processor executes the computer program, enabling it to implement the motor drive control method according to any one of claims 1 to 8.