Motor driving method, motor driving system, electronic device and storage medium
By setting the motor phase to a preset fixed value as a deceleration damping, the problem of the motor drive system taking a long time and poor stability during deceleration is solved, and a fast and stable deceleration effect is achieved.
Patent Information
- Application Number
- CN202411262963.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-10
AI Technical Summary
The existing motor drive system takes a long time to slow down in high-speed operation, and direct emergency braking may cause unstable device operation and affect efficiency.
By setting at least one of the several driving motors of the driven device as a passive motor, its phase is set to a preset fixed phase value as a deceleration damping of other motors, accelerated deceleration and improved stability.
The deceleration time is effectively shortened, the stability of the deceleration process is improved, and the driven device can quickly and stably reach the target speed or stop position.
Smart Images

Figure CN118783818B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of motor control technology, and in particular to a motor driving method, a motor driving system, an electronic device and a storage medium. Background Art
[0002] In the current motor drive system, when the driven device needs to smoothly transition from a high-speed operation state to a stop or a lower speed, the traditional motor deceleration method often takes a long time and affects the overall efficiency; if emergency braking is used directly to decelerate, the inertia force generated during the braking process can easily lead to unstable operation of the device. Therefore, innovative motor drive strategies are urgently needed to ensure the stability of the device operation while significantly improving the deceleration efficiency. Summary of the invention
[0003] The main technical problem solved by the present application is to provide a motor driving method, a motor driving system, an electronic device and a storage medium, which can accelerate the deceleration of the driven device while improving the stability of the deceleration process.
[0004] In order to solve the above technical problems, a technical solution adopted in the present application is: to provide a motor driving method, the method comprising: in response to receiving a deceleration instruction, obtaining the current running speed of the driven device as the initial speed; in response to the initial speed satisfying a preset speed condition, using at least one motor among a plurality of driving motors driving the driven device to run as a passive motor, and setting the phase of the passive motor to a preset fixed phase value as a deceleration damping for the other plurality of driving motors, so as to decelerate the driven device to a target speed specified by the deceleration instruction, wherein the target speed is lower than the initial speed; wherein the plurality of driving motors coaxially drive the driven device.
[0005] The phase of the passive motor is set to a preset fixed phase value to serve as a deceleration damping for the other drive motors, including: after setting the control current of the passive motor to 0, switching the phase control of the passive motor from synchronous control with the other drive motors to independent control, and setting the phase of the passive motor to a preset fixed phase value.
[0006] Wherein, the preset speed condition includes a preset speed range. In response to the initial speed not satisfying the preset speed range, the method further includes: in response to the initial speed of the driven device being greater than the upper limit of the preset speed range, performing in-phase deceleration control on a plurality of drive motors until the running speed of the driven device satisfies the preset speed range, using at least one of the plurality of drive motors driving the driven device to run as a passive motor, setting the phase of the passive motor to a preset fixed phase value as a deceleration damping of the other plurality of drive motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction; or, in response to the initial speed of the driven device being less than the lower limit of the preset speed range, performing in-phase deceleration control on a plurality of drive motors until the running speed of the driven device satisfies the target speed.
[0007] The deceleration instruction includes a stop point instruction; wherein the stop point instruction is used to instruct the driven device to a target position when the driven device decelerates to a stop.
[0008] Wherein, in response to the deceleration instruction including the stop point instruction, the phase of the passive motor is set to a preset fixed phase value as the deceleration damping of the other several drive motors so that the driven device is decelerated to the target speed specified by the deceleration instruction, including: setting the phase of the passive motor to a preset fixed phase value as the deceleration damping of the other several drive motors so that the driven device is decelerated to 0; obtaining the stroke between the position of the driven device when the driven device is decelerated to 0 and the target position; after setting the phase of the passive motor to a preset fixed phase value as the deceleration damping of the other several drive motors so that the driven device is decelerated to 0, switching the phase control of the passive motor from individual control to synchronous control with the several drive motors so as to move the driven device to the target position.
[0009] In order to solve the above technical problems, another technical solution adopted in the present application is: to provide a motor drive system, which includes a processing module and a motor phase control module; the processing module is used to: output a first phase control signal to control the operation of several drive motors; specify a target speed for deceleration of the driven device, and in response to the running speed of the driven device meeting a preset speed condition, send a first phase switching signal to the motor phase control module; the motor phase control module is connected to the processing module and several drive motors, and the motor phase control module is used to: in response to receiving the first phase switching signal, use at least one motor among the several drive motors as a passive motor, switch the first phase control signal received by the passive motor to a preset fixed phase, so that the passive motor acts as a deceleration damping for the other several drive motors, so as to decelerate the driven device to the target speed; wherein, the several drive motors coaxially drive the driven device.
[0010] Among them, the processing module is also used to specify the target position at which the driven device stops running; in response to the passive motor acting as a deceleration damping for several other driving motors to decelerate the driven device to 0, a second phase switching signal is sent to the motor phase control module, and the output first phase control signal is switched to a third phase control signal; the motor phase control module is also used to: in response to receiving the second phase switching signal, switch a preset fixed phase received by the passive motor to a third phase control signal; wherein the third phase control signal is used to control the driven device to move toward the target position, and the travel between the position where the driven device is when it decelerates to 0 and the target position.
[0011] Among them, several driving motors include a first two-phase four-wire stepper motor and a second two-phase four-wire stepper motor, and the motor phase control module includes a single-pole double-throw analog switch; wherein the first phase control interface of the first two-phase four-wire stepper motor is connected to the common end of the first switch of the single-pole double-throw analog switch, and the second phase control interface of the first two-phase four-wire stepper motor is connected to the common end of the second switch of the single-pole double-throw analog switch; the normally open end of the first switch is connected to the first phase control interface of the second two-phase four-wire stepper motor, and the normally open end of the second switch is connected to the second phase control interface of the second two-phase four-wire stepper motor; the normally closed ends of the first switch and the second switch are respectively connected to the signal output end of the preset fixed phase; wherein the second two-phase four-wire stepper motor is a passive motor.
[0012] To solve the above technical problems, another technical solution adopted in the present application is: to provide an electronic device, which includes a communication circuit, a memory and a processor, the communication circuit and the memory are respectively coupled to the processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement any of the above motor driving methods.
[0013] In order to solve the above technical problems, another technical solution adopted by the present application is: providing a storage medium on which a computer program is stored, and the program is processed and executed to implement any of the above motor driving methods.
[0014] The beneficial effect of the present application is that, different from the prior art, when the driven device needs to decelerate, the present application sets the phase of one of the several driving motors used to coaxially drive the driven device to a preset fixed value, so that the motor is in a fixed holding torque state, so as to be used as an auxiliary deceleration damping for the driven device, thereby accelerating the deceleration of the driven device and improving the stability of the deceleration process by adding resistance to deceleration. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 is a flow chart of an embodiment of a motor driving method of the present application;
[0016] Figure 2is a schematic diagram of a motor driving structure of an embodiment of a motor driving method of the present application;
[0017] Figure 3 It is a schematic diagram of acceleration and deceleration curves of dual motor drive and single motor drive of the present application;
[0018] Figure 4 is a schematic diagram of a driving curve of an embodiment of a motor driving method of the present application;
[0019] Figure 5 It is a structural schematic diagram of an embodiment of the motor drive system of the present application;
[0020] Figure 6 It is a schematic diagram of the framework of an embodiment of the motor drive device of the present application;
[0021] Figure 7 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application;
[0022] Figure 8 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION
[0023] In order to make the purpose, technical solution and effect of the present application clearer and more specific, the present application is further described in detail below with reference to the accompanying drawings and examples.
[0024] It should be understood that the reference to "embodiment" in this application means that the specific features, structures or characteristics described in conjunction with the embodiment may be included in at least one embodiment of the present application. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.
[0026] In the description of the embodiments of the present application, technical terms such as “first”, “second”, etc. are only used to distinguish different objects and cannot be understood as indicating or implying relative importance or implicitly indicating the quantity, specific order or primary and secondary relationship of the indicated technical features.
[0027] The preset point speed of large devices such as pan / tilts and ball cameras refers to the speed at which the pan / tilt or ball camera moves from one preset point to another. In the process of driving the pan / tilt or ball camera from one preset point to another, the driving motor needs to undergo at least the process of acceleration and deceleration, and the pan / tilt or ball camera needs to be accurately stopped at the next preset point. In the prior art, a common method is to increase the output torque of the motor by simply increasing the motor specifications, thereby increasing the preset point speed of the driven device. This practice not only leads to an increase in the overall cost of the device, but also inevitably leads to unlimited expansion of the device volume. Compared with the single motor drive method, the multi-motor coaxial drive can effectively increase the preset point speed of the driven device. However, the multi-motor coaxial drive requires the precise synchronization of the operation of multiple motors. Once the drive is not synchronized, it may cause the driven device to shake, thereby affecting the operating stability of the driven device. In addition, whether it is a single motor drive or a multi-motor coaxial drive, there is a problem that it takes a long time to quickly and stably decelerate from a high-speed running state and stop at a predetermined target position. This technical bottleneck limits the application efficiency of the driven device in scenarios that require fast response and high-precision positioning.
[0028] This application provides a motor driving method, see Figure 1 , Figure 1 1 is a flow chart of an embodiment of a motor driving method of the present application. The method comprises the following steps:
[0029] Step S11: In response to receiving a deceleration instruction, the current running speed of the driven device is acquired as an initial speed.
[0030] Specifically, the driven device is a device driven by a motor, and the driven device of the present application may be a pan / tilt head, a ball camera, etc. The driven device may receive external control signals through a control system, and convert these signals into instructions that can be recognized by the motor, thereby realizing control of the rotation direction and speed of the driven device. In some application scenarios, the deceleration instruction may include instructing the driven device to decelerate to a speed lower than the current operating speed of the driven device. In some application scenarios, the deceleration instruction may include instructing the driven device to decelerate to a stop. In some application scenarios, the deceleration instruction includes a stop point instruction, wherein the stop point instruction is used to indicate the target position of the driven device when the driven device decelerates to a stop. The initial speed of the current driven device is obtained as a reference for subsequent adjustment of the operating speed of the driven device.
[0031] Step S12: In response to the initial speed satisfying the preset speed condition, at least one of the several driving motors driving the driven device is used as a passive motor, and the phase of the passive motor is set to a preset fixed phase value as a deceleration damping for the other several driving motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction, wherein the target speed is lower than the initial speed.
[0032] Specifically, several drive motors coaxially drive the driven device. In some embodiments, the several drive motors can be two or more motors of the same specification, or several motors of different specifications. The several drive motors share the load to disperse the pressure of a single motor, reduce the failure rate, and improve the stability and reliability of the operation of the driven device. The coaxial drive of the driven device by the several drive motors can be specifically driven by synchronous belts, gears, etc. In a specific embodiment, the several drive motors are dual motors, see Figure 2 , Figure 2 1 is a schematic diagram of the motor drive structure of an embodiment of the motor drive method of the present application. The plurality of drive motors include a first motor 21 and a second motor 22. The output shafts of the first motor 21 and the second motor 22 are respectively connected to the pulley 23 of the driven device through a synchronous belt to achieve coaxial drive of the first motor 21 and the second motor 22. Figure 3 , Figure 3 It is a schematic diagram of the acceleration and deceleration curves of the dual motor drive and the single motor drive of the present application. Among them, the first curve 31 is the acceleration and deceleration curve of the first motor 21 and the second motor 22 driving the pulley 23 in a dual motor coaxial drive mode, and the second curve 32 is the acceleration and deceleration curve of the first motor 21 driving the pulley 23 alone under the same driving conditions as the first curve 31. It can be seen from the first curve 31 and the second curve 32 that the coaxial drive of the first motor 21 and the second motor 22 can achieve faster acceleration and deceleration than the single motor drive, that is, it can achieve fast start and fast stop, and can shorten the time from the same speed to the target speed.
[0033] In some embodiments, the operation mode of the driven device may be rotation, and obtaining the current operation speed of the driven device may be obtaining the current rotation speed of the driven device. It is understandable that in the case of coaxial drive, the rotation speed of the driving motor is the same as the rotation speed of the driven device. The current rotation speed of each driving motor is the current rotation speed of the driven device. Specifically, one or more of the driving motors that drive the driven device to operate may be used as passive motors, and at least one motor is retained as an active motor in addition to the passive motors. In some application scenarios, the preset speed condition may be that the speed at which all active motors can drive all passive motors placed in a fixed phase and the driven device to operate stably satisfies a preset speed range. For example, the maximum rotation speed at which all active motors can drive all passive motors placed in a fixed phase and the driven device to operate is used as the upper limit of the preset speed range, and the speed value that is a certain percentage lower than the upper limit of the preset speed range is used as the lower limit of the preset speed range. In some application scenarios, the preset speed condition may also be a preset speed threshold, which may be a speed value at which all active motors can drive all passive motors placed in fixed phases and the driven device to operate stably. For example, the preset speed threshold may be set to the maximum speed at which all active motors can drive all passive motors placed in fixed phases and the driven device to operate stably. The corresponding preset speed condition is set according to the parameters of each passive motor and the active motor, so that during deceleration, the passive motor will be driven to rotate by the active motor, and the passive motor acts as a damper to accelerate the deceleration of the driven device while improving the stability of the deceleration process.
[0034] In some embodiments, the phase of the passive motor is set to a preset fixed phase value as a deceleration damping of the other plurality of drive motors, including: after the control current of the passive motor is set to 0, the phase control of the passive motor is switched from synchronous control with the other plurality of drive motors to separate control, and the phase of the passive motor is set to a preset fixed phase value. In some specific embodiments, the plurality of drive motors may include a two-phase four-wire stepper motor, for example, a two-phase four-wire hybrid stepper motor, a two-phase four-wire permanent magnet stepper motor, a full stepper motor, a half stepper motor, etc. The control current of the passive motor can be set to 0 by stopping the output of the PWM signal to the passive motor, and then the phase control of the passive motor is switched to separate control, and the preset fixed phase of the passive motor is set according to the required damping size, and a preset control current is applied to the passive motor, and the preset control current can be less than the control current of the active motor, so that the active motor can drive the passive motor to decelerate smoothly to the target speed specified by the deceleration instruction. Specifically, the deceleration curve of the motor can be obtained by combining the parameters of several current driving motors and the driven device with a preset fixed phase and a preset control current, and the driven device can be decelerated according to the motor deceleration curve to obtain the time required for the driven device to decelerate to the target speed, thereby achieving precise control of the driven device.
[0035] In some application scenarios, it is necessary to stop the driven device at a target position, and the deceleration instruction may include a stop point instruction. In some embodiments, in response to the deceleration instruction including the stop point instruction, the phase of the passive motor is set to a preset fixed phase value as the deceleration damping of the other several driving motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction, including: setting the phase of the passive motor to a preset fixed phase value as the deceleration damping of the other several driving motors, so that the driven device is decelerated to 0. During the period when the driven device is decelerated to 0, the stroke between the position of the driven device when the driven device is decelerated to 0 and the target position is obtained. After the phase of the passive motor is set to a preset fixed phase value as the deceleration damping of the other several driving motors, so that the driven device is decelerated to 0, the passive motor phase control is switched from single control to synchronous control with the several driving motors, so that the driven device moves the stroke to the target position. The speed of the driven device is quickly reduced to 0 by adding damping deceleration, and then the driven device is driven to the target position by a multi-motor synchronous drive method, so that the driven device stops at the target position efficiently and accurately.
[0036] In some application scenarios, when a deceleration instruction is received, the initial speed of the driven device may be greater than the preset speed range, and the driven device needs to be decelerated to the preset speed range before adding damping to decelerate. In some embodiments, before executing step S12, it also includes: in response to the initial speed of the driven device being greater than the upper limit of the preset speed range, a plurality of drive motors are subjected to same-phase deceleration control until the running speed of the driven device meets the preset speed range, at least one of the plurality of drive motors driving the driven device to run is used as a passive motor, and the phase of the passive motor is set to a preset fixed phase value as the deceleration damping of the other plurality of drive motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction. In a specific embodiment, the preset speed range is Va-Vb, where Va>Vb. In response to receiving a deceleration instruction, the initial speed of the current driven device is obtained as Vc, and Vc is greater than Va. Several driving motors of the driven device are decelerated in the same phase until Vc satisfies Va-Vb. It can be understood that when Vc is equal to Va, the running speed of the driven device satisfies the preset speed condition. In response to the running speed of the driven device satisfying the preset speed condition, at least one of the several driving motors running in the driving device is used as a passive motor, and the phase of the passive motor is set to a preset fixed phase value as a deceleration damping for the other several driving motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction.
[0037] In some application scenarios, when a deceleration command is received, the running speed of the driven device is already less than the lower limit of the preset speed range, and deceleration can be directly performed by coaxial driving of several drive motors. In some embodiments, before executing step S12, it also includes: in response to the running speed of the driven device being less than the lower limit of the preset speed range, controlling several drive motors in the same phase until the running speed of the driven device meets the target speed.
[0038] In a specific embodiment, this embodiment follows Figure 2 The motor drive structure in the embodiment performs dual motor drive control on the driven device, wherein the first motor 21 and the second motor 22 are two-phase four-wire hybrid stepper motors respectively. The two-phase four-wire and hybrid stepper motors have two sets of coils inside. When each pulse comes, the rotor will always stop in the direction of the magnetic field synthesized by the two-phase coils after rotation. The magnitude of the magnetic field is proportional to the magnitude of the current. Therefore, the direction of the magnetic field synthesized by the coils can be controlled by controlling the direction of the current in the coils, thereby controlling the rotation of the motor. By controlling the stepping phase sequence, the displacement of the motor rotation can be accurately controlled. In a usage scenario, the acceleration and deceleration curves of the first camera and the second camera can be pre-planned. Please refer to Figure 4 , Figure 4 It is a schematic diagram of the driving curve of an embodiment of the motor driving method of the present application. The third curve 41 is the acceleration and deceleration curve when the first motor 21 and the second motor 22 are driven in the same phase; the fourth curve 42 is the curve of the uniform motion of the motor, wherein the speed value of the intersection of the fourth curve 42 and the third curve 41 is U1; the fifth curve 43 is the deceleration curve when one of the first motor 21 and the second motor 22 is used as a passive motor and the passive motor is placed in a fixed phase. Among them, the third curve 41, the fourth curve 42 and the fifth curve 43 are obtained by pre-calculation or actual testing after setting according to the preset motor operating parameters. It can be understood that the motor acceleration and deceleration curves obtained with different preset parameters are different.
[0039] Specifically, during the operation of the driven device, in response to receiving the acceleration signal, the dual motor accelerates according to the third curve 41. In response to receiving the signal of stopping to the stop point, the current running speed of the driven device is obtained as U, and the current starting position of the driven device is determined to determine whether U is greater than U1. If U is greater than U1, deceleration is performed according to the third curve 41 until the current running speed of the driven device is equal to U1, the second motor 22 is used as a passive motor, and the control current of the passive motor is set to 0, the first motor 21 is used to drive the driven device to run at a constant speed along the fourth curve 42, the phase control of the passive motor is switched from synchronous control with the first motor 21 to separate control, and a preset fixed phase value is applied to the passive motor, and a preset control current is applied to the passive motor. In response to applying the preset fixed phase value to the passive motor, the first motor 21 is switched from uniform speed operation to deceleration operation, so that the driven device runs according to the fifth curve 43. It is understandable that the distance the driven device runs during the deceleration process can be obtained according to the running curve of the driven device. According to the starting position of the driven device and the distance the driven device runs during the deceleration process, the first position of the driven device when it decelerates to 0 according to the fifth curve 43 can be obtained, and the target running distance of the first position and the stop point can be calculated. The passive motor is switched back to the same phase control as the first motor 21, and the dual motors are controlled to accelerate and run half the target running distance according to the third curve 41, and then run half the target running distance according to the third curve 41. So that the driven device stops quickly and accurately at the stop point. In the above manner, devices such as pan / tilt heads and ball cameras can also stop quickly and accurately at the target stop point under the state of high preset point speed.
[0040] In the above scheme, when the driven device needs to decelerate, the present application sets the phase of one of the several driving motors used to coaxially drive the driven device to a preset fixed value, so that the motor is in a fixed holding torque state to be used as an auxiliary deceleration damping for the driven device. While accelerating the deceleration of the driven device, the stability of the deceleration process can be improved by adding resistance to deceleration.
[0041] See also Figure 5 , Figure 5It is a structural schematic diagram of an embodiment of the motor drive system of the present application. The drive system includes a processing module 51 and a motor phase control module 52. Among them, the processing module 51 is used to output a first phase control signal to control the operation of a plurality of drive motors, specify a target speed for decelerating the driven device, and send a first phase switching signal to the motor phase control module 52 in response to the running speed of the driven device meeting a preset speed condition. The motor phase control module 52 is connected to the processing module 51 and a plurality of starting motors. The motor phase control module 52 is used to, in response to receiving the first phase switching signal, use at least one of the plurality of drive motors as a passive motor, switch the first phase control signal received by the passive motor to a preset fixed phase, so that the passive motor acts as a deceleration damper for the other plurality of drive motors, so as to decelerate the driven device to the target speed. Among them, a plurality of drive motors coaxially drive the driven device.
[0042] In some application scenarios, the preset speed condition may be that the speed at which all active motors can drive all passive motors placed in a fixed phase and the driven device to run stably satisfies a preset speed range. For example, the maximum speed at which all active motors can drive all passive motors placed in a fixed phase and the driven device to run is used as the upper limit of the preset speed range, and the speed value that is a certain percentage lower than the upper limit of the preset speed range is used as the lower limit of the preset speed range. In some application scenarios, the preset speed condition may be a preset speed threshold, and the preset speed threshold may specifically be a speed value at which all active motors can drive all passive motors placed in a fixed phase and the driven device to run stably. For example, the preset speed condition may be set to the maximum speed value at which all active motors can drive all passive motors placed in a fixed phase and the driven device to run stably. The corresponding preset speed condition is set according to the parameters of each passive motor and the active motor, so that when decelerating, the passive motor will be driven to rotate by the active motor, and the passive motor acts as a damper to accelerate the deceleration of the driven device while improving the stability of the deceleration process.
[0043] In some application scenarios, when the target speed is less than the preset speed threshold, and when a deceleration instruction to decelerate to the target speed is received, the running speed of the driven device is greater than the preset speed threshold, the processing module 51 is also used to adjust the output first phase control signal to a deceleration phase control signal, and control the synchronous deceleration of the plurality of drive motors until the driven device decelerates to the preset speed threshold. Then, at least one of the plurality of drive motors is switched to be a passive motor, and the first phase control signal received by the passive motor is switched to a preset fixed phase, so that the passive motor acts as a deceleration damper for the other plurality of drive motors, so that the driven device is decelerated to the target speed. Among them, the plurality of drive motors coaxially drive the driven device.
[0044] In some application scenarios, the target speed is greater than a preset speed threshold, and when a deceleration instruction to decelerate to the target speed is received, the running speed of the driven device is greater than the target speed. The processing module 51 is also used to adjust the output first phase control signal to a deceleration phase control signal, and control several drive motors to decelerate in the same phase until the driven device decelerates to the target speed.
[0045] In some application scenarios, the processing module 51 is also used to output a first phase control signal to control the operation of several drive motors, specify a target speed for acceleration of the driven device, adjust the first phase control signal to an acceleration phase control signal, and control the synchronous acceleration of several drive motors.
[0046] In some application scenarios, the processing module 51 is also used to specify the target position at which the driven device stops running. In response to the passive motor acting as a deceleration damper for the other several driving motors, the driven device is decelerated to 0, and a second phase switching signal is sent to the motor phase control module 52 to switch the output first phase control signal to a third phase control signal. The motor phase control module 52 is also used to switch a preset fixed phase received by the passive motor to a third phase control signal in response to receiving the first phase switching signal. Specifically, the third phase control signal is used to control the driven device to move in the direction of the target position, and the distance between the position where the driven device is located when it is decelerated to 0 and the target position. Re-switching the phase enables the passive motor and the other several driving motors to resume the same phase drive, so that they can start and run faster, and the third phase control signal is used to accurately control the motor to synchronously drive the driven device to run to the target position, so as to ensure that the driven device stops accurately at the target position.
[0047] In some specific embodiments, several drive motors may be motors of the same type and specification, or several drive motors may be motors of different types and specifications. In some embodiments, the processing module 51 also uses an output current control signal to control the operation of several drive motors, and the output current control signals for different drive motors may be the same or different. For example, several drive motors include motor A, motor B, and motor C, and the phase control signals received by motor A, motor B, and motor C are the same, all being first phase control signals. The processing module 51 may apply the same control current, for example, 0.5A, to motor A, motor B, and motor C, respectively. The processing module 51 may also apply different drive currents to each motor, for example, 0.7A to motor A, 0.5A to motor B, and 0.8A to motor C, so that several drive motors move synchronously and output different torques.
[0048] In some embodiments, the motors include a first two-phase four-wire stepper motor 53 and a second two-phase four-wire stepper motor 54, and the motor phase control module 52 includes a single-pole double-throw analog switch. Specifically, the first phase control interface of the first two-phase four-wire stepper motor 53 is connected to the common end of the first switch of the single-pole double-throw analog switch, and the second phase control interface of the first two-phase four-wire stepper motor 53 is connected to the common end of the second switch of the single-pole double-throw analog switch; the normally open end of the first switch is connected to the first phase control interface of the second two-phase four-wire stepper motor 54, and the normally open end of the second switch is connected to the second phase control interface of the second two-phase four-wire stepper motor 54; the normally closed ends of the first switch and the second switch are respectively connected to the signal output end of the preset fixed phase; wherein the second two-phase four-wire stepper motor 54 is a passive motor. Specifically, the signal output end of the preset fixed phase can be integrated in the processing module 51, or it can belong to the signal output end that can output the fixed phase outside the processing module 51, and the present application does not limit it here. The motor phase control module 52 can switch the phase synchronous drive and phase independent drive of the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 by switching the connection state of the single-pole double-throw analog switch. Specifically, the signal output end of the preset fixed phase is used to output a phase control signal that can lock the motor fixed phase at a fixed value, and the phase control signal can be a high or low level signal.
[0049] In some embodiments, the first phase control interface of the first two-phase four-wire stepper motor 53 is connected to the first phase output terminal of the processing module 51, and the second phase control interface of the first two-phase four-wire stepper motor 53 is connected to the second phase output terminal of the processing module 51. The first phase output terminal and the second phase output terminal are used to output phase control signals to control the phase of the motor in the form of high and low levels, that is, to control the current direction in the motor coil, and then to control the direction of the magnetic field, thereby realizing the control of the motor forward, reverse and stationary.
[0050] In some embodiments, the processing module 51 further includes a first group of pulse output terminals and a second group of pulse output terminals. The first group of pulse output terminals are respectively connected to the first phase and second phase pulse input terminals of the first motor drive module 55 of the first two-phase four-wire stepper motor 53. The second group of pulse output terminals are respectively connected to the first phase and second phase pulse input terminals of the second motor drive module 56 of the second two-phase four-wire stepper motor 54. The first group of pulse output terminals and the second group of pulse output terminals control the current size of the motor by outputting pulse signals with different duty cycles, thereby controlling the output torque of the motor. The pulse signal can be a PWM (Pulse Width Modulation) signal.
[0051] For ease of understanding, this application continues to list specific examples as follows:
[0052] The processing module 51 includes a first group of pulse output terminals, a second group of pulse output terminals, a phase switching signal output terminal, and a phase signal output terminal. Among them, the pulse signals output by the first group of pulse output terminals are PWM1 and PWM2, and the pulse signals output by the second group of pulse output terminals are PWM3 and PWM4. The chip select signal output by the phase switching signal output terminal is CS. The phase control signals output by the first phase output terminal are PHASE1 and PHASE2. In addition, the phase control signals output by the preset fixed phase signal output terminal are PHASE3 and PHASE4.
[0053] Among them, the two sets of coils inside the first two-phase four-wire stepper motor 53 are divided into two phases, 1AB and 2AB, the two ends of the 1AB phase are OUT1A and OUT1B respectively, and the two ends of the 2AB phase are OUT2A and OUT2B respectively. In this embodiment, the current flowing from OUT1A to OUT1B is defined as X+ corresponding to PHASE1 is 1, OUT1B flowing to OUT1A is X- corresponding to PHASE1 is 0, and OUT2A flowing to OUT2B is defined as Y+ corresponding to PHASE2 is 1, and OUT2B flowing to OUT2A is Y- corresponding to PHASE2 is 0. The first two-phase four-wire stepper motor 53 can be controlled by the logic control table of the first two-phase four-wire stepper motor 53, as shown in the following Table 1, which is the logic control table of the first two-phase four-wire stepper motor.
[0054] Table 1: is the logic control table of the first two-phase four-wire stepper motor.
[0055]
[0056] Among them, x represents the numbers 1 and 2, corresponding to their respective signals, N represents signal output, Y represents no signal output, L represents low level, and H represents high level.
[0057] The two sets of coils inside the second two-phase four-wire stepper motor 54 are divided into two phases, 3AB and 4AB. The two ends of the 3AB phase are OUT3A and OUT3B respectively, and the two ends of the 4AB phase are OUT4A and OUT4B respectively. In this embodiment, the current flowing from OUT3A to OUT3B is defined as X+ corresponding to PHASE3 is 1, OUT3B flows to OUT3A as X- corresponding to PHASE3 is 0, and OUT4A flows to OUT4B as Y+ corresponding to PHASE4 is 1, and OUT4B flows to OUT4A as Y- corresponding to PHASE4 is 0. It can be understood that by further refining the phase sequence by making different combinations of PHASE1 and PHESE2, or PHASE3 and PHESE4, the displacement of the motor rotation can be accurately controlled. The second two-phase four-wire stepper motor 54 can be controlled by the logic control table of the second two-phase four-wire stepper motor 54, as shown in Table 2 below, which is the logic control table of the second two-phase four-wire stepper motor.
[0058] Table 2: is the logic control table of the second two-phase four-wire stepper motor.
[0059]
[0060] Among them, x represents the numbers 3 and 4, corresponding to their respective signals, N represents signal output, Y represents no signal output, L represents low level, and H represents high level.
[0061] The motor phase control module 52 controls the signal PHASE1 and PHASE3 as the phase control signal B-PHASE3 output to the second motor drive module 56 in a two-selection form through the chip select signal CS, and controls the signal PHASE2 and PHASE4 as the phase control signal B-PHASE4 output to the second motor drive module 56 in a two-selection form. The phase input signal of the second two-phase four-wire stepper motor 54 can be controlled by the logic control table of the motor phase control module 52, as shown in the following Table 3, which is the logic control table of the motor phase control module.
[0062] Table 3 is the logic control table of the motor phase control module.
[0063]
[0064] Among them, NC is the normally closed end of the first switch and the second switch, and NO is the normally open end of the first switch and the second switch. ON is connected, and OFF is disconnected. That is, when CS is 0 (low level), the phase control signal B-PHASE3 output by the motor phase control module 52 to the second motor drive module 56 is signal PHASE1; the phase control signal B-PHASE4 output by the motor phase control module 52 to the second motor drive module 56 is signal PHASE2; the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 are driven in the same phase, and when CS is 1 (high level), the phase control signal B-PHASE3 output by the motor phase control module 52 to the second motor drive module 56 is signal PHASE3; the phase control signal B-PHASE4 output by the motor phase control module 52 to the second motor drive module 56 is signal PHASE4; the first two-phase four-wire stepper motor 53, the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 are driven in phase independently.
[0065] Specifically, it can be combined Figure 4The driving curve in the figure takes the process from the first preset point to the second preset point as an example, and drives the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54. The time period 0-t1 is the dual-motor same-phase acceleration section, and the phase control signals PHASE1 and PHASE2 output by the first phase output terminal are acceleration control signals based on the third curve 41. The pulse signals PWM1 and PWM2 output by the first group of pulse output terminals are the first preset signals, and the pulse signals PWM3 and PWM4 output by the second group of pulse output terminals are the second preset signals. CS is 0, and the phase control signal B-PHASE3 output by the motor phase control module 52 to the second motor drive module 56 is the signal PHASE1; the phase control signal B-PHASE4 output by the motor phase control module 52 to the second motor drive module 56 is the signal PHASE2, and the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 are driven in the same phase. The first preset signal and the second preset signal can be the same or different, and can be set according to the specific motor model and driving requirements. When the running speed of the driven device rises to U2, that is, Figure 4At time t1 in the figure, the phase control signals PHASE1 and PHASE2 outputted from the first phase output terminal are adjusted to deceleration control signals based on the third curve 41. When the running speed of the driven device drops to U1, i.e., time t2, U1 is the maximum running speed of the driven device when the first two-phase four-wire stepper motor 53 can drive the second two-phase four-wire stepper motor 54 and the driven device to run stably. The phase control signals PHASE1 and PHASE2 outputted from the first phase output terminal are adjusted to uniform speed control signals based on the fourth curve 42, the pulse signals PWM3 and PWM4 outputted from the second group of pulse output terminals are first set to 0, and then CS is switched to 1, the phase control signal B-PHASE3 outputted from the motor phase control module 52 to the second motor drive module 56 is the signal PHASE3; the phase control signal B-PHASE4 outputted from the motor phase control module 52 to the second motor drive module 56 is the signal PHASE4, the phase of the second two-phase four-wire stepper motor 54 is locked to a preset fixed value, and PWM3 and PWM4 are set to a preset fixed pulse value, so that the second two-phase four-wire stepper motor 54 is in a state with a fixed holding torque. The moment when the step of switching CS to 1 is completed is taken as the moment t3, and the phase control signals PHASE1 and PHASE2 outputted from the first phase output terminal are adjusted to deceleration control signals based on the fifth curve 43, so that the second two-phase four-wire stepper motor 54 is used as a damping to increase the torque of the deceleration process to achieve faster deceleration. The stroke between the position of the driven device when it decelerates to 0 and the second preset point is calculated. When the driven device decelerates to 0, that is, at time t4, the pulse signals PWM3 and PWM4 outputted from the second group of pulse output terminals are set to 0, and then CS is switched to 0, so that the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 are driven in phase, and the remaining stroke distance is accelerated and decelerated according to the third curve 41, so that the driven device stops quickly and accurately at the second preset point. In some embodiments, calculating the stroke between the position of the driven device when it decelerates to 0 and the second preset point includes calculating the shortest stroke between the position of the driven device when it decelerates to 0 and the second preset point. For example, from t3 to t4, the coordinate of the driven device when it decelerates in the clockwise direction to a speed of 0 is 0°. Assuming that the clockwise direction is positive and the coordinate of the second preset point is 90°, after t4, the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 are driven in the same phase according to the third curve 41 to accelerate and decelerate the driven device to run a 90° clockwise stroke, so that the driven device stops precisely at the second preset point.For another example, from t3 to t4, the coordinate of the driven device when it decelerates in the clockwise direction to a speed of 0 is 90°. Assuming that the clockwise direction is positive, the coordinate of the second preset point is 0°. It can be understood that the shortest distance between the position when the driving device decelerates to 0 and the second preset point is -90°, that is, 90° counterclockwise. Then, after t4, the first two-phase four-wire stepper motor 53 and the second two-phase four-wire stepper motor 54 are driven in the same phase according to the third curve 41 to accelerate and decelerate and drive the driven device to run 90° counterclockwise, so that the driven device stops precisely at the second preset point.
[0066] In the above scheme, when the driven device needs to decelerate, the present application sets the phase of one of the several driving motors used to coaxially drive the driven device to a preset fixed value, so that the motor is in a fixed holding torque state to be used as an auxiliary deceleration damping for the driven device. While accelerating the deceleration of the driven device, the stability of the deceleration process can be improved by adding resistance to deceleration.
[0067] See also Figure 6 , Figure 6 It is a schematic diagram of the framework of an embodiment of the motor drive device of the present application. The motor drive device 60 includes: a receiving module 61 and a response module 62. The receiving module 61 is used to obtain the current running speed of the driven device as the initial speed in response to receiving a deceleration instruction. The response module 62 is used to respond to the initial speed meeting the preset speed, and at least one motor among the several driving motors driving the driven device to run is used as a passive motor, and the phase of the passive motor is set to a preset fixed phase value as a deceleration damping of the other several driving motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction, wherein the target speed is lower than the initial speed. Among them, several driving motors coaxially drive the driven device.
[0068] In some embodiments, the response module 62 sets the phase of the passive motor to a preset fixed phase value to serve as a deceleration damping for the other drive motors, including: after setting the control current of the passive motor to 0, switching the phase control of the passive motor from synchronous control with the other drive motors to independent control, and setting the phase of the passive motor to a preset fixed phase value.
[0069] In some embodiments, the preset speed condition includes a preset speed range, and the response module 62 responds to the initial speed not meeting the preset speed condition. The method further includes, in response to the initial speed of the driven device being greater than the preset speed range, performing in-phase deceleration control on a plurality of drive motors until the running speed of the driven device meets the preset speed range, using at least one of the plurality of drive motors driving the driven device as a passive motor, setting the phase of the passive motor to a preset fixed phase value as a deceleration damping of the other plurality of drive motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction; or, in response to the initial speed of the driven device being less than the preset speed, performing in-phase deceleration control on a plurality of drive motors until the running speed of the driven device meets the target speed. In some specific embodiments, the deceleration instruction includes a stop point instruction; wherein the stop point instruction is used to indicate the target position of the driven device when the driven device is decelerated to a stop.
[0070] In some embodiments, the response module 62 is also used to respond to the deceleration instruction including the stop point instruction, set the phase of the passive motor to a preset fixed phase value as the deceleration damping of the other several drive motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction, including: setting the phase of the passive motor to a preset fixed phase value as the deceleration damping of the other several drive motors to decelerate the driven device to 0; obtaining the stroke between the position of the driven device when the driven device is decelerated to 0 and the target position; after setting the phase of the passive motor to a preset fixed phase value as the deceleration damping of the other several drive motors to decelerate the driven device to 0, switching the phase control of the passive motor from individual control to synchronous control with the several drive motors to move the driven device to the target position. In a specific embodiment, several drive motors include a first two-phase four-wire stepper motor and a second two-phase four-wire stepper motor, and the motor phase control module includes a single-pole double-throw analog switch; wherein, the first phase control interface of the first two-phase four-wire stepper motor is connected to the common end of the first switch of the single-pole double-throw analog switch, and the second phase control interface of the first two-phase four-wire stepper motor is connected to the common end of the second switch of the single-pole double-throw analog switch; the normally open end of the first switch is connected to the first phase control interface of the second two-phase four-wire stepper motor, and the normally open end of the second switch is connected to the second phase control interface of the second two-phase four-wire stepper motor; the normally closed ends of the first switch and the second switch are respectively connected to the signal output ends of the preset fixed phase; wherein, the second two-phase four-wire stepper motor is a passive motor.
[0071] In the above scheme, when the driven device needs to decelerate, the present application sets the phase of one of the several driving motors used to coaxially drive the driven device to a preset fixed value, so that the motor is in a fixed holding torque state to be used as an auxiliary deceleration damping for the driven device. While accelerating the deceleration of the driven device, the stability of the deceleration process can be improved by adding resistance to deceleration.
[0072] See also Figure 7 , Figure 7 It is a schematic diagram of the framework of an embodiment of the electronic device of the present application.
[0073] The electronic device 70 includes a memory 72 and a processor 71 . The memory 72 is coupled to the processor 71 . The memory 72 stores program instructions. The processor 71 can be any device with processing capabilities, such as a computer, a tablet computer, a mobile phone, etc.
[0074] The memory 72 is used to store the program data executed by the processor 71 and the data of the processor 71 during the processing process. For example, the amount of data, metadata, timing data, etc. are stored. Among them, the memory 72 includes a non-volatile storage part for storing the above program data. The processor 71 controls the operation of the processing device, and the processor 71 can also be called a CPU (Central Processing Unit). The processor 71 may be an integrated circuit chip with signal processing capabilities. The processor 71 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor 71, etc. In addition, the processor 71 can be implemented by multiple integrated circuit chips. The processor 71 calls the program data stored in the memory 72, and the processor 71 is used to execute program instructions to implement the motor driving method as any of the above embodiments.
[0075] See also Figure 8 , Figure 8 1 is a schematic diagram of a computer-readable storage medium of the present application. In this embodiment, the storage medium 80 stores program data 81 executable by a processor, and the program data 81 can be executed to implement the motor driving method of any of the above embodiments.
[0076] The storage medium 80 may specifically be a medium that can store program data, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or may be a server that stores the program data. The server may send the stored program data to other devices for execution, or may execute the stored program data itself.
[0077] In some embodiments, the storage medium 80 may also be Figure 7 The memory 72 is shown.
[0078] In the above scheme, when the driven device needs to decelerate, the present application sets the phase of one of the several driving motors used to coaxially drive the driven device to a preset fixed value, so that the motor is in a fixed holding torque state to be used as an auxiliary deceleration damping for the driven device. While accelerating the deceleration of the driven device, the stability of the deceleration process can be improved by adding resistance to deceleration.
[0079] The above description is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A motor driving method, characterized in that: The method comprises: In response to receiving a deceleration instruction, obtaining a current operating speed of the driven device as an initial speed; In response to the initial speed satisfying a preset speed condition, at least one of the plurality of driving motors driving the driven device to operate is used as a passive motor, and the phase of the passive motor is set to a preset fixed phase value as a deceleration damping of the other plurality of driving motors, so that the driven device is decelerated to a target speed specified by the deceleration instruction, wherein the target speed is lower than the initial speed; Wherein, the plurality of driving motors coaxially drive the driven device.
2. The method according to claim 1, characterized in that The step of setting the phase of the passive motor to a preset fixed phase value to serve as a deceleration damping for the other plurality of driving motors comprises: After the control current of the passive motor is set to 0, the phase control of the passive motor is switched from synchronous control with other driving motors to independent control, and the phase of the passive motor is set to a preset fixed phase value.
3. The method according to claim 1, characterized in that The preset speed condition includes a preset speed range. In response to the initial speed not satisfying the preset speed condition, the method further includes: In response to the initial speed of the driven device being greater than the upper limit of the preset speed range, the plurality of driving motors are subjected to same-phase deceleration control until the running speed of the driven device meets the preset speed range, at least one of the plurality of driving motors driving the driven device to run is used as a passive motor, and the phase of the passive motor is set to a preset fixed phase value as a deceleration damping of the other plurality of driving motors, so that the driven device is decelerated to the target speed specified by the deceleration instruction; or, In response to the initial speed of the driven device being less than the lower limit of the preset speed range, the plurality of driving motors are subjected to in-phase deceleration control until the running speed of the driven device meets the target speed.
4. The method according to claim 1, characterized in that The deceleration instruction includes a stop point instruction; wherein the stop point instruction is used to indicate the target position of the driven device when the driven device decelerates to a stop.
5. The method according to claim 4, characterized in that The method further comprises: In response to the deceleration instruction including the stop point instruction, setting the phase of the passive motor to a preset fixed phase value as a deceleration damping of the other plurality of driving motors so as to decelerate the driven device to a target speed specified by the deceleration instruction includes: Setting the phase of the passive motor to a preset fixed phase value as a deceleration damping of the other driving motors to decelerate the driven device to 0; Acquire the travel distance between the position of the driven device and the target position when the driven device decelerates to 0; After the phase of the passive motor is set to a preset fixed phase value as a deceleration damping for the other several driving motors to decelerate the driven device to 0, the phase control of the passive motor is switched from individual control to synchronous control with the several driving motors to move the driven device to the target position by the stroke.
6. A motor drive system, characterized in that: including a processing module and a motor phase control module; The processing module is used to: output a first phase control signal to control the operation of a plurality of driving motors; specify a target speed at which the driven device is decelerated, and in response to the operating speed of the driven device meeting a preset speed condition, send a first phase switching signal to the motor phase control module; The motor phase control module is connected to the processing module and the plurality of drive motors, and the motor phase control module is used to: in response to receiving the first phase switching signal, use at least one motor among the plurality of drive motors as a passive motor, switch the first phase control signal received by the passive motor to a preset fixed phase, so that the passive motor acts as a deceleration damper for the other plurality of drive motors, so as to decelerate the driven device to the target speed; Wherein, the plurality of driving motors coaxially drive the driven device.
7. The system according to claim 6, characterized in that The processing module is also used to specify a target position where the driven device stops running; in response to the passive motor acting as a deceleration damper of the other driving motors to decelerate the driven device to 0, send a second phase switching signal to the motor phase control module, and switch the output first phase control signal to a third phase control signal; The motor phase control module is further used for: in response to receiving the second phase switching signal, switching a preset fixed phase received by the passive motor to a third phase control signal; The third phase control signal is used to control the driven device to move toward the target position by a distance between the position where the driven device is located when the deceleration reaches 0 and the target position.
8. The system according to claim 6, characterized in that The plurality of drive motors include a first two-phase four-wire stepper motor and a second two-phase four-wire stepper motor, and the motor phase control module includes a first single-pole double-throw analog switch and a second single-pole double-throw analog switch; Wherein, the first phase control interface of the first two-phase four-wire stepper motor is connected to the common end of the first single-pole double-throw analog switch, and the second phase control interface of the first two-phase four-wire stepper motor is connected to the common end of the second single-pole double-throw analog switch; The normally open end of the first single-pole double-throw analog switch is connected to the first phase control interface of the second two-phase four-wire stepper motor, and the normally open end of the second single-pole double-throw analog switch is connected to the second phase control interface of the second two-phase four-wire stepper motor; The normally closed ends of the first single-pole double-throw analog switch and the second single-pole double-throw analog switch are respectively connected to the signal output end of the preset fixed phase; Wherein, the second two-phase four-wire stepping motor is the passive motor.
9. An electronic device, characterized in that: It includes a communication circuit, a memory and a processor, wherein the communication circuit and the memory are respectively coupled to the processor, the memory stores program instructions, and the processor is used to execute the program instructions to implement the motor driving method according to any one of claims 1 to 5.
10. A storage medium having a computer program stored thereon, characterized in that: The program is processed and executed to implement the motor driving method according to any one of claims 1 to 5.
