Motor control method, electronic equipment and chip system

By having the DSP control the motor to generate a force opposite to the shaking direction after the camera is turned off, the problem of abnormal noise after the motor is powered off is solved, achieving low power consumption and fast stabilization, thus improving the user experience.

CN120897126APending Publication Date: 2025-11-04HONOR DEVICE CO LTD

Patent Information

Application Number
CN202410524828.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-28
Publication Date
2025-11-04

AI Technical Summary

Technical Problem

The camera motor is susceptible to movement due to external stress after power is off, which can cause abnormal noise, affect user experience, and increase power consumption.

Method used

After the camera is turned off, the digital signal processor (DSP) detects the device shaking and controls the motor to generate a force in the opposite direction of the shaking, ensuring that the motor stabilizes quickly, reducing power consumption and shortening the anti-shake response time.

Benefits of technology

It effectively avoids motor noise, saves power consumption of the application processor (AP), shortens the anti-shake response time, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120897126A_ABST
    Figure CN120897126A_ABST
Patent Text Reader

Abstract

The invention provides a motor control method, electronic equipment and a chip system, which are applied to the electronic equipment, and the electronic equipment comprises a camera, a motor driving chip, an application processor (AP) and a digital signal processor (DSP). And the AP is connected with a motor control interface of the DSP and is connected with a control interface of the motor driving chip, so that the time-sharing control of the motor driving chip by the AP and the DSP is realized. And after the camera is turned off, the DSP takes over the motor driving chip, controls the motor driving chip to be powered on when detecting that the electronic equipment shakes, and generates a motor control instruction based on detected shaking information and sends the motor control instruction to the motor driving chip. The motor control instruction is used for controlling the motor to generate acting force opposite to the shaking direction, so that the motor is fast and stable. According to the scheme, after the camera is turned off, the DSP controls the motor to be stable, and the AP does not need to be awakened, so that the power consumption of the AP and the waiting time for awakening the AP are saved, the overall power consumption of the electronic equipment is reduced, and the anti-shake response time of the motor is shortened.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of camera, in particular to a motor control method, an electronic device and a chip system. BACKGROUND

[0002] The camera is an imaging device with a photographing function in an electronic device, and the camera usually includes a lens and a motor. The motor can drive the lens to move to achieve focusing and anti-shake.

[0003] In order to reduce the power consumption of the motor when achieving focusing and anti-shake, a ball-type motor or a sliding shaft-type motor is used. When moving, the static friction (rolling friction or sliding friction) is overcome first, and then a small thrust is relied on to maintain the continuous movement or stability of the motor. However, after the motor is powered off, it is easy to move under the external stress, and then impact the fixed parts of the motor to produce abnormal sound. SUMMARY

[0004] Therefore, the present application provides a motor control method, an electronic device and a chip system to solve the problem of abnormal sound when the motor is powered off. The disclosed technical solutions are as follows:

[0005] In a first aspect, the present application provides a motor control method applied to an electronic device. The electronic device includes a camera, an application processor, a digital signal processor and a motor driving chip. A first interface of the application processor (AP) is connected with a second interface of the digital signal processor (DSP). The method includes: in response to an operation of closing the camera, the application processor controls the camera to be closed; when the camera is closed, after the digital signal processor detects that the electronic device shakes, the digital signal processor sends a motor control instruction to the motor driving chip through the second interface. The motor control instruction is used to control the motor driving chip to be powered on and drive the motor to generate a force opposite to the shaking direction. It can be seen that the interface of the DSP is connected with the motor control interface of the AP to realize the time-sharing control of the DSP and the AP on the motor. After the camera is closed, the motor is controlled by the DSP. When the DSP detects that the electronic device shakes, it is determined that the position of the motor moves, and the motor is immediately powered on to generate a force opposite to the shaking direction, so that the motor is quickly stabilized, and abnormal sound caused by the motor due to shaking is avoided. Moreover, the motor is directly controlled by the DSP to be stabilized, and the AP does not need to be woken up, so as to save the power consumption of the AP and the waiting time of waking up the AP, thereby reducing the overall power consumption of the electronic device and shortening the anti-shake response time of the motor.

[0006] In a possible implementation manner of the first aspect, the method further includes: in response to the operation of closing the camera, the application processor releases the motor control right, and the digital signal processor obtains the motor control right. In this scheme, after detecting the operation of closing the camera, the AP timely releases the motor control right, so that the DSP timely obtains the motor control right, shortens the anti-shake response time of the motor, and improves the anti-shake response speed.

[0007] In a possible implementation manner of the first aspect, in response to the operation of closing the camera, the application processor releasing the motor control right and the digital signal processor obtaining the motor control right include: in response to the operation of closing the camera, the application processor releases the motor control right and generates a first instruction and sends the first instruction to the digital signal processor; and in response to the first instruction, the digital signal processor obtains the motor control right. In this scheme, the AP sends the first instruction to the DSP while releasing the motor control right, so that the DSP obtains the motor control right, and the DSP obtains the motor control right in time through the communication between the AP and the DSP, thereby improving the timeliness of the exchange of the control right between the AP and the DSP.

[0008] In a possible implementation manner of the first aspect, in response to the operation of closing the camera, the application processor releasing the motor control right includes: in response to the operation of closing the camera, the application processor sets the first interface from a transceiving state to a high-impedance state; and in response to the first instruction, the digital signal processor obtaining the motor control right includes: in response to the first instruction, the digital signal processor controls the second motor control interface to switch from the high-impedance state to the transceiving state. In this way, the AP and the DSP control the state of the control interface connected to the motor driving chip to release and obtain the motor control right, and the control logic is simple.

[0009] In a possible implementation manner of the first aspect, the first interface and the second interface are connected to the control interface of the motor driving chip through a two-way electronic switch; in response to the operation of closing the camera, the application processor releasing the motor control right and the digital signal processor obtaining the motor control right include: in response to the operation of closing the camera, the application processor controls the two-way electronic switch to switch from a state of being in communication with the first interface to a state of being in communication with the second interface. It can be seen that, in this scheme, the conduction path of the two-way electronic switch is controlled to switch the motor control right between the AP and the DSP, and the reliability of the hardware switch is higher, so that the accuracy of the switching of the motor control right is improved, and the control logic of the switch is simple.

[0010] In a possible implementation manner of the first aspect, in response to the digital signal processor detecting that the electronic device is shaken, the digital signal processor sending the motor control instruction to the motor driving chip through the second interface includes: the digital signal processor generates the motor control instruction based on the shaking direction, the motor control instruction driving the motor to generate a force opposite to the shaking direction; and the digital signal processor sends the motor control instruction to the motor driving chip through the second interface. It can be seen that, in this scheme, the motor control instruction driving the motor to generate a force opposite to the shaking direction is generated based on the shaking direction of the electronic device and is transmitted to the motor driving chip, and each direction can be controlled independently to stabilize the motor quickly.

