Motor control device, motor control method, motor control device and electronic equipment
By obtaining the relationship between the target direction of the motor and the preset rotation direction, the motor drive unit controls the phase exchange of the motor's magnetic field, which solves the problem of motor rotor loss and improves the control reliability of electronic equipment for the motor.
Patent Information
- Application Number
- CN202310757560.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-25
- Publication Date
- 2024-12-27
AI Technical Summary
In the case of motor air gap design, electronic equipment has low reliability in the control of motor rotor, which can easily lead to the rotor failure and start-up failure.
By obtaining the relationship between the target direction of the motor and the preset rotation direction, the motor drive unit controls the phase exchange process of the magnetic field of the motor stator to drive the motor to rotate in the target direction to avoid the rotor from losing steps.
Improve the reliability of electronic equipment to control the motor and ensure the smooth start and operation of the motor rotor.
Smart Images

Figure CN119210226A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a motor control device, a motor control method, a device and an electronic device. Background Art
[0002] With the development of science and technology, electronic devices are used more and more widely and have more and more functions. They have become one of the necessities in people's daily life. At present, electronic devices including motors are becoming more and more common. In the related technology, a solution of unequal air gap design is proposed to solve the problem of dead point of single-phase motors. However, in the case of unequal air gap design of motors, the control of the rotor of the motor by the electronic device has the problem of low reliability. Summary of the invention
[0003] In view of the above problems, the present application proposes a motor control device, a motor control method, a device and an electronic device, which can control the current commutation of the motor according to the relationship between the target direction and the preset rotation direction of the motor, thereby effectively avoiding the motor's rotor losing step during the control of the motor rotation and improving the reliability of the electronic device in controlling the motor.
[0004] In the first aspect, an embodiment of the present application provides a motor control device, which includes a motor drive unit and a main control chip. The motor drive unit is used to connect to the motor and drive the motor to rotate; the main control chip is connected to the motor drive unit, and is used to obtain the target direction for driving the motor to rotate and the preset rotation direction of the motor, and according to the relationship between the target direction and the preset rotation direction, control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0005] In a second aspect, an embodiment of the present application provides a motor control method, which is applied to the motor control device provided in the first aspect. The method includes: obtaining a target direction for driving the motor to rotate, and obtaining a preset rotation direction of the motor; according to the relationship between the target direction and the preset rotation direction, controlling the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0006] In a third aspect, an embodiment of the present application provides a motor control device, which is applied to the motor control device provided in the first aspect above. The motor control device includes: a target direction acquisition module and a motor rotation direction control module. Among them, the target direction acquisition module is used to obtain the target direction for driving the motor to rotate, and to obtain the preset rotation direction of the motor; the motor rotation direction control module is used to control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor according to the relationship between the target direction and the preset rotation direction, so as to drive the motor to rotate in the target direction.
[0007] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a motor; one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more applications are configured to execute the method of the second aspect described above.
[0008] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored, and the program code is called by a processor to execute the method of the second aspect as described above.
[0009] The motor control device, motor control method, device and electronic device provided in the embodiments of the present application obtain the target direction of the rotation of the driving motor and the preset rotation direction of the motor; according to the relationship between the target direction and the preset rotation direction, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, and then the current phase switching of the motor is controlled according to the relationship between the target direction and the preset rotation direction of the motor, thereby effectively avoiding the rotor of the motor from losing step during the control of the motor rotation and improving the reliability of the electronic device in controlling the motor. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0011] Figure 1 A schematic diagram showing the rotor position of a motor provided by an embodiment of the present application is shown.
[0012] Figure 2 A structural block diagram of a motor control device provided by an embodiment of the present application is shown.
[0013] Figure 3A circuit structure schematic diagram of a pre-driving circuit provided in one embodiment of the present application is shown.
[0014] Figure 4 A circuit structure schematic diagram of an inverter circuit provided in one embodiment of the present application is shown.
[0015] Figure 5 A circuit structure diagram of a voltage sampling circuit provided in one embodiment of the present application is shown.
[0016] Figure 6 A circuit structure schematic diagram of a first current sampling circuit provided in an embodiment of the present application is shown.
[0017] Figure 7 A circuit structure schematic diagram of a second current sampling circuit provided in an embodiment of the present application is shown.
[0018] Figure 8 A flow chart of a motor control method provided by an embodiment of the present application is shown.
[0019] Fig. 9 A flow chart of a motor control method provided by an embodiment of the present application is shown.
[0020] Fig.10 A schematic diagram showing the rotation of the rotor of a drive motor provided by an embodiment of the present application is shown.
[0021] Fig.11 A flow chart of a motor control method provided by an embodiment of the present application is shown.
[0022] Fig.12 A schematic diagram showing the rotation of the rotor of a drive motor provided by an embodiment of the present application is shown.
[0023] Fig.13 A flow chart of a motor control method provided by an embodiment of the present application is shown.
[0024] Fig.14 A structural block diagram of a motor control device provided by an embodiment of the present application is shown.
[0025] Fig.15 A structural block diagram of an electronic device provided by an embodiment of the present application is shown.
[0026] Fig.16 A structural block diagram of a computer-readable storage medium provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0027] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0028] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0029] With the development of science and technology, electronic devices are becoming more and more diverse. At present, electronic devices including motors are becoming more and more common, such as vacuum cleaners, washing machines, exhaust fans, etc. Correspondingly, the reliability requirements for motor control in related technologies are getting higher and higher. In the related technology, a solution of unequal air gap design is proposed to solve the problem of dead point of single-phase motors, so that the position of the rotor when the motor starts avoids the dead point. Among them, the normal n-pole motor rotor in a single-phase motor has 2n initial positions in a static state. In the process of controlling a single-phase motor, each time the motor is started, the initial position of the rotor needs to be determined, and then the motor current commutation is controlled in the required direction.
[0030] For example, see Figure 1 , which shows a schematic diagram of the rotor position of a motor provided by an embodiment of the present application. In order to avoid the problem of a dead point at the start of a single-phase motor, the stator core of the motor is designed with unequal air gaps, wherein the motor includes a pair of pole motor rotors, and the rotor is affected by the cogging torque in a stationary state. The initial position of the rotor of the motor has and only has two initial positions, such as Figure 1 As shown in the first position, the N pole of the rotor is at an oblique upper position and the S pole is at an oblique lower position; Figure 1 Position 2 is shown, in which the N pole of the rotor is diagonally downward and the S pole is diagonally upward.
[0031] In the process of designing the motor, the main rotation direction of the motor can be defined according to the cogging torque of the motor. For example, the position of the rotor of the motor in a stationary state is as follows: Figure 1 As shown in position 1, there is an angle ∠1 between the magnetic field direction of the rotor and the magnetic field direction of the stator in the stationary state of the motor. Accordingly, the main rotation direction of the motor can be defined as counterclockwise according to the cogging torque of the motor.
[0032] Among them, when the electronic device needs to control the motor to drive clockwise, if the electronic device directly controls the direction of the motor's stator magnetic field upward, the rotor can only rotate clockwise by a small angle; when the motor controls the current direction to make the stator magnetic field change phase, the rotor is affected by the cogging torque and may deflect back by an angle, causing the rotor to reverse, or directly lose step and fail to start. Therefore, when the electronic device controls the motor's rotor to rotate in the opposite direction of the main rotation direction, there is a problem of low control reliability.
[0033] Therefore, in the related art, when the motor is designed with unequal air gaps, the control of the motor rotor by the electronic device has the problem of low reliability.
[0034] In view of the above problems, the inventors have discovered after long-term research and proposed a motor control device, motor control method, device and electronic device provided in the embodiments of the present application, which effectively avoids the motor rotor from losing step during the control of the motor rotation process by controlling the current commutation of the motor according to the relationship between the target direction and the preset rotation direction of the motor, thereby improving the reliability of the electronic device controlling the motor. Among them, the specific motor control method is described in detail in the subsequent embodiments.
[0035] See also Figure 2 , which shows a schematic diagram of a motor control device provided by an embodiment of the present application. In the embodiment of the present application, the motor control device 10 may include a motor drive unit 101 and a main control chip 102.
[0036] Among them, the motor drive unit 101 can be used to connect to the motor and drive the motor to rotate; the main control chip 102 can be connected to the motor drive unit 101 to obtain the target direction of driving the motor to rotate and the preset rotation direction of the motor, and control the motor drive unit 101 to the motor according to the relationship between the target direction and the preset rotation direction.
[0037] Wherein, the motor drive unit 101 may include a power supply unit, wherein the power supply unit may be used to provide energy for driving the motor to work, and illustratively, the power supply unit may provide a voltage of 175V to 264V. Optionally, the power supply unit may include a unit for rectifying the 310V mains to obtain an output voltage. Exemplarily, the power supply unit may filter the mains with an electrolytic capacitor and input it into the motor drive unit 101 to provide a bus voltage for driving the motor to work. Wherein, the rectification method may include half-wave rectification, full-wave rectification, bridge rectification, etc., which are not limited here.
[0038] The motor drive unit 101 may further include a pre-drive circuit and an inverter circuit. The pre-drive circuit may be composed of one or more circuit elements such as resistors, capacitors, and diodes. The inverter circuit may be composed of one or more circuit elements such as resistors, capacitors, diodes, and electronic switches. The electronic switch included in the inverter circuit may include a field effect transistor (MOS). Exemplarily, the inverter circuit may include an "H-bridge" composed of four MOS tubes; accordingly, the inverter circuit may be connected to the motor, and may provide different current directions for the motor drive through different MOS tube conduction modes.
[0039] Among them, considering that the driving current of the MOS tube is generally greater than 100mA, the chip IO output capacity of the main control chip 102 is generally less than or equal to 10mA. Optionally, the pre-drive circuit may include a pre-drive chip, which can receive the drive signal sent by the main control chip 102, and turn on the corresponding MOS tube in response to the drive signal to drive the motor to work. Among them, the drive signal may include the current flow direction of the motor. Further, the pre-drive circuit can turn on the electronic switch included in the inverter circuit based on the drive signal, control the inverter circuit to turn on the current flow corresponding to the drive signal to control the motor to work. Among them, the pre-drive chip can include a driver chip such as an LN8362 chip and a SOT23-6 chip, which is not limited here.
[0040] Exemplarily, the motor drive unit 101 is connected to the main control chip 102 to receive the drive signal sent by the main control chip 102; the output end of the pre-drive circuit can be connected to the inverter circuit to control the conduction of the inverter circuit in response to the drive signal, and control the flow direction of the current in the inverter circuit. The inverter circuit can be connected to the motor to drive the motor to work.
[0041] For example, see Figure 3 , which shows a schematic diagram of the circuit structure of the pre-drive circuit provided in an embodiment of the application. The pre-drive circuit is composed of resistors R1, R2, R3, R4, R5, R6, capacitors C1, C2, C3, C4, diodes D1, D2, pre-drive chips U1, U2, as shown in FIG. Figure 3The connection method shown is composed of the following. The pre-drive circuit can receive the drive signal PWM_UH high-level signal and PWM_UL low-level signal sent by the main control chip 102 or the associated electronic device; the pre-drive chip U1 included in the pre-drive circuit can output the U signal, HOU signal and LOU signal to the inverter circuit based on the drive signal, and the pre-drive chip U2 included in the pre-drive circuit can output the V signal, HOU signal and LOU signal to the inverter circuit based on the drive signal. The U signal, V signal, HOU signal and LOU signal output by the pre-drive circuit can control the conduction mode of the inverter circuit, and thus control the flow direction of the motor current.
[0042] For example, see Figure 4 , which shows a schematic diagram of the circuit structure of an inverter circuit provided by an embodiment of the present application. The inverter circuit comprises resistors R7, R8, R9, R10, R11, R12, R13, R14, R15, R16, capacitors C5, C6, MOS1, MOS2, MOS3, MOS4, as shown in FIG. Figure 4 The connection method shown in the figure is as follows. Among them, capacitors C5 and C6 can rectify and filter the 310V mains power to obtain the bus voltage for driving the motor. Among them, MOS1, MOS2, MOS3, and MOS4 can form an "H bridge", MOS1 and MOS3 are turned on as one group, and MOS2 and MOS4 are turned on as another group.
[0043] Please refer to Figure 3 and Figure 4 , wherein the U signal, V signal, HOU signal and LOU signal output by the pre-drive circuit can control the conduction of MOS1 and MOS4, and the U signal, V signal, HOU signal and LOU signal output by the pre-drive circuit can also control the conduction of MOS2 and MOS3. The motor can be connected to the inverter circuit. After the MOS tube is turned on, the current can flow through the motor based on the direction of U—>V, and can also flow through the motor based on the direction of V—>U, thereby driving the motor to work.
[0044] In some embodiments, the motor drive unit 101 may further include a voltage sampling circuit. The voltage sampling circuit may be used to connect to the power supply unit and the main control chip 102 respectively, and may sample the voltage of the drive motor. The voltage sampling circuit may be composed of one or more circuit elements such as resistors, capacitors, and diodes.
[0045] For example, please refer to Figure 4 and Figure 5 , Figure 5FIG. 1 is a schematic diagram showing a circuit structure of a voltage sampling circuit provided by an embodiment of the present application. The voltage sampling circuit may be composed of a resistor R17, a resistor R18, a resistor R19, a resistor R20, a resistor R21, a resistor R22, a capacitor C7, a diode D3, and the like. Figure 5 The input end of the voltage sampling circuit can be connected to the inverter circuit, and the output end can be connected to the main control chip 102. Figure 4 The 310V input inverter circuit voltage shown is understood as the 310V voltage of the input voltage sampling circuit; Figure 5 The output end of the voltage sampling circuit shown can output the sampled bus voltage U_AD for driving the motor to the main control chip 102 .
[0046] In some embodiments, the motor drive unit 101 may further include a first current sampling circuit, the first end of which may be used to connect to the input end of the first resistor included in the inverter circuit, the second end of which may be used to be grounded, the third end of which may be used to connect to the main control chip 102, and the first current sampling circuit may be used to sample the first current corresponding to the first resistor. The first current sampling circuit may determine the first current based on the built-in operational amplifier of the MCU; the first current sampling circuit may also determine the first current based on the external current sampling operational amplifier.
[0047] The first current sampling circuit may be composed of one or more circuit elements such as resistors, capacitors, and comparators. Figure 4 and Figure 6 ,in, Figure 6 FIG. 1 is a schematic diagram showing the circuit structure of a first current sampling circuit provided by an embodiment of the present application. The first current sampling circuit comprises a resistor R23, a resistor R24, a capacitor C8, a comparator 1, and a Figure 6 The first end of the first current sampling circuit can be understood as follows: Figure 6 The I_shunt1 input terminal can be used to connect to the first resistor (such as Figure 4 The first current sampling circuit is connected to the input end of the resistor R16 shown in the figure, the second end of the first current sampling circuit can be used for grounding, and the third end of the first current sampling circuit can be used for connecting to the main control chip 102, wherein the third end of the first current sampling circuit can send the voltage I_AD of the first resistor to the ground to the main control chip 102. Further, the main control chip 102 can obtain the first current corresponding to the first resistor according to the voltage I_AD and the resistance of the first resistor using the Ohm's law formula. Accordingly, it can be understood that the first current sampling circuit can be used to sample the first current corresponding to the first resistor.
[0048] The motor drive unit 101 may also include a second current sampling circuit, the first end of which may be used to connect to the first end of the second resistor included in the inverter circuit, the second end of which may be used to connect to the input end of the first resistor included in the inverter circuit, the third end of which may be used to connect to the main control chip 102, and the second current sampling circuit may be used to sample the second current corresponding to the first resistor and the second resistor, wherein the first resistor may be connected in series with the second resistor. The second current sampling circuit may determine the second current based on the built-in operational amplifier of the MCU; the second current sampling circuit may also determine the second current based on the external current sampling operational amplifier.
[0049] The second current sampling circuit may be composed of one or more circuit elements such as resistors, capacitors, and comparators. Figure 4 and Figure 7 ,in, Figure 7 FIG. 1 shows a schematic diagram of the circuit structure of a second current sampling circuit provided by an embodiment of the present application. The second current sampling circuit comprises a resistor R25, a resistor R26, a capacitor C9, a comparator 2, and a Figure 7 The connection method shown is composed
[0050] The first end of the second current sampling circuit can be understood as follows: Figure 7 The input terminal of iv+ can be used to connect to the second resistor (such as Figure 4 A first end of a resistor R15) is connected.
[0051] The second end of the second current sampling circuit can be understood as follows: Figure 7 The input end of I_shunt1 can be used to connect to the first resistor (such as Figure 4 The input terminal of the resistor R16 is connected as shown.
[0052] The third end of the second current sampling circuit can be used to connect to the main control chip 102, wherein the third end of the second current sampling circuit can send the voltage I_U of the first resistor and the second resistor to the ground to the main control chip 102. Further, the main control chip 102 can obtain the second current corresponding to the first resistor and the second resistor based on the Ohm's law formula according to the voltage I_U, the first resistor and the second resistor. Accordingly, it can be understood that the second current sampling circuit can be used to sample the second current corresponding to the first resistor and the second resistor.
[0053] It can be understood that when MOS1 and MOS4 are turned on, the first resistor can be connected in series with the second resistor, and the current direction flowing through the motor is U->V; when MOS2 and MOS3 are turned on, the first resistor can be connected in parallel with the second resistor, and the current direction flowing through the motor is V->U.
[0054] Optionally, the main control chip 102 may include a microcontroller unit (MCU). In this embodiment, the main control chip 102 may obtain the target direction of the motor and the preset rotation direction of the motor; according to the relationship between the target direction and the preset rotation direction, the motor drive unit 101 is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, and then the current phase switching of the motor is controlled according to the relationship between the target direction and the preset rotation direction of the motor, which effectively avoids the rotor of the motor from losing step during the control of the motor rotation, and improves the reliability of the electronic device controlling the motor.
[0055] See also Figure 8 , Figure 8 The flow chart of the motor control method provided by an embodiment of the present application is shown. The motor control method is applied to the motor control device provided by an embodiment of the present application. By controlling the current commutation of the motor according to the relationship between the target direction and the preset rotation direction of the motor, the motor rotor is effectively prevented from losing step during the control of the motor rotation, thereby improving the reliability of the electronic device controlling the motor. In a specific embodiment, the motor control method can be applied to Fig.14 The motor control device 200 and the electronic device 100 ( Fig.15 ). The following will take an electronic device as an example to illustrate the specific process of this embodiment. Of course, it can be understood that the electronic device used in this embodiment may include a washing machine, a hair dryer, an exhaust fan, and other electronic devices including the motor control device provided in an embodiment of the present application, which are not limited here. Among them, the electronic device can be connected to the motor. Figure 8 The process shown is described in detail, and the motor control method may specifically include the following steps:
[0056] Step S110: obtaining a target direction for driving the motor to rotate, and obtaining a preset rotation direction of the motor.
[0057] In this embodiment, the electronic device may include a motor, and the electronic device may also be connected to one or more motors. The motor may include a single-phase motor; the single-phase motor may adopt an uneven air gap design on the stator; the single-phase motor may generate a magnetic resistance torque based on the uneven air gap design, ensuring that the rotor of the motor does not stop at a dead point with zero torque when the power is cut off and the reliability of controlling the rotation of the motor is ensured.
[0058] The electronic device may further include a motor control device, wherein the motor control device may include a motor drive unit and a main control chip. The motor drive unit may be used to connect to the motor and drive the motor to rotate. The main control chip may be connected to the motor drive unit to obtain a target direction for driving the motor to rotate and a preset rotation direction of the motor, and may control the motor drive unit to perform subsequent motor control operations according to the target direction and the preset rotation direction.
[0059] As an implementable manner, the electronic device may receive a first instruction input by a user, wherein the first instruction may carry a target direction for driving the motor to rotate. Accordingly, after receiving the first instruction, the electronic device may determine that the motor needs to be controlled to rotate, wherein the electronic device may parse the first instruction to obtain the target direction. Further, after obtaining the target direction, the electronic device may control the motor drive unit to perform subsequent motor control operations based on the target direction.
[0060] As another practicable manner, the target direction of the motor rotation controlled by the electronic device is fixed. The electronic device may receive a second instruction input by a user, wherein the second instruction may not carry the target direction of the motor rotation. Accordingly, after receiving the second instruction, the electronic device determines that the motor needs to be controlled to rotate; the electronic device may also control the motor drive unit to perform subsequent motor control operations based on the fixed target direction.
[0061] In some embodiments, the electronic device may include one motor or multiple motors. The electronic device may be connected to one motor to control the operation of the motor. The electronic device may be connected to multiple motors to control the operation of the multiple motors.
[0062] Wherein, the electronic device can receive a third instruction input by the user, wherein the third instruction can be used to instruct the target motor to drive the rotation. Wherein, after receiving the third instruction, the electronic device can determine the target motor to drive the rotation corresponding to the third instruction from the motors included in the motor or the connected motors. Accordingly, after the electronic device determines the target motor, it can obtain the preset rotation direction corresponding to the target motor; wherein, when the number of target motors is one, the main rotation direction of the target motor can be determined as the preset rotation direction, and when the number of target motors is multiple, the main rotation direction corresponding to each target motor can be determined as the preset rotation direction corresponding to each target motor.
[0063] In some embodiments, the electronic device may receive a fourth instruction input by a user, wherein the fourth instruction may include multiple target directions and multiple target motors for indicating driven rotation, wherein the target directions may correspond one-to-one to the target motors for indicating driven rotation.
[0064] In some embodiments, a preset rotation direction corresponding to a motor may be pre-set in the electronic device, wherein the preset rotation direction may be obtained through third-party experimental data. The preset rotation direction may be determined when the motor is designed, and may be pre-set in the electronic device or stored in an associated cloud or electronic device. Optionally, the electronic device may also obtain the preset rotation direction corresponding to the motor from an associated cloud or electronic device through wireless communication technology (e.g., wireless technologies such as Bluetooth, WiFi, and zigbee technology). For example, please refer to Figure 1 , wherein, when the initial state of the motor is position one, the corresponding preset rotation direction of the motor is counterclockwise.
[0065] The electronic device may also determine the preset rotation direction of the motor by determining the position of the rotor when the motor is started. Figure 1 When the electronic device determines that the position of the rotor when starting the motor is position 1, it can determine that the preset rotation direction of the motor is counterclockwise. The electronic device may include a position sensor; accordingly, the electronic device can determine the position of the rotor when starting the motor by acquiring the sensing data collected by the position sensor, and can determine the preset rotation direction of the motor according to the position.
[0066] Step S120: According to the relationship between the target direction and the preset rotation direction, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor, so as to drive the motor to rotate in the target direction.
[0067] In some embodiments, after the electronic device obtains the target direction of the driving motor and the preset rotation direction of the motor, it can control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor according to the relationship between the target direction and the preset rotation direction to drive the motor to rotate in the target direction.
[0068] Among them, taking into account the unequal air gap design of the motor, for example, the rotor of a pole pair of the motor will have two initial positions when the motor is stationary. In order to effectively avoid the rotor of the motor from losing step, the electronic device can perform phase switching control on the motor current according to the initial position of the rotor in the motor when controlling the motor to start.
[0069] In this embodiment, after the electronic device obtains the target direction of the driving motor and the preset rotation direction of the motor, it can obtain the relationship between the target direction and the preset rotation direction, such as the same or opposite. In particular, considering that there is a main direction when the single-phase motor is started during the single-phase motor design process, the main direction can be understood as the preset rotation direction of the single-phase motor.
[0070] Correspondingly, if the electronic device determines that the target direction of the motor rotation is the same as the preset rotation direction of the motor, the motor can be started based on the main direction, and the motor drive unit can be controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction. It can be understood that the target direction of the motor rotation is the same as the preset rotation direction of the motor. When the electronic device controls the motor drive unit to drive the motor to start in the main direction, the rotor of the motor can rotate a larger angle at the beginning and can use the inertia of the motor to pass through the center line of the stator magnetic field. The electronic device can control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to ensure that the rotor of the motor continues to rotate based on the main direction.
[0071] Correspondingly, if the electronic device determines that the target direction of the motor is opposite to the preset rotation direction of the motor, the motor can be started based on the main direction to rotate the motor in the opposite direction to the target direction by a preset angle, and then the motor drive unit can be controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction. It can be understood that if the target direction is opposite to the preset rotation direction, starting the motor in the target direction is likely to cause the rotor of the motor to reverse or lose step. This embodiment controls the motor to rotate in the opposite direction by a preset angle in the preset rotation direction opposite to the target direction, and then controls the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, thereby improving the reliability of controlling the rotation of the motor.
[0072] A motor control method provided in an embodiment of the present application obtains a target direction for driving the motor to rotate and a preset rotation direction of the motor; based on the relationship between the target direction and the preset rotation direction, controls the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, and then controls the current phase switching of the motor based on the relationship between the target direction and the preset rotation direction of the motor, thereby effectively avoiding the rotor of the motor from losing step during the control of the motor rotation and improving the reliability of the electronic device in controlling the motor.
[0073] See also Fig. 9 , Fig. 9 The flow chart of the motor control method provided by an embodiment of the present application is shown. The method is applied to the electronic device including the motor control device. Fig. 9 The process shown is described in detail, and the motor control method may specifically include the following steps:
[0074] Step S210: obtaining a target direction for driving the motor to rotate, and obtaining a preset rotation direction of the motor.
[0075] For the specific description of step S210, please refer to the specific description of step S110 above, which will not be repeated here.
[0076] Step S220: If it is determined based on the relationship that the target direction is the same as the preset rotation direction, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0077] In some embodiments, after the electronic device obtains the target direction of the driving motor and the preset rotation direction of the motor, the target direction can be compared with the preset rotation direction to obtain the relationship between the target direction and the preset rotation direction. If the electronic device determines that the target direction is the same as the preset rotation direction based on the relationship, the motor drive unit can be controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0078] Wherein, the process in which the electronic device controls the motor drive unit to perform phase switching processing on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction may include obtaining the first initial position of the rotor of the motor, and determining the first magnetic field direction of the stator of the motor according to the first initial position and the preset rotation direction. Wherein, the electronic device may control the motor drive unit to energize the motor based on the first magnetic field direction to drive the rotor of the motor to rotate to an intermediate position based on the target direction. Wherein, the magnetic field direction of the rotor at the intermediate position coincides with the first magnetic field direction. Wherein, the electronic device may control the motor drive unit to energize the motor based on the second magnetic field direction when the rotor of the motor is in the intermediate position to drive the rotor of the motor to rotate based on the target direction; wherein, the second magnetic field direction may be opposite to the first magnetic field direction.
[0079] In order to avoid the problem of starting dead point of single-phase motor, the stator core of the motor can be designed with unequal air gap. For example, taking the rotor of a 1-pole motor as an example, the rotor has only two initial positions under the influence of the cogging torque in the stationary state. The electronic device can obtain the first initial position of the rotor of the motor by pulse positioning as the first initial position, or by rotor pre-positioning as the first initial position.
[0080] For example, please refer to Figure 4 and Fig.10 , Fig.10 A schematic diagram of controlling the position of the rotor of a motor provided by an embodiment of the present application is shown. The electronic device can obtain the target direction of the rotation of the driving motor as counterclockwise, and the electronic device can obtain the position of the rotor of the motor in the initial state as position 1 as the first initial position based on pulse positioning. The electronic device can determine the preset rotation direction of the motor as counterclockwise based on the first initial position.
[0081] Among them, the electronic device can determine that the target direction is the same as the preset rotation direction based on the relationship between the target direction and the preset rotation direction, and then control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction. Among them, the electronic device can control the motor drive unit to energize the motor based on the first magnetic field direction, that is, turn on MOS2 and MOS3 in the inverter circuit, control the motor current flow direction to V->U, so that the magnetic field direction of the motor coil (stator) is downward after power is turned on, and then control the motor rotor to rotate counterclockwise to the middle position where the magnetic field direction coincides with the magnetic field direction of the stator coil.
[0082] Among them, the electronic device can energize the motor based on the second magnetic field direction opposite to the first magnetic field direction when the rotor of the motor is in the middle position, that is, turn on MOS1 and MOS4 in the inverter circuit, control the motor current flow direction to U->V, so that the magnetic field direction of the coil (stator) of the motor is upward after power is turned on, wherein, in the middle position, the rotor will continue to rotate counterclockwise due to inertia and pass through the center line of the stator magnetic field, and then continue to rotate counterclockwise due to the upward stator magnetic field force.
[0083] Correspondingly, when the target direction is the same as the preset rotation direction obtained during the motor design phase, the electronic device can control the motor drive unit to perform phase switching on the motor based on the preset rotation direction and the position of the rotor, thereby improving the reliability of motor control.
[0084] Compared with the motor control method provided in one embodiment of the present application, Figure 8 The motor control method shown in this embodiment can also control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction if it is determined based on the relationship between the target direction and the preset rotation direction that the target direction is the same as the preset rotation direction, thereby controlling the motor to rotate based on the preset rotation direction of the motor, thereby improving the reliability of controlling the motor.
[0085] See also Fig.11 , Fig.11 The flow chart of the motor control method provided by an embodiment of the present application is shown. The method is applied to the electronic device including the motor control device. Fig.11 The process shown is described in detail, and the motor control method may specifically include the following steps:
[0086] Step S310: obtaining a target direction for driving the motor to rotate, and obtaining a preset rotation direction of the motor.
[0087] For the specific description of step S310, please refer to the specific description of step S110 above, which will not be repeated here.
[0088] Step S320: If it is determined based on the relationship that the target direction is opposite to the preset rotation direction, then the motor drive unit is controlled to drive the motor to rotate a preset angle based on the preset rotation direction, and then the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0089] In some embodiments, after the electronic device obtains the target direction of the driving motor and the preset rotation direction of the motor, the target direction can be compared with the preset rotation direction to obtain the relationship between the target direction and the preset rotation direction. If the electronic device determines that the target direction is opposite to the preset rotation direction based on the relationship, the motor drive unit can be controlled to drive the motor to rotate a preset angle based on the preset rotation direction, and then the motor drive unit can be controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0090] Among them, after the electronic device controls the motor drive unit to drive the motor to rotate a preset angle based on a preset rotation direction, the process of controlling the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in a target direction may include controlling the motor drive unit to drive the motor to rotate based on the preset rotation direction, and obtaining the direction deflection angle of the rotor of the motor; if the difference between the direction deflection angle and the preset angle is less than a deviation threshold, controlling the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0091] The preset angle and the deviation threshold may be pre-set in the electronic device, and the electronic device may also obtain the preset angle and the deviation threshold from an associated cloud or electronic device through wireless communication technology.
[0092] As an implementable manner, the electronic device may include a position sensor, and the electronic device may determine the position of the rotor based on the signal fed back by the position sensor, and determine the direction deflection angle of the motor drive unit driving the motor to rotate based on the preset rotation direction based on the position of the rotor.
[0093] In some embodiments, the electronic device can control the motor drive unit to drive the motor to rotate based on the preset rotation direction, and control the motor drive unit to perform phase switching processing on the magnetic field of the stator of the motor after the motor rotates for a preset drag time to drive the motor to rotate in the target direction. The preset drag time can be pre-set in the electronic device, or the electronic device can obtain it from an associated cloud or electronic device through a wireless communication interface, or the electronic device can obtain it from an associated electronic device through a serial communication interface (e.g., a serial peripheral port).
[0094] The electronic device may include a position sensor, and the electronic device may determine the duration for which the motor drive unit drives the motor to rotate based on the preset rotation direction according to a signal fed back by the position sensor.
[0095] As an implementable method, the electronic device can control the motor drive unit to drive the motor to rotate based on the preset rotation direction based on the current of the preset duty cycle, and control the motor drive unit to perform phase switching processing on the magnetic field of the stator of the motor after the motor rotates for a preset drag time to drive the motor to rotate in the target direction. Among them, the preset duty cycle and the preset drag time can be pre-set in the electronic device, can be set by the user, or can be obtained through third-party experimental data. Exemplarily, the electronic device can determine the preset duty cycle and the preset drag time based on the bus voltage and motor resistance value of the input motor sampled by the voltage sampling circuit.
[0096] Among them, the process of the electronic device controlling the motor drive unit to drive the motor to rotate based on a preset rotation direction may include obtaining a second initial position of the motor's rotor; determining a third magnetic field direction of the stator based on the second initial position and the preset rotation direction; and controlling the motor drive unit to energize the motor based on the third magnetic field direction to drive the motor's rotor to rotate based on the preset direction.
[0097] Wherein, the electronic device can obtain the position of the rotor when starting the motor as the second initial position based on the pulse positioning method, and can also determine the third magnetic field direction of the stator according to the second initial position and the preset rotation direction. Wherein, the electronic device can start the motor based on the preset rotation direction at the second initial position, and the electronic device can determine the third magnetic field direction of the stator according to the second initial position and the preset rotation direction, which can also be understood as the electronic device can determine the current direction of the motor according to the second initial position and the preset rotation direction.
[0098] It is understandable that the preset rotation direction of the motor can be determined when the motor is designed, and can be understood as the main direction when the motor is started. In the process of controlling the motor to rotate in a target direction opposite to the preset rotation direction, the electronic device can control the motor direction to rotate by a preset angle based on the preset rotation direction, and then switch the rotation direction of the motor to the target direction based on the phase change processing of the magnetic field of the stator of the motor, thereby driving the motor to rotate in the target direction.
[0099] For example, please refer to Figure 4 and Fig.12 , Fig.12 A schematic diagram of controlling the position of the rotor of a motor provided by an embodiment of the present application is shown. The electronic device can obtain the target direction of the rotation of the driving motor as a clockwise direction, and the electronic device can obtain the position of the rotor of the motor in the initial state as position 1 as the second initial position based on pulse positioning. The electronic device can determine the preset rotation direction of the motor as a counterclockwise direction based on the second initial position.
[0100] Among them, the electronic device can determine that the target direction is opposite to the preset rotation direction based on the relationship between the target direction and the preset rotation direction, and then control the motor drive unit to drive the motor to rotate a preset angle based on the preset rotation direction, and then control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0101] Among them, the electronic device can determine the third magnetic field direction of the stator according to the second initial position and the preset rotation direction, and control the motor drive unit to power on the motor based on the third magnetic field direction, that is, turn on MOS2 and MOS3 in the inverter circuit, control the motor current flow direction to V->U, so that the magnetic field direction of the coil (stator) of the motor is downward after power-on, and then control the motor's rotor to rotate counterclockwise at a preset angle.
[0102] Among them, the electronic device can control the motor rotor to rotate counterclockwise by a preset angle, and then control the motor drive unit to perform phase switching on the magnetic field of the motor stator, that is, turn on MOS1 and MOS4 in the inverter circuit, control the motor current flow direction to U->V, so that the magnetic field direction of the motor coil (stator) is upward after power is turned on. Among them, the rotor will continue to rotate counterclockwise through the center line of the stator magnetic field under the action of inertia, and then rotate clockwise under the action of the upward stator magnetic field force.
[0103] Among them, it can be understood that when the electronic device controls the motor to rotate clockwise, if the stator magnetic field is directly controlled to be upward, the rotor of the motor can rotate clockwise at a very small angle. When the stator magnetic field of the motor is commutated, the rotor is affected by the cogging torque and may deviate counterclockwise by an angle, causing the rotor to rotate in the opposite direction or lose step and cannot start. In this embodiment, the electronic device can control the motor to rotate counterclockwise at a preset angle, and then commutate the stator magnetic field of the motor to rotate the motor in the target direction, thereby improving the reliability of the electronic device for reverse starting of the motor.
[0104] Correspondingly, when the target direction is opposite to the preset rotation direction obtained during the motor design phase, the electronic device can reversely drag the rotor to rotate by a preset angle based on the preset rotation direction, and then perform stator magnetic field commutation operation on the motor in the target direction to control the motor to rotate in the target direction. Among them, the electronic device can use the inertia of the rotor rotation to deviate from the center line of the stator magnetic field, and then switch the direction of the motor rotation to the target direction and the position of the rotor to control the motor drive unit to perform commutation processing on the motor, effectively avoiding the problem of rotor loss of step when controlling the motor rotation direction, and improving the reliability of the electronic device's control of the motor.
[0105] Compared with the motor control method provided in one embodiment of the present application, Fig. 9The motor control method shown in this embodiment can also control the motor drive unit to drive the motor to rotate a preset angle based on the preset rotation direction if it is determined that the target direction is opposite to the preset rotation direction based on the relationship between the target direction and the preset rotation direction. Then, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, thereby improving the reliability of motor control.
[0106] See also Fig.13 , Fig.13 The flow chart of the motor control method provided by an embodiment of the present application is shown in FIG. The method is applied to the electronic device including the motor control device. Fig.13 The process shown is described in detail, and the motor control method may specifically include the following steps:
[0107] Step S410: receiving a control instruction for driving the motor to operate, wherein the control instruction carries the target direction.
[0108] In some embodiments, the electronic device may receive a control instruction instructing the drive motor to operate, wherein the control instruction may carry a target direction, wherein the target direction may include a counterclockwise direction or a clockwise direction.
[0109] After receiving the control instruction instructing the drive motor to work, the electronic device can determine that the rotation direction of the motor needs to be controlled. Accordingly, the electronic device can perform subsequent operations to control the rotation direction of the motor based on the control instruction.
[0110] Step S420: parsing the control instruction to obtain a target direction for driving the motor to rotate.
[0111] In some embodiments, after receiving the control instruction, the electronic device may parse the control instruction to obtain the target direction of the drive motor. Exemplarily, the control instruction may include a parameter indicating the target direction, wherein the electronic device may decode the control instruction after receiving the control instruction to obtain the parameter indicating the target direction, and determine the target direction of the drive motor according to the parameter.
[0112] Step S430: determining the preset rotation direction according to the cogging torque of the motor.
[0113] In some embodiments, the electronic device can determine the preset rotation direction of the motor based on the cogging torque of the motor. Figure 1, wherein the stator core of the motor is designed with unequal air gaps, wherein the initial position of the motor includes position one or position two. When the initial position of the motor is position one, the electronic device can determine that the preset rotation direction of the motor is counterclockwise based on the cogging torque of the motor.
[0114] Step S440: According to the relationship between the target direction and the preset rotation direction, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
[0115] For the specific description of step S440, please refer to the specific description of step S120 above, which will not be repeated here.
[0116] Compared with the motor control method provided in one embodiment of the present application, Fig. 9 The motor control method shown in the embodiment can also receive a control instruction instructing the drive motor to work, wherein the control instruction carries a target direction; parse the control instruction to obtain the target direction of rotation of the drive motor, determine the preset rotation direction according to the tooth torque of the motor, and then control the motor to rotate in the target direction according to the relationship between the target direction and the preset rotation direction, thereby improving the reliability of motor control.
[0117] See also Fig.14 , Fig.14 The module block diagram of the motor control device provided by an embodiment of the present application is shown. The motor control device 200 is applied to the electronic device provided by an embodiment of the present application. Fig.14 The process shown in the figure is described in detail, the motor control device 200 includes: a target direction acquisition module 210 and a motor rotation direction control module 220, wherein:
[0118] The target direction acquisition module 210 is used to acquire a target direction for driving the motor to rotate, and to acquire a preset rotation direction of the motor.
[0119] The motor rotation direction control module 220 is used to control the motor drive unit to perform phase switching processing on the magnetic field of the stator of the motor according to the relationship between the target direction and the preset rotation direction, so as to drive the motor to rotate in the target direction.
[0120] Further, the motor rotation direction control module 220 may include: a motor rotation direction control first unit or a motor rotation direction control second unit, wherein:
[0121] The first motor rotation direction control unit is used to control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction if it is determined based on the relationship that the target direction is the same as the preset rotation direction.
[0122] The second motor rotation direction control unit is used to control the motor drive unit to drive the motor to rotate a preset angle based on the preset rotation direction if it is determined based on the relationship that the target direction is opposite to the preset rotation direction, and then control the motor drive unit to drive the motor to rotate a preset angle based on the preset rotation direction.
[0123] Further, the motor rotation direction control first unit may include: a first initial position acquisition unit, a first magnetic field direction determination unit, a rotation to an intermediate position unit and a target direction rotation first unit, wherein:
[0124] The first initial position acquisition unit is used to acquire a first initial position of the rotor of the motor.
[0125] The first magnetic field direction determining unit is used to determine the first magnetic field direction of the stator according to the first initial position and the preset rotation direction.
[0126] The rotation to intermediate position unit is used to control the motor drive unit to energize the motor based on the first magnetic field direction, so as to drive the rotor of the motor to rotate to the intermediate position based on the target direction, wherein the magnetic field direction of the rotor at the intermediate position coincides with the first magnetic field direction.
[0127] The target direction rotating first unit is used to control the motor drive unit to energize the motor based on a second magnetic field direction in the middle position to drive the rotor of the motor to rotate based on the target direction, wherein the second magnetic field direction is opposite to the first magnetic field direction.
[0128] Further, the first initial position acquisition unit may include: a first positioning unit or a second positioning unit, wherein:
[0129] The first positioning unit is used to obtain the first initial position by pulse positioning.
[0130] The second positioning unit is used to obtain the first initial position by pre-positioning the rotor.
[0131] Further, the motor rotation direction control second unit may include: a direction deflection angle acquisition unit and a target direction rotation second unit, wherein:
[0132] The direction deflection angle acquisition unit is used to control the motor drive unit to drive the motor to rotate based on the preset rotation direction and acquire the direction deflection angle of the rotor of the motor.
[0133] The second target direction rotation unit is used to control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction if the difference between the direction deflection angle and the preset angle is less than a deviation threshold.
[0134] Further, the direction deflection angle acquisition unit may include: a second initial position acquisition unit, a third magnetic field direction determination unit and a preset direction rotation unit, wherein:
[0135] The second initial position acquisition unit is used to acquire a second initial position of the rotor of the motor.
[0136] The third magnetic field direction determining unit is used to determine the third magnetic field direction of the stator according to the second initial position and the preset rotation direction.
[0137] The preset direction rotation unit is used to control the motor drive unit to energize the motor based on the third magnetic field direction, so as to drive the rotor of the motor to rotate based on the preset direction.
[0138] Furthermore, the target direction acquisition module 210 may include: a control instruction receiving unit and a target direction acquisition subunit, wherein:
[0139] A control instruction receiving unit is used to receive a control instruction instructing to drive the motor to work, wherein the control instruction carries the target direction.
[0140] The target direction acquisition subunit is used to parse the control instruction to acquire the target direction for driving the motor to rotate.
[0141] Furthermore, the target direction acquisition module 210 may include: a preset rotation direction acquisition unit, wherein:
[0142] The preset rotation direction obtaining unit is used to determine the preset rotation direction according to the cogging torque of the motor.
[0143] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0144] In several embodiments provided in the present application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0145] In addition, each functional module in each embodiment of the present application can be integrated into a processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software functional modules.
[0146] See also Fig.15 , which shows a structural block diagram of an electronic device provided in an embodiment of the present application. The electronic device 100 may be an electronic device such as an exhaust fan, a washing machine, a hair dryer, etc. that can run an application. The electronic device 100 in the present application may include: a motor 110, a processor 120, a memory 130, and one or more applications. Among them, one or more applications may be stored in the memory 130 and configured to be executed by one or more processors 120, and one or more programs are configured to execute the method described in the aforementioned method embodiment.
[0147] The processor 120 may include one or more processing cores. The processor 120 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 130, and calling data stored in the memory 130. Optionally, the processor 120 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 120 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing the content to be displayed; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 120, but may be implemented separately through a communication chip.
[0148] In some embodiments, the processor 120 may include a main control chip 102, which can obtain the target direction of the driving motor 110 and the preset rotation direction of the motor 110; according to the relationship between the target direction and the preset rotation direction, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor 110 to drive the motor 110 to rotate in the target direction.
[0149] The memory 130 may include a random access memory (RAM) or a read-only memory (ROM). The memory 130 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 130 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as audio data, temperature data, time data) created by the electronic device 100 during use.
[0150] See also Fig.16 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 300 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0151] The computer readable storage medium 300 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer readable storage medium 300 has storage space for program code 310 that performs any method steps in the above method. These program codes can be read from or written to one or more computer program products. The program code 310 can be compressed, for example, in an appropriate form.
[0152] In summary, the motor control device, motor control method, device and electronic device provided in the embodiments of the present application obtain the target direction of the rotation of the driving motor and the preset rotation direction of the motor; according to the relationship between the target direction and the preset rotation direction, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, and then the current phase switching of the motor is controlled according to the relationship between the target direction and the preset rotation direction of the motor, thereby effectively avoiding the rotor of the motor from losing step during the control of the motor rotation and improving the reliability of the electronic device in controlling the motor.
[0153] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A motor control device, characterized in that: The motor control device comprises: A motor drive unit, the motor drive unit is used to connect to the motor and drive the motor to rotate; A main control chip, wherein the main control chip is connected to the motor drive unit, and is used to obtain a target direction for driving the motor to rotate and a preset rotation direction of the motor, and, based on a relationship between the target direction and the preset rotation direction, control the motor drive unit to perform phase switching on the magnetic field of the stator of the motor, so as to drive the motor to rotate in the target direction.
2. A motor control method, characterized in that: Applied to the motor control device according to claim 1, the method comprises: Acquiring a target direction for driving the motor to rotate, and acquiring a preset rotation direction of the motor; According to the relationship between the target direction and the preset rotation direction, the motor drive unit is controlled to perform phase switching processing on the magnetic field of the stator of the motor, so as to drive the motor to rotate in the target direction.
3. The method according to claim 2, characterized in that According to the relationship between the target direction and the preset rotation direction, controlling the motor drive unit to perform phase switching processing on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction includes: If it is determined based on the relationship that the target direction is the same as the preset rotation direction, controlling the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction; or If it is determined based on the relationship that the target direction is opposite to the preset rotation direction, the motor drive unit is controlled to drive the motor to rotate a preset angle based on the preset rotation direction, and then the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
4. The method according to claim 3, characterized in that The controlling the motor drive unit to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction includes: Acquiring a first initial position of a rotor of the motor; Determining a first magnetic field direction of the stator according to the first initial position and the preset rotation direction; Controlling the motor drive unit to energize the motor based on the first magnetic field direction to drive the rotor of the motor to rotate to an intermediate position based on the target direction, wherein the magnetic field direction of the rotor at the intermediate position coincides with the first magnetic field direction; In the case of the intermediate position, the motor drive unit is controlled to energize the motor based on a second magnetic field direction to drive the rotor of the motor to rotate based on the target direction, wherein the second magnetic field direction is opposite to the first magnetic field direction.
5. The method according to claim 4, characterized in that The step of obtaining a first initial position of a rotor of the motor comprises: Acquire the first initial position by pulse positioning; or The first initial position is obtained by means of rotor pre-positioning.
6. The method according to claim 3, characterized in that After the motor drive unit is controlled to drive the motor to rotate by a preset angle based on the preset rotation direction, the motor drive unit is controlled to perform phase switching processing on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction, including: Controlling the motor drive unit to drive the motor to rotate based on the preset rotation direction, and obtaining a direction deflection angle of the rotor of the motor; If the difference between the direction deflection angle and the preset angle is smaller than a deviation threshold, the motor drive unit is controlled to perform phase switching on the magnetic field of the stator of the motor to drive the motor to rotate in the target direction.
7. The method according to claim 6, characterized in that The controlling the motor driving unit to drive the motor to rotate based on the preset rotation direction includes: Acquiring a second initial position of a rotor of the motor; determining a third magnetic field direction of the stator according to the second initial position and the preset rotation direction; The motor driving unit is controlled to energize the motor based on the third magnetic field direction, so as to drive the rotor of the motor to rotate based on the preset direction.
8. The method according to any one of claims 2 to 7, characterized in that: The obtaining of a target direction for driving the motor to rotate comprises: receiving a control instruction for driving the motor to work, wherein the control instruction carries the target direction; The control instruction is parsed to obtain a target direction for driving the motor to rotate.
9. The method according to any one of claims 2 to 7, characterized in that: The obtaining of the preset rotation direction of the motor includes: The preset rotation direction is determined according to the cogging torque of the motor.
10. A motor control device, characterized in that: Applied to the motor control device according to claim 1, the device comprising: A target direction acquisition module, used to acquire a target direction for driving the motor to rotate, and to acquire a preset rotation direction of the motor; The motor rotation direction control module is used to control the motor drive unit to perform phase switching processing on the magnetic field of the stator of the motor according to the relationship between the target direction and the preset rotation direction, so as to drive the motor to rotate in the target direction.
11. An electronic device, characterized in that: include: Motor; one or more processors; Memory; One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 2 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 2 to 9.
