Voice coil motor control method and system, electronic device, and storage medium
Patent Information
- Application Number
- CN202611360024.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-03
- Publication Date
- 2026-10-20
AI Technical Summary
[0004]本发明目的是:提供一种音圈电机控制方法、系统、电子设备及存储介质,以解决现有音圈电机在非线性迟滞条件下控制精度不足、位移跟踪误差较大以及难以兼顾响应速度与稳态性能的技术问题
针对音圈电机非线性迟滞导致的控制精度下降问题,能够引入表征输入输出迟滞逆映射关系的神经网络逆模型,以进行迟滞逆建模,并基于迟滞逆模型生成前馈补偿驱动量,使控制系统能够在控制输入施加前对迟滞影响进行预补偿;同时结合基于位移误差的反馈补偿,对模型误差、外部扰动以及工况变化引起的残余偏差进行修正,从而实现前馈预补偿与反馈闭环校正的协同作用,达到减小位移跟踪误差、提高响应速度并增强控制稳定性的效果。
Smart Images

Figure FT_1 
Figure FT_2 
Figure FT_3
Abstract
Description
Technical Field
[0001] This invention relates to the field of motor control technology, and in particular to a voice coil motor control method, system, electronic device, and storage medium. Background Technology
[0002] Voice coil motors (VCOs) possess advantages such as fast response speed, high control precision, and compact structure, and are widely used in precision positioning, rapid adjustment, and high dynamic response control applications. However, as application scenarios demand increasingly higher positioning and tracking accuracy, the nonlinear hysteresis problem inherent in VCOs during actual operation is gradually becoming a significant factor affecting control performance. Due to the path dependence and memory effect of hysteresis, the same drive input may correspond to different displacement outputs under different historical states, resulting in a multi-valued mapping relationship between the VCO input and output, increasing the difficulty of modeling and control.
[0003] In existing technologies, the handling of actuator nonlinear hysteresis typically employs pure feedback control or a combination of model-based feedforward compensation and feedback correction. While pure feedback control can correct tracking errors to some extent, it often struggles to balance response speed, overshoot, and steady-state accuracy when significant nonlinear hysteresis exists. Model-based feedforward compensation can compensate for some nonlinear effects in advance, but insufficient model accuracy, changes in operating conditions, and external disturbances can make simple feedforward compensation insufficient for high-precision control requirements. Especially in the case of voice coil motors, how to construct a model that can characterize the inverse hysteresis characteristics and effectively integrate it into the control loop to generate feedforward compensation drive, while simultaneously combining it with feedback compensation to further suppress residual errors, remains an unsolved technical problem. Summary of the Invention
[0004] The purpose of this invention is to provide a voice coil motor control method, system, electronic device, and storage medium to solve the technical problems of insufficient control accuracy, large displacement tracking error, and difficulty in balancing response speed and steady-state performance of existing voice coil motors under nonlinear hysteresis conditions.
[0005] To address the aforementioned technical problems, this application provides a voice coil motor control method in a first aspect, comprising: acquiring the desired displacement and actual displacement of the voice coil motor at the current moment, and the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment; inputting the desired displacement at the current moment and the desired displacement, drive control quantity, and / or actual displacement at the at least one historical moment into a hysteresis inverse model, and calculating in real time a feedforward compensation drive quantity corresponding to the desired displacement at the current moment, wherein the hysteresis inverse model is constructed by direct inversion as a neural network inverse model trained based on the drive input and displacement output samples of the voice coil motor, and the parameters of the neural network inverse model are determined by a multi-stage collaborative improvement whale algorithm, wherein the multi-stage includes at least two of the following: population initialization, convergence process, spiral search process, and candidate individual update; generating a feedback compensation quantity based on the error between the desired displacement and the actual displacement at the current moment; combining the feedforward compensation drive quantity and the feedback compensation quantity into a control quantity at the current moment, and outputting the control quantity to the voice coil motor to control the voice coil motor to achieve displacement tracking.
[0006] Furthermore, the hysteresis inverse model is constructed using a direct inversion method, comprising: constructing a training input vector including the current displacement output, at least one historical displacement output, and at least one historical driving input; inputting the training input vector into the neural network inverse model to output a current driving input prediction value corresponding to the current displacement output; adjusting the parameters of the neural network inverse model based on the current driving input prediction value and the current driving input in the training samples, and determining the adjusted neural network parameters as the parameters of the hysteresis inverse model after training is completed.
[0007] Furthermore, the feedforward compensation driving quantity is obtained through real-time calculation, including: constructing a control input vector that includes the desired displacement at the current moment and the desired displacement, driving control quantity, and / or actual displacement at at least one historical moment; inputting the control input vector into the hysteresis inverse model to output the feedforward compensation driving quantity at the current moment.
[0008] Furthermore, the inverse model of the neural network is a backpropagation neural network.
[0009] Furthermore, the parameters of the neural network inverse model include connection weights and bias parameters.
[0010] Furthermore, the multi-stage process includes population initialization, convergence process, spiral search process, and candidate individual update, and the collaborative improvement includes: introducing chaotic mapping in population initialization; using a nonlinear dynamic change strategy based on cosine function to update the convergence control parameters used to adjust the balance between global exploration and local exploitation; using spiral parameters that change with iteration in the spiral update process to adjust the spiral update trajectory; using the current individual, the current best individual, and random individuals to perform random difference mutation to generate new candidate individuals, and comparing the fitness of the new candidate individuals with that of the current individual to select the best one to retain.
[0011] Furthermore, the feedback compensation amount is generated by the proportional-integral-derivative controller based on the error between the expected displacement and the actual displacement at the current moment.
[0012] Furthermore, before outputting the control quantity to the voice coil motor, the method further includes: performing a limiting process on the control quantity so that the control quantity falls within the allowable driving range of the voice coil motor.
[0013] Secondly, this application also discloses a voice coil motor control system, comprising: a sampling module for sampling the input and output of the voice coil motor to obtain the desired displacement, actual displacement, and / or drive control quantity of the voice coil motor; and an inverse model calling module for inputting the desired displacement at the current moment and the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment into a hysteresis inverse model to obtain a feedforward compensation drive quantity corresponding to the desired displacement at the current moment, wherein the hysteresis inverse model is constructed by direct inversion as a neural network trained based on the drive input and displacement output samples of the voice coil motor. The network inverse model, wherein the parameters of the neural network inverse model are determined by a multi-stage collaborative improvement whale algorithm, wherein the multi-stage includes at least two of the following: population initialization, convergence process, spiral search process, and candidate individual update; a feedback compensation module, used to receive the expected displacement and actual displacement at the current moment, and generate and output the feedback compensation amount based on the error between the two; a control quantity synthesis module, used to receive the feedforward compensation driving amount and the feedback compensation amount, to synthesize and output the control quantity at the current moment; and a drive output module, used to output the control quantity to the voice coil motor, so as to control the voice coil motor to achieve displacement tracking.
[0014] Furthermore, the multi-stage process includes population initialization, convergence process, spiral search process, and candidate individual update, and the collaborative improvement includes: introducing chaotic mapping in population initialization; using a nonlinear dynamic change strategy based on cosine function to update the convergence control parameters used to adjust the balance between global exploration and local exploitation; using spiral parameters that change with iteration in the spiral update process to adjust the spiral update trajectory; using the current individual, the current best individual, and random individuals to perform random difference mutation to generate new candidate individuals, and comparing the fitness of the new candidate individuals with that of the current individual to select the best one to retain.
[0015] Thirdly, this application also discloses an electronic device including a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the method described in any of the first aspects.
[0016] Fourthly, this application also discloses a storage medium, characterized in that the storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of the first aspects.
[0017] Compared with existing technologies, the above technical solution has the following beneficial effects: To address the issue of decreased control accuracy caused by the nonlinear hysteresis of voice coil motors, an inverse neural network model representing the inverse mapping relationship between input and output hysteresis can be introduced for hysteresis inverse modeling. Based on the hysteresis inverse model, a feedforward compensation driving quantity is generated, enabling the control system to pre-compensate for the hysteresis effect before the control input is applied. Simultaneously, combined with feedback compensation based on displacement error, residual deviations caused by model errors, external disturbances, and changes in operating conditions are corrected. This achieves the synergistic effect of feedforward pre-compensation and feedback closed-loop correction, thereby reducing displacement tracking error, improving response speed, and enhancing control stability.
[0018] A corresponding substitution design of input vectors is adopted between model construction and online control. During the training phase, the training input vector is constructed using the current displacement output, historical displacement output, and historical drive input to learn the inverse mapping relationship between displacement state and drive input. During the control phase, while maintaining the consistency of the input structure, the current displacement output from the training phase is replaced with the expected displacement at the current moment. This is combined with the expected displacement at the historical moment, the drive control quantity, and / or the actual displacement to construct the control input vector, thereby calling the hysteresis inverse model to output the feedforward compensation drive quantity. This design maintains consistency in input form between the model training and online control phases, reducing structural deviations when the model migrates to the control process. Furthermore, compared to lookup-based feedforward or static inverse model feedforward methods that only generate compensation quantities based on the current target value, this application further introduces historical control states to characterize nonlinear hysteresis and path dependence characteristics, thereby improving the targeting of feedforward compensation and the tracking stability during the control process.
[0019] Establishing a hysteresis inverse model through direct inversion allows for a more direct learning and expression of the inverse mapping relationship between displacement output and driving input. By employing a backpropagation neural network as the inverse model carrier and utilizing parameter optimization methods, especially the improved whale algorithm incorporating chaotic initialization, cosine dynamic adjustment, spiral update enhancement, and random difference mutation, the model parameters can be optimized, thereby improving the stability of model training, the globality of parameter optimization, and the modeling accuracy of the inverse model. Furthermore, through feedback controllers and control quantity limiting processing, the system's engineering applicability, robustness, and operational safety can be further improved. Attached Figure Description
[0020] The present invention will be further described below with reference to the accompanying drawings and embodiments: Figure 1 A flowchart illustrating an exemplary voice coil motor control method provided in this application; Figure 2 This is a schematic diagram of an exemplary voice coil motor control system architecture provided in this application; Figure 3 This is a schematic diagram illustrating the exemplary control principle of a voice coil motor provided in this application; Figure 4 A comparison chart of position tracking performance of exemplary voice coil motor composite control and feedforward control provided in this application; Figure 5 A comparison chart of position tracking errors between exemplary voice coil motor composite control and feedforward control provided in this application. Detailed Implementation
[0021] The present invention will be further described in detail below with reference to specific embodiments.
[0022] In the description of this application, "acquisition" may include methods such as collecting, receiving, reading, calling, generating, or determining; "based on" indicates that it is based on relevant data, states, parameters, or results, and does not exclude processing in combination with other information; "including" and its variations are open-ended expressions; "at least one" indicates one or more; ordinal numbers such as "first" and "second" are only used to distinguish objects and do not indicate order, importance, or quantity limitations; "current moment" refers to the discrete control moment in which control calculation or data processing is being performed, and "historical moment" refers to one or more discrete control moments prior to the current moment. Without causing ambiguity, the current moment and historical moment may be expressed in words or using discrete moment symbols.
[0023] In this application, "voice coil motor" refers to an actuator that generates driving force through the interaction of a coil and a magnetic field; "desired displacement" refers to the target displacement that the control system hopes the voice coil motor will achieve; "actual displacement" refers to the actual output displacement of the voice coil motor obtained by detection or estimation under the current operating state; "drive control quantity" refers to the control input applied to the voice coil motor or its driver; "feedforward compensation drive quantity" refers to the drive quantity generated according to the inverse hysteresis model and used to compensate for the effects of nonlinear hysteresis in advance; "feedback compensation quantity" refers to the compensation quantity generated according to the error between the desired displacement and the actual displacement and used to correct model errors, external disturbances, and parameter changes; and "control quantity" refers to the quantity generated by the feedforward compensation drive quantity and the actual displacement. The feedback compensation quantity is synthesized and output to the voice coil motor as the driving quantity; "hysteresis inverse model" refers to a model used to characterize the inverse mapping relationship between the displacement state of the voice coil motor and the driving input; "neural network model" refers to a model that can learn and express the nonlinear relationship between input and output, and in the preferred embodiment, it can be a backpropagation neural network model; "direct inversion method" refers to a modeling method that directly uses the displacement output information as the model input and the driving input as the model output to establish the inverse mapping relationship; "parameter optimization method" refers to an optimization method used to search for and determine the parameters of the neural network model; "improved whale algorithm" refers to an optimization method that introduces an improvement strategy on the basis of the whale optimization algorithm to improve the parameter search performance.
[0024] In applications such as precision positioning, rapid focusing, micro-displacement tracking, and high dynamic response control, voice coil motors (VRMs) need to accurately track target displacement within a short response time. However, VRMs typically exhibit significant nonlinear hysteresis and path dependence during actual operation, making it difficult to maintain a stable one-to-one correspondence between drive input and displacement output. This results in conventional feedback control alone being insufficient to compensate for hysteresis errors in a timely manner, while general feedforward compensation alone is insufficient to account for factors such as modeling errors, external disturbances, and parameter drift. Therefore, the core technical problem addressed in this application is how to construct an inverse hysteresis model that characterizes the inverse mapping relationship between displacement and drive input, and how to use this inverse hysteresis model to generate feedforward compensation drive quantities during control, combined with error feedback to form collaborative control, thereby improving the displacement tracking accuracy, response speed, and control stability of the VRM.
[0025] Figure 1 A flowchart illustrating an exemplary voice coil motor control method provided in this application. Figure 1 As shown, the exemplary method may include the following steps: In step S1, the desired displacement and actual displacement of the voice coil motor at the current moment, as well as the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment, are obtained to form state information related to the current control process; In step S2, the desired displacement at the current moment and the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment are input into the hysteresis inverse model, and the feedforward compensation drive quantity is output. The hysteresis inverse model is used to characterize the hysteresis inverse mapping relationship between the voice coil motor displacement state and the drive input. In some embodiments, the hysteresis inverse model is constructed using a direct inversion method, and can be based on the voice coil motor drive input and displacement output samples. The trained neural network inverse model is implemented to pre-compensate for nonlinear hysteresis. Furthermore, the parameter optimization method of the neural network inverse model employs a multi-stage collaborative improvement whale algorithm, collaboratively improving at least two stages: population initialization, convergence process, and swirl search process, as well as candidate individual update. In step S3, a feedback compensation amount is generated based on the error between the expected displacement and the actual displacement at the current moment to correct for modeling errors, external disturbances, and parameter changes during operation of the hysteresis inverse model. In step S4, the feedforward compensation driving amount and the feedback compensation amount are combined into the control amount at the current moment, and the control amount is output to the voice coil motor to control the voice coil motor to achieve displacement tracking. Through the above steps, the hysteresis effect can be compensated in advance using the hysteresis inverse model before the control input is applied, and the tracking accuracy and control robustness of the voice coil motor control process can be further improved by combining feedback compensation.
[0026] Figure 2 This is a schematic diagram of an exemplary voice coil motor control system architecture provided in this application. Figure 2As shown, the voice coil motor control system 100 can be connected to the voice coil motor 200 for displacement tracking control of the voice coil motor 200. The voice coil motor control system 100 may include a sampling module 110, an inverse model calling module 120, a feedback compensation module 130, a control quantity synthesis module 140, and a drive output module 150. The sampling module 110 can be used to acquire the desired displacement, drive control quantity, and / or actual displacement of the voice coil motor 200. Specifically, refer to... Figure 1 In accordance with the above exemplary voice coil motor control method flow, the desired displacement and actual displacement at the current moment, as well as the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment, should be obtained, and these data should be combined into input information that can be used by the inverse model. Simultaneously, the sampling module 110 is also used to organize the drive input and displacement output data of the voice coil motor 200 into training samples for subsequent model training. The inverse model invocation module 120 can be connected to the sampling module 110, and is used to receive the current data and historical data or training samples provided by the sampling module 110, and invoke the hysteresis inverse model to generate the feedforward compensation drive quantity corresponding to the desired displacement at the current moment, so as to utilize the hysteresis inverse mapping relationship of the voice coil motor to... Nonlinear hysteresis is pre-compensated; the feedback compensation module 130 can be connected to the sampling module 110 to receive the expected displacement and actual displacement at the current moment, and generate a feedback compensation amount based on the error between the two to compensate for the modeling error of the hysteresis inverse model, external disturbances, and parameter changes during operation; the control quantity synthesis module 140 is connected to the inverse model calling module 120 and the feedback compensation module 130 respectively, to receive the feedforward compensation driving amount and the feedback compensation amount, and synthesize the two into a control quantity; the drive output module 150 can be connected to the control quantity synthesis module 140 to receive the control quantity and output it to the voice coil motor 200 to drive the voice coil motor 200 to achieve displacement tracking. Through the above system architecture, feedforward compensation based on the hysteresis inverse model and feedback compensation based on displacement error can be organically combined, thereby improving the tracking accuracy, response speed, and control stability in the voice coil motor control process.
[0027] Figure 3 This is a schematic diagram illustrating the exemplary control principle of a voice coil motor provided in this application. Figure 3 As shown, the expected output is 𝑦 d The tracking error S is obtained by comparing the actual output R of the voice coil motor with the actual output R. The desired output R is then calculated. d One input is fed forward compensator to generate feedforward input A. 𝑓𝑓 The other path performs a differential operation with the actual output to generate a tracking error , which is then input to the feedback controller to generate the feedback input . 𝑓𝑏 Then, the feedforward input is... 𝑓𝑓 With feedback input 𝑓𝑏After synthesis, the signal is input to the voice coil motor, thereby controlling the voice coil motor. The output of the voice coil motor, λ, is fed back through a sensor, forming a closed-loop control circuit. Based on the above control principle, the feedforward compensator can be used to compensate for nonlinear hysteresis effects in advance according to the target output, and the feedback controller can be used to correct model errors, external disturbances, and parameter changes based on the tracking error λ, thereby improving the displacement tracking accuracy, response speed, and control stability of the voice coil motor.
[0028] In some embodiments, the voice coil motor control method provided in this application can be based on a hysteresis inverse model and performed according to discrete control times. Taking discrete control time 𝑘 as an example, at control time 𝑘, the expected displacement and actual displacement of the voice coil motor at time 𝑘, as well as the expected displacement, drive control quantity and / or actual displacement at at least one historical time, can be obtained; wherein, the historical time may include time 𝑘−1, 𝑘−2, etc. Subsequently, based on the expected displacement at time 𝑘 and the historical control state, the corresponding input information is input into the hysteresis inverse model to generate the feedforward compensation drive quantity at time 𝑘; then, based on the error between the expected displacement and the actual displacement at time 𝑘, the feedback compensation quantity at time 𝑘 is generated; then, the feedforward compensation drive quantity and the feedback compensation quantity at time 𝑘 are combined into the control quantity at time 𝑘, specifically, for example, by using additive superposition, and the control quantity is output to the voice coil motor to act on the next control cycle, thereby affecting the displacement output at time 𝑘+1. Through the above timing arrangement, feedforward compensation is used to offset the effects of nonlinear hysteresis in advance, and feedback compensation is used to correct residual deviations caused by model errors, external disturbances, and parameter drift, thereby jointly realizing displacement tracking control of the voice coil motor in the discrete control process.
[0029] In the above implementation, the reason for simultaneously introducing current and historical information is that voice coil motors exhibit significant nonlinear hysteresis and path dependence characteristics during actual operation. The displacement response at the current moment is related not only to the target state at the current moment but also to the control state at historical moments. Therefore, by using the desired displacement at the current moment, along with the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment, as inputs to the hysteresis inverse model, the hysteresis memory characteristics of the voice coil motor can be more fully characterized. This allows the hysteresis inverse model to more fully consider the historical operating state of the voice coil motor when generating the feedforward compensation drive quantity at moment φ, thereby improving the fitting ability of the feedforward compensation drive quantity generation process to the hysteresis inverse mapping relationship.
[0030] In some implementations, the feedforward compensation driving quantity can be obtained through real-time calculation. Specifically, a control input vector can be constructed online in real time. This control input vector includes the desired displacement at the current moment and the desired displacement, driving control quantity, and / or actual displacement at at least one historical moment. This control input vector is then input into the hysteresis inverse model to output the feedforward compensation driving quantity at the current moment. In these implementations, the displacement output information used in the training phase and the desired displacement information used in the online control phase correspond logically to each other in the model construction. That is, the training phase learns the inverse mapping relationship through actual samples, and the online control phase uses the learned inverse mapping relationship to convert the target trajectory into the feedforward compensation driving quantity, thereby realizing the online generation of control input.
[0031] To further illustrate the correspondence between the training phase and the online control phase, the construction of the input vector is explained as follows. In the training phase, a training input vector can be constructed that includes the current displacement output, at least one historical displacement output, and at least one historical driving input, with the current driving input serving as the training output. For example, in one example, the training input vector may include the current displacement output, the previous displacement output, and the previous driving input, with the training output being the current driving input; in another example, the training input vector may further include the displacement outputs and driving inputs from the previous two or more historical moments. Correspondingly, in the online control phase, a control input vector can be constructed that includes the current desired displacement, at least one historical desired displacement, and at least one historical driving control quantity and / or actual displacement, and input to the hysteresis inverse model to output the current feedforward compensation driving quantity. Thus, the inverse mapping relationship learned based on the actual displacement output in the training phase can be invoked in the control phase by replacing the current actual displacement output with the current desired displacement, thereby maintaining a correspondence between the training phase and the control phase in terms of input structure. By employing the corresponding replacement design between the training and control phases in this embodiment, on the one hand, the consistency of the model input structure can be maintained, reducing the structural deviation between model training and online invocation; on the other hand, the control input vector not only contains target displacement information but also retains historical control states related to hysteresis memory. Therefore, unlike the static inverse model feedforward method and the lookup table compensation method that only map based on the current target value, it can better adapt to the nonlinear hysteresis and path dependence characteristics of the coil motor.
[0032] In some implementations, the feedback compensation amount can be generated by the proportional-integral-derivative (PID) controller based on the error between the desired displacement and the actual displacement at the current moment. Specifically, the difference between the desired displacement and the actual displacement at the current moment can be used as an error signal input to the PID controller, which then outputs a feedback compensation amount to correct for modeling errors in the hysteresis inverse model, external disturbances during operation, and the effects of parameter changes. The PID controller can output a feedback compensation amount based on the error signal, its cumulative amount, and its changing trend, thereby improving dynamic response performance while ensuring the steady-state accuracy of the system.
[0033] In some implementations, the feedforward compensation drive quantity and the feedback compensation quantity can be added together to obtain the control quantity at the current moment. Since the feedforward compensation drive quantity is mainly used to offset the nonlinear hysteresis effect of the voice coil motor in advance, while the feedback compensation quantity is mainly used to correct the residual error, the control quantity formed by adding together can achieve the synergistic effect of feedforward compensation and feedback correction in the control structure. This control quantity can then be output to the voice coil motor to drive it to perform displacement tracking tasks.
[0034] In some implementations, the control quantity can be limited before being output to the voice coil motor (VCM) to ensure it falls within the VCM's permissible drive range. Limiting prevents the control quantity from exceeding the allowable range of the VCM driver or actuator, thereby improving the engineering applicability and operational safety of the control system. In some optional implementations, limiting can also be used in conjunction with driver saturation protection, outlier suppression, or soft-limit strategies. Specifically, without limiting the synthesized control quantity, the sum of the feedforward compensation drive quantity and the feedback compensation quantity may result in a large instantaneous amplitude or rapid changes, especially in scenarios with large tracking errors, sudden changes in the target trajectory, or simultaneous increases in model compensation and feedback correction. This can easily lead to the control quantity exceeding the VCM's permissible drive range, causing problems such as driver saturation, increased overshoot, or output response instability. By performing limiting before outputting the control quantity, keeping it within the VCM's permissible drive range, the impact of excessive drive input on system stability and device safety can be suppressed while ensuring compensation capability, thereby improving the engineering applicability and operational reliability of the control process.
[0035] In the embodiments provided in this application, the hysteresis inverse model is a neural network inverse model trained based on voice coil motor drive input and displacement output samples. Because the neural network inverse model has strong nonlinear mapping capabilities, compared to a fixed analytical inverse model, it can learn the complex inverse mapping relationship between the voice coil motor displacement state and the drive input, thus being more suitable for characterizing the nonlinear hysteresis characteristics in the voice coil motor control process. In these embodiments, the neural network inverse model receives the desired displacement at the current moment and the historical control state during the control phase, and outputs the feedforward compensation drive quantity corresponding to the desired displacement at the current moment. Therefore, before the control input is applied at the next moment, the compensation drive quantity can be given according to the target trajectory or the desired displacement at the next moment, thereby reducing the adverse effects of nonlinear hysteresis on the displacement tracking results.
[0036] In some implementations, drive input samples and displacement output samples for training are obtained by applying a preset test signal to the voice coil motor and simultaneously acquiring the displacement response. The test signal can cover the main operating range of the voice coil motor, enabling the training samples to characterize the input-output relationship under different displacement ranges, different input variation trends, and different hysteresis loop states. By constructing a hysteresis inverse model based on these samples, the resulting inverse model can be more suitable for generating compensation drive quantities corresponding to the target displacement in actual control scenarios.
[0037] In the above embodiments, the hysteresis inverse model can be constructed using a direct inversion method. Specifically, drive input samples and displacement output samples of the voice coil motor under different driving conditions can be obtained, and training samples can be constructed in chronological order. For the current training moment, a training input vector can be constructed, including the current displacement output, at least one historical displacement output, and at least one historical drive input. Then, the training input vector is input into the neural network inverse model to output the current drive input prediction value corresponding to the current displacement output. Based on the difference between the current drive input prediction value and the current drive input in the training samples, the parameters of the neural network inverse model are adjusted, and the adjusted neural network parameters are determined as the parameters of the hysteresis inverse model after training. In this embodiment, the core of the direct inversion method is to directly establish the mapping relationship from "displacement output to drive input," rather than first establishing a forward model of "displacement output excited by drive input" and then obtaining the inverse mapping relationship through numerical or analytical inversion. In this way, on the one hand, the model output form in the training stage can be consistent with the feedforward compensation drive output form required in the control stage, and on the other hand, it is also beneficial to reduce the intermediate conversion complexity in the inverse model construction process.
[0038] In some implementations, the inverse neural network model is preferably a backpropagation neural network. This model may include an input layer, hidden layers, and an output layer. The input layer receives an input vector consisting of the desired displacement at the current time and historical control states. The hidden layer performs nonlinear feature extraction and mapping on the input information, and the output layer outputs the feedforward compensation driving quantity. In an optional implementation, the hidden layer may employ a nonlinear activation function, and the output layer may adopt a linear or approximately linear form suitable for continuous value regression output to achieve continuous value prediction of the driving input at the current time.
[0039] In some embodiments, the parameters of the neural network inverse model can be determined through parameter optimization methods. These parameters may include connection weights between the input and hidden layers, connection weights between the hidden and output layers, and bias parameters for each layer. By optimizing the connection weights and bias parameters, the initial state of the neural network inverse model's parameters and the convergence quality during training can be improved, thereby enhancing the fitting accuracy and control applicability of the hysteresis inverse model. Specifically, the output error of the neural network inverse model on training samples can be used as a parameter evaluation criterion. By adjusting the connection weights and bias parameters, the difference between the predicted driving input value output by the neural network inverse model and the actual driving input in the training samples can be gradually reduced. The parameter optimization method can be any method capable of searching and optimizing neural network parameters, such as swarm intelligence optimization methods, heuristic optimization methods, or other methods capable of searching and optimizing network parameters. This application does not limit this method; its goal is to reduce model prediction error and improve the fitting accuracy of the inverse mapping.
[0040] In some preferred embodiments, the above parameter optimization method is a multi-stage collaborative improvement whale algorithm, employing a collaborative improvement design in the population initialization, convergence process, spiral search process, and candidate individual update stages. In this embodiment, each individual in the whale population corresponds to a set of neural network parameters, and the individual fitness is used to characterize the prediction effect of this set of neural network parameters on the training samples, thereby optimizing the neural network parameters through iterative population updates. Specifically, the improved whale algorithm, based on the traditional whale algorithm, introduces chaotic mapping during population initialization to improve the uniformity and diversity of the initial population distribution in the parameter space, mitigating the risk of premature convergence caused by excessive concentration of initial individuals. It employs a nonlinear dynamic change strategy based on cosine functions to update the convergence control parameters used to balance global exploration and local development, ensuring the algorithm maintains strong global search capabilities in the early stages of parameter search and gradually enhances local optimization capabilities in later stages. During the spiral update process, it uses iteratively changing spiral parameters to adjust the spiral update trajectory, maintaining a certain search flexibility as the population converges towards optimal regions. Furthermore, it utilizes the current individual, the current best individual, and random individuals to perform random differential mutation to generate new candidate individuals, then compares the fitness of these new candidate individuals with the current individual to select the best. Through these improved strategies, the stability, globality, and adaptability to complex nonlinear hysteresis modeling tasks of the neural network inverse model parameter optimization process can be improved.
[0041] In some embodiments, after parameter optimization is completed, gradient descent or backpropagation fine-tuning can be further used to refine the network parameters, thereby further improving the modeling accuracy of the hysteresis inverse model. In the embodiments provided in this application, the parameter optimization method is mainly used to improve the global search capability and the quality of initial parameters, while gradient descent or backpropagation fine-tuning is mainly used to further reduce prediction errors; the two can be used in combination.
[0042] In some embodiments, the control method of this application can also be implemented by an electronic device. The electronic device may include a processor, a memory, and program instructions stored in the memory. When executed by the processor, the program instructions can implement the above-described voice coil motor control method based on the inverse hysteresis model. The processor may be a general-purpose processor, a digital signal processor, a microcontroller, or other processing unit capable of executing program instructions. The memory may be volatile memory, non-volatile memory, or a combination thereof.
[0043] In some embodiments, the method of this application can also be implemented in the form of a computer program product or a storage medium, wherein the storage medium stores program instructions for implementing the above method. When executed by a processor, the program instructions can perform operations such as acquiring sampled data, calling the hysteresis inverse model, generating feedback compensation, synthesizing control quantities, and outputting control quantities.
[0044] It should be understood that the specific settings regarding the neural network inverse model, feedback controller type, parameter optimization method, input vector construction method, and control output method in the above embodiments can be selected or adjusted according to different voice coil motor application scenarios without affecting the implementation of the core concept of this application. Any technical solution that generates a feedforward compensation driving quantity based on a hysteresis inverse model, combines it with displacement error feedback to generate a feedback compensation quantity, and then synthesizes the two into a control quantity to achieve voice coil motor displacement tracking can be implemented under the ideas disclosed in this application.
[0045] To verify the effectiveness of the voice coil motor control method based on the hysteresis inverse model of this application, the displacement tracking performance of three methods—no control, feedforward control only, and composite control combining feedforward and feedback—can be compared and tested under the same experimental platform and reference trajectory conditions. Specifically, a representative mid-to-high frequency sinusoidal desired displacement trajectory can be selected as the reference input, such as a sinusoidal reference displacement with a frequency of 5Hz, to examine the improvement of the voice coil motor displacement tracking effect by the hysteresis inverse model feedforward compensation and feedforward-feedback coordinated control described in this application under higher dynamic response requirements. During the experiment, the actual displacement output of the voice coil motor under different control methods is recorded, and the corresponding displacement tracking errors are further statistically analyzed.
[0046] Figure 4 A comparison chart of position tracking performance between the exemplary voice coil motor composite control and feedforward control provided in this application. Figure 4 As shown, under the same desired displacement input conditions, there is a significant deviation between the voice coil motor output and the desired displacement in the uncontrolled case. After introducing the feedforward compensation drive quantity generated based on the hysteresis inverse model, the voice coil motor output can track the desired displacement well. Furthermore, after adding feedback compensation, the composite control output is closer to the desired displacement curve than the simple feedforward control output. Therefore, this application, by generating the feedforward compensation drive quantity through the hysteresis inverse model, can compensate for the nonlinear hysteresis of the voice coil motor in advance. Combined with feedback compensation, it can further reduce the residual deviation, thereby improving the displacement tracking performance of the voice coil motor.
[0047] Figure 5 A comparison diagram of position tracking errors between the exemplary voice coil motor composite control and feedforward control provided in this application. Figure 5 As shown, in relation to Figure 4Under the same experimental conditions, compared with the uncontrolled state, feedforward control can significantly reduce displacement tracking error; while composite control further reduces the error amplitude and improves error fluctuation based on feedforward control. These results indicate that the feedforward compensation drive generated by the hysteresis inverse model in this application can effectively offset the main effects of the nonlinear hysteresis of the voice coil motor, while the feedback compensation can further correct the residual error caused by modeling errors, external disturbances, and parameter changes during operation, thereby improving control accuracy and stability.
[0048] To further illustrate the control effects of the control methods described in the above embodiments under different motion frequency conditions, this application provides Table 1 below to provide a comparison of the root mean square error (RMSE) and relative error (RE) of feedforward control and composite control under 1Hz, 5Hz and 8Hz operating conditions.
[0049] Table 1. Comparison of displacement tracking errors between feedforward control and composite control at different motion frequencies.
[0050] Table 1 compares the displacement tracking errors of feedforward control and composite control at different motion frequencies of 1Hz, 5Hz, and 8Hz. RMSE characterizes the overall tracking error level, and RE characterizes the relative error magnitude. As shown in Table 1, composite control exhibits superior error performance compared to feedforward control at 1Hz, 5Hz, and 8Hz: at 1Hz, RMSE decreases from 0.11507μm for feedforward control to 0.02855μm for composite control, and RE decreases from 0.24% to 0.059%; at 5Hz, RMSE decreases from 0.11479μm to 0.028127μm, and RE decreases from 0.24% to 0.058%; at 8Hz, RMSE decreases from 0.11451μm to 0.027621μm, and RE decreases from 0.24% to 0.057%. This demonstrates that the control method described in this application can not only improve the displacement tracking performance of the voice coil motor under a single operating condition, but also maintain a relatively stable error suppression effect under different motion frequencies. Especially under high dynamic response conditions, the composite control can still significantly reduce the displacement tracking error, indicating that the feedforward compensation drive and feedback compensation generated based on the hysteresis inverse model can form an effective synergy, thereby improving the operating condition adaptability and control robustness of the voice coil motor control process.
[0051] In summary, the experimental comparisons above verify that the voice coil motor control method based on the hysteresis inverse model provided in this application can effectively reduce tracking errors during voice coil motor displacement tracking, and further improve the control effect through feedback compensation on the basis of feedforward compensation. This demonstrates that the technical solution described in this application can not only achieve pre-compensation for the nonlinear hysteresis effect of the voice coil motor, but also maintain good control accuracy and robustness under complex operating conditions, thus making it suitable for voice coil motor control scenarios with high requirements for positioning accuracy and dynamic response performance.
[0052] In summary, this application provides a voice coil motor control method, system, electronic device, and storage medium. By constructing and training a neural network hysteresis inverse model based on the input and output samples of the voice coil motor, and using this hysteresis inverse model to generate a feedforward compensation driving quantity during the control process, and then combining it with the feedback compensation quantity generated based on the displacement error to form a control quantity output to the voice coil motor, the method can not only compensate for the effects of nonlinear hysteresis in advance, but also further correct model errors and external disturbances, thereby improving the displacement tracking accuracy, response speed, control stability, and engineering applicability of the voice coil motor.
[0053] The above embodiments are merely illustrative of the technical concept and features of the present invention, intended to enable those skilled in the art to understand the content of the present invention and implement it accordingly, and should not be construed as limiting the scope of protection of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects. The scope of the present invention is defined by the appended claims rather than the foregoing description, and thus all changes falling within the meaning and scope of the equivalents of the claims are intended to be included within the present invention.
Claims
1. A voice coil motor control method, characterized in that, include: Obtain the desired displacement and actual displacement of the voice coil motor at the current moment, as well as the desired displacement, drive control quantity and / or actual displacement at at least one historical moment; The desired displacement at the current moment and the desired displacement, drive control quantity and / or actual displacement at at least one historical moment are input into the hysteresis inverse model to calculate the feedforward compensation drive quantity corresponding to the desired displacement at the current moment in real time. The hysteresis inverse model is constructed by direct inversion and is a neural network inverse model trained based on the drive input and displacement output samples of the voice coil motor. The parameters of the neural network inverse model are determined by the whale algorithm with multi-stage collaborative improvement. The multi-stage includes at least two of the following: population initialization, convergence process, spiral search process and candidate individual update. A feedback compensation amount is generated based on the error between the expected displacement and the actual displacement at the current moment; The feedforward compensation drive quantity and the feedback compensation quantity are combined into the control quantity at the current moment, and the control quantity is output to the voice coil motor to control the voice coil motor to achieve displacement tracking.
2. The voice coil motor control method according to claim 1, characterized in that, The hysteresis inverse model is constructed using a direct inversion method, including: Construct a training input vector that includes the current displacement output, at least one historical displacement output, and at least one historical driving input; The training input vector is input into the inverse model of the neural network to output the current time driving input prediction value corresponding to the current time displacement output; Based on the predicted value of the current driving input and the current driving input in the training samples, the parameters of the inverse neural network model are adjusted, and after training, the adjusted neural network parameters are determined as the parameters of the hysteresis inverse model.
3. The voice coil motor control method according to claim 1, characterized in that, The feedforward compensation driving quantity is obtained through real-time calculation, including: Construct a control input vector that includes the desired displacement at the current moment and the desired displacement, drive control quantity, and / or actual displacement at at least one historical moment; The control input vector is input into the hysteresis inverse model to output the feedforward compensation driving quantity at the current moment.
4. The voice coil motor control method according to claim 1, characterized in that, The inverse model of the neural network is a backpropagation neural network.
5. The voice coil motor control method according to claim 1, characterized in that, The parameters of the neural network inverse model include connection weights and bias parameters.
6. The voice coil motor control method according to claim 1, characterized in that, The multi-stage process includes population initialization, convergence, spiral search, and candidate individual update, and the collaborative improvement includes: Introduce chaotic mappings in population initialization; A nonlinear dynamic change strategy based on cosine functions is adopted to update the convergence control parameters used to adjust the balance between global exploration and local exploitation; In the spiral update process, spiral parameters that change with iteration are used to adjust the spiral update trajectory; The current individual, the current best individual, and the random individual are used to perform random difference mutation to generate new candidate individuals, and the fitness of the new candidate individuals is compared with that of the current individual to select the best one to retain.
7. The voice coil motor control method according to claim 1, characterized in that, The feedback compensation amount is generated by the proportional-integral-derivative controller based on the error between the expected displacement and the actual displacement at the current moment.
8. The voice coil motor control method according to claim 1, characterized in that, Before outputting the control quantity to the voice coil motor, the method further includes: performing a limiting process on the control quantity to ensure that the control quantity falls within the allowable driving range of the voice coil motor.
9. A voice coil motor control system, characterized in that, include: The sampling module is used to sample the input and output of the voice coil motor to obtain the desired displacement, actual displacement and / or drive control quantity of the voice coil motor. The inverse model calling module is used to input the expected displacement at the current moment and the expected displacement, drive control quantity and / or actual displacement at at least one historical moment into the hysteresis inverse model to obtain the feedforward compensation drive quantity corresponding to the expected displacement at the current moment. The hysteresis inverse model is constructed by direct inversion as a neural network inverse model trained based on the drive input and displacement output samples of the voice coil motor. The parameters of the neural network inverse model are determined by the whale algorithm with multi-stage collaborative improvement. The multi-stage includes at least two of the following: population initialization, convergence process, spiral search process and candidate individual update. The feedback compensation module is used to receive the expected displacement and the actual displacement at the current moment, and generate and output the feedback compensation amount based on the error between the two. The control quantity synthesis module is used to receive the feedforward compensation driving quantity and the feedback compensation quantity, so as to synthesize and output the control quantity at the current moment; The drive output module is used to output the control quantity to the voice coil motor to control the voice coil motor to achieve displacement tracking.
10. The voice coil motor control system according to claim 9, characterized in that, The multi-stage process includes population initialization, convergence, spiral search, and candidate individual update, and the collaborative improvement includes: Introduce chaotic mappings in population initialization; A nonlinear dynamic change strategy based on cosine functions is adopted to update the convergence control parameters used to adjust the balance between global exploration and local exploitation; In the spiral update process, spiral parameters that change with iteration are used to adjust the spiral update trajectory; The current individual, the current best individual, and the random individual are used to perform random difference mutation to generate new candidate individuals, and the fitness of the new candidate individuals is compared with that of the current individual to select the best one to retain.
11. An electronic device, characterized in that, The method includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the method according to any one of claims 1 to 8.
12. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 8.