[0011] In a possible implementation manner of the first aspect, the motor driving chip includes an autofocus integrated circuit (AFIC) and an optical image stabilization integrated circuit (OIS IC); and the sending of the motor control instruction to the motor driving chip includes: if it is determined that the shaking direction is the axis direction of the motor, the motor control instruction is sent to the AF IC; and if it is determined that the shaking direction is the X-axis direction and / or the Y-axis direction perpendicular to the axis direction, the motor control instruction is sent to the OIS IC. In this way, the motor control instruction is sent to the motor driving chip in the corresponding axis direction based on the direction of the axis on which the shaking occurs, and individual control in each direction is implemented.

[0012] In a possible implementation manner of the first aspect, the method further includes: the motor driving chip stores fast stabilization proportional-integral-derivative (PID) parameters and performance PID parameters; when the motor driving chip receives the motor control instruction, the fast stabilization PID parameters are read, and a driving current for driving the motor is output based on the fast stabilization PID parameters and the motor control instruction; or, when the application processor controls the camera to be closed, the performance PID parameters stored in the motor driving chip are modified to the fast stabilization PID parameters; when the motor driving chip receives the motor control instruction, the fast stabilization PID parameters are read, and a driving current for driving the motor is output based on the fast stabilization PID parameters and the motor control instruction. It can be seen that the scheme sets the fast stabilization PID parameters, and when the camera is closed and the motor shaking is detected, the motor driving chip can control the motor to be quickly stabilized by using the fast stabilization PID parameters, and the time for stabilizing the motor is further shortened. Moreover, the motor driving chip can directly store two sets of PID parameters, i.e., one set of fast stabilization PID parameters and one set of performance PID parameters, the performance PID parameters are used to control the motor when the camera is opened, and the fast stabilization PID parameters are used to control the motor when the camera is closed, thereby meeting different control requirements. In addition, the PID parameters in the motor driving chip can be modified by the AP according to the state of the camera, for example, when the camera is closed, the performance PID parameters in the motor driving chip are modified to the fast stabilization PID parameters, so that the motor driving chip can control the motor to be quickly stabilized by using the fast stabilization PID parameters; and when the camera is opened, the fast stabilization PID parameters in the motor driving chip are modified to the performance PID parameters, so that the motor driving chip can control the motor by using the performance PID parameters.

[0013] In a possible implementation manner of the first aspect, the electronic device includes a motion sensor; and the detection of the shaking of the electronic device includes: the digital signal processor acquires motion data of the electronic device collected by the motion sensor; and the digital signal processor determines that the electronic device shakes after detecting that the motion data meets a handheld shaking feature. Since the motor produces abnormal sound in the handheld shaking scenario, which affects the user experience, the motor is quickly controlled to be stabilized after the scenario is detected, thereby improving the user experience.

[0014] In a possible implementation of the first aspect, the electronic device further includes a proximity light sensor; and the detecting that the electronic device is shaking further includes: detecting, by the digital signal processor, that the motion data matches a non-handheld shaking feature, and that the proximity light sensor is not blocked, and determining that the electronic device is shaking. The non-handheld shaking feature includes any one of a walking feature, a running feature, and a climbing stairs feature. In other shaking scenarios, such as when a user is running, walking, or climbing stairs while holding the electronic device, the abnormal motor may also affect the user experience. Therefore, the motor is quickly controlled to be stable after detecting these scenarios to improve the user experience.

[0015] In a possible implementation of the first aspect, the method further includes: controlling, by the digital signal processor, the motor drive chip to power down or enter a sleep state when the shaking is not detected within a first preset time period or when the shaking is not detected again within a second preset time period after detecting the shaking. In this way, when the shaking is not detected by the DSP or the shaking is not detected again within a period of time, the motor drive chip is controlled to power down or enter a sleep state, thereby reducing the power consumption of the motor drive chip and the overall power consumption of the electronic device.

[0016] In a possible implementation of the first aspect, the method further includes: in response to an operation of starting the camera, the digital signal processor releases the motor control right and sends control right released information to the application processor. In this way, the DSP informs the AP that it can obtain the motor control right through the control right released information, and the switching of the motor control right is realized through the communication between the DSP and the AP, thereby improving the control accuracy of the motor drive chip.

[0017] In a possible implementation of the first aspect, in response to the operation of starting the camera, the digital signal processor releasing the motor control right includes: in response to the operation of starting the camera, the application processor generates a second instruction and sends the second instruction to the digital signal processor; and in response to the second instruction, the digital signal processor releases the motor control right. In this scheme, after the camera is started, the DSP releases the motor control right so that the AP obtains the motor control right, thereby ensuring the performance of the camera when it is working normally.

[0018] In a possible implementation of the first aspect, the digital signal processor releasing the motor control right includes: the digital signal processor controlling the second interface to switch from a transceiving state to a high-impedance state; or the first interface and the second interface are connected to the control interface of the motor drive chip through a one-of-two electronic switch; and the digital signal processor releasing the motor control right includes: the digital signal processor controlling the one-of-two electronic switch to switch from a state of being in communication with the second interface to a state of being in communication with the first interface.

[0019] In a possible implementation manner of the first aspect, the method further includes: after receiving the control right released information, the application processor controls the motor drive chip to be powered on or enter a wake-up state. In this way, the DSP informs the AP that the motor control right can be obtained through the control right released information, and the switching of the motor control right is realized through the communication between the DSP and the AP, thereby improving the accuracy of the AP and the DSP in time-sharing control of the motor drive chip.

[0020] In a second aspect, the present application further provides an electronic device, including: an application processor, a digital signal processor, a memory, a camera and a motor drive chip; a first interface of the application processor is connected with a second interface of the digital signal processor, and the memory is used to store first program code and second program code; the application processor is used to run the first program code, so that the electronic device realizes the steps performed by the application processor in the motor control method according to any one of the first aspect; the digital signal processor is used to run the second program code, so that the electronic device realizes the steps performed by the digital signal processor in the motor control method according to any one of the first aspect.

[0021] In a third aspect, the present application further provides a chip system, applied to an electronic device, the electronic device including a camera and a motor drive chip; the chip system including an application processor, a digital signal processor and an interface; a first interface of the application processor is connected with a second interface of the digital signal processor; the interface is used to receive first code instructions and transmit the first code instructions to the digital signal processor, and receive second code instructions and transmit the second code instructions to the application processor; the digital signal processor runs the first code instructions to realize the steps performed by the digital signal processor in the motor control method according to any one of the first aspect; the application processor runs the second code instructions to realize the steps performed by the application processor in the motor control method according to any one of the first aspect.

[0022] In a fourth aspect, the present application further provides a computer readable storage medium, having instructions stored thereon, when the instructions are run on an electronic device, causing the electronic device to perform the motor control method according to any one of the first aspect.

[0023] In a fifth aspect, the present application further provides a computer program product, having instructions stored thereon, when the computer program product is run on an electronic device, causing the electronic device to perform the motor control method according to any one of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 is a structural schematic diagram of a camera provided by an embodiment of the present application;

