Motor control module, electronic equipment and method for controlling movement of motor

By using a compensator and a PID controller in the motor control module to compensate for motor commands, the problem of poor synchronization of multiple motor controls is solved, achieving efficient synchronous movement of the motors and improving the photographic effect and ease of operation of the camera equipment.

CN121546948APending Publication Date: 2026-02-17VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511752259.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-26
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing technologies, when controlling the movement of multiple motors, result in poor control of each motor, leading to poor synchronization and making it difficult to achieve synchronized movement.

Method used

The target control command is compensated by the compensator in the motor control module, so that the displacement of the first motor and the second motor moves in the same unit time. The error is calculated by the PID controller and a control signal is generated to achieve synchronization.

Benefits of technology

It enables the synchronous movement of multiple motors, improves the linkage and synchronization of motor control, and enhances the photographic effect and ease of operation of the photography equipment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121546948A_ABST
    Figure CN121546948A_ABST
Patent Text Reader

Abstract

The invention discloses a motor control module, electronic equipment and a method for controlling a motor to move, and belongs to the field of electronics. The motor control module comprises a motor control module, a compensator, a first motor and a second motor, the motor control module is respectively coupled with the first motor and the second motor, and the compensator is coupled with the motor control module; wherein the compensator is used for compensating a target control instruction, so that the displacement of the first motor and the displacement of the second motor in unit time are matched; the target control instruction comprises at least one of a first instruction used for controlling the first motor to move and a second instruction used for controlling the second motor to move.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of electronics, specifically relating to a motor control module, electronic equipment, and a method for controlling the movement of a motor. Background Technology

[0002] Currently, in many scenarios, it is necessary to control the simultaneous movement of multiple motors within electronic devices. For example, when a user performs continuous zoom, it is necessary to control multiple motors to drive multiple lenses to move simultaneously.

[0003] In controlling the movement of multiple motors, related technologies often control each motor individually, meaning that the control schemes for multiple motors are independent of each other. This approach results in poor motor control performance. Summary of the Invention

[0004] This application provides a motor control module, electronic device, and method for controlling motor movement, which can solve the problem of poor motor control effect in related technologies.

[0005] In a first aspect, embodiments of this application provide a motor control module, including: a motor control module, a compensator, a first motor, and a second motor; The motor control module is coupled to the first motor and the second motor respectively, and the compensator is coupled to the motor control module; The compensator is used to compensate for the target control command, so that the displacement of the first motor and the second motor moves in a unit time is matched. The target control command includes at least one of a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor.

[0006] Secondly, embodiments of this application provide an electronic device, including the motor control module as described in the first aspect.

[0007] Thirdly, embodiments of this application provide a method for controlling the movement of a motor, applied to the motor control module described in the first aspect, comprising: During the movement of the first motor and the second motor, a target control command is acquired; the target control command includes at least one of a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor. The target control command is compensated so that the displacements of the first motor and the second motor are matched within a unit time.

[0008] In this embodiment, at least one of the first command for controlling the movement of the first motor and the second command for controlling the movement of the second motor is compensated to match the displacement of the first motor and the second motor within a unit time. Compared with the related technologies that control each motor individually, this embodiment ensures that the control of the first motor and the control of the second motor are linked by matching the displacement of the first motor and the second motor within a unit time, thereby making the movement of the first motor and the second motor more synchronized and solving the problem of poor motor control effect in the related technologies. Attached Figure Description

[0009] Figure 1 This is a schematic diagram of a motor control module provided in an embodiment of this application; Figure 2 This is a schematic diagram of another motor control module provided in an embodiment of this application; Figure 3 This is a schematic diagram of another motor control module provided in an embodiment of this application; Figure 4 This is a schematic diagram of a motor control module provided in an embodiment of this application; Figure 5 This is a flowchart of a method for controlling the movement of a motor provided in an embodiment of this application; Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application.

[0010] Explanation of reference numerals in the attached figures: Motor control module-100; Motor control module-200; First controller-210; Second controller-220; Compensator-300; First motor-410; Second motor-420; First load module-430; Second load module-440. Detailed Implementation

[0011] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.

[0012] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.

[0013] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0014] The motor control module provided in this application embodiment can compensate for at least one of the first command for controlling the movement of the first motor and the second command for controlling the movement of the second motor, so that the displacements of the first motor and the second motor move in a unit time are matched, and the first motor and the second motor move synchronously as much as possible.

[0015] The motor control module provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.

[0016] For reference Figure 1 , Figure 1 This is a schematic diagram of a motor control module provided in an embodiment of this application. Figure 1 As shown, the motor control module 100 includes: a motor control module 200, a compensator 300, a first motor 410, and a second motor 420; the motor control module 200 is coupled to the first motor 410 and the second motor 420 respectively, and the compensator 300 is coupled to the motor control module 200.

[0017] The compensator is used to compensate for the target control command, so that the displacements of the first motor and the second motor are matched within a unit time. The target control command includes at least one of a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor. Both the first motor and the second motor can be micromotors, i.e., any micromotor can be used, such as a voice coil motor (VCM), a shape memory alloy actuator (SMA), or a piezoelectric motor.

