Motor control method, motor controller, system, radar, vehicle, medium and product
By only detecting the motor angle data and generating control information based on the speed control loop, the problem of high cost of existing motor control methods is solved, and the low-cost control of the motor is realized.
Patent Information
- Application Number
- CN202411844966.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-13
AI Technical Summary
The existing motor control methods require a large number of sampling devices and corresponding algorithm logic circuits, resulting in higher motor costs.
By detecting the motor angle data, motor control information is generated based on the speed control loop, saving the software and hardware costs of other control loops.
It realizes low-cost control of the motor and reduces hardware and software development costs.
Smart Images

Figure CN119813863A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of motor control technology, and particularly relates to a motor control method, a motor controller, a motor system, a lidar, a vehicle, a computer-readable storage medium, and a computer program product. Background Art
[0002] With the frenzy surrounding new energy vehicles sweeping the entire industry, the number of new energy vehicles is increasing dramatically. Accurate visual perception is crucial for achieving autonomous driving. Currently, vehicles primarily achieve visual perception through devices such as cameras and radar.
[0003] Among them, the rotating mirror lidar is a high-precision ranging sensor, and the motor is the foundation for the rotating mirror lidar to achieve scene scanning. Controlling the smooth operation of the motor is a key aspect of the rotating mirror lidar, and to a certain extent determines the quality of the final point cloud image.
[0004] To achieve high-precision control, current motors require a large number of sampling devices and corresponding algorithm logic circuits, resulting in high motor costs. Summary of the Invention
[0005] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a motor control method, a motor controller, a motor system, a lidar, a vehicle, a computer-readable storage medium, and a computer program product. This method only requires detecting motor angle data and, based on a speed control loop, can achieve motor control, eliminating the hardware and software costs of other control loops and resulting in lower costs.
[0006] In a first aspect, this application provides a motor control method, the method comprising:
[0007] Based on the angle data of the motor, the rotational speed of the motor is obtained;
[0008] Based on the motor's rotational speed and the target set rotational speed, motor control information is generated through a preset motor control model, which includes a speed control loop.
[0009] Based on the motor control information, the motor is controlled to operate.
[0010] Secondly, this application provides a motor controller, which includes a processor and a memory. The memory stores a control program, and the processor executes the control program to perform the above-described motor control method.
[0011] Thirdly, this application provides a motor system, which includes a motor and the aforementioned motor controller.
[0012] Fourthly, this application provides a lidar, which includes a rotating mirror and the aforementioned motor system, wherein the motor is used to drive the lidar to rotate.
[0013] Fifthly, this application provides a vehicle including the aforementioned motor controller, lidar, or motor system.
[0014] Sixthly, this application provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described motor control method.
[0015] In a seventh aspect, this application provides a computer program product, the computer product including a computer program, which, when executed by a processor, implements the above-described motor control method.
[0016] The motor control method, motor controller, motor system, lidar, vehicle, computer-readable storage medium, and computer program product provided in this application can acquire the angle data of the motor, calculate the motor speed through the angle data, and then control the motor based on the motor speed and the target set speed through the speed control loop of the motor control model.
[0017] Since only the motor angle data needs to be detected, the motor can be controlled based on the speed control loop, eliminating the need for the hardware and software costs of other control loops, resulting in lower costs.
[0018] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0020] Figure 1 This is a schematic diagram of the structure of the lidar provided in the embodiments of this application;
[0021] Figure 2 This is a first flowchart illustrating the motor control method provided in an embodiment of this application;
[0022] Figure 3 This is a second flowchart illustrating the motor control method provided in the embodiments of this application;
[0023] Figure 4 This is a schematic diagram illustrating the principle of the motor control method provided in the embodiments of this application;
[0024] Figure 5This is a third flowchart illustrating the motor control method provided in the embodiments of this application;
[0025] Figure 6 This is a schematic diagram of the fourth process of the motor control method provided in the embodiments of this application;
[0026] Figure 7 This is a fifth flowchart illustrating the motor control method provided in the embodiments of this application;
[0027] Figure 8 This is a sixth flowchart illustrating the motor control method provided in the embodiments of this application;
[0028] Figure 9 This is a seventh flowchart illustrating the motor control method provided in the embodiments of this application;
[0029] Figure 10 This is a schematic diagram of the control device provided in the embodiments of this application;
[0030] Figure 11 This is a schematic diagram of the vehicle structure provided in the embodiments of this application. DETAILED DESCRIPTION
[0031] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0032] This application provides a motor control method, which will be described in detail below:
[0033] See also Figure 1 and Figure 2 The motor control method provided in this application embodiment is implemented by steps 011 to 013, which are described in detail below.
[0034] Step 011: Based on the angle data of motor 20, obtain the rotational speed of motor 20.
[0035] Among them, motor 20 includes a three-phase motor, which is a widely used type of AC motor that is driven by a three-phase AC power supply.
[0036] Alternatively, motor 20 may be a brushless DC motor.
[0037] Optionally, the three-phase motor is a three-phase asynchronous motor, whose working principle is based on the law of electromagnetic induction. The stator windings of motor 20 are powered by three-phase symmetrical alternating current, generating a rotating magnetic field. This rotating magnetic field interacts with the conductors on the rotor (usually a squirrel-cage or wound-rotor structure), generating induced current and torque, thus causing the rotor to rotate. The speed of the rotor is always lower than the speed of the rotating magnetic field, hence the name "asynchronous".
[0038] Optionally, the operation of the motor 20 is controlled by the motor controller 10. The motor 20 is equipped with an encoder 21, which is used to collect the angle data of the motor 20.
[0039] The encoder 21 is a sensor used to measure the rotor position of the motor 20. They are widely used in various applications requiring precise control of the position and speed of the motor 20.
[0040] The encoders 21 are divided into two main categories: incremental encoders and absolute encoders.
[0041] Incremental encoders typically have two output channels, A and B, with a fixed phase difference (usually 90 degrees) between the pulse signals of these two channels, known as quadrature encoding. By analyzing the sequence and quantity of these two pulse signals, the direction of rotation, the angle of rotation, and the amount of displacement can be determined. They are relatively inexpensive and have a simple structure. A counter is needed to record the accumulated number of pulses to determine the current position.
[0042] Absolute encoders have a unique code for each position, allowing direct reading of the current absolute position without the need for a reference point or accumulated pulse count. They provide absolute position information, and the current position is immediately known even after a power outage and restart. They offer high resolution and accuracy. Furthermore, they eliminate the need for external counters, simplifying the design of the control system.
[0043] Optionally, the encoder 21 of this application can be an absolute encoder, with each angle of the motor 20 having a corresponding code, thereby achieving accurate detection of the angle data of the motor 20.
[0044] Specifically, when the rotor of motor 20 rotates around the stator, the real-time speed of motor 20 can be obtained by differentiating the angle change of motor 20 with respect to time.
[0045] Optionally, please refer to Figure 2 Step 011 includes:
[0046] Step 0111: Calculate the rotational speed of motor 20 based on the angle change value and rotation duration of motor 20 within a preset statistical period.
[0047] It is understandable that, since this application eliminates the current control loop and there is no real-time current feedback, in order to ensure the stability of motor 20 control, the speed of motor 20 needs to be calculated based on the angle change value and rotation time of motor 20 within a preset statistical period. For example, the quotient of the angle change value and rotation time of motor 20 within the preset statistical period is determined as the speed of motor 20.
[0048] When it is necessary to obtain the current speed of motor 20, the angle change value and rotation time within a preset statistical period containing the angle data of motor 20 at the current time are obtained, so as to calculate the current speed of motor 20.
[0049] Optionally, the angle change value corresponding to the preset statistical period is a preset value; or, the rotation duration corresponding to the preset statistical period is a first preset duration.
[0050] In other words, the preset statistical period can be determined by a fixed angle change value or by a first preset duration.
[0051] When the angle change value corresponding to the preset statistical period is a preset value, it means that the angle change value used to calculate the speed of motor 20 is fixed. For example, if the angle of motor 20 is divided into 360 degrees, the angle change value can be fixed at 8 degrees. That is to say, the speed of motor 20 at any moment can be calculated based on 8 degrees and the rotation time of motor 20 within the preset statistical period including the current angle.
[0052] Optionally, the current angle can be any angle within a preset statistical period. For example, if the current angle is the angle with the latest acquisition time within the preset statistical period, the preset statistical period is determined by taking the current angle as the starting point and the target angle that is 7 degrees earlier than the current angle as the ending point. Within the preset statistical period, the rotation time of the motor 20 is the difference between the acquisition time of the current angle and the acquisition time of the target angle.
[0053] When the rotation duration corresponding to the preset statistical period is the first preset duration, it means that the rotation duration used to calculate the speed of motor 20 is fixed, such as 10 milliseconds, 1 second, etc. In other words, the speed of motor 20 at any given moment can be calculated based on the angle data change value of motor 20 within the preset statistical period including the current moment and the first preset duration.
[0054] Optionally, the current time can be any time within a preset statistical period. For example, if the current time is the latest time within the preset statistical period, the preset statistical period is determined by taking the current time as the starting point and the target time before the current time with a time difference of the first preset duration as the ending point. Within the preset statistical period, the angle change value of motor 20 is the difference between the angle of motor 20 at the current time and the angle of motor 20 at the target time.
[0055] It is understandable that, based on the differences in the actual factory parameters of motor 20, different statistical periods will result in differences in the control accuracy and stability of motor 20 when calculating its speed. Therefore, in order to find the optimal statistical period, it is necessary to test and calibrate motor 20 in advance to obtain motor 20 with good control accuracy and stability, or to prioritize a preset statistical period that ensures the accuracy or stability of motor 20 control. This will reduce the cost of motor 20 while ensuring the control effect of motor 20 control is achieved solely based on the speed control loop.
[0056] Optionally, tests can be performed on multiple predetermined test statistical periods, and a preset statistical period can be determined from the multiple predetermined test statistical periods.
[0057] For example, at least one of the first indicator value and the second indicator value can be obtained under different test statistical periods; based on the first indicator value and / or the second indicator value corresponding to each test statistical period, the preset statistical period can be determined.
[0058] The first indicator value is used to evaluate the accuracy of motor control, and the second indicator value is used to evaluate the stability of motor control.
[0059] The smaller the difference between the actual speed of motor 20 at each moment and the target set speed, the more accurate the control of motor 20 is. The smaller the difference between the average speed of motor 20 and the target set speed, the better the stability of motor 20. This means that within the preset period, the actual speed of motor 20 may fluctuate relative to the target set speed, but the overall average speed is still the same as the target set speed.
[0060] Optionally, the test statistical period in which the first index value is less than the first preset value and / or the second index value is less than the second preset value is determined as the preset statistical period, wherein the first index value is negatively correlated with the transient speed accuracy of the motor, and the second index value is negatively correlated with the speed stability of the motor.
[0061] The first and second preset values are empirical values, which can be determined based on the actual requirements for the accuracy and stability of motor control.
[0062] For example, for radar, accuracy is a higher requirement. Therefore, the test statistical period with the largest first indicator value in each test statistical period can be determined as the preset statistical period. As another example, if both accuracy and stability are required, but accuracy is more critical, different weights can be assigned to the first and second indicator values (e.g., the first indicator value has a larger weight), and then the test statistical period with the largest weighted sum of the first and second indicator values can be determined as the preset statistical period.
[0063] Furthermore, it is understandable that when the control period of the pulse width modulation information (i.e., the period in the pulse modulation waveform) is different, the preset statistical period that satisfies the requirements for accuracy and stability is also different.
[0064] The first index value is determined based on the difference between each real-time speed and the target set speed. The real-time speed is determined based on the angle change value within the test statistical period. The second index value is determined based on the average value of each speed. The angle range of the motor is divided into multiple sub-angle ranges, and the average speed is determined based on the average speed of the sub-angle range.
[0065] For example, the first index value can be determined based on the sum of the absolute values of the differences between the actual speeds of motor 20 and the target set speeds. The larger this sum of absolute values, the greater the difference between the actual speed and the target set speed at each moment, and the lower the accuracy of the transient speed control by motor 20. The real-time speed is determined based on the angle change values within the test statistical period. The smaller the test statistical period, the closer the real-time speed is to the transient speed.
[0066] In one example, the angle change value of the motor is acquired every other test statistical cycle. Therefore, the actual rotational speed = angle change value / test statistical cycle. Let the acquired actual rotational speeds be v1 to v2. n Taking a target rotational speed of v0 as an example, then For the x-th real-time rotational speed, i.e., the first index value = |v1-v0|+|v2-v0|+......+|v n -v0|.
[0067] The second indicator value can be determined based on the average value of each speed and the target set speed. For example, the second indicator value can be determined based on the sum of the absolute values of the differences between the average value of each speed and the target set speed. The smaller the sum of the absolute values, the better the speed stability controlled by motor 20.
[0068] For example, the angular range of the motor (i.e., 0-360 degrees) can be divided into multiple sub-angle ranges (e.g., 10 sub-angle ranges, each of which is 36 degrees). The average speed is determined based on the average speed within the sub-angle range. The average speed of any sub-angle range can be determined based on the time required for the motor to rotate within that sub-angle range.
[0069] In one example, the time *t* taken for motor 20 to rotate through one sub-angle range (e.g., 0 degrees to 36 degrees) can be obtained; therefore, the average rotational speed = 36 degrees / *t*. Let the average rotational speeds for *m* sub-angle ranges be... to Taking the target rotational speed as v0 as an example, then in, The average value of the x-th rotational speed.
[0070] Based on this, different test statistical cycles can be set for the motor 20, and then at least one of the first index value and the second index value corresponding to the different test statistical cycles can be obtained, thereby determining the preset statistical cycle in each test statistical cycle that meets the requirements of accuracy and stability.
[0071] Optionally, under different test control cycles, a preset statistical cycle corresponding to each test control cycle is determined; based on the preset statistical cycle corresponding to each test control cycle, a mapping relationship between the control cycle and the preset statistical cycle is established.
[0072] In each test control cycle, based on the first and / or second index values of different test statistical cycles, the preset statistical cycle in which the accuracy and stability of motor control meet the requirements can be quickly determined, thus obtaining the preset statistical cycle corresponding to each test control cycle.
[0073] By treating each test control cycle and its corresponding preset statistical cycle as a set of data, multiple sets of data can be obtained. By fitting multiple sets of data with a preset fitting function, the mapping relationship between the control cycle and the preset statistical cycle can be quickly established.
[0074] For example, the preset fitting function can be a polynomial function. Based on the number of terms in the polynomial function, multiple sets of data with a number greater than or equal to the number of terms can be obtained, thereby establishing multiple equations. By combining multiple equations to form a system of equations, and solving the system of equations, the polynomial function with determined parameters can be obtained, that is, the mapping relationship between the control period and the preset statistical period.
[0075] Step 012: Based on the rotational speed of motor 20 and the target set rotational speed, generate motor control information through a preset motor control model, which includes a speed control loop.
[0076] The motor control model can be a field-oriented control (FOC) model, which refers to the control method for permanent magnet synchronous motors (PMSM) and brushless DC motors (BLDC). The purpose of FOC is to dynamically and accurately control the magnitude and direction of the magnetic field, driving the motor to operate efficiently, while also having the advantages of low torque ripple, low noise, and fast dynamic response.
[0077] Optionally, the motor control information can be pulse width modulation information.
[0078] Existing traditional FOC motor control algorithms generally have at least two control loops: a speed loop and a current loop. The current loop is indispensable in these FOC motor control algorithms. However, these solutions have the following problems:
[0079] (1) Since these schemes use the current loop as the basic control loop, it is necessary to obtain the sampled value of the three-phase current of the motor 20 as the system input. This requires a current sampling ADC or other devices that provide equivalent functions in terms of hardware, which increases the device cost; and it is necessary to set up a corresponding current control loop, which increases the development cost.
[0080] (2) These traditional solutions generally rely heavily on sampling equipment, and have very high requirements for the accuracy of the sampling equipment and the acquisition method. When these solutions are implemented, if the quality of the sampling equipment is poor, the control effect of these solutions will be greatly reduced, thus affecting the final point cloud effect of the lidar.
[0081] The vector control model of this application does not include a current control loop; it can generate pulse width modulation information solely through a speed control loop to control the motor 20. This eliminates the hardware and software costs associated with other control loops (such as the current control loop), reducing both hardware and software development costs. Furthermore, the current control loop of this application only requires an encoder 21 to detect the angle of the motor 20, eliminating the need for other sampling devices. The encoder 21 also boasts high sampling accuracy and stability, minimizing any impact on the control performance of the motor 20 and ensuring the stability of the motor 20 control.
[0082] Specifically, the speed of motor 20 and the target set speed are processed based on the speed control loop in the vector control model to generate pulse width modulation information.
[0083] Alternatively, please continue reading Figure 3 Step 012 includes:
[0084] Step 0121: Based on the motor speed, the target set speed, and the electrical angle of motor 20, pulse width modulation information is generated using a preset motor control model. The electrical angle of motor 20 is determined based on the angle data of motor 20 and the number of pole pairs of the motor.
[0085] When generating pulse width modulation information based on the output of the speed control loop, the speed of motor 20 is first used as a basis (e.g., ...). Figure 4 The n_ref shown represents the target set speed output torque voltage and excitation voltage.
[0086] Torque voltage refers to the voltage component related to the torque of motor 20. In AC motors, this voltage typically refers to the voltage on the stator windings, which directly affects the electromagnetic torque of motor 20. Excitation voltage refers to the voltage used to generate the magnetic field of motor 20. In synchronous motor 20, the excitation voltage is applied directly to the excitation windings, while in induction motor 20, the excitation voltage is achieved through the rotating magnetic field generated by the stator current.
[0087] For example, the speed of motor 20 is compared with the target set speed. The resulting error signal is regulated by a speed loop (such as a PI (Proportional-Integral) controller) to output a torque voltage, which is used to control the motor torque and thus regulate the motor speed.
[0088] In the speed loop, when it is necessary to change the motor's speed range or perform field weakening control, an excitation voltage is output according to the preset speed control strategy to reduce the heat generated by the motor.
[0089] Alternatively, the excitation voltage generally causes the motor 20 to generate additional heat. Therefore, in order to improve the efficiency of the motor 20, the excitation voltage can be set to 0, the excitation current of the motor 20 can be reduced as much as possible, and the heat generated by the motor 20 can be reduced.
[0090] Pulse width modulation (PWM) information can be generated based on torque voltage and excitation voltage. When generating PWM information based on torque voltage and excitation voltage, the torque voltage and excitation voltage in the rotating coordinate system can first undergo an inverse Park transformation to convert them to a two-phase stationary coordinate system (e.g., ...). Figure 4 The Vq and Vd in the coordinate system are converted to Vα and Vβ, respectively. Then, the Vα and Vβ in the two-phase stationary coordinate system are transformed to the three-phase stationary coordinate system of Space Vector Pulse Width Modulation (SVPWM) to obtain the three-phase pulse width modulation information (e.g., Vq and Vd in the coordinate system are converted to Vα and Vβ). Figure 4 (pwm_a, pwm_b, pwm_c in the text).
[0091] Optionally, when generating pulse width modulation information based on torque voltage and excitation voltage, it is also necessary to obtain the electrical angle of motor 20 (e.g., Figure 4 As shown in θ), the electrical angle can be calculated based on the angle data and pole pair number of the motor 20.
[0092] Step 013: Control the operation of motor 20 based on pulse width modulation information.
[0093] Specifically, by generating pulse width modulation information, the voltage of each phase of the three-phase motor can be controlled based on the pulse width modulation information, thereby controlling the operation of motor 20.
[0094] Alternatively, please continue reading Figure 3 Step 013 includes:
[0095] Step 0131: Send pulse width modulation information to the motor drive device 22 so that the motor drive device 22 controls the three-phase voltage output by the three-phase inverter 23 based on the pulse width modulation information, so as to control the operation of the motor 20.
[0096] The motor 20 also includes a motor drive unit 22 and a three-phase inverter 23.
[0097] The motor drive device 22 may include a motor drive circuit 20, which is an integrated circuit specifically designed to control and drive various types of motors 20, such as DC motors 20, stepper motors 20, brushless DC motors (BLDC), and permanent magnet synchronous motors (PMSM). The motor drive IC typically integrates power switches (such as MOSFETs or IGBTs), gate drive circuits, protection circuits (such as overcurrent protection and overtemperature protection), and possible control logic.
[0098] The motor drive unit 22 is used to control the output three-phase voltage of the three-phase inverter 23. The three-phase inverter 23 is connected to the motor 20, and the three-phase voltage is input into the motor 20 so that the three-phase motor can operate based on the three-phase voltage.
[0099] After receiving the pulse width modulation information, the motor drive unit 22 can obtain the pulse modulation waveforms of phases a, b, and c in the three-phase stationary coordinate system. It then controls the three-phase inverter 23 using these pulse modulation waveforms, thereby causing the three-phase inverter 23 to output three-phase voltages (e.g., ...). Figure 4 (The three-phase voltages U, V, and W in the middle).
[0100] In the motor control method of this application, the motor controller 10 acquires the mechanical angle of the motor 20 through the encoder 21. When the motor 20 rotates, the real-time speed of the motor 20 can be calculated by differentiating the change value of the mechanical angle of the motor 20 with respect to time. Then, the speed control loop in the field-oriented control model (FOC) is used to generate pulse width modulation information based on the speed of the motor 20 and the target set speed, thereby realizing the control of the motor 20 based on the pulse width modulation information.
[0101] Since only the angle data of motor 20 needs to be detected, only encoder 21 needs to be set. There is no need to set up the corresponding hardware and software for other control loops (such as current loop), thus saving the cost required for other control loops and reducing the cost of motor 20.
[0102] In some embodiments, please refer to Figure 5 Motor control methods also include:
[0103] Step 014: Determine the current control cycle based on at least one of the frequency of the motor controller 10 and the speed of the motor 20;
[0104] Step 015: Based on the mapping relationship between the control cycle and the preset statistical cycle, determine the target statistical cycle corresponding to the current control cycle in each preset statistical cycle.
[0105] Step 0111 includes:
[0106] Step 0112: Calculate the rotational speed of motor 20 based on the angle change value and rotation duration of motor 20 within the target statistical period.
[0107] Specifically, when generating pulse width modulation information, the control period needs to be determined. The control period must first be greater than the period of the main controller (motor controller 10) of motor 20 to ensure the stability of the main controller. Then, based on the speed of motor 20, different control periods also need to be set. For example, when the speed is slower, more precise control of motor 20 is generally required, and the control period can be set to be smaller. When the speed is faster, the control period can be set to be larger.
[0108] Thus, by determining the current control cycle based on at least one of the frequency of the motor controller 10 and the speed of the motor 20, the current control cycle of the generated pulse width modulation information can be quickly determined.
[0109] Then, when determining the rotational speed within the current control cycle, the target control cycle corresponding to each preset statistical cycle can be quickly determined based on the pre-calibrated mapping relationship between different control cycles and preset statistical cycles.
[0110] Then, based on the angle change and rotation duration of motor 20 within the target statistical period, the rotational speed of motor 20 is calculated. Thus, calculating the rotational speed based on a target statistical period that matches the control period can meet the control requirements of motor 20 (such as the accuracy requirements of motor 20).
[0111] In some embodiments, please refer to Figure 6 Motor control methods also include:
[0112] Step 016: When the motor 20 starts, control the motor 20 to perform a positioning operation so that the electrical angle corresponding to the angle of the motor 20 is 0. The positioning operation includes controlling the motor 20 to run with a first preset torque for a first preset time.
[0113] Specifically, when the motor 20 starts, it will not immediately connect to the speed control loop. In order to ensure the accuracy of angle data detection, a positioning operation is required. The initial position of the motor 20 needs to be positioned so that the motor 20 is at the initial angle of 0 electrical angle.
[0114] For example, the positioning operation can be to control the motor 20 to run with a first preset torque for a first preset time. The first preset torque is the torque that drives the motor 20 to run toward a position with an electrical angle of 0. Thus, by running with the first preset torque for a first preset time, the motor 20 is rotated to the initial position with an electrical angle of 0.
[0115] In this way, the motor can be positioned at a 20° angle, avoiding the impact of initial position deviation on subsequent detection of the motor's 20° angle data.
[0116] In some embodiments, please refer to Figure 7 Motor control methods also include:
[0117] Step 017: When the motor 20 completes the positioning operation, at the beginning of the first control cycle, control the motor 20 to perform a rotation operation, which includes controlling the motor 20 to run with a second preset torque for a second preset duration;
[0118] Step 018: Obtain the angle data of motor 20 while motor 20 is rotating.
[0119] Specifically, since the motor 20 cannot calculate its speed when it is not rotating, it is necessary to apply an initial torque to the motor 20 after it has been positioned, so that the motor 20 can be started to rotate by performing a rotation operation. For example, the rotation operation of the motor 20 can be controlled by operating the motor 20 with a second preset torque for a second preset duration. The second preset torque is different from the first preset torque, which allows the motor 20 to rotate instead of being fixed at a position with an electrical angle of 0.
[0120] Once the motor 20 starts rotating, the angle data of the motor 20 collected by the encoder 21 can be obtained, thereby calculating the speed of the motor 20.
[0121] This avoids the problem that the motor 20 cannot be connected to the speed control loop when it is stationary, thus preventing the motor 20 from being controlled.
[0122] In some embodiments, please refer to Figure 8 Motor control methods also include:
[0123] Step 019: Send the angle data of motor 20 to motor controller 10 so that motor controller 10 controls motor 20 to drive the rotating mirror to rotate based on the angle data of motor 20.
[0124] The lidar can generate images based on the angle data of motor 20 and the point cloud information collected under the angle data of each motor 20.
[0125] Specifically, motor 20 can be used to drive the rotation of the lidar mirror. For lidar to achieve environmental perception, it needs to scan and acquire point cloud information at different locations in the environment. The lidar's position corresponds to the angle data of motor 20. Therefore, to determine the position corresponding to the point cloud acquired by the lidar, the lidar needs to acquire the angle data of motor 20. Thus, motor controller 10 can send the angle data of motor 20 to the lidar in real time, enabling the lidar to generate an image of the scene (such as a 3D image) based on the angle data of motor 20 and the point cloud information collected under the angle data of each motor 20, thereby achieving visual perception.
[0126] In some embodiments, please refer to Figure 9 Motor control methods also include:
[0127] Step 020: Based on the speed and angle data of motor 20, perform fault detection to obtain the fault detection results;
[0128] Step 021: Based on the fault detection results, issue a prompt message.
[0129] Specifically, the motor controller 10 also has a fault detection function, which can detect whether the speed or angle data of the motor 20 is abnormal. If the speed detection value deviates from the normal speed range, or the difference from the target set speed is too large, the speed is determined to be abnormal; or, if the angle data of the motor 20 is abnormal (such as exceeding the normal angle range), the angle data is determined to be abnormal. At this time, the motor 20 or the motor controller 10 (such as the encoder 21) may have malfunctioned, and timely handling is required.
[0130] Therefore, the motor controller 10 can issue a prompt message based on the fault detection results, prompting maintenance personnel to perform maintenance in time, so as to avoid the motor 20 and the motor controller 10 continuing to operate under fault conditions and causing more serious faults.
[0131] Based on the method described in the above embodiments, this application also provides a control device 300 for executing the steps in the above motor control method. Please refer to... Figure 10 , Figure 10 This is a schematic diagram of the control device 300 provided in an embodiment of this application. The control device 300 includes a time-sharing drive module 301 and a determination module 302, wherein:
[0132] The calculation module 301 is used to obtain the rotational speed of the motor 20 based on the angle data of the motor 20;
[0133] The processing module 302 is used to generate motor control information based on the rotational speed of the motor 20 and the target set rotational speed through a preset motor control model, the motor control model including a speed control loop;
[0134] The control module 303 is used to control the operation of the motor 20 based on the motor control information.
[0135] It should be noted that the specific details of each module unit in the control device 300 have been described in detail in the embodiments of the motor control method, and will not be repeated here.
[0136] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0137] In some embodiments, the control device in this application can be implemented in hardware, such as an electronic device or a component in an electronic device, such as an integrated circuit or a chip; the control device can also be implemented in software, such as as an application installed in an electronic device.
[0138] In some embodiments, please refer again Figure 1 In this embodiment, the motor controller 10 is used to control the operation of the motor 20. The motor controller 10 includes a processor and a memory. The memory stores a control program. The processor is used to execute the control program to perform the motor control method of any of the above embodiments and achieve the same technical effect. To avoid repetition, it will not be described again here.
[0139] In some embodiments, please refer again Figure 1 The motor system 100 in this embodiment includes the motor controller 10 and the motor 20 described in the above embodiments. The motor controller 10 is used to control the operation of the motor 20.
[0140] In some embodiments, please refer again Figure 1 The lidar 900 in this embodiment includes a rotating mirror 200 and a motor system 100 as described in the previous embodiment. The motor 20 is used to drive the rotating mirror 200 to rotate. If the rotating mirror 200 is connected to the rotor of the motor 20, the motor 20 drives the rotor to rotate, thereby causing the rotating mirror 200 to rotate.
[0141] Optionally, the lidar 900 also includes a transmitter and a receiver. The light emitted by the transmitter is reflected by the rotating mirror 200 and directed to different locations in the scene. The light reflected by the scene is then reflected by the rotating mirror and enters the receiver, thereby collecting point cloud information at different locations in the scene.
[0142] Alternatively, the lidar 900 can be a rotating mirror lidar.
[0143] In some embodiments, please refer to Figure 11 The vehicle 1000 in this application embodiment includes the lidar 900, motor system 100, or motor controller 10 in the above embodiments.
[0144] The vehicles can be electric vehicles, gasoline vehicles, hybrid vehicles, range-extended vehicles, etc., without any restrictions.
[0145] This application also provides a non-transitory computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described motor control method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here.
[0146] The processor can be the processor in the electronic device described in the above embodiments. The computer-readable storage medium can be a computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.
[0147] Computer-readable media can include computer storage media and communication media. Computer storage media includes volatile and non-volatile, removable and non-removable media implemented using any method or technology for storing information such as computer-readable instructions, data structures, program modules, or other data. Computer storage media include RAM, ROM, erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that computer storage media are not limited to the above-mentioned types.
[0148] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the aforementioned motor control method. The processor may be a processor in the electronic device described in the above embodiments. When executed by the processor, the computer program implements the various processes of the embodiments of the aforementioned motor control method and achieves the same technical effects; therefore, to avoid repetition, further details are omitted here.
[0149] It is understood that in the specific implementation of this application, data related to user identity or characteristics is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0150] Although the embodiments of the present application have been shown and described, those skilled in the art will appreciate that various changes, modifications, substitutions, and variations may be made to the embodiments without departing from the principles and intent of the present application, and that the scope of the present application is defined by the claims and their equivalents.
Claims
1. A motor control method, characterized in that: The method comprises: Based on the angle data of the motor, obtaining the rotation speed of the motor; Based on the rotation speed of the motor and the target setting rotation speed, the motor control information is generated by a preset motor control model, wherein the motor control model includes a speed control loop; Based on the motor control information, the operation of the motor is controlled.
2. The motor control method according to claim 1, characterized in that: The calculating the rotation speed of the motor based on the angle data of the motor comprises: The rotation speed of the motor is calculated based on the angle change value and the rotation duration of the motor within a preset statistical period.
3. The motor control method according to claim 2, characterized in that: The angle change value corresponding to the preset statistical period is a preset value; or, the rotation duration corresponding to the preset statistical period is a first preset duration.
4. The motor control method according to claim 2 or 3, characterized in that: The method further comprises: A plurality of predetermined test statistical cycles are tested, and the preset statistical cycle is determined from the plurality of predetermined test statistical cycles.
5. The motor control method according to claim 4, characterized in that: The testing of a plurality of predetermined test statistical cycles and determining the preset statistical cycle from the plurality of predetermined test statistical cycles comprises: Obtaining at least one of a first index value and a second index value corresponding to different test statistical cycles, wherein the first index value is used to evaluate the accuracy of motor control, and the second index value is used to evaluate the stability of motor control; The preset statistical period is determined based on the first indicator value and / or the second indicator value corresponding to each of the test statistical periods.
6. The motor control method according to claim 5, characterized in that: The determining the preset statistical period based on the first indicator value and / or the second indicator value corresponding to each of the test statistical periods includes: The test statistical period in which the first indicator value is less than a first preset value and / or the second indicator value is less than a second preset value is determined as a preset statistical period, wherein the first indicator value is negatively correlated with the transient speed accuracy of the motor, and the second indicator value is negatively correlated with the speed stability of the motor.
7. The motor control method according to claim 6, characterized in that: The first index value is determined based on the difference between each real-time speed and the target set speed, the second index value is determined based on each speed average value and the target set speed, the angle range of the motor is divided into multiple sub-angle ranges, and the speed average value is determined based on the average speed of the sub-angle range.
8. The motor control method according to claim 7, characterized in that: The angle change value of the motor is obtained once every test statistical cycle, and the real-time speed = the angle change value / the test statistical cycle. Among them, v x is the xth real-time speed, and v0 is the target setting speed.
9. The motor control method according to claim 7, characterized in that: The time t taken by the motor to rotate through a sub-angle range is obtained, and the average speed value = sub-angle range / t. in, is the xth average speed, and v0 is the target setting speed.
10. The motor control method according to claim 4, characterized in that: The motor control information includes pulse width modulation information, the pulse width modulation information includes a control period, and the method further includes: Under different test control cycles, respectively determine the preset statistical cycle corresponding to each of the test control cycles; Based on the preset statistical periods corresponding to the respective test control periods, a mapping relationship between the control period and the preset statistical period is established.
11. The motor control method according to claim 10, characterized in that: The method further comprises: determining a current control cycle based on at least one of a frequency of a motor controller and a rotational speed of the motor; Based on the mapping relationship between the control cycle and the preset statistical cycle, determine the target statistical cycle corresponding to the current control cycle in each of the preset statistical cycles; The obtaining of the rotation speed of the motor based on the angle change value and the rotation duration of the motor within a preset statistical period includes: The rotation speed of the motor is calculated based on the angle change value and the rotation duration of the motor within the target statistical period.
12. The motor control method according to claim 1, characterized in that: Also includes: When the motor is started, the motor is controlled to perform a positioning operation so that the electrical angle corresponding to the angle data of the motor is 0, and the positioning operation includes controlling the motor to run at a first preset torque for a first preset time period.
13. The motor control method according to claim 12, characterized in that: Also includes: When the motor completes the positioning operation, at the start time of the first control cycle, the motor is controlled to perform a rotation operation, wherein the rotation operation includes controlling the motor to run at a second preset torque for a second preset time period; When the motor rotates, angle data of the motor is acquired.
14. The motor control method according to claim 1, characterized in that: The motor control information includes pulse width modulation information, and the motor control information is generated by a preset motor control model based on the motor speed and the target set speed, including: Based on the rotation speed of the motor, the target rotation speed and the electrical angle of the motor, pulse width modulation information is generated through a preset motor control model, and the electrical angle of the motor is determined based on the angle data of the motor and the number of pole pairs of the motor.
15. The motor control method according to claim 14, characterized in that: The method generates pulse width modulation information based on the rotation speed of the motor, the target rotation speed and the electrical angle of the motor by using a preset motor control model, wherein the electrical angle of the motor is determined based on the angle data of the motor and the number of pole pairs of the motor, including: The speed control loop processes the speed of the motor, the target setting speed, and the electrical angle of the motor to output a torque voltage and an excitation voltage; The pulse width modulation information is generated based on the torque voltage and the excitation voltage.
16. The motor control method according to claim 1, 14 or 15, characterized in that: The motor control information includes pulse width modulation information, the motor also includes a motor drive device and a three-phase inverter, the three-phase inverter is connected to the motor, and the motor is controlled to run based on the motor control information, including: The pulse width modulation information is sent to the motor driving device, so that the motor driving device controls the three-phase voltage output by the three-phase inverter based on the pulse width modulation information to control the operation of the motor.
17. The motor control method according to claim 1, characterized in that: The laser radar includes a rotating mirror, the motor and a motor controller, the motor is used to drive the rotating mirror to rotate, and the method further includes: The angle data of the motor is sent to the motor controller, so that the motor controller controls the motor to drive the rotating mirror to rotate based on the angle data of the motor.
18. The motor control method according to claim 1, characterized in that: Also includes: Performing fault detection based on the rotation speed and angle data of the motor to obtain a fault detection result; Based on the fault detection result, a prompt message is issued.
19. The motor control method according to claim 1, characterized in that: The motor includes an encoder, and the encoder is used to collect angle data of the motor. The encoder includes an absolute encoder.
20. The motor control method according to claim 1, characterized in that: The motor control model includes a vector control model.
21. A motor controller, characterized in that: The motor controller includes a processor and a memory, the memory stores a control program, and the processor is used to execute the control program to execute the motor control method according to any one of claims 1-20.
22. A motor system, characterized in that: It comprises a motor and the motor controller as claimed in claim 21.
23. A laser radar, characterized in that: It comprises a rotating mirror and the motor system according to claim 22, wherein the motor is used for driving the rotating mirror to rotate.
24. A vehicle, characterized in that: The vehicle includes the motor controller of claim 21 or the lidar of claim 23 or the motor system of claim 22.
25. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the motor control method according to any one of claims 1 to 20 is implemented.
26. A computer program product, characterized in that It comprises a computer program, which, when executed by a processor, implements the motor control method according to any one of claims 1 to 20.
Citation Information
Patent Citations
Motor rotor position detection and speed estimation method
CN106787993A
Electromechanical time constant identification method and device for rod and wire rolling mill
CN112718875A
Regulation and control method, device and system of air conditioner motor and electronic equipment
CN119070694A
Dc brushless motor system
JP2001231288A
Constant-Speed Control Circuit for BLDC Motors
US20110254498A1