[0025] Figure 2 is a hardware structural schematic diagram of an electronic device provided by an embodiment of the present application;

[0026] Figure 3 is a schematic diagram of an architecture of an electronic device provided by an embodiment of the present application;

[0027] Figure 4 is a flowchart of a motor control method provided by an embodiment of the present application;

[0028] Figure 5 is a lens position curve diagram after the motor is powered off before and after the motor control method provided by an embodiment of the present application. DETAILED DESCRIPTION

[0029] The terms "first", "second", and "third" and the like in the specification and claims of the present application and the description of the drawings are used to distinguish different objects, and are not used to limit a specific order.

[0030] In the embodiments of the present application, the words "exemplary" or "for example" are used to mean serving as an example, instance, or illustration, and not necessarily to imply any preference or advantage. In other words, the use of the words "exemplary" or "for example" is intended to present concepts in a concrete manner. Any embodiment or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or advantageous than other embodiments or design schemes.

[0031] Please refer to Figure 1 , which shows a structural schematic diagram of a camera module. As Figure 1 indicated, the camera module can include a lens 11 and a motor 12, etc. The motor 12 can include a moving part 13, a fixed part 14, an image sensor 15, and a position sensor 16.

[0032] The lens 11 can include a set of lenses, and incident light can converge at the focal point of the lens through the lens 11, so that the photographed object is imaged on the image sensor 15.

[0033] The lens 11 is connected to the moving part 13. The moving part 13 can include a magnetic device, and the fixed part 14 can include a coil. The coil is powered to generate a magnetic field, and the magnetic device on the moving part 13 moves under the action of the force in the magnetic field, thereby driving the lens 11 to move. In other embodiments, the coil can also be provided on the moving part 13, and correspondingly, the magnetic part is provided on the fixed part 14. The moving principle of this implementation mode is similar to the above process and will not be described here.

[0034] The position sensor 16 can be provided on the side or bottom of the fixed part 14 to collect the position data of the moving part 13. The lens 11 is fixed on the moving part 13, so the position data of the moving part 13 is the position data of the lens 11. Further, the position of the motor can be controlled according to the position data of the lens 11.

[0035] The motor can include a motor with an optical image stabilization (OIS) function (or referred to as an OIS motor) and a motor with an auto focus (AF) function (referred to as an AF motor). The motor can not only drive the lens to move in the direction of the optical axis (z-axis) to achieve camera focusing, so that the photographed object can be clearly imaged, but also drive the lens to move in the plane perpendicular to the optical axis, that is, in the x and y axis directions, so as to compensate for the imaging deviation phenomenon caused by lens shaking.

[0036] After the camera is turned on, the motor can drive the lens to move in the x, y, and z directions to achieve focusing and anti-shake. After the camera is turned off and the motor is powered off, the moving part 13 of the motor loses the supporting force (such as magnetic force), and the weight of the lens can be large or the stroke of the lens movement is long. Under the action of external stress (such as user shaking of the electronic device) or inertia, the moving part 13 can hit the fixed part 14 in the x, y, and z directions to generate abnormal sound, resulting in a decrease in user experience.

[0037] Figure 1 Taking a vertical lens as an example to illustrate the abnormal sound phenomenon after the camera is powered off, other types of lenses (such as periscopic lenses) also have the problem of power-off abnormal sound. The scheme provided by the present application is applicable to all types of cameras that have the problem of power-off abnormal sound.

[0038] In order to solve the problem of motor power-off abnormal sound, the present application provides a motor control method. The control interface of the motor driving chip is connected to the interface of the application processor (AP) and the digital signal processor (DSP) (or advanced digital signal processing (ADSP)), that is, the motor driving chip is controlled by the AP or DSP / ADSP. Wherein, when the camera is turned on, the AP controls the motor driving chip to output a driving current to drive the motor, so as to realize focusing and anti-shake. After the camera is turned off, the DSP / ADSP controls the motor, and when the DSP / ADSP detects that the electronic device is shaking, it is determined that the position of the motor has moved, and immediately controls the motor to be powered on to generate a force opposite to the shaking direction, so as to quickly stabilize the motor and stabilize the lens. The scheme controls the motor to be stable by the DSP / ADSP after the camera is turned off, without waking up the AP, thereby saving the power consumption of the AP and the waiting time of waking up the AP, thus reducing the overall power consumption of the electronic device and shortening the anti-shaking response time of the motor.

[0039] Exemplarily, the electronic device described in the embodiments of the present application can be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, and a cellular phone, a personal digital assistant (PDA), an augmented reality (AR) \ virtual reality (VR) device, a media player, and the like. The embodiments of the present application do not limit the specific form of the electronic device.

[0040] Please refer to Figure 2 , which shows a structural schematic diagram of an electronic device provided by the embodiments of the present application.

[0041] As shown in Figure 2 , the electronic device includes a processor 101, a memory 102, a display screen 103, a motion sensor 104, a power management module 105, an auto focus integrated circuit (AF IC) 106, an optical image stabilization integrated circuit (OIS IC) 107, a camera 108, and a proximity light sensor 109, and the like. Wherein, the internal structure of the camera 108 is shown in Figure 1 .

[0042] The number of the camera 108 and the display screen 103 can be one or N, N is an integer greater than 1.

[0043] It can be understood that the structure shown in the embodiments does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0044] The AF IC 106 and the OIS IC 107 can be arranged inside or outside the camera 108 (the present figure shows the arrangement outside the camera).

[0045] The motion sensor 104 can include a gyroscope sensor, an acceleration sensor, and the like. The position sensor 16 can include a Hall sensor, a magnetic sensor, and the like.

[0046] The processor 101 can include multiple processors. For example, the processor of the present application can include an application processor (AP), a digital signal processor (DSP) (or ADSP), an image signal processor (ISP), and the like. Different processing units can be independent devices or can be integrated in one or more processors.

[0047] The processor 101 can include multiple interfaces, such as inter-integrated circuit (I2C) interfaces. The processor 101 can include multiple groups of I2C interfaces, and different I2C interfaces are respectively coupled to a camera, a sensor, an IC chip, and the like. For example, in an embodiment of the present application, the processor 101 is respectively coupled to an AF IC and an OIS IC through I2C interfaces.

[0048] In some embodiments of the present application, the I2C interface in the AP for controlling the AF IC and the OIS IC is connected to the I2C interface in the DSP for controlling the AF IC and the OIS IC, and the connected I2C interface is connected to the I2C interface of the AF IC and the OIS IC. Thus, the AP and the DSP control the AF IC and the OIS IC (i.e., the camera motor) in time division.

[0049] In an exemplary embodiment, the I2C interfaces of the AP and the DSP can be connected through resistors, or both the I2C interfaces of the AP and the DSP are provided with a switching switch, or both the I2C interfaces of the AP and the DSP are connected to an I2C interface of the processor having a switching function. The present application does not limit the specific manner of connecting the I2C interfaces of the AP and the DSP, as long as the I2C interfaces of the AP and the DSP can be connected to the I2C interface of the motor driving chip.