[0018] In this embodiment, the displacements of the first motor and the second motor within a unit time are matched, indicating that the displacement difference between the first motor and the second motor within a unit time is closer than before compensation. When the motor control module receives a control command, it can drive the first motor to move via a first instruction and drive the second motor to move via a second instruction. The control command is, for example, a continuous zoom command, which instructs the first motor and the second motor to move synchronously. Synchronous movement means that the first motor and the second motor move simultaneously at the same or similar speeds. The first motor and the second motor can move in the same direction. If it is detected that the first motor and the second motor are not moving synchronously, i.e., the displacements of the first motor and the second motor within a unit time are mismatched, compensation can be made for at least one of the first instruction and the second instruction.

[0019] For example, if the displacement of the first motor per unit time is greater than that of the second motor per unit time (i.e., the speed of the first motor is greater than the speed of the second motor), then the first command can be compensated, and the compensated first command is used to instruct the speed of the first motor to decrease; alternatively, the second command can be compensated, and the compensated second command is used to increase the speed of the second motor; or, both the first and second commands can be compensated, with the compensated first command used to instruct the speed of the first motor to decrease and the compensated second command used to instruct the speed of the second motor to increase. In this way, through the compensation mechanism of the compensator, the first and second motors can be made to move synchronously as much as possible.

[0020] In this embodiment, at least one of the first command for controlling the movement of the first motor and the second command for controlling the movement of the second motor is compensated to match the displacement of the first motor and the second motor within a unit time. Compared with the related technologies that control each motor individually, this embodiment ensures that the control of the first motor and the control of the second motor are linked by matching the displacement of the first motor and the second motor within a unit time, thereby making the movement of the first motor and the second motor more synchronized and solving the problem of poor motor control effect in the related technologies.

[0021] exist Figure 1 Based on the illustrated embodiment, the motor control module may include a first controller and a second controller. See details for further information. Figure 2 , Figure 2 This is a schematic diagram of another motor control module provided in an embodiment of this application. For example... Figure 2 As shown, the motor control module 200 further includes a first controller 210 and a second controller 220. The first controller 210 is coupled to the first motor 410, and the second controller 220 is coupled to the second motor 420. The compensator 300 is coupled to both the first controller 210 and the second controller 220. The compensator is used to: determine a compensation value based on a displacement deviation value; and compensate for the target control command based on the compensation value. The displacement deviation value is the difference in displacement between the first motor and the second motor within the same time period.

[0022] In this embodiment, the first motor and the second motor can start moving simultaneously. Taking the process of controlling the movement of the first and second motors in one go as an example, the starting point of the same time period can be the time point when the first and second motors begin moving, and the ending point can be the current time point. That is, the displacement deviation value can be the displacement difference between the first and second displacement values ​​of the first and second motors within the same time period. The first displacement value can be the distance the first motor moves from the starting point to the current time point, and the second displacement value can be the distance the second motor moves from the starting point to the current time point. The first and second motors can be, for example, linear motion motors. It should be noted that this embodiment is not limited to using linear motion motors; motors with other motion modes can also be used.

[0023] In this embodiment, the compensation value is positively correlated with the displacement deviation value. That is, the larger the displacement deviation value, the larger the compensation value determined based on it; conversely, the smaller the displacement deviation value, the smaller the compensation value determined based on it. For example, the compensation value can be determined by multiplying the displacement deviation value by a set value, which can be set and adjusted according to actual conditions. The set value may be, for example, the target value described later. Thus, by considering the displacement deviation between the first and second motors in determining the compensation value, the effect of compensating the target control command based on the compensation value is better, and the displacement deviation between the first and second motors during movement can be more effectively eliminated.

[0024] In one embodiment of this application, the target control command includes a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor; the compensation value includes a first compensation value and a second compensation value; the compensator is used to: compensate the first command based on the first compensation value; and compensate the second command based on the second compensation value.

[0025] Specifically, the compensator is used to: compensate the first instruction based on the first compensation value to obtain a first update instruction; and compensate the second instruction based on the second compensation value to obtain a second update instruction. The motor control module is used to: control the movement of the first motor based on the first update instruction, and control the movement of the second motor based on the second update instruction, such that the displacement difference between the first motor and the second motor within a unit time is less than a threshold. In this way, by compensating for both the first and second instructions, the first and second motors can achieve synchronized movement more quickly and efficiently.

[0026] In this embodiment, compensation can be applied to both the first command for controlling the first motor and the second command for controlling the second motor. The first compensation value for compensating the first command and the second compensation value for compensating the second command may be different or the same. For example, the first compensation value may be 0.5, and the second compensation value may be 1; or both the first and second compensation values ​​may be 0.5. It should be noted that compensating the first command based on the first compensation value and compensating the second command based on the second compensation value both ensure that the displacements of the first and second motors are matched within a unit time. That is, the compensation for both the first and second commands aims to synchronize the movement of the first and second motors.

[0027] In one embodiment of this application, the compensator in any of the above embodiments may include a proportional-integral-derivative (PID) controller. The working principle of a PID controller is to calculate the error between a preset value and the actual output value, and use the proportional, integral, and derivative operations of the error to generate a control signal, thereby enabling the system to reach a precise and stable state. In the embodiments of this application, by using a PID controller, compensation values ​​with higher accuracy and precision can be obtained.

