Motor control method, device and equipment
By performing low-pass filtering on the feedback voltage and coil current data of the voice coil motor, calculating and compensating for the voltage compensation, the problem of inaccurate feedback from the Hall device is solved, and the control accuracy and reliability of the voice coil motor are improved.
Patent Information
- Application Number
- CN202511197720.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-26
- Publication Date
- 2025-12-23
AI Technical Summary
In the existing technology, the Hall device of the voice coil motor cannot accurately feedback the displacement, resulting in poor control effect, especially when the coil current changes greatly instantaneously, the excitation interference has a serious impact.
By performing low-pass filtering on the feedback voltage data and coil current data, the voltage compensation amount is calculated, and this compensation amount is used to compensate the feedback voltage data, which is then used for closed-loop control.
This improves the control precision and reliability of the motor, ensures that the motion state is consistent with the expected control target, and enhances the system's operating performance.
Smart Images

Figure CN121193145A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of motor control technology, specifically to a motor control method, device, and equipment. Background Technology
[0002] A voice coil motor (VCPM) is a device that converts electrical energy into linear or finite-angle mechanical motion. Its working principle is based on the interaction between a current-carrying coil and the magnetic field of a permanent magnet. The thrust is determined by the current intensity and structural design. Positioning accuracy depends on an external feedback system, such as using a Hall effect sensor to detect changes in the magnetic field and converting the Hall voltage into displacement feedback, which is then fed to the control unit for closed-loop control.
[0003] Related technologies assume that the magnetic field generated by the coil is linearly related to the coil current. Therefore, linear compensation of the Hall voltage is used to eliminate the interference of the coil current on the magnetic field. However, the changing coil current itself also generates a magnetic field. Therefore, when the coil current changes significantly instantaneously, the voltage corresponding to this magnetic field will still affect the output of the Hall device, i.e., generate excitation interference. This prevents the Hall device from accurately feeding back displacement, resulting in the motor control not achieving the expected effect. Summary of the Invention
[0004] In view of the above problems, this application provides a motor control method, apparatus and equipment to solve the above technical problems.
[0005] In a first aspect, this application provides a motor control method, which includes:
[0006] When the target motor is running, the acquired feedback voltage data and coil current data are low-pass filtered to obtain the first voltage data and the first current data.
[0007] The voltage compensation amount is calculated based on the first current data;
[0008] The first voltage data is compensated based on the voltage compensation amount to obtain the second voltage data, and the target motor is then controlled in a closed loop based on the second voltage data.
[0009] In one possible implementation of this application, the acquired feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data, including: performing low-pass filtering on the feedback voltage data through a first low-pass filter to obtain the first voltage data; wherein, the first cutoff frequency of the first low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0010] In one possible implementation of this application, the acquired feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data, including: performing low-pass filtering on the coil current data through a second low-pass filter to obtain first current data; wherein, the second cutoff frequency of the second low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0011] In one possible implementation of this application, the acquired feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data, including: adjusting the cutoff frequency of the low-pass filter based on the measurement results of the magnetic induction response of the high-frequency coil; and performing low-pass filtering on the feedback voltage data and coil current data based on the adjusted cutoff frequency to obtain first voltage data and first current data.
[0012] In one possible implementation of this application, calculating the voltage compensation amount based on the first current data includes: calculating the voltage compensation amount based on the first current data according to a preset evaluation function; wherein the evaluation function is used to characterize the correspondence between the coil current and the feedback voltage.
[0013] In one possible implementation of this application, voltage compensation is performed on the first voltage data according to the voltage compensation amount to obtain the second voltage data, including: obtaining the second voltage data based on the difference between the first voltage data and the voltage compensation amount.
[0014] In one possible implementation of this application, closed-loop control of the target motor based on the second voltage data includes: obtaining displacement feedback data based on the second voltage data, and performing closed-loop control of the target motor based on the displacement feedback data.
[0015] In one possible implementation of this application, the acquired feedback voltage data and coil current data are respectively subjected to low-pass filtering to obtain first voltage data and first current data. Before that, the method further includes: acquiring initial Hall voltage data and initial coil current data; preprocessing the initial Hall voltage data and initial coil current data to obtain feedback voltage data and coil current data; wherein, the preprocessing includes smoothing processing.
[0016] Secondly, this application also provides a motor control device, which includes:
[0017] The filtering unit is used to perform low-pass filtering on the acquired feedback voltage data and coil current data respectively when the target motor is running, to obtain the first voltage data and the first current data.
[0018] The compensation calculation unit is used to calculate the voltage compensation amount based on the first current data.
[0019] The feedback control unit is used to perform voltage compensation on the first voltage data according to the voltage compensation amount to obtain the second voltage data, and to perform closed-loop control on the target motor according to the second voltage data.
[0020] In one possible implementation of this application, the filtering unit is specifically used to: perform low-pass filtering on the feedback voltage data through a first low-pass filter to obtain first voltage data; wherein, the first cutoff frequency of the first low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0021] In one possible implementation of this application, the filtering unit is specifically used to: perform low-pass filtering on the coil current data through a second low-pass filter to obtain first current data; wherein, the second cutoff frequency of the second low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0022] In one possible implementation of this application, the filtering unit is specifically used to: adjust the cutoff frequency of the low-pass filter based on the measurement results of the magnetic induction response of the high-frequency coil; and perform low-pass filtering processing on the feedback voltage data and coil current data respectively based on the adjusted cutoff frequency to obtain first voltage data and first current data.
[0023] In one possible implementation of this application, the compensation calculation unit is specifically used to: calculate the first current data according to a preset evaluation function to obtain the voltage compensation amount; wherein, the evaluation function is used to characterize the correspondence between the coil current and the feedback voltage.
[0024] In one possible implementation of this application, the feedback control unit is specifically used to: obtain second voltage data based on the difference between the first voltage data and the voltage compensation amount.
[0025] In one possible implementation of this application, the feedback control unit is specifically used to: obtain displacement feedback data based on the second voltage data, and perform closed-loop control of the target motor based on the displacement feedback data.
[0026] In one possible implementation of this application, the acquired feedback voltage data and coil current data are respectively subjected to low-pass filtering to obtain first voltage data and first current data. Before that, the filtering unit is also used to: acquire initial Hall voltage data and initial coil current data; preprocess the initial Hall voltage data and initial coil current data to obtain feedback voltage data and coil current data; wherein, the preprocessing includes smoothing processing.
[0027] Thirdly, this application also provides a motor control device, which includes one or more processors; a memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps of the motor control method of the first aspect.
[0028] From the above, it can be concluded that this application has the following beneficial effects:
[0029] In this application, the acquired feedback voltage data and coil current data are low-pass filtered respectively. The voltage compensation amount is calculated based on the filtered current data, and then the compensation amount is used to compensate the filtered feedback voltage data. Finally, the compensated voltage data is applied to closed-loop control. This effectively solves the problem of inaccurate displacement feedback caused by ignoring the magnetic field interference generated by the instantaneous change of coil current in the prior art. It improves control accuracy and reliability, ensures that the motion state of the motor is highly consistent with the expected control target, and thus improves the operating performance of the entire system. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a schematic flowchart of a motor control method provided in an embodiment of this application;
[0032] Figure 2 This is another schematic flowchart of the motor control method provided in the embodiments of this application;
[0033] Figure 3 This is a schematic diagram of a magnetic interference frequency provided in the embodiments of this application;
[0034] Figure 4 This is a schematic diagram of a module of the motor control device provided in the embodiments of this application;
[0035] Figure 5 This is a schematic diagram of a motor control device provided in an embodiment of this application. Detailed Implementation
[0036] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0037] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0038] In the embodiments of this application, it should be noted that, in this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations.
[0039] Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.
[0040] In the description of the embodiments of this application, the words "example" or "for example" are used to indicate exemplification, illustration, or description. Any embodiment or design described as "example" or "for example" in the embodiments of this application is not to be construed as being more preferred or having more advantages than another embodiment or design. The use of the words "example" or "for example" is intended to present relative concepts in a clear manner.
[0041] Before introducing the motor control method, apparatus and equipment of this application, we will first introduce the relevant background information of the embodiments of this application.
[0042] Voice coil motors, as devices that convert electrical energy into mechanical energy, are widely used in scenarios requiring high-precision displacement control, such as camera autofocus and precision instrument positioning. In the closed-loop control process of a voice coil motor, Hall effect sensors are typically used to sense changes in the magnetic field, thereby providing feedback on the motor's displacement. Specifically, the Hall effect sensor generates a corresponding Hall voltage based on the sensed magnetic field strength. This Hall voltage, after processing, is converted into a displacement feedback quantity and input to the closed-loop control circuit, serving as the basis for adjusting the motor's operating state.
[0043] However, in practical applications, the magnetic field sensed by Hall devices does not come from a single source. It consists of two parts: one part is the magnetic field generated by displacement changes during motor movement. This part of the magnetic field is directly related to the actual displacement of the motor and is the effective information required for closed-loop control; the other part is the magnetic field generated by the coil drive current. This part of the magnetic field is an interference signal and will affect the accuracy of displacement feedback.
[0044] In related technologies, in order to eliminate magnetic field interference generated by coil current, some solutions assume that the magnetic field generated by the coil is linearly related to the driving current. Therefore, a linear compensation method is adopted, such as estimating the Hall voltage interference corresponding to the coil magnetic field by multiplying the current value by a fixed proportional coefficient, and then subtracting the interference from the Hall voltage output by the Hall device.
[0045] However, in practical applications, the coil current is not always in a stable state. For example, in scenarios requiring rapid response during step movements or large-scale travel, the current undergoes instantaneous and drastic changes, generating an additional magnetic field. Because the linear compensation method in related technologies does not consider the magnetic field generated by these instantaneous current changes, the estimated interference deviates significantly from the actual interference. Consequently, even after compensation, the Hall voltage cannot accurately reflect the actual displacement of the motor. This leads to deviations in the closed-loop control circuit, ultimately resulting in the motor's control performance falling short of expectations, such as blurry focus or delayed response during camera focusing.
[0046] Based on this, embodiments of this application provide a motor control method, apparatus, and device, which will be described in detail below.
[0047] First, this application provides a motor control method. The subject executing the method can be a motor control device, or a motor control device or other electronic device that integrates the motor control device, such as a mobile phone, tablet computer, digital camera, lithography machine, laser processing equipment, etc.
[0048] Please see Figure 1 , Figure 1This is a flowchart illustrating a motor control method provided in an embodiment of this application. It should be noted that although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than that shown here. The motor control method may include the following multiple steps.
[0049] Step S101: When the target motor is running, the acquired feedback voltage data and coil current data are subjected to low-pass filtering to obtain the first voltage data and the first current data.
[0050] In this embodiment, the feedback voltage data can come from a Hall device in the system, such as a Hall sensor. The Hall device generates a Hall voltage by sensing changes in the magnetic field. It is understood that there can be one or more Hall devices. If there are multiple Hall devices, the feedback voltage data can be the average of the Hall voltages of those multiple devices; the specific value can be determined according to the actual application scenario and is not limited here.
[0051] The coil current data can come from a current sensor in the system, which detects the coil drive current to obtain the coil current data. Understandably, in a constant current drive circuit, this coil current data can also be current data sent by the control unit.
[0052] In this embodiment, the feedback voltage data and coil current data are low-pass filtered respectively, which can be implemented using any existing low-pass filter; and the parameters of the low-pass filter for the feedback voltage data and coil current data can be the same or different, which can be determined according to the actual application scenario, and are not limited here.
[0053] Step S102: Calculate the voltage compensation amount based on the first current data.
[0054] In this embodiment of the application, the first current data can be calculated according to a pre-set evaluation method to obtain the corresponding voltage compensation amount; it can be understood that the voltage compensation amount here is a voltage value that is only related to the first current data.
[0055] Step S103: Perform voltage compensation on the first voltage data according to the voltage compensation amount to obtain the second voltage data, and perform closed-loop control on the target motor according to the second voltage data.
[0056] Since the voltage compensation amount is only related to the first current data, it can include the voltage values corresponding to the magnetic field generated by the coil current and the magnetic field generated by the coil current due to its own changes. By compensating the first voltage data according to this compensation amount, the resulting second voltage data becomes independent of both the coil current and the changing current; that is, the second voltage data is only related to the displacement of the target motor. By using this second voltage data for closed-loop control of the target motor, it can be ensured that the second voltage data accurately reflects the displacement of the target motor.
[0057] In this embodiment, the acquired feedback voltage data and coil current data are low-pass filtered respectively. The voltage compensation amount is calculated based on the filtered current data, and then the compensation amount is used to compensate the filtered feedback voltage data. Finally, the compensated voltage data is applied to closed-loop control. This effectively solves the problem of inaccurate displacement feedback caused by ignoring the magnetic field interference generated by the instantaneous change of coil current in the prior art. It improves control accuracy and reliability, ensures that the motion state of the motor is highly consistent with the expected control target, and thus improves the operating performance of the entire system.
[0058] Next, continue with Figure 1 The steps shown are explained in detail, as well as the specific implementation methods that may be used in practical applications.
[0059] Please see Figure 2 In some embodiments of this application, the obtained feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data, which may further include: performing low-pass filtering on the feedback voltage data through a first low-pass filter to obtain the first voltage data; wherein, the first cutoff frequency of the first low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0060] In this embodiment, the first low-pass filter can be an RC filter. The first cutoff frequency of the first low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency. Here, the magnetic interference frequency is the frequency corresponding to the low-frequency cutoff point where the curve of frequency f versus Hall value H is flat. For example... Figure 3 The frequency f1 is shown. It is understandable that the frequency response curves will be different in different application scenarios, and the magnetic interference frequency will also be different. Therefore, this magnetic interference frequency can be determined according to the actual application scenario, and is not limited here.
[0061] For example, if the resonant frequency of the target motor is 450Hz, the magnetic interference frequency generated by the instantaneous change of coil current is mainly distributed above 5000Hz. Therefore, the first cutoff frequency of the first low-pass filter can be set to 1000Hz. The feedback voltage data is filtered by the first low-pass filter to obtain the first voltage data.
[0062] In this embodiment, the first cutoff frequency being greater than the resonant frequency of the target motor can ensure that the voltage corresponding to the displacement of the maximum power vibration of the target motor can be preserved; while being less than the magnetic interference frequency can filter out the high-frequency interference of Hall magnetic interference generated by the coil current.
[0063] Please continue reading. Figure 2 In some embodiments of this application, the obtained feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data, which may further include: performing low-pass filtering on the coil current data through a second low-pass filter to obtain first current data; wherein, the second cutoff frequency of the second low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0064] In this embodiment, the second low-pass filter can also be an RC filter. The second cutoff frequency of the second low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency. Similar to the description of the first low-pass filter, the magnetic interference frequency here is the frequency corresponding to the low-frequency cutoff point of the flat curve on the frequency response graph of frequency versus Hall value.
[0065] For example, if the resonant frequency of the target motor is 450Hz, the magnetic interference frequency generated by the instantaneous change of the coil current is mainly distributed above 5000Hz. Therefore, the second cutoff frequency of the second low-pass filter can be set to 1100Hz. The coil current data is filtered by the second low-pass filter to obtain the first current data.
[0066] In this embodiment, the second cutoff frequency being greater than the resonant frequency of the target motor ensures that the current corresponding to the maximum power vibration of the target motor can be retained; while being less than the magnetic interference frequency can filter out the high-frequency interference of Hall magnetic interference generated by the coil current.
[0067] In some embodiments of this application, the obtained feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data, which may further include: adjusting the cutoff frequency of the low-pass filter according to the measurement results of the magnetic induction response of the high-frequency coil; and performing low-pass filtering on the feedback voltage data and coil current data according to the adjusted cutoff frequency to obtain first voltage data and first current data.
[0068] In practical applications, the measurement accuracy of the magnetic induction response of the high-frequency coil may vary due to individual differences in the motor or changes in the usage environment. In this case, the cutoff frequency of the low-pass filter can be adjusted based on the measurement results of the magnetic induction response of the high-frequency coil, that is, the first cutoff frequency of the first low-pass filter and the second cutoff frequency of the second low-pass filter can be adjusted.
[0069] Specifically, the magnetic induction response of the coil under high-frequency current can be measured using specialized testing equipment. If the current measurement conditions allow for accurate measurement of the high-frequency coil's magnetic induction response, the first and second cutoff frequencies can be set close to the magnetic interference frequency to ensure that the subsequent filtering order is not too high and the results are relatively accurate. Alternatively, if the current measurement conditions allow for accurate measurement of the high-frequency coil's magnetic induction response, the first and second cutoff frequencies can be appropriately increased to allow more high-frequency signals to pass through the filter, making the calculation process more stable and less prone to data divergence. Furthermore, if the current measurement conditions do not allow for accurate measurement of the high-frequency coil's magnetic induction response, the first and second cutoff frequencies can be appropriately decreased to directly filter out the influence of high-frequency components while retaining the low-frequency characteristics related to coil magnetic field interference, thus requiring only low-frequency compensation.
[0070] In some embodiments of this application, calculating the voltage compensation amount based on the first current data may further include: calculating the voltage compensation amount based on the first current data according to a preset evaluation function; wherein the evaluation function is used to characterize the correspondence between the coil current and the feedback voltage.
[0071] In this embodiment, the evaluation function can be used to characterize the correspondence between coil current and feedback voltage; specifically, it can be obtained through calibration operations, for example, by controlling a single variable so that the Hall device in the target motor only responds to the coil current to generate Hall voltage, i.e., feedback voltage, thereby obtaining the feedback voltage under different currents to calibrate the relationship between coil current and feedback voltage.
[0072] As an example, when the target motor operates in a low-current, low-dynamic scenario (such as lens fine-tuning focus) and the current changes gradually, a linear function can be used as the evaluation function. For example, the voltage compensation amount Δ = k × the first current data I. lpf , where k is the proportionality coefficient.
[0073] When the target motor operates within a moderate current range (such as a lens moving at a moderate amplitude), and the current change exhibits a certain degree of nonlinearity, a multi-segment linear function can be used as the evaluation function. For example, when the first current data I... lpf When the current is ≤400mA, the voltage compensation amount Δ = k1 × the first current data I lpf When 400mA < first current data I lpfWhen the current is ≤500mA, the voltage compensation amount Δ = k2 × the first current data I lpf +b; when the first current data I lpf When the current is >500mA, the voltage compensation amount Δ = k3 × the first current data I lpf , where k1, k2, and k3 are the proportionality coefficients for different intervals, and b is a constant term.
[0074] When the target motor is operating in a high-current, high-dynamic-range scenario (such as rapid lens focusing), and there are many high-frequency components in the current, a filtering method can be used as the evaluation function, that is, for the first current data I... lpf Perform another low-pass filter to obtain the voltage compensation amount Δ = filter(I) lpf The cutoff frequency of this filter can be set to 600Hz to further filter out high-frequency noise.
[0075] In this embodiment, the parameters of the evaluation function can be determined through calibration. Specifically, the target motor can be fixed on the test platform and its displacement restricted by a mechanical limiting device to ensure that the magnetic field sensed by the Hall device comes only from the magnetic field generated by the coil current, and not from the magnetic field generated by the displacement. Then, the coil current is controlled to start from 0mA and gradually increase to 1000mA in 50mA intervals, with each current value held for 3 seconds. At the same time, the Hall voltage data output by the Hall device is recorded. Similarly, the Hall voltage data is low-pass filtered to obtain the corresponding voltage data V. lpf_cal and current data I lpf_cal .
[0076] Since the displacement is zero at this time, the voltage data V lpf_cal This refers to the Hall voltage interference corresponding to the magnetic field generated by the coil current; therefore, the compensation amount Δ_cal = V lpf_cal Based on multiple sets of current data I lpf_cal The parameters of the evaluation function can be determined through linear fitting, along with the compensation amount Δ_cal.
[0077] For the linear function Δ=k×I lpf The least squares method is used for fitting. For example, when I lpf_cal When the current is 100mA, 400mA, and 300mA respectively, the corresponding Δ_cal are 2mV, 4.1mV, and 5.9mV respectively. Through fitting, we can obtain k≈0.02mV / mA, that is, Δ=0.02×I lpf .
[0078] For multi-segment linear functions, fitting can be performed separately in different current ranges. For example, in I... lpf_cal In the ≤400mA range, the fitted value yielded k1 = 0.02mV / mA; in the 400mA range... lpf_cal In the ≤500mA interval, the fitting yielded k2 = 0.018mV / mA and b = 0.4mV; in I lpf_cal In the >500mA range, the fitting yielded k3 = 0.015mV / mA.
[0079] For the evaluation function of the filtering method, the calibrated Δ_cal can be used as the target value for I. lpf_cal Perform filtering, adjusting the filter parameters to make the output consistent with Δ_cal. For example, use a low-pass filter with a cutoff frequency of 500Hz for I. lpf_cal The error between the filtered result obtained after processing and Δ_cal is controlled within 0.1mV.
[0080] After selecting the evaluation function based on the actual application scenario, the first current data I can be obtained. lpf Input the value into the selected evaluation function to calculate the voltage compensation amount Δ.
[0081] In some embodiments of this application, the process of compensating the first voltage data according to the voltage compensation amount to obtain the second voltage data may further include: obtaining the second voltage data based on the difference between the first voltage data and the voltage compensation amount.
[0082] Understandably, the first voltage data includes not only the voltage data corresponding to the target motor displacement, but also the voltage data corresponding to the coil current. Therefore, after obtaining the voltage compensation amount corresponding to the coil current, the difference between the first voltage data and the voltage compensation amount can be calculated to obtain the voltage data corresponding only to the target motor displacement, which is the second voltage data.
[0083] For example, the second voltage data Vo = the first voltage data V lpf - Voltage compensation amount Δ, when the first voltage data V lpf When the voltage is 15mV and the voltage compensation Δ is 7mV, the second voltage data Vo is 8mV.
[0084] In some embodiments of this application, closed-loop control of the target motor based on the second voltage data may further include: obtaining displacement feedback data based on the second voltage data, and performing closed-loop control of the target motor based on the displacement feedback data.
[0085] Since the second voltage data Vo reflects the Hall voltage corresponding to the magnetic field generated solely by the displacement of the target motor, it can be converted into displacement feedback data. This conversion can be based on the linear relationship between Hall voltage and displacement. Understandably, this linear relationship can also be pre-calibrated using the controlled variable method.
[0086] Once the displacement feedback data is obtained, closed-loop control of the target motor can be performed using this data. For example, the displacement feedback data is input into the closed-loop control loop, compared with the target displacement, and the error between the two is calculated. The PID control algorithm then calculates the current data corresponding to this error and inputs it into the coil to correct the displacement of the target motor until the error between the displacement feedback data and the target displacement is within an acceptable range, thus completing the closed-loop control.
[0087] In some embodiments of this application, the acquired feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data. Prior to this, the method may further include: acquiring initial Hall voltage data and initial coil current data; preprocessing the initial Hall voltage data and initial coil current data to obtain feedback voltage data and coil current data; wherein, the preprocessing includes smoothing.
[0088] In this embodiment, the initial Hall voltage data can come from a Hall device installed inside the target motor, and the initial coil current data can come from a current sensor connected in series with the target motor. This current sensor can detect the current value flowing through the coil in real time. It is understood that since the coil is driven by a constant current drive circuit, the error between the current command issued by the control unit and the actual current detected by the current sensor is almost negligible. Therefore, in this scenario, the current command issued by the control unit can be directly used as the initial coil current data.
[0089] Then, the initial Hall voltage data and initial coil current data are preprocessed separately. Since the voltage signal output by the Hall device may contain slight high-frequency noise, to avoid the influence of high-frequency noise on subsequent processing, a smoothing operation using a moving average can be used for preprocessing. For example, the moving average window size can be set to 5, meaning that the voltage data from 5 consecutive sampling times are averaged. Because the initial Hall voltage data has been preprocessed, the same preprocessing operation can be performed on the initial coil current data to ensure consistency in the processing of the two initial data sets.
[0090] To better implement the motor control method of this application, based on the above embodiments, this application also provides a motor control device, such as... Figure 4 As shown, Figure 4 This is a schematic diagram of a motor control device 400 provided in an embodiment of this application. The motor control device 400 may include:
[0091] The filtering unit 401 can be used to perform low-pass filtering on the acquired feedback voltage data and coil current data respectively when the target motor is running, to obtain the first voltage data and the first current data.
[0092] The compensation calculation unit 402 can be used to calculate the voltage compensation amount based on the first current data.
[0093] The feedback control unit 403 can be used to perform voltage compensation on the first voltage data according to the voltage compensation amount to obtain the second voltage data, and to perform closed-loop control on the target motor according to the second voltage data.
[0094] In this embodiment, the filtering unit 401 performs low-pass filtering on the acquired feedback voltage data and coil current data respectively. The compensation calculation unit 402 calculates the voltage compensation amount based on the filtered current data. The feedback control unit 403 then uses the compensation amount to compensate the filtered feedback voltage data. Finally, the compensated voltage data is applied to closed-loop control. This effectively solves the problem of inaccurate displacement feedback caused by ignoring the magnetic field interference generated by the instantaneous change of the coil current in the prior art. It improves control accuracy and reliability, ensures that the motion state of the motor is highly consistent with the expected control target, and thus improves the operating performance of the entire system.
[0095] In some embodiments of this application, the filtering unit 401 can be specifically used to: perform low-pass filtering on the feedback voltage data through a first low-pass filter to obtain first voltage data; wherein, the first cutoff frequency of the first low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0096] In some embodiments of this application, the filtering unit 401 can be specifically used to: perform low-pass filtering on the coil current data through a second low-pass filter to obtain first current data; wherein, the second cutoff frequency of the second low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
[0097] In some embodiments of this application, the filtering unit 401 may be specifically used to: adjust the cutoff frequency of the low-pass filter according to the measurement results of the magnetic induction response of the high-frequency coil; and perform low-pass filtering processing on the feedback voltage data and coil current data according to the adjusted cutoff frequency to obtain the first voltage data and the first current data.
[0098] In some embodiments of this application, the compensation calculation unit 402 may be specifically used to: calculate the first current data according to a preset evaluation function to obtain the voltage compensation amount; wherein, the evaluation function is used to characterize the correspondence between the coil current and the feedback voltage.
[0099] In some embodiments of this application, the feedback control unit 403 may be specifically used to: obtain second voltage data based on the difference between the first voltage data and the voltage compensation amount.
[0100] In some embodiments of this application, the feedback control unit 403 may be specifically used to: obtain displacement feedback data based on the second voltage data, and perform closed-loop control of the target motor based on the displacement feedback data.
[0101] In some embodiments of this application, the acquired feedback voltage data and coil current data are subjected to low-pass filtering to obtain first voltage data and first current data. Prior to this, the filtering unit 401 can also be used to: acquire initial Hall voltage data and initial coil current data; preprocess the initial Hall voltage data and initial coil current data to obtain feedback voltage data and coil current data; wherein, the preprocessing includes smoothing processing.
[0102] It should be noted that the relevant contents of the filtering unit 401, the compensation calculation unit 402, and the feedback control unit 403 in this application correspond one-to-one with those described above. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the motor control device and its corresponding unit modules described above can be referred to as follows: Figures 1 to 2 The specific description of the motor control method corresponding to any embodiment will not be repeated here.
[0103] To better implement the motor control method of this application, embodiments of this application also provide a motor control device that integrates any of the motor control devices provided in this application. The motor control device includes one or more processors 501; a memory 502; and one or more application programs, wherein the one or more application programs are stored in the memory 502 and configured to be executed by the processor 501 to perform the following functions:
[0104] When the target motor is running, the acquired feedback voltage data and coil current data are low-pass filtered to obtain the first voltage data and the first current data.
[0105] The voltage compensation amount is calculated based on the first current data;
[0106] The first voltage data is compensated based on the voltage compensation amount to obtain the second voltage data, and the target motor is then controlled in a closed loop based on the second voltage data.
[0107] like Figure 5 As shown, it illustrates a structural schematic diagram of the motor control device involved in this application, specifically:
[0108] The motor control device may include components such as a processor 501 with one or more processing cores, a memory 502 with one or more computer-readable storage media, a power supply 503, and an input unit 504. Those skilled in the art will understand that... Figure 5The device structure shown does not constitute a limitation on the device. The motor control device may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0109] The processor 501 is the control center of the device, connecting various parts of the device through various interfaces and lines. It executes software programs and / or unit modules stored in the memory 502, and calls data stored in the memory 502 to perform various functions and process data, thereby providing overall monitoring of the motor control device. Optionally, the processor 501 may include one or more processing cores; the processor 501 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and application programs, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may not be integrated into the processor 501.
[0110] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function, etc.; the data storage area may store data created based on the use of the motor control device, etc. In addition, the memory 502 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.
[0111] The motor control device may also include a power supply 503 that supplies power to the various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 503 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0112] The motor control device may also include an input unit 504 and an output unit 505. The input unit 504 can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0113] Although not shown, the motor control device may also include a display unit, etc., which will not be described in detail here. Specifically, in this application, the processor 501 in the motor control device loads the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 runs the application programs stored in the memory 502 to realize various functions, as follows:
[0114] When the target motor is running, the acquired feedback voltage data and coil current data are low-pass filtered to obtain the first voltage data and the first current data.
[0115] The voltage compensation amount is calculated based on the first current data;
[0116] The first voltage data is compensated based on the voltage compensation amount to obtain the second voltage data, and the target motor is then controlled in a closed loop based on the second voltage data.
[0117] Those skilled in the art will understand that all or part of the steps in the various methods described above can be accomplished by instructions, or by controlling related hardware with instructions. These instructions can be stored in a computer-readable storage medium and loaded and executed by the processor 501.
[0118] Therefore, this application provides a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc. Computer instructions are stored thereon, and these computer instructions are loaded by processor 501 to execute the steps in any of the motor control methods provided in this application. For example, when the computer instructions are executed by processor 501, they perform the following functions:
[0119] When the target motor is running, the acquired feedback voltage data and coil current data are low-pass filtered to obtain the first voltage data and the first current data.
[0120] The voltage compensation amount is calculated based on the first current data;
[0121] The first voltage data is compensated based on the voltage compensation amount to obtain the second voltage data, and the target motor is then controlled in a closed loop based on the second voltage data.
[0122] The computer instructions stored in the computer-readable storage medium can execute the present application as follows. Figures 1 to 2 Corresponding to the steps in the motor control method of any embodiment, the present application can be implemented as described above. Figures 1 to 2 For details on the beneficial effects that the motor control method can achieve in any embodiment, please refer to the preceding description, which will not be repeated here.
[0123] The above are merely preferred embodiments of this application and are not intended to limit this application in any way. Although this application has disclosed preferred embodiments as above, it is not intended to limit this application. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the technical solution of this application. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of this application without departing from the scope of the technical solution of this application shall still fall within the scope of the technical solution of this application.
Claims
1. A motor control method, characterized in that, The method includes: When the target motor is running, the acquired feedback voltage data and coil current data are low-pass filtered to obtain the first voltage data and the first current data. The voltage compensation amount is calculated based on the first current data; The first voltage data is compensated according to the voltage compensation amount to obtain the second voltage data, and the target motor is controlled in a closed loop according to the second voltage data.
2. The motor control method according to claim 1, characterized in that, The step of performing low-pass filtering on the acquired feedback voltage data and coil current data to obtain first voltage data and first current data includes: The feedback voltage data is low-pass filtered by a first low-pass filter to obtain the first voltage data; wherein the first cutoff frequency of the first low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
3. The motor control method according to claim 1, characterized in that, The step of performing low-pass filtering on the acquired feedback voltage data and coil current data to obtain first voltage data and first current data includes: The coil current data is obtained by performing low-pass filtering on the second low-pass filter; wherein the second cutoff frequency of the second low-pass filter is greater than the resonant frequency of the target motor and less than the magnetic interference frequency.
4. The motor control method according to any one of claims 1-3, characterized in that, The step of performing low-pass filtering on the acquired feedback voltage data and coil current data to obtain first voltage data and first current data includes: Based on the measurement results of the magnetic induction response of the high-frequency coil, adjust the cutoff frequency of the low-pass filter; The feedback voltage data and the coil current data are low-pass filtered according to the adjusted cutoff frequency to obtain the first voltage data and the first current data.
5. The motor control method according to claim 1, characterized in that, The step of calculating the voltage compensation amount based on the first current data includes: The voltage compensation amount is obtained by calculating the first current data according to a preset evaluation function; wherein the evaluation function is used to characterize the correspondence between the coil current and the feedback voltage.
6. The motor control method according to claim 1, characterized in that, The step of performing voltage compensation on the first voltage data according to the voltage compensation amount to obtain the second voltage data includes: The second voltage data is obtained based on the difference between the first voltage data and the voltage compensation amount.
7. The motor control method according to claim 1, characterized in that, The closed-loop control of the target motor based on the second voltage data includes: Displacement feedback data is obtained based on the second voltage data, and closed-loop control is performed on the target motor based on the displacement feedback data.
8. The motor control method according to claim 1, characterized in that, Before performing low-pass filtering on the acquired feedback voltage data and coil current data to obtain first voltage data and first current data, the method further includes: Acquire initial Hall voltage data and initial coil current data; The initial Hall voltage data and the initial coil current data are preprocessed to obtain the feedback voltage data and the coil current data; wherein, the preprocessing includes smoothing.
9. A motor control device, characterized in that, include: The filtering unit is used to perform low-pass filtering on the acquired feedback voltage data and coil current data respectively when the target motor is running, to obtain the first voltage data and the first current data. The compensation calculation unit is used to calculate the voltage compensation amount based on the first current data. The feedback control unit is used to perform voltage compensation on the first voltage data according to the voltage compensation amount to obtain the second voltage data, and to perform closed-loop control on the target motor according to the second voltage data.
10. A motor control device, characterized in that, include: One or more processors; Memory; as well as One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the motor control method according to any one of claims 1-8.