[0050] The memory 102 can be used to store computer executable program codes (such as instructions). The processor 101 executes various functional applications and data processing of the electronic device by running the instructions stored in the memory 102. For example, in an embodiment of the present application, after the camera is turned on, the AP can execute the instructions in the memory 102 to control the motor driving chip, so as to realize automatic focusing and anti-shake of the camera. After the camera is turned off, the DSP executes the instructions in the memory 102 to detect whether the electronic device is shaking, and if so, controls the motor driving chip to be powered on and generates a force in the opposite direction of the shaking to stabilize the motor and prevent abnormal noise.

[0051] The display screen 103 is used to display images, videos, and the like.

[0052] The motion sensor 104 collects motion data of the electronic device, and determines the posture of the electronic device through the motion data.

[0053] The proximity light sensor 109 is configured to detect whether there is an object close to the electronic device, for example, whether the electronic device is placed in a pocket or a bag.

[0054] The power management module 105 is connected to the battery, the charging management module and the processor 101, and is configured to receive input of the battery and / or the charging management module to supply power to components in the electronic device that need to be powered, such as the processor, the memory, the display screen, the camera, the focus driving integrated circuit and the anti-shake driving integrated circuit. For example, the power management module 105 can be a power management integrated circuit (PMIC).

[0055] The camera 108 is configured to capture still images or videos. Incident light can be converged on the focal point of the lens through the lens 11, so that the object being photographed is imaged on the image sensor 15. The image sensor 15 can convert the light signal into an electrical signal, which is transmitted to the ISP in the processor 101 for conversion into a digital image signal. The digital image signal is further processed to convert it into a standard image signal in the RGB, YUV or other format, which can be transmitted to the display screen 103 for display.

[0056] In an example embodiment of the present application, the AF IC 106 and the OIS IC 107 are configured to drive the motor in the camera 108 to move, so that the camera can realize automatic focusing, anti-shake when it is turned on, or fast stabilization when it is turned off.

[0057] The I2C interfaces of the AF IC 106 and the OIS IC 107 are connected to the I2C interface of the processor 101, and are configured to receive instructions issued by the processor. The AF IC 106 and the OIS IC 107 are configured to output driving current for driving the motor of the camera 108 based on the lens position collected by the position sensor 16 in the camera 108 after receiving the control instructions issued by the processor. The AF IC 106 is configured to output driving current for driving the motor to move in the z-axis direction, so as to realize automatic focusing of the camera or fast stabilization of the camera in the z-axis direction. The OIS IC 107 is configured to output driving current for driving the motor to move in the x-axis and y-axis directions, so as to realize anti-shake function of the camera or fast stabilization of the camera in the x-axis and y-axis directions.

[0058] For convenience of illustration, the I2C interfaces of the AF IC 106 and the OIS IC 107 are connected to the I2C interface of the processor 101, Figure 2 The I2C interfaces of the two integrated circuits are connected. In actual application, the I2C interfaces of the AF IC 106 and the OIS IC 107 can be two independent interfaces.

[0059] The driving current output by the AF IC 106 and / or the OIS IC 107 is input into a motor coil inside the camera 108, so as to drive the moving component 13 of the motor to move in the x, y and / or z axis direction, and the moving component 13 drives the lens 11 to move.

[0060] Referring to Figure 1 , the position sensor 16 inside the camera 108 can be arranged on a component where the motor coil is located, such as the fixed component 14, for example, can be arranged on the side or bottom of the fixed component, to collect the position data of the moving component 13, and the lens 11 is fixed on the moving component 13, so the position data of the moving component 13 is the position data of the lens 11. Further, the position sensor 16 sends the position data of the lens 11 to the AF IC 106 and / or the OIS IC 107, so that the AF IC 106 and / or the OIS IC 107 outputs corresponding driving current according to the actual position and the target position of the lens.

[0061] In addition, on the above components, an operating system runs. The operating system can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture or a cloud architecture.

[0062] As shown in Figure 3 , a schematic diagram of a framework of an electronic device provided by an embodiment of the present application is shown. The embodiment of the present application takes the layered architecture of the Android (TM) ) system as an example to exemplarily illustrate the software structure of the electronic device. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system can include an application layer (Application), an application framework layer (Framework), a hardware abstraction layer (hardware abstraction layer, HAL) and a kernel layer (Kernel).

[0063] The application layer can include a series of application packages. For example, the application packages can include applications such as a camera, which is not limited by the present application.

[0064] The application framework layer provides application programming interfaces (application programming interface, API) and programming frameworks for the applications of the application layer. The application framework layer includes some pre-defined functions. For example, CameraService and the like, which are not limited by the present application. CameraService provides an interprocess communication (interprocess communication, IPC) interface for the APK layer, and completes camera device (CameraDevice) creation and session management, etc.

[0065] The HAL layer encapsulates the Linux kernel driver, provides an interface upward, and shields the implementation details of the underlying hardware. In the embodiment of the present application, the HAL layer can include a camera HAL, a communication service, an OIS IC driver, an AF IC driver, and the like.

[0066] The camera HAL can connect the camera framework API of the application framework layer to the underlying camera driver and hardware.

[0067] The communication service (such as a non-camera service, NCS) can implement communication between an application processor (AP) and a DSP.

[0068] The OIS IC driver is a driver for the AP to call the OIS IC, and the AF IC driver is a driver for the AP to call the AF IC.

[0069] The kernel layer is a layer between hardware and software. The electronic device implements control of each hardware through the kernel layer. In the embodiment of the present application, the kernel layer at least includes a camera driver, an I2C driver, and a communication bus interface. The upper layer module (such as the OIS IC driver and the AF IC driver) connects the I2C interface through the I2C driver.

[0070] The camera driver is a driver of the camera, and the I2C driver is a driver of the I2C communication bus. The communication bus interface can implement communication between the AP and the DSP / ADSP.

[0071] The application program layer, the application framework layer, the hardware abstraction layer, and the kernel layer described above belong to the application processor.

[0072] In an example embodiment of the present application, the processor further includes a digital signal processor (DSP) or an advanced digital signal processor (ADSP). In the embodiment, the DSP / ADSP can include a sensor hub and an I2C driver.

[0073] The sensor hub is used to connect and process data from various sensor devices. In the embodiment of the present application, the sensor hub can include a shake detection module, an actuator manager, an OIS IC driver, an AF IC driver, and the like.

[0074] The shaking detection module is configured to detect whether the electronic device shakes according to motion data of the electronic device collected by a motion sensor (e.g., a gyroscope sensor, an acceleration sensor, etc.), so as to determine whether the position of the motor moves. If the electronic device shakes, it is determined that the position of the motor moves. If the electronic device does not shake, it is determined that the position of the motor does not move.

[0075] The motor manager is configured to control the OIS IC and / or the AF IC to output corresponding driving currents.