[0028] In one embodiment of this application, the motor control module and the compensator in any of the above embodiments can be housed within the same motor control chip. That is, the motor control chip can receive control commands sent by an external module (e.g., a CPU), which instruct the first motor and the second motor to move synchronously. The motor control chip can control the motor control module based on the control commands, thereby driving the first motor and the second motor to move. During the control of the first and second motors, a compensation value determined by the compensator can be further introduced, thereby enabling the first motor and the second motor to move synchronously and better realize the control commands. In this way, by housing the compensation value and the motor control module within the same motor control chip, the entire motor control logic becomes simpler and clearer.

[0029] In one embodiment of this application, the motor control module in any of the above embodiments may further include a first load module and a second load module. See also... Figure 3 , Figure 3 This is a schematic diagram of another motor control module provided in an embodiment of this application. For example... Figure 3 As shown, the motor control module 100 also includes a first load module 430 and a second load module 440. The first load module 430 includes a first lens, and the second load module 440 includes a second lens. A first motor 410 is connected to the first load module 430, and a second motor 420 is connected to the second load module 440; the first motor 410 drives the first load module 430 to move, and the second motor 420 drives the second load module 440 to move. The following description uses a lens as an example of a load module, but it should be noted that the load module in this embodiment is not limited to a lens and can also be other load modules.

[0030] In this embodiment, the first lens and the second lens can be different lenses. These different lenses can be of different types, for example, both the first and second lenses could be zoom lenses; alternatively, they could be lenses of the same type but with different specifications or parameters. The type of lens difference is not limited here. During the process of the first motor driving the first lens to move and the second motor driving the second lens to move, due to differences between the first and second lenses or other reasons (such as friction), even if the first and second motors are controlled with the same command, their movements may be asynchronous. In this case, the compensation mechanism provided in this embodiment can be used to further control the first and second motors, making them move synchronously as much as possible, thereby driving the first and second lenses to move synchronously.

[0031] In other words, the embodiments of this application can be applied to situations where multiple motors drive multiple lenses to move. By controlling the first motor and the second motor to move synchronously, the first lens and the second lens can be further driven to move synchronously, so that the first lens and the second lens remain relatively stationary during the movement. At this time, taking pictures through the first lens and the second lens can result in better picture effects and photography experience.

[0032] In one embodiment of this application, the first lens may be one of a zoom lens and a focusing lens, and the second lens may be the other of a zoom lens and a focusing lens. A zoom lens is a lens whose focal length can be adjusted within a certain range; by adjusting the position of the zoom lens, the shooting angle and shooting range can be changed. A focusing lens is a lens used to achieve focusing during the shooting process; by adjusting the position of the focusing lens, the focus position can be adjusted, thereby ensuring image clarity.

[0033] This application embodiment can control the movement of a first motor and a second motor based on a continuous zoom command. In other words, this application embodiment can be applied to scenarios implementing continuous zoom commands, achieving the effect of synchronous movement of the zoom lens and the focus lens. Thus, when the user triggers continuous zoom via gestures or buttons, the zoom lens and focus lens move synchronously, ensuring that the focus remains stable throughout the zoom process. Therefore, the captured image remains clear even as the zoom and focus lenses move. Compared to related technologies that require manual focusing and produce blurry images during zooming, the motor control module provided in this application embodiment offers a clearer and more convenient photography experience.

[0034] Taking a mobile phone camera as an example, its focusing ability directly affects the clarity and scene adaptability of photos. Currently, mobile phone cameras typically use a miniature motor to drive the lens assembly, adjusting the distance between the lens and the image sensor. This changes the focal length or optical path of the lens, altering the convergence point of light and ensuring that the light from the subject is accurately focused on the image sensor, ultimately forming a clear image. The principle is similar to a fixed-focal-length lens, where a motor drives the lens assembly to achieve precise focusing within a single focal length.

[0035] However, focusing only changes the sharpness of the image, not the framing. While this focusing design meets basic everyday shooting needs, it has significant limitations: shooting distant objects requires digital zoom to magnify the image, which can easily lead to blurry images; switching to close-up macro often requires manual adjustment of the shooting distance, which is cumbersome and has limited focusing accuracy. To simultaneously change the field of view, continuous zoom is needed. This involves adjusting the relative positions of multiple lens elements to continuously change the lens's equivalent focal length, achieving a smooth transition from wide-angle to telephoto – a function that continuously changes the field of view. Continuous zoom requires multiple motors to drive multiple lens elements simultaneously while maintaining a certain level of synchronization, thus necessitating a high-precision motor synchronization control method.

[0036] Based on this, this application provides a motor control module that enables continuous zoom operation driven by two motors. By controlling the focusing lens group (focusing lens) and the zoom lens group (zoom lens) with two independent motors respectively, seamless switching of focal length can be achieved. To ensure the synchronization accuracy of the focusing lens and the zoom lens, this application provides a two-motor synchronous control method based on current compensation. By performing closed-loop position control on the two motors respectively, and then collecting the actual displacement of the two motors (first displacement value and second displacement value), the difference between the actual displacement of the two motors is input into a compensator for compensation to obtain a current compensation value. The current compensation value is applied to the current command of the two motors, thereby achieving the purpose of synchronous movement of the two motors.

[0037] In one embodiment of this application, the compensator in any of the above embodiments includes a compensation unit, a first arithmetic logic unit, and a second arithmetic logic unit. The compensation unit may include a PID controller. The input terminal of the first arithmetic logic unit is connected to the first controller and the compensation unit, and the output terminal of the first arithmetic logic unit is connected to the first motor; the input terminal of the second arithmetic logic unit is connected to the second controller and the compensation unit, and the output terminal of the second arithmetic logic unit is connected to the second motor.