[0076] The OIS IC driver is a driver of the OIS IC, and the AF IC driver is a driver of the AF IC.

[0077] In an exemplary embodiment, taking the camera application as an example, when the camera application receives an operation of closing the camera, the camera application delivers a camera closing instruction to a camera service of an application framework layer. The camera service continues to deliver the camera closing instruction to a camera HAL of a HAL layer. The camera HAL issues the camera closing instruction to a camera driver, and further, the camera driver issues the camera closing instruction to an image sensor. The camera HAL releases the motor control right in response to the camera closing instruction, that is, the camera closing AP releases the motor control right. In addition, the camera HAL delivers the received camera closing instruction to a communication service, and the communication service delivers the instruction to a motor manager in the DSP / ADSP through a communication bus interface of a kernel layer.

[0078] After receiving the camera closing instruction, the motor manager obtains the motor control right, and generates corresponding control instructions (e.g., including an OIS control instruction and an AF control instruction) according to a detection result that the electronic device shakes, which is detected according to the motion data collected by the motion sensor. The motor manager calls the OIS IC driver and the I2C driver, and delivers the OIS control instruction to the OIS IC through a corresponding I2C interface of the OIS IC. Similarly, the motor manager calls the AF IC driver and the I2C driver, and delivers the AF control instruction to the AF IC through a corresponding I2C interface of the AF IC. The motor driving chip outputs a current to drive the motor to generate a force opposite to the shaking direction according to the received control instruction and the lens position (collected by a position sensor in the camera), so as to quickly stabilize the motor, and further, quickly stabilize the lens.

[0079] When the camera application receives an operation of opening the camera, the camera application delivers a camera opening instruction to the camera service. The camera service delivers the camera opening instruction to the camera HAL. The camera HAL enables the AP to obtain the motor control right in response to the camera opening instruction, and delivers the camera opening instruction to the communication service, and the communication service delivers the instruction to the motor manager in the DSP / ADSP through the communication bus interface.

[0080] The motor manager releases the motor control right in response to the camera opening instruction, and delivers control right released information to the communication service through the communication bus interface after successfully releasing the motor control right, and the communication service continues to deliver the control right released information to the camera HAL. After the camera HAL receives the information, the image sensor is powered on, the motor drive chip is powered on, or enters the wake-up state. When the camera HAL detects the need for auto focus or anti-shake, it generates the corresponding control instruction. Specifically, when the anti-shake function is implemented, the camera HAL calls the OIS IC drive and I2C drive on the AP side, and delivers the OIS control instruction to the OIS IC through the I2C interface corresponding to the OIS IC. Similarly, when focusing, the camera HAL calls the AF IC drive and I2C drive on the AP side, and delivers the AF control instruction to the AF IC through the I2C interface corresponding to the AF IC. The motor drive chip outputs current to drive the motor according to the received control instruction and the lens position (collected by the position sensor in the camera).

[0081] The motor control process provided by the present application will be described below in conjunction with the flowcharts shown in Figure 3 and Figure 4 First, the process of switching the motor control right from the AP side to the DSP side when the camera is closed will be introduced.

[0082] S101, the AP responds to the operation of closing the camera, and issues a camera closing instruction to the motor manager and releases the control right of the motor.

[0083] In an example, the camera can be a camera APP in the electronic device, and the operation of closing the camera can be the operation of closing the camera APP.

[0084] In another example, the camera can also be a third-party application, for example, an application that needs to call the camera for scanning or shooting, such as an instant messaging application. When the AP detects the operation of closing the camera, the operation of closing the camera can be the operation of closing or exiting the shooting or scanning interface of the third-party application.

[0085] For example, taking the closing of the camera APP as an example, as shown in Figure 3 The camera APP delivers a camera closing instruction to the camera HAL through the camera service in response to the operation of closing the camera APP. The camera HAL sends the camera closing instruction to the communication service (such as the NCS service) of the HAL layer, and the communication service sends the camera closing instruction to the motor manager in the DSP (such as SensorHub) through the communication bus interface of the kernel layer. At the same time, the camera HAL releases the control right of the motor, that is, releases the control right of the I2C interface (including the I2C interface of the OIS IC and the I2C interface of the AF IC).

[0086] In other exemplary embodiments, the camera HAL can generate a first instruction based on the received camera shutdown instruction and deliver the first instruction to the motor manager via the communication service, the first instruction being used to cause the DSP to obtain the motor control.

[0087] In an exemplary embodiment, the switching of the motor control is implemented by software, for example, when the AP releases the motor control, the I2C interface connecting the AF IC and the OIS IC is set to a high impedance state, and the I2C interface in the high impedance state cannot send data / instructions.

[0088] In another exemplary embodiment, the I2C interface of the AP and the DSP is connected in series through a switching switch (an electronic switch similar in function to a single-pole double-throw switch, such as a two-way electronic switch), in this scenario, the control of the I2C interface can be switched between the AP and the DSP by directly controlling the switching switch. For example, when the AP side releases the control of the motor, the two-way electronic switch is switched from being connected to the I2C interface of the AP to being connected to the I2C interface of the DSP, at this time, the I2C interface of the AP is disconnected from the I2C interfaces of the AF IC and the OIS IC, that is, the AP releases the control of the motor drive chip.

[0089] In yet another exemplary embodiment, the I2C interfaces of the AP and the DSP are both connected to an I2C interface having a switching function in the processor, and the switching function of the I2C interface is controlled by the processor, when the AP releases the control of the motor, the processor controls the I2C interface to be connected to the DSP.

[0090] S102, the AP sends a power-down instruction to the image sensor and a power-down or sleep state instruction to the motor drive chip in response to the operation of closing the camera APP.

[0091] As shown in Figure 3 After the camera APP of the application layer receives the operation of closing the camera APP, the camera service and the camera HAL deliver the power-down instruction to the image sensor and the power-down instruction or the sleep instruction to the motor drive chip layer by layer.

[0092] S103, the motor manager obtains the control of the motor in response to the camera shutdown instruction.

[0093] In the scenario of controlling the switching of the motor control by software, after the motor manager receives the camera shutdown instruction, the I2C interface connecting the AF IC and the OIS IC can be switched from a high impedance state to a transceiving state, that is, the I2C interface can transceive data / instructions.

[0094] In the scenario of the I2C interfaces of the AP and the DSP being connected in series through a switching switch (such as a two-way electronic switch), the switching switch is switched to be connected to the I2C interface of the DSP, and the DSP obtains the control of the motor.

[0095] In the scenario of connecting the I2C interface of the AP with the I2C interface of the DSP by the I2C interface with switching function in the processor, the processor switches the I2C interface to the DSP side, and the DSP obtains the motor control right.

[0096] In S104, the motion sensor sends the collected motion data of the electronic device to the shake detection module.

[0097] In an exemplary embodiment, the motion sensor can detect the motion data of the electronic device and deliver the motion data to the shake detection module at all times without shutting down the electronic device.

[0098] In S105, the shake detection module detects whether the electronic device has a shake; if there is a shake, S106 is executed; if there is no shake, it is continued to determine whether the motor has a shake according to the latest collected motion data.

[0099] In an exemplary embodiment, the shake detection module receives the motion data sent by the motion sensor, performs shake detection, and sends the shake detection result (or shake information, including the shake direction) to the motor manager after detecting the shake. Further, the shake detection module continues to determine whether the electronic device has a shake according to the new motion data transmitted by the motion sensor after obtaining the shake detection result based on the motion data.

[0100] In addition, the shake detection module can comprehensively determine whether there is a shake based on the data collected by multiple sensors (such as a gyroscope sensor, an acceleration sensor, a proximity light sensor, etc.).

[0101] For example, in the electronic device, the x, y, z axis directions of the motion sensor are parallel to the directions of the x, y, z axis of the motor, respectively, and the motion sensor can detect the motion data of the electronic device in the x, y, z axis directions and provide the motion data to the shake detection module in the DSP. The shake detection module respectively detects whether the motion data in the x, y, z axis directions conforms to the shake characteristics.

[0102] The shake detection module uses a shake detection algorithm to detect whether the motion data of the electronic device conforms to the shake characteristics. For example, a motion curve is obtained according to the motion data of the electronic device, and it is further compared whether the motion curve matches a shake characteristic curve (such as a handheld shake characteristic curve, a walking / running characteristic curve, a stair climbing characteristic curve, etc.). If it matches the handheld shake characteristic curve, it is determined that the electronic device has a shake, and it is further determined that the position of the motor is moved, and S106 is continued to be executed.

[0103] If the motion curve of the electronic device matches the walking / running characteristic curve or the climbing stairs characteristic curve, it is determined whether the electronic device is currently in a pocket or bag according to the detection result of the proximity light sensor, and if not, it is determined that the electronic device is shaking, and it is further determined that the position of the motor is moving, and S106 is continued to be executed. If it is determined that the electronic device is not in a pocket or bag, it is determined that the electronic device is not shaking, and it is continued to be detected whether there is shaking according to the latest motion data collected by the motion sensor.

[0104] In an exemplary embodiment, the shaking detection module determines that there is shaking after detecting a shaking feature once, and triggers the subsequent process, thereby improving the response speed.

[0105] In S106, the shaking detection module sends the shaking information to the motor manager.

[0106] After the shaking detection module detects that the motor is shaking, the shaking information detected is sent to the motor manager, and the shaking information includes the shaking direction, such as which axis direction of the x, y, and z three-axis directions has shaking.

[0107] In S107, the motor manager sends a power-on instruction or an instruction to enter a wake-up state to the motor drive chip, and sends a control instruction obtained based on the shaking information to the motor drive chip.

[0108] After the motor manager obtains the control right of the motor, if the motor drive chip (i.e., the AF IC and the OIS IC) is in a power-off state, it is powered on; if the motor drive chip is in a sleep state, it is woken up. Further, the motor manager decides the axis direction that needs to be driven according to the shaking information sent by the shaking detection module, and outputs the control instruction of the corresponding direction to the motor drive chip through the I2C interface.

[0109] For example, if the shaking direction is the x-axis and / or the y-axis direction, the motor manager generates an OIS control instruction for controlling the OIS IC to output a driving current. Further, as shown in FIG. 6, the motor manager calls the OIS IC driver and issues the control instruction to the OIS IC through the I2C interface corresponding to the OIS IC. Figure 3

[0110] If the shaking direction is the z-axis, a control instruction for controlling the AF IC to output a driving current is generated, and the AF IC driver is further called and the control instruction is issued to the AF IC through the I2C interface corresponding to the AF.

[0111] If there is shaking in the x, y, and z axis directions, the motor manager generates control instructions for controlling the OIS IC and the AF IC, and issues the control instructions to the OIS IC and the AF IC, respectively, so as to control the motor to move in the x, y, and z three-axis directions to quickly stabilize the lens. ​

[0112] S108, the motor driving chip outputs a driving current corresponding to the axis direction in response to the control instruction.

[0113] After receiving the corresponding control instruction, the OIS IC and the AF IC output a corresponding driving current according to the control instruction and the lens position, and transmit the driving current to the coil of the motor. After the coil is energized, the moving part of the motor generates an action force opposite to the shaking direction, thereby avoiding collision with the fixed part of the motor and finally stabilizing the motor. For example, when the motor shakes in the x-axis direction, the output driving current can make the motor generate an action force opposite to the x-axis shaking.

[0114] For example, the lens position can be obtained by a position sensor (such as a Hall sensor and / or a magnetic sensor) arranged in the camera.

[0115] S109, the motor manager sends a power-off instruction or an instruction to enter a sleep state to the motor driving chip within a preset time length.

[0116] After the motor manager receives the detection result of the shaking detection module that there is shaking, if the shaking information detected by the shaking detection module is not received again within a preset time length, it is determined that the motor has stabilized, and a power-off instruction or an instruction to enter a sleep state (or a low-power state) is sent to the motor driving chip.

[0117] The following describes the process of switching the motor control right from the DSP side to the AP side when the camera is started:

[0118] S110, the AP sends a camera start instruction to the DSP in response to the operation of starting the camera.

[0119] For example, the operation of starting the camera can be an operation of opening the camera APP, or can also be an operation of calling the camera by a third-party application, such as an operation of clicking a scanning or shooting button in the third-party application.

[0120] For example, as shown in FIG. 10, in response to the operation of starting the camera, the camera APP transmits a camera start instruction to the camera HAL through the camera service, and the camera HAL sends the camera start instruction to the communication service (such as the NCS service) of the HAL layer. The communication service issues the camera start instruction to the motor manager in the SensorHub through the communication bus interface of the kernel layer. Figure 3 In other embodiments, the camera HAL can generate a second instruction based on the received camera start instruction, and issue the second instruction to the motor manager in the DSP through the communication service. The second instruction is used to release the motor control right of the DSP.

[0121]

[0122] ​S111, the DSP releases the motor control right in response to the camera opening instruction, and returns the control right release information to the AP.

[0123] The motor manager in the SensorHub receives the camera opening instruction sent by the AP, and releases the motor control right, i.e. releases the control right of the I2C interface connected to the motor drive chip. For example, the motor manager can set the I2C interface connected to the motor drive chip on the DSP side to a high impedance state, and the I2C interface in the high impedance state cannot receive or send any data or instructions, so that the SensorHub releases the motor control right. Further, the motor manager sends the control right release information to the AP after successfully releasing the motor control right.

[0124] In the scenario of connecting the I2C interface of the AP and the DSP through the switch, the switch can be controlled to switch to the connection with the I2C interface on the AP side, and the AP obtains the control right while the DSP releases the control right.

[0125] In an exemplary embodiment, as shown in Figure 3 After the motor manager releases the motor control right, the control right release information is sent to the communication bus interface on the AP side. The communication bus interface continues to send the control right release information to the communication service of the HAL layer. The communication service continues to pass the information to the camera HAL.