[0038] In this embodiment, the first arithmetic logic unit is used to: compensate the first instruction based on the first compensation value to obtain the first update instruction; the second arithmetic logic unit is used to: compensate the second instruction based on the second compensation value to obtain the second update instruction.

[0039] The first and second arithmetic logic units can be used to perform addition or subtraction operations. Specifically, the displacement deviation value can be the displacement difference between the first and second displacement values ​​of the first and second motors within the same time period. The first displacement value can be the distance the first motor moves within that time period, and the second displacement value can be the distance the second motor moves within that time period. Both the first compensation value and the second compensation value can be current compensation values ​​obtained based on the displacement deviation value. The first instruction includes a first current value for driving the first motor to move, and the first controller drives the first motor to move by outputting the first current value to the first motor. The second instruction includes a second current value for driving the second motor to move, and the second controller drives the second motor to move by outputting the second current value to the second motor. The first update instruction includes a third current value for driving the first motor to move, and the second update instruction includes a fourth current value for driving the second motor to move. In the process of compensating the first instruction based on the first compensation value to obtain the first update instruction, the first arithmetic logic unit is specifically used to: perform a subtraction operation on the first current value and the first compensation value to obtain the third current value. In the process of compensating the second instruction based on the second compensation value to obtain the second update instruction, the second arithmetic logic unit is used to: perform an addition operation on the second current value and the second compensation value to obtain the fourth current value. After obtaining the third current value and the fourth current value, the motor control module can output the third current value to the first motor and drive the first motor to move based on the updated third current value; the motor control module can also output the fourth current value to the second motor and drive the second motor to move based on the updated fourth current value.

[0040] It should be noted that the first and second arithmetic logic units in the embodiments of this application are not limited to being integrated into the compensator, and can also be located outside the compensator. Similarly, the various modules in the embodiments of this application can be combined and separated, and are not limited to the combination methods provided in the embodiments of this application.

[0041] In one embodiment of this application, the motor control module in any of the above embodiments may further include a first position sensor and a second position sensor. The first position sensor is connected to the first motor and coupled to both the compensator and the first controller; the second position sensor is connected to the second motor and coupled to both the compensator and the second controller.

[0042] In this embodiment, a first position sensor is used to acquire the real-time position of a first motor, and a second position sensor is used to acquire the real-time position of a second motor. Using the first and second position sensors, a first displacement value and a second displacement value of the first and second motors within the same time period can be obtained, thereby obtaining the displacement deviation value of the first and second motors within the same time period.

[0043] In one embodiment of this application, the compensator may further include a third arithmetic logic unit. The input terminal of the third arithmetic logic unit is connected to the first position sensor and the second position sensor, and the output terminal of the third arithmetic logic unit is connected to the compensation unit. Similar to the first and second arithmetic logic units, the third arithmetic logic unit is used to implement addition or subtraction operations.

[0044] In this embodiment, the third arithmetic logic unit is used to: obtain a first displacement value and a second displacement value of the first motor and the second motor within the same time period; and perform a subtraction operation on the first displacement value and the second displacement value to obtain a displacement deviation value. That is, the third arithmetic logic unit can obtain the first displacement value of the first motor and the second displacement value of the second motor through the detection values ​​of the first position sensor and the second position sensor, and determine the difference between the first displacement value and the second displacement value as the displacement deviation value between the first motor and the second motor. After the third arithmetic logic unit calculates the displacement deviation value, it can send the displacement deviation value to the compensation unit. The compensation unit may include a PID controller, and the compensation unit can obtain a compensation value through a PID algorithm and the displacement deviation value. The compensation value may include a current compensation value.

[0045] For reference Figure 4 , Figure 4 This is a schematic diagram of a motor control module provided in an embodiment of this application. Figure 4 As shown, the motor control module includes a motor control module, a compensator 300, a first motor 410, a second motor 420, a first lens 430, a second lens 440, a first position sensor, and a second position sensor. The motor control module and the compensator are housed within the same motor control chip. The motor control module includes a first controller 210 and a second controller 220.

[0046] The first controller is coupled to the first motor, the second controller is coupled to the second motor, and the compensator is coupled to both the first and second controllers. The first motor is connected to the first lens, and the second motor is connected to the second lens; the first motor drives the first lens to move, and the second motor drives the second lens to move. The first lens is either a zoom lens or a focusing lens, and the second lens is either a zoom lens or a focusing lens. Figure 4As shown, the first lens 430 is, for example, a zoom lens, and the second lens 440 is, for example, a focusing lens. The first position sensor is connected to the first motor, and the first position sensor is coupled to the compensator and the first controller, respectively; the second position sensor is connected to the second motor, and the second position sensor is coupled to the compensator and the second controller, respectively.

[0047] The compensator may include a compensation unit, a first arithmetic logic unit, a second arithmetic logic unit, and a third arithmetic logic unit. The input terminal of the first arithmetic logic unit is connected to the first controller and the compensation unit, and the output terminal of the first arithmetic logic unit is connected to the first motor. The input terminal of the second arithmetic logic unit is connected to the second controller and the compensation unit, and the output terminal of the second arithmetic logic unit is connected to the second motor. The input terminal of the third arithmetic logic unit is connected to the first position sensor and the second position sensor, and the output terminal of the third arithmetic logic unit is connected to the compensation unit. Each of the first controller, the second controller, and the compensation unit may include a PID controller.

[0048] like Figure 4 As shown, the motor control module may further include a fourth arithmetic logic unit and a fifth arithmetic logic unit. The input terminal of the fourth arithmetic logic unit is coupled to the first position sensor, and the output terminal of the fourth arithmetic logic unit is connected to the first controller. The input terminal of the fifth arithmetic logic unit is coupled to the second position sensor, and the output terminal of the fifth arithmetic logic unit is connected to the second controller. The fourth arithmetic logic unit is used to obtain a first displacement error value, and the fifth arithmetic logic unit is used to obtain a second displacement error value.

[0049] The compensator is used to: determine a compensation value based on a displacement deviation value; and compensate for a target control command based on the compensation value, so that the displacements of the first motor and the second motor within a unit time period are matched, wherein the displacement deviation value is the difference in displacement between the first motor and the second motor within the same time period. The target control command includes a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor. The compensation value includes a first compensation value and a second compensation value. Specifically, during the compensation of the target control command based on the compensation value, the compensator is used to: compensate for the first command based on the first compensation value; and compensate for the second command based on the second compensation value.

[0050] In this embodiment, synchronous control of two motors can be achieved through a current compensation mechanism, within a single control chip (i.e., Figure 4In the motor control chip, two motors are controlled in a closed-loop manner, and their actual displacements are collected. When the two motors move asynchronously, a difference (displacement deviation) will occur between their actual displacements. This difference can be used as a position compensation signal, which is then input to a compensator to obtain a current compensation value. After obtaining the current compensation value, it can be applied to the current commands of the two motors to compensate for their current requirements. After current compensation, the difference between the actual displacements of the two motors will gradually decrease. When the difference between the actual displacements of the two motors decreases to 0, the movement of the two motors is completely synchronized.

[0051] In this embodiment, at least one of the first command for controlling the movement of the first motor and the second command for controlling the movement of the second motor is compensated to match the displacement of the first motor and the second motor within a unit time. Compared with the related technologies that control each motor individually, this embodiment ensures that the control of the first motor and the control of the second motor are linked by matching the displacement of the first motor and the second motor within a unit time, thereby making the movement of the first motor and the second motor more synchronized and solving the problem of poor motor control effect in the related technologies.

[0052] To facilitate understanding of the motor control process, the following description uses a specific example to illustrate the entire process of controlling motor movement. This process is illustrated by executing a single continuous zoom command. (See reference below.) Figure 4 To understand.

[0053] First, the motor control chip receives control commands sent by an external module (e.g., a CPU), which instruct the first and second motors to synchronously move a target displacement value. A first displacement value of the first motor can be detected by a first position sensor connected to the first motor; this first displacement value represents the displacement of the first motor during the entire movement process. The difference between the target displacement value and the first displacement value can be determined as a first displacement error value using a fourth arithmetic logic unit. Specifically, refer to the following formula: .in, This is the first displacement error value. The target displacement value, This is the first displacement value.

[0054] The first controller may be a position controller, and may employ a general-purpose PID controller, meaning the first controller may include a PID controller. The first controller incorporates a PID algorithm and includes a first transfer function as shown in the following formula: Where s is a complex variable, , , These are the proportional, integral, and derivative parameters of the PID controller. , , All are greater than or equal to 0. When setting the proportional parameter, integral parameter, and derivative parameter, the proportional parameter... Error value with first displacement Related, A larger value results in faster adjustment, but an excessively large value can lead to overshoot. (Integral parameter) Error value with first displacement Related to the cumulative value, The larger the value, the smaller the steady-state error; however, an excessively large value can also lead to overshoot. (Differential parameter) Error value with first displacement Related to the rate of change, The larger the value, the stronger the predictive ability, but excessively large values ​​will produce noise.

[0055] The first displacement error value can be By inputting the first controller, a first current value can be obtained. The specific formula for calculating the first current value is as follows: .in, The first current value, This is the first displacement error value. This is the value of the first transfer function.

[0056] Then, the first controller can output the first current value to the first motor, thereby driving the first motor to move. The first displacement value of the first motor can be re-detected by the first position sensor to form a closed-loop position control of the first motor, that is, continuously comparing the first displacement value of the first motor with the target displacement to control the movement of the first motor to reach the target displacement.

[0057] Similar to the first motor, a second position sensor connected to the second motor detects a second displacement value of the second motor. This second displacement value represents the displacement of the second motor throughout the entire control process. The difference between the target displacement value and the second displacement value can be determined as the second displacement error value by the fifth arithmetic logic unit. See the following formula for details: .in, This is the second displacement error value. For the target displacement value, This is the second displacement value.

[0058] Similar to the first controller, the second controller can be a position controller. The second controller can employ a general-purpose PID controller; that is, the second controller may include a PID controller. The second controller incorporates a PID algorithm and includes a second transfer function as shown in the following equation: .in, Let s be the value of the second transfer function, and s be a complex variable. , , These are the proportional, integral, and derivative parameters of the PID controller. , , All are greater than or equal to 0. When setting the proportional parameter, integral parameter, and derivative parameter, the proportional parameter... With the second displacement error value Related, A larger value results in faster adjustment, but an excessively large value can lead to overshoot. (Integral parameter) With the second displacement error value Related to the cumulative value, The larger the value, the smaller the steady-state error; however, an excessively large value can also lead to overshoot. (Differential parameter) With the second displacement error value Related to the rate of change, The larger the value, the stronger the predictive ability, but excessively large values ​​will produce noise.

[0059] The second displacement error value can be input into the second controller to obtain the second current value. The specific calculation formula for the second current value is as follows: .in, This is the second current value. This is the second displacement error value. This is the second transfer function value. After obtaining the second current value, the second controller can output the second current value to the second motor, thereby driving the second motor to move. The second displacement value of the second motor can be re-detected by the second position sensor, forming a closed-loop position control of the second motor, that is, continuously comparing the second displacement value of the second motor with the target displacement to control the movement of the second motor to achieve the target displacement.

[0060] In this way, the first motor moves to drive the first lens, and the second motor moves to drive the second lens. Figure 4 For example, the first motor drives the zoom lens to move, and the second motor drives the focusing lens to move. Due to differences in parameters such as weight or specifications between the first and second lenses, or other reasons (such as friction generated by movement), for example, the zoom lens and the focusing lens have different weights, the initial movements of the two motors will begin to become asynchronous, that is, the first displacement value of the first motor and the second displacement value of the second motor will begin to differ. ≠ At this point, a displacement deviation will occur between the first displacement value of the first motor and the second displacement value of the second motor. This displacement deviation is the difference between the first displacement value of the first motor and the second displacement value of the second motor. Specifically, refer to the following formula: .in, This is the displacement deviation value. This is the first displacement value. This is the second displacement value.

[0061] In addition, the compensation unit can also use a general-purpose PID controller, with a PID algorithm built into the compensator, including the third transfer function as shown in the following formula: .in, The value of the third transfer function is given, where s is a complex variable. , , These are the proportional, integral, and derivative parameters of the PID controller. , , All are greater than or equal to 0. When setting the proportional parameter, integral parameter, and derivative parameter, the proportional parameter... Displacement deviation value Related, A larger value results in faster adjustment, but an excessively large value can lead to overshoot. (Integral parameter) Displacement deviation value Related to the cumulative value, The larger the value, the smaller the steady-state error; however, an excessively large value can also lead to overshoot. (Differential parameter) Displacement deviation value Related to the rate of change, The larger the value, the stronger the predictive ability, but excessively large values ​​will produce noise.

[0062] Specifically, by inputting the displacement deviation value into the compensation unit, a current compensation value can be obtained. The specific calculation formula for the current compensation value is as follows: .in, This is the current compensation value. The displacement deviation value, This is the value of the third transfer function.

[0063] Then, the first current value used to drive the first motor and the second current value used to drive the second motor can be compensated. The specific process is as follows: the difference between the first current value and the current compensation value is determined as the third current value. Specifically, refer to the following formula: .in, The third current value, The first current value, The current compensation value is given. The sum of the second current value and the current compensation value is determined as the fourth current value. Specifically, refer to the following formula: .in, The fourth current value, This is the second current value. The current compensation value is given. After obtaining the third and fourth current values, the motor control chip can output the third current value to the first motor and the fourth current value to the second motor.

[0064] In fact, the larger the displacement deviation between the first and second motors, the larger the current compensation value determined based on the displacement deviation. After current compensation is performed based on the current compensation value, the displacement deviation between the first and second motors will gradually decrease, and the current compensation value determined based on the displacement deviation will also continuously decrease. When the displacement deviation is less than a threshold, the displacement deviation between the first and second motors can be detected to be close to 0 through the detection values ​​of the two position sensors. At this time, the effect of the first and second motors going from being out of sync to being synchronized is achieved. For example, when the displacement deviation between the first and second motors is 0, the first displacement value of the first motor and the second displacement value of the second motor are equal, that is... = .

[0065] For reference Figure 5 , Figure 5 This is a flowchart illustrating a method for controlling motor movement according to an embodiment of this application. This method can be applied to the motor control module shown in any of the above embodiments, and can be executed by the motor control chip in the motor control module. Figure 5 As shown, the method includes the following steps: Step 510: During the movement of the first motor and the second motor, a target control command is acquired; the target control command includes at least one of a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor.

[0066] In the embodiments of this application, the relevant descriptions of the first motor, the second motor, and the target control commands can be found above, and will not be repeated here.

[0067] Step 520: Compensate the target control command so that the displacement of the first motor and the second motor moves in a unit time is matched.

[0068] In this embodiment, the displacements of the first motor and the second motor within a unit time are matched, indicating that the displacement difference between the first motor and the second motor within a unit time is closer than before compensation. The unit time is, for example, the time interval from the start of movement of the first motor and the second motor to the current time. The process of compensating for the target control command is described above and will not be elaborated here. During the process of controlling the movement of the first motor and the second motor based on the same control command, the target control command can be acquired in real time. Once a mismatch in the displacements of the first motor and the second motor within a unit time is detected, compensation can be performed on the target control command. In fact, embodiments of this application can achieve synchronization between the first motor and the second motor by one or more compensations. Each compensation process brings the first displacement value of the first motor and the second displacement value of the second motor closer together until the displacement difference between the first motor and the second motor within a unit time is less than a threshold, at which point it is determined that the first motor and the second motor have reached a synchronized state.

[0069] In this embodiment, at least one of the first command for controlling the movement of the first motor and the second command for controlling the movement of the second motor is compensated to match the displacement of the first motor and the second motor within a unit time. Compared with the related technologies that control each motor individually, this embodiment ensures that the control of the first motor and the control of the second motor are linked by matching the displacement of the first motor and the second motor within a unit time, thereby making the movement of the first motor and the second motor more synchronized and solving the problem of poor motor control effect in the related technologies.

[0070] In one embodiment of this application, the step of compensating the target control command so that the displacements of the first motor and the second motor move in a unit time match includes: compensating the target control command based on a compensation value so that the displacements of the first motor and the second motor move in a unit time match; wherein the compensation value is determined based on a displacement deviation value, and the displacement deviation value is the difference in displacement between the first motor and the second motor in the same time period.

[0071] In this embodiment, the displacement deviation value is, for example, the difference between the first displacement value and the second displacement value of the first motor and the second motor within the same time period, and can be expressed with reference to the following formula: .in, The displacement deviation value, The first displacement value, The second displacement value is used. The compensation value, for example, is a current compensation value. Determining the compensation value based on the displacement deviation value includes: obtaining a target value based on the displacement deviation value and a PID algorithm; and determining the current compensation value as the product of the target value and the displacement deviation value. Specifically, the displacement deviation value is input into the compensation unit, and the target value (i.e., the third transfer function value) can be calculated according to the third transfer function within the compensation unit. The current compensation value is the product of the target value and the displacement deviation value, as shown in the following formula: ; ; in, This is the current compensation value. The displacement deviation value, This is the value of the third transfer function. The value of the third transfer function is given, where s is a complex variable. , , These are the proportional, integral, and derivative parameters of the PID controller. , , All are greater than or equal to 0. When setting the proportional parameter, integral parameter, and derivative parameter, the proportional parameter... Displacement deviation value Related, A larger value results in faster adjustment, but an excessively large value can lead to overshoot. (Integral parameter) Displacement deviation value Related to the cumulative value, The larger the value, the smaller the steady-state error; however, an excessively large value can also lead to overshoot. (Differential parameter) Displacement deviation value Related to the rate of change, The larger the value, the stronger the predictive ability, but excessively large values ​​will produce noise.

[0072] In this embodiment of the application, the displacement deviation between the first motor and the second motor is taken into account when determining the compensation value. Therefore, the effect of compensating the target control command based on the compensation value is better, and the displacement deviation between the first motor and the second motor during the movement process can be better eliminated.

[0073] In one embodiment of this application, the target control command includes a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor; the compensation value includes a first compensation value and a second compensation value. The step of compensating the target control command based on the compensation value, so that the displacements of the first motor and the second motor move in a unit time match, includes: compensating the first command based on the first compensation value to obtain a first update command; compensating the second command based on the second compensation value to obtain a second update command; controlling the movement of the first motor based on the first update command, and controlling the movement of the second motor based on the second update command, so that the displacement difference between the first motor and the second motor moving in a unit time is less than a threshold. In this way, by compensating for both the first and second commands, the first motor and the second motor can achieve synchronized movement more quickly and efficiently.

[0074] In this embodiment, the first compensation value and the second compensation value may be the same or different. The following description uses an example where both the first and second compensation values ​​are current compensation values ​​determined based on displacement deviation values. The first instruction includes a first current value for driving the first motor to move, and the second instruction includes a second current value for driving the second motor to move. The process of obtaining the first and second current values ​​can be referred to the previous section on... Figure 4 The examples will not be elaborated here. The first update instruction includes a third current value for driving the first motor, and the second update instruction includes a fourth current value for driving the second motor. The first update instruction is obtained by compensating the first instruction based on the first compensation value, including: determining the difference between the first current value and the current compensation value as the third current value. The second update instruction is obtained by compensating the second instruction based on the second compensation value, including: determining the sum of the second current value and the current compensation value as the fourth current value. Specifically, refer to the following formula: ; ; in, The third current value, The fourth current value, The first current value, This is the second current value. This is the current compensation value.

[0075] It should be noted that this is merely an example of one compensation method and is not limited to this one method. For example, the displacement deviation value can also be the difference between the second displacement value of the second motor and the first displacement value of the first motor. In this case, the sum of the first current value and the current compensation value can be determined as the third current value, and the difference between the second current value and the current compensation value can be determined as the fourth current value. After obtaining the third current and the fourth current, controlling the first motor to move based on the first update instruction and controlling the second motor to move based on the second update instruction includes: driving the first motor to move based on the third current value and driving the second motor to move based on the fourth current value.

[0076] Furthermore, it should be understood that the explanations of the same or corresponding content in the above embodiments can be referred to each other, for example, regarding... Figure 1 The introduction of the first and second motors in the middle can be applied to Figure 5 The first and second motors in the system.

[0077] It should also be understood that the motor control module provided in this application embodiment is applicable to camera usage scenarios, such as mobile phones, tablets, and cameras. The method for controlling motor movement provided in this application embodiment is applicable to all micro-motors, such as voice coil motors (VCMs), shape memory alloy actuators (SMAs), and piezoelectric motors. After using the method for controlling motor movement provided in this application embodiment, the displacement deviation between the first motor and the second motor can be monitored from large to small until they are equal, through the detection signal values ​​of the first and second position sensors.

[0078] Furthermore, the motor control module provided in this application embodiment can achieve high-precision continuous zoom operation by using current compensation to enable the first motor and the second motor to move synchronously. The two motors respectively drive the focusing lens and the zoom lens. The motor control module provided in this application embodiment has the following beneficial effects: First, it allows for more flexible shooting scenarios, from distant landscapes to close-up still life, enabling clear shooting without moving electronic devices (such as mobile phones). Second, it provides more stable image quality; this physical zoom method avoids the image quality loss caused by digital zoom, and the embodiment in this application offers superior detail reproduction. Third, it offers more convenient operation; the focus can be smoothly adjusted via gestures or buttons, making capturing moments more effortless. This technological upgrade makes mobile phone photography closer to the experience of a professional camera, meeting the diverse creative needs of users.

[0079] For reference Figure 6 , Figure 6 This is a structural block diagram of an electronic device provided in an embodiment of this application. For example... Figure 6 As shown in the illustration, this application also provides an electronic device 600. The electronic device 600 includes the motor control module shown in any of the above embodiments. The electronic device and motor control module provided in this application achieve the same technical effects, and to avoid repetition, they will not be described again here.

[0080] This application also provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of various embodiments of the method for controlling the movement of a motor and achieve the same technical effect. To avoid repetition, these steps will not be repeated here.

[0081] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0082] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above method embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0083] This application provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the above method embodiments and achieve the same technical effects. To avoid repetition, it will not be described again here.

[0084] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

[0085] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0086] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.

Claims

1. A motor control module, characterized in that, include: Motor control module, compensator, first motor and second motor; The motor control module is coupled to the first motor and the second motor respectively, and the compensator is coupled to the motor control module; The compensator is used to compensate for the target control command, so that the displacement of the first motor and the second motor moves in a unit time is matched. The target control command includes at least one of a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor.

2. The motor control module according to claim 1, characterized in that, The motor control module further includes a first controller and a second controller; the first controller is coupled to the first motor, the second controller is coupled to the second motor, and the compensator is coupled to the first controller and the second controller respectively; The compensator is used to: determine a compensation value based on the displacement deviation value; and compensate the target control command based on the compensation value; wherein the displacement deviation value is the displacement difference between the first motor and the second motor in the same time period.

3. The motor control module according to claim 2, characterized in that, The target control command includes a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor; the compensation value includes a first compensation value and a second compensation value. The compensator is used to: compensate the first instruction based on the first compensation value; and compensate the second instruction based on the second compensation value.

4. The motor control module according to any one of claims 1-3, characterized in that, The compensator includes a proportional-integral-derivative controller.

5. The motor control module according to any one of claims 1-3, wherein the motor control module further comprises a first load module and a second load module; the first motor is connected to the first load module, and the second motor is connected to the second load module; the first motor drives the first load module to move, and the second motor drives the second load module to move; The first load module includes a first lens, and the second load module includes a second lens.

6. The motor control module according to claim 5, characterized in that, The first lens is one of a zoom lens and a focusing lens, and the second lens is the other of a zoom lens and a focusing lens.

7. An electronic device, characterized in that, Includes the motor control module according to any one of claims 1-6.

8. A method for controlling the movement of a motor, characterized in that, include: During the movement of the first motor and the second motor, a target control command is acquired; the target control command includes at least one of a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor. The target control command is compensated so that the displacements of the first motor and the second motor are matched within a unit time.

9. The method according to claim 8, characterized in that, The compensation of the target control command, so that the displacements of the first motor and the second motor are matched within a unit time, includes: Based on the compensation value, the target control command is compensated so that the displacements of the first motor and the second motor in a unit time are matched. The compensation value is determined based on the displacement deviation value, which is the displacement difference between the first motor and the second motor within the same time period.

10. The method according to claim 9, characterized in that, The target control command includes a first command for controlling the movement of the first motor and a second command for controlling the movement of the second motor; the compensation value includes a first compensation value and a second compensation value. The compensation of the target control command based on the compensation value, so that the displacements of the first motor and the second motor move in a unit time are matched, includes: The first instruction is compensated based on the first compensation value to obtain the first update instruction; The second instruction is compensated based on the second compensation value to obtain the second update instruction; The first motor is controlled to move based on the first update instruction, and the second motor is controlled to move based on the second update instruction, so that the displacement difference between the first motor and the second motor within a unit time is less than a threshold.

11. The method according to claim 10, characterized in that, The first instruction includes a first current value for driving the first motor to move, and the second instruction includes a second current value for driving the second motor to move; the first update instruction includes a third current value for driving the first motor to move, and the second update instruction includes a fourth current value for driving the second motor to move; the first compensation value is the same as the second compensation value, and both are current compensation values ​​determined based on the displacement deviation value. The step of compensating the first instruction based on the first compensation value to obtain the first update instruction includes: determining the difference between the first current value and the current compensation value as the third current value; The step of compensating the second instruction based on the second compensation value to obtain the second update instruction includes: determining the fourth current value by summing the second current value and the current compensation value. The step of controlling the movement of the first motor based on the first update instruction and controlling the movement of the second motor based on the second update instruction includes: driving the first motor to move based on the third current value and driving the second motor to move based on the fourth current value.