[0126] S112, after the AP obtains the motor control right, the power-on instruction is sent to the image sensor, and the power-on instruction or the instruction to enter the wake-up state is sent to the motor drive chip.

[0127] After the camera HAL on the AP side receives the control right release information, it is determined that the SensorHub has released the control right of the motor. Further, the AP obtains the control right of the motor, and for example, the camera HAL controls the I2C interface connected to the motor drive chip on the AP side to be set to a transceiving state, and the I2C interface in the transceiving state can receive and send data / instructions.

[0128] Further, after the AP obtains the control right of the motor, the image sensor is powered on to realize normal shooting. At the same time, the motor drive chip is powered on or enters the wake-up state to realize automatic focusing and anti-shake during shooting.

[0129] S113, the AP sends the control instruction of anti-shake and / or focusing to the motor drive chip.

[0130] In an exemplary embodiment, as shown in Figure 3As shown, during auto-focusing, the camera HAL on the AP side calls the AF IC driver and sends a control instruction to the I2C interface connected to the AF IC through the kernel layer I2C driver. The control instruction is used to control the movement of the motor in the z-axis direction, thereby driving the lens to move in the z-axis direction, so as to realize auto-focusing. When the camera HAL determines that the lens is shaking based on the data collected by the motion sensor in the electronic device, an OIS control instruction is generated. The camera HAL calls the OIS IC driver and sends the OIS control instruction to the I2C interface connected to the OIS IC through the kernel layer I2C driver. The OIS control instruction is used to control the movement of the motor in the x-axis and y-axis directions, thereby driving the lens to move in the x-axis and y-axis directions, so as to stabilize the lens, i.e., realize the anti-shake function.

[0131] In S114, the motor driver chip outputs a corresponding driving current according to the received control instruction to drive the motor, so as to realize the focusing and / or anti-shake of the lens.

[0132] After receiving the control instruction, the motor driver chip outputs a corresponding driving current according to the control instruction and the lens position and transmits it to the coil of the motor. After the coil is energized, a magnetic force is generated, which can move the moving part of the motor to drive the lens to move in the corresponding direction, thereby realizing the auto-focusing or anti-shake of the lens. The lens position can be obtained by a position sensor (such as a Hall sensor and / or a magnetic sensor) arranged in the camera.

[0133] In addition, after the camera is turned off, in order to shorten the time for stabilizing the motor, the PID parameters (i.e., fast stabilization PID parameters) that can make the motor quickly stabilize can be obtained according to the physical parameters of the motor (such as the gap between the moving part and the fixed part, the damping coefficient, etc.). The motor driver chip can make the motor quickly reach a stable state by using the fast stabilization PID parameters to drive the motor. The motor driver chip includes a performance mode and a fast stabilization mode. When the camera is turned on, the motor driver chip is in the performance mode, in which the performance PID parameters (i.e., original PID parameters) are used. When the camera is turned off, the motor driver chip is in the fast stabilization mode, in which the fast stabilization PID parameters are used. The PID parameters can include z-axis direction corresponding PID parameters and x-axis and y-axis direction corresponding PID parameters.

[0134] In one scenario, two sets of PID parameters (i.e., one set of original PID parameters and one set of fast stabilization PID parameters) can be directly written in the storage space of the motor driver IC. In this scenario, the currently used PID parameters can be set by setting the value of the highest bit in the storage space. For example, the highest bit is 1, indicating that the original PID parameters are used, and 0, indicating that the fast stabilization PID parameters are used. Or the highest bit is 0, indicating that the original PID parameters are used, and 1, indicating that the fast stabilization PID parameters are used.

[0135] In another scenario, when the AP turns off the camera, the AP modifies the performance PID parameters in the motor driving chip to the fast stabilization PID parameters, and when the camera is turned on, the AP modifies the fast stabilization PID parameters in the motor driving chip to the performance PID parameters.

[0136] Please refer to Figure 5 , which shows a motor power-off lens movement curve diagram provided by the embodiment of the application. The horizontal axis of the curve diagram represents time, and the vertical axis represents the motor movement position.

[0137] As shown in Figure 5 , curve 1 is the lens movement curve when the application scheme is not used, and curve 2 is the lens movement curve after the application scheme is used.

[0138] As can be seen from curve 1, the electronic device starts to shake at t1, the moving part of the motor collides with the fixed part at t3, and continues to move in the opposite direction for a short time (such as 70ms) after the collision, collides with the other side of the fixed part at t4, and then continues to collide repeatedly until the energy is exhausted and stops.

[0139] As can be seen from curve 2, when the shaking is detected at t1-t2, the motor is powered on to suppress the motor shaking, so that the motor is quickly stabilized before the motor collides. In addition, after detecting the shaking of the motor, if no shaking information is received again at t2-t5, it is determined that the motor has stabilized, and the motor driving chip can be powered off or enter a sleep state to reduce power consumption.

[0140] The motor control method provided by the embodiment is to control the motor in the camera by the AP and the DSP in time, and to realize the motor time control by switching the control right of the motor driving chip by the AP and the DSP. Specifically, when the camera is turned off, the control right of the motor is switched from the AP to the DSP, and when the electronic device shakes, the DSP controls the motor to be powered on to generate a force opposite to the shaking direction to quickly stabilize the motor. After the camera is turned on, the control right of the motor is switched from the DSP to the AP, and the AP controls the motor driving chip to output a corresponding driving current to drive the motor to realize automatic focusing and / or anti-shake. It can be seen that, after the camera is turned off, the DSP obtains the control right of the motor, and when the electronic device shakes, the DSP immediately controls the motor to generate a force opposite to the moving direction to quickly stabilize the motor, without waking up the AP, thereby saving the power consumption of the AP and the waiting time of waking up the AP, thus reducing the overall power consumption of the electronic device and shortening the anti-shake response time of the motor.

[0141] Moreover, the method determines that the motor is shaking after detecting that the motion curve of the electronic device conforms to the shaking feature, that is, determines that the motor is shaking after detecting for the first time that the motion curve conforms to the shaking feature, and further immediately controls the motor to generate an action force in the opposite direction to rapidly stabilize the motor, thereby shortening the time for detecting shaking, that is, improving the response speed.

[0142] Further, in order to shorten the time for stabilizing the motor, the fast stabilization PID parameter is obtained according to the physical parameter of the motor, and the motor driving chip controls the motor by using the fast stabilization PID parameter when the camera is closed and the motor is detected to be shaking, thereby rapidly stabilizing the motor.

[0143] The integrated unit, if realized in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the embodiments can essentially or say the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product, and the computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method described in the embodiments. The foregoing storage medium includes a flash memory, a mobile hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk, and various media that can store program codes.

[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, and any change or replacement within the technical scope disclosed in the present application should be covered in the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A motor control method, characterized in that, Applied to an electronic device, the electronic device including a camera, an application processor, a digital signal processor, and a motor driver chip, wherein a first interface of the application processor is connected to a second interface of the digital signal processor, the method includes: In response to the operation of turning off the camera, the application processor controls the camera to turn off; When the camera is off, after the digital signal processor detects that the electronic device is shaking, it sends a motor control command to the motor driver chip through the second interface. The motor control command is used to control the motor driver chip to power on and drive the motor to generate a force opposite to the direction of shaking.

2. The method according to claim 1, characterized in that, The method further includes: in response to the operation of turning off the camera, the application processor releases control of the motor, and the digital signal processor gains control of the motor.

3. The method according to claim 2, characterized in that, In response to the operation of turning off the camera, the application processor releases control of the motor, and the digital signal processor gains control of the motor, including: in response to the operation of turning off the camera, the application processor releases control of the motor and generates a first instruction and sends it to the digital signal processor; In response to the first instruction, the digital signal processor gains control of the motor.

4. The method according to claim 3, characterized in that, In response to the operation of turning off the camera, the application processor releases control of the motor, including: in response to the operation of turning off the camera, the application processor sets the first interface from a transmit / receive state to a high impedance state; In response to the first instruction, the digital signal processor obtains motor control, including: in response to the first instruction, the digital signal processor controls the second motor control interface to switch from a high-impedance state to a transmit / receive state.

5. The method according to claim 2, characterized in that, The first interface and the second interface are connected to the control interface of the motor drive chip via a two-to-one electronic switch; In response to the operation of turning off the camera, the application processor releases control of the motor, and the digital signal processor gains control of the motor, including: In response to the operation of turning off the camera, the application processor controls the two-way electronic switch to switch from being connected to the first interface to being connected to the second interface.

6. The method according to any one of claims 1-5, characterized in that, After detecting vibration in the electronic device, the digital signal processor sends a motor control command to the motor driver chip through the second interface, including: The digital signal processor generates motor control commands based on the direction of the swaying, and the motor control commands drive the motor to generate a force opposite to the direction of the swaying. The digital signal processor sends the motor control command to the motor driver chip through the second interface.

7. The method according to claim 6, characterized in that, The motor drive chip includes an autofocus integrated circuit (AF IC) and an optical image stabilization integrated circuit (OIS IC); sending the motor control command to the motor drive chip includes: If the direction of the swaying is determined to be the axis of the motor, the motor control command is sent to the AF IC; If the direction of the swaying is determined to be the X-axis direction and / or the Y-axis direction perpendicular to the axis, the motor control command is sent to the OIS IC.

8. The method according to claim 6 or 7, characterized in that, The method further includes: The motor drive chip stores fast and stable proportional-integral-derivative PID parameters and performance PID parameters. When the motor drive chip receives the motor control command, it reads the fast and stable PID parameters and outputs the drive current of the motor based on the fast and stable PID parameters and the motor control command. or, When the application processor controls the camera to turn off, it modifies the performance PID parameters stored in the motor drive chip to fast and stable PID parameters. When the motor drive chip receives the motor control command, it reads the fast and stable PID parameters and outputs the drive current of the motor based on the fast and stable PID parameters and the motor control command.

9. The method according to claim 1, characterized in that, The electronic device includes a motion sensor; detecting shaking in the electronic device includes: The digital signal processor acquires motion data of the electronic device collected by the motion sensor; After the digital signal processor detects that the motion data matches the characteristics of hand-held shaking, it determines that the electronic device is shaking.

10. The method according to claim 9, characterized in that, The electronic device further includes a proximity light sensor; and if shaking of the electronic device is detected, it also includes: The digital signal processor detects that the motion data matches the non-handheld shaking characteristics and that the proximity sensor is not blocked, and then determines that the electronic device is shaking. The non-handheld shaking characteristics include any one of walking characteristics, running characteristics, and stair climbing characteristics.

11. The method according to any one of claims 1-10, characterized in that, The method further includes: If the digital signal processor does not detect any shaking within a first preset time period, or if it does not detect shaking again within a second preset time period after shaking is detected, it controls the motor drive chip to power down or enter a sleep state.

12. The method according to any one of claims 1-10, characterized in that, The method further includes: In response to the camera activation operation, the digital signal processor releases control of the motor and sends a control release message to the application processor.

13. The method according to claim 12, characterized in that, In response to the camera activation operation, the digital signal processor releases control of the motor, including: In response to the operation of activating the camera, the application processor generates a second instruction and sends it to the digital signal processor; In response to the second instruction, the digital signal processor releases control of the motor.

14. The method according to claim 13, characterized in that, The digital signal processor releases motor control, including: the digital signal processor controls the second interface to switch from a transmit / receive state to a high impedance state; or, The first interface and the second interface are connected to the control interface of the motor driver chip via a two-to-one electronic switch; the digital signal processor releases motor control, including: The digital signal processor controls the 2-to-1 electronic switch to switch from being connected to the second interface to being connected to the first interface.

15. The method according to any one of claims 12-14, characterized in that, The method further includes: after receiving the information that control has been released, the application processor controls the motor driver chip to power on or enter a wake-up state.

16. An electronic device, characterized in that, The electronic device includes: an application processor, a digital signal processor, a memory, a camera, and a motor driver chip; the first interface of the application processor is connected to the second interface of the digital signal processor, and the memory is used to store first program code and second program code; The application processor is used to run the first program code, so that the electronic device implements the steps executed by the application processor in the motor control method as described in any one of claims 1 to 15; The digital signal processor is used to run the second program code, causing the electronic device to implement the steps executed by the digital signal processor in the motor control method as described in any one of claims 1 to 15.

17. A chip system, characterized in that, The chip system is applied to electronic devices, including cameras and motor drive chips; the chip system includes an application processor, a digital signal processor, and interfaces. The first interface of the application processor is connected to the second interface of the digital signal processor; The interface is used to receive a first code instruction and transmit it to the digital signal processor, and to receive a second code instruction and transmit it to the application processor; The digital signal processor executes the first code instructions to implement the steps performed by the digital signal processor in the motor control method according to any one of claims 1-15; The application processor executes the second code instructions to implement the steps performed by the application processor in the motor control method according to any one of claims 1-15.

18. A computer-readable storage medium, characterized in that, It stores instructions that, when executed on an electronic device, cause the electronic device to perform the motor control method as described in any one of claims 1 to 15.

19. A computer program product, characterized in that, It stores instructions that, when the computer program product is run on the electronic device, cause the electronic device to implement the motor control method as described in any one of claims 1 to 15.

Citation Information

Patent Citations

  • Electronic device, drop processing method and related product

    CN110581917A

  • Camera control circuit and method and electronic equipment

    CN115529412A

  • Anti-shake method and electronic equipment

    CN117750198A

  • Shooting correction method and assembly, computer readable storage medium and electronic equipment

    CN117939298A

Cited By

  • Motor control method, electronic equipment and readable storage medium

    CN121037690A