Position deviation calibration method, motor driving method, system and device

Through the simplified position deviation calibration method, the position deviation value of the motor is calculated by using the electrical angle value and mechanical angle, the problems of complex calibration process and adaptation limitation in the prior art are solved, and efficient adaptation and stable operation of the motor are achieved.

CN114499290BActive Publication Date: 2025-03-11SHANGHAI MICROPORT MEDBOT (GRP) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111583018.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-22
Publication Date
2025-03-11
Estimated Expiration
2041-12-22

AI Technical Summary

Technical Problem

In the prior art, the calibration process of position deviation between the motor driver and the motor is complicated and requires human participation. There are errors and adaptation restrictions, resulting in the motor being unable to operate normally.

Method used

A position deviation calibration method is provided. By obtaining the preset electrical angle value, outputting the corresponding torque to the motor, and reading the mechanical angle of the position sensor, calculating the position deviation value between the position sensor and the motor, simplifying the calibration process.

Benefits of technology

This method does not require a towing motor and a towing driver, and does not require an oscilloscope and tooling, which simplifies the calibration process, reduces errors, and improves the adaptability and operating stability of the motor.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114499290B_ABST
    Figure CN114499290B_ABST
Patent Text Reader

Abstract

The present application relates to a position deviation calibration method and a motor driving method. The method comprises: obtaining a preset electrical angle value corresponding to the rotation position of the motor; outputting a torque corresponding to the electrical angle value to the motor; mechanically reading the mechanical angle of the motor rotor output by the position sensor; obtaining the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle. The motor driving method comprises: reading the position deviation value obtained by the position deviation calibration method; reading the output value of the position sensor; calculating the motor rotation position according to the position deviation value and the output value; processing the motor rotation position to obtain a pulse width modulation signal for driving the motor to operate. The present method can automatically calibrate the position deviation value of the position sensor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of motor control technology, and in particular to a position deviation calibration method, a motor driving method, a system and a device. Background Art

[0002] The motor and its driver are the power actuators of the robot and the core components of the robot system. The relative positions of traditional motors and their encoders are fixed together and calibrated before leaving the factory.

[0003] In the permanent magnet synchronous motor driver, there is a key parameter configuration that matches the relative position of the motor and its position sensor. The common method now is to fix and make the relative position relationship between the motor and the position sensor fixed and consistent through tooling and processes when leaving the factory. At the same time, the corresponding configuration parameters of the motor driver are also fixed values.

[0004] However, the motor driver and the motor have a matching relationship, and the relative position relationship between the motors and position sensors installed by different manufacturers / countries is not uniform, so users must purchase the motor driver and motor as a set.

[0005] Among them, in traditional technology, the position deviation calibration adopts a drag device, which drives the measured motor to rotate through the coupling. In the rotating state, the motor winding will generate back electromotive force, the zero-crossing signal of the position encoder will generate a pulse waveform, and the U phase of the zero sensor will generate a high-low level jump. The conventional alignment strategy is to align the sensor zero signal with the zero-crossing point of the back electromotive force by adjusting the relative position of the sensor and the motor. If there is an independent Hall sensor and the angle needs to be adjusted, the same method is used to align the rising edge of the sensor U signal with the zero-crossing point of the back electromotive force. This method is used to perform drag correction and unify the difference before each motor leaves the factory. In this way, the fixed deviation value difference inside the driver can be adapted to each motor. However, because the position of the back electromotive force alignment of each motor manufacturer is not uniform, the driver and motor need to be used in combination. As long as the fixed deviation value parameters inside the driver and the position deviation value of the motor are not compatible, the motor cannot operate normally.

[0006] The traditional calibration method uses a pair of motors and drivers, an oscilloscope, and certain tooling to complete the calibration. In addition, workers need to operate the machine, and each step requires human involvement, which makes errors more likely. In addition, the calibration completion standard is determined by the oscilloscope waveform, which is somewhat subjective. In addition, if the driver does not have the function of identifying bias, the motors it can adapt to will be limited. Summary of the invention

[0007] Based on this, it is necessary to provide a position deviation calibration method, a motor driving method, a system and a device that can calibrate the position deviation value of the position sensor in order to address the above technical problems.

[0008] A position deviation calibration method, the method comprising:

[0009] Obtaining a preset electrical angle value corresponding to the rotation position of the motor;

[0010] Outputting a torque corresponding to the electrical angle value to the motor;

[0011] Read the mechanical angle of the motor rotor output by the position sensor;

[0012] A position deviation value between the position sensor and the motor is obtained according to the electrical angle value and the mechanical angle.

[0013] In one embodiment, before obtaining the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle, the method further includes:

[0014] Under open-loop control, the forward current and reverse current fed back by the motor during forward and reverse rotation are substantially equal in magnitude and are minimized, and the motor is in a stable forward and reverse operation state.

[0015] In one embodiment, before obtaining the preset electrical angle value corresponding to the rotation position of the motor, the method includes:

[0016] Get the type of position sensor;

[0017] The obtaining of the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle includes:

[0018] A position deviation value between the position sensor and the motor is obtained according to the type of the position sensor, the electrical angle value and the mechanical angle.

[0019] In one embodiment, the type of the position sensor is a Hall sensor; and obtaining the position deviation value between the position sensor and the motor according to the type of the position sensor, the electrical angle value, and the mechanical angle includes:

[0020] The electrical angle value corresponding to the signal transition edge output by the Hall sensor is recorded as the position deviation value between the position sensor and the motor.

[0021] According to the above position deviation calibration method, the type of the position sensor is an encoder; the position deviation value between the position sensor and the motor is obtained according to the type of the position sensor, the electrical angle value and the mechanical angle, including:

[0022] The electrical angle value corresponding to the zero position signal output by the encoder is obtained as a position deviation value between the position sensor and the motor.

[0023] In one embodiment, the type of the position sensor is an encoder, and the electrical angle value is set to 0; and obtaining the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle includes:

[0024] Reading the output angle of the position sensor;

[0025] The position deviation value between the position sensor and the motor is calculated according to the output angle of the position sensor.

[0026] In one embodiment, the method further comprises:

[0027] The position sensor is calibrated to obtain the counting direction and / or line number information of the position sensor.

[0028] In one embodiment, the counting direction verification method includes:

[0029] Determining whether the increase or decrease direction of the mechanical angle of the position sensor is consistent with the increase or decrease direction of the electrical angle value;

[0030] When the increase and decrease direction of the mechanical angle of the position sensor is inconsistent with the increase and decrease direction of the electrical angle value, the counting direction of the position sensor is configured to be consistent with the increase and decrease direction of the electrical angle value.

[0031] In one embodiment, the verification method of the line number information includes:

[0032] Adjacent zero-position signals output by the position sensor are acquired, and increments of mechanical angles between the adjacent zero-position signals are counted as the line number information.

[0033] In one embodiment, the position sensor is a Hall sensor; after reading the output value of the position sensor, the method further includes:

[0034] Determining whether the output value of the position sensor meets a preset requirement;

[0035] When the output value of the position sensor does not meet the requirement, it is determined that the position sensor is faulty.

[0036] A motor driving method, the motor driving method comprising:

[0037] Reading the position deviation value obtained according to the position deviation calibration method described in any one of the above embodiments;

[0038] Reading the output value of the position sensor;

[0039] The motor rotation position is calculated according to the position deviation value and the output value;

[0040] The rotational position of the motor is processed to obtain a pulse width modulation signal for driving the motor to operate.

[0041] A motor drive system, the system comprising a motor, a position sensor and a motor driver; the position sensor is connected to the motor and the motor driver respectively, and the motor is connected to the motor driver;

[0042] The motor driver is used to execute the steps in the method in any one of the above embodiments.

[0043] A robot joint, wherein the robot shutdown adopts the above-mentioned motor drive system.

[0044] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above embodiments when executing the computer program.

[0045] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of the method in any one of the above embodiments.

[0046] The above-mentioned position deviation calibration method, motor drive method, system and equipment do not require a pair of towing motors and towing drivers, nor do they require an oscilloscope and some tooling. It is only necessary to connect the motor driver and the motor, and then obtain a pre-set electrical angle value corresponding to the rotation position of the motor. In this way, a torque corresponding to the electrical angle value is output to the motor, and the mechanical angle of the motor rotor output by the position sensor is read in mechanical angle. Then, the position deviation value between the position sensor and the motor is obtained by processing according to the electrical angle value and the mechanical angle, which is simpler and more convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 is a schematic diagram of a motor drive system in one embodiment;

[0048] Figure 2 Schematic diagram of a flow chart of a method for calibrating a position deviation in one embodiment;

[0049] Figure 3is a schematic diagram of an embodiment in which the torque is perpendicular to the rotor of the motor;

[0050] Figure 4 is a schematic diagram of an embodiment in which the torque overlaps with the rotor of the motor;

[0051] Figure 5 A schematic diagram of a process for obtaining a forward and reverse stable running state in an embodiment;

[0052] Figure 6 is a flow chart for obtaining a position deviation value of a Hall sensor in an embodiment;

[0053] Figure 7 is a schematic flow chart of a position deviation calibration method in another embodiment;

[0054] Figure 8 is a schematic flow chart of a motor driving method in one embodiment;

[0055] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0057] The position deviation calibration method and motor driving method provided in this application can be applied to Figure 1 The motor drive system shown in the figure includes a motor, a position sensor and a motor driver; the position sensor is connected to the motor and the motor driver respectively, and the motor is connected to the motor driver. The position sensor and the motor can be separated and connected by a transmission device in the middle, which gives engineers more freedom in space utilization.

[0058] Combination Figure 1 As shown, the motor driver does not need to drag the motor and the driver, nor does it need an oscilloscope and some tooling. It only needs to connect the driver and the motor to be dragged normally, start the automatic configuration program through the upper interface, and then learn and store the position deviation value of the motor and the position sensor according to the process. In addition, the motor driver can also identify and correct the position sensor parameters and whether there is a signal failure based on the basic parameters such as the type of the position sensor. For details, please refer to the following.

[0059] In one embodiment, Figure 2 As shown, a position deviation calibration method is provided, which is applied to Figure 1The motor driver in the example is used as an example to illustrate, including the following steps:

[0060] S202: Acquire a preset electrical angle value corresponding to the rotation position of the motor.

[0061] Specifically, the electrical angle value is pre-set, which gives the electrical angle value that changes according to a certain rule under different mechanical positions. Preferably, the change direction of the rotation position of the motor can be pre-set, so that the electrical angle value that changes according to a certain rule is configured according to the incremental rotation position of the motor. In practical applications, the electrical angle value is the angle value of the artificially given excitation signal, that is, the rotation angle value corresponding to the rotation voltage given by the voltage open loop. Taking the ring motor as an example, its rotor rotates one circle to produce different incremental positions, and the user pre-configures these incremental positions with electrical angle values ​​that change according to a certain rule.

[0062] S204: Outputting a torque corresponding to the electrical angle value to the motor.

[0063] Specifically, the torque configured according to the electrical angle value can be found in Figure 3 and Figure 4 As shown, one of the torques is Figure 3 The torque shown in the figure is perpendicular to the motor rotor. This is the state with the maximum speed under a certain torque, that is, the motor is in a stable forward and reverse running state. In this state, the torque is perpendicular to the motor rotor. As the electrical angle value changes, the direction of the torque also changes, but the torque and the motor rotor are always perpendicular to each other. The other is Figure 4 The torque in the motor overlaps with the rotor. At this time, under a certain torque, the position of the rotor remains unchanged, and the electrical angle value is fixed at 0.

[0064] Optionally, when outputting a torque corresponding to an electrical angle value to the motor, it is preferred to first output a torque that causes the motor's rotor to rotate, and keep the torque and the rotor in a vertical state. The torque value is adjusted so that the motor is in a stable state, and then the readings of the position sensor are collected to avoid errors.

[0065] S206: Read the mechanical angle of the motor rotor output by the position sensor.

[0066] Specifically, in this embodiment, the position sensor can be selected according to actual conditions, wherein the position sensor includes a Hall sensor and / or an encoder, and the motor driver can acquire the mechanical angle of the Hall sensor and / or the encoder.

[0067] Among them, the mechanical angle of the motor rotor output by the position sensor needs to be read after the motor is in a stable operating state of forward and reverse installation, or at least wait for the motor rotor to rotate one circle before reading. Take the incremental rotation position sensor as an example, after power-on, the signal output by the position sensor is zero, and increases successively until it reaches the zero position, then corrects, outputs the zero position signal, and then increases according to the encoding method, so in order to ensure the accuracy of the mechanical angle of the position sensor, it is necessary to wait for the motor rotor to rotate one circle before reading. In other embodiments, when the electrical angle value is always 0, the mechanical angle of the motor rotor output by the position sensor can be read at the mechanical angle when the rotor is no longer rotating.

[0068] S208: Obtaining a position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle.

[0069] Among them, since the electrical angle value corresponds to the rotation position of the motor, the mechanical angle of the position sensor also corresponds to the rotation position of the motor. Therefore, the correspondence between the electrical angle value and the mechanical angle can be obtained according to the rotation position of the motor, and then the position deviation value between the position sensor and the motor can be obtained.

[0070] More preferably, since the calculation logic of the position deviation value of the position sensor and the motor is different when the rotor is in a rotating state and a non-rotating state, the motor driver processes the electrical angle value and the mechanical angle according to the calculation logic corresponding to the state of the rotor to calculate the position deviation value.

[0071] In order to enable the technicians in this field to fully understand the above technical solution, the principle of the technical solution is explained below, wherein the electrical angle value corresponding to the rotation position of each motor is preset by the motor driver, that is, at the corresponding mechanical position, there is firstly an electrical angle value corresponding to the electrical angle value, which is also the angle value of the artificially given excitation signal. According to the electrical principle, the direction of the magnetic field of the rotor is consistent with the direction of the magnetic field of the stator. For each input of an electric pulse, the motor rotates one angle and moves forward one step. The angular displacement it outputs is proportional to the number of pulses input, and the speed is proportional to the pulse frequency. Therefore, when the rotor rotates one circle, the mechanical angle of the position sensor is recorded, and the mechanical angle is the actual mechanical position of the rotor, thereby establishing a corresponding relationship between the mechanical angle and the electrical angle value, so that the position deviation value between the position sensor and the motor at each position can be known according to the corresponding relationship between the mechanical angle and the electrical angle value.

[0072] The above-mentioned position deviation calibration method does not require a pair of towing motors and towing drivers, nor does it require an oscilloscope or some tooling. It only requires connecting the motor driver and the motor, and then obtaining a preset electrical angle value corresponding to the rotation position of the motor. In this way, the torque corresponding to the electrical angle value is output to the motor, and the mechanical angle of the motor rotor output by the position sensor is read in mechanical angle. Then, the position deviation value between the position sensor and the motor is obtained by processing according to the electrical angle value and the mechanical angle, which is simpler and more convenient.

[0073] In one of the embodiments, before obtaining the position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle, it also includes: under open-loop control, the forward current and reverse current fed back by the motor during forward and reverse rotation are basically equal in magnitude and the forward current and reverse current are minimized, and the motor is in a stable forward and reverse operation state.

[0074] In one of the embodiments, the method for obtaining the forward and reverse stable operation state includes: first configuring the torque of the input motor to make the motor start to rotate; collecting the sampled current output when the motor is forward and reversed; when the sampled currents are equal and minimum in size, the motor is in the forward and reverse stable operation state.

[0075] Specifically, the forward and reverse stable operation state is that when the motor is unloaded, a certain torque and a certain speed of rotation position angle are given, and the given positive and negative torque magnitude is automatically adjusted by the program (for example, increasing in order from small to large), so that the magnitude of the current feedback during forward and reverse rotation is basically equal, and the motor runs smoothly, wherein with the magnitude of the given positive and negative torque, the magnitude of the forward current and reverse current fed back will also change. When the magnitude of the forward current and the reverse current are basically equal and minimum, the motor is in a forward and reverse stable operation state. Among them, the minimum is mainly to ensure that the direction of the torque is basically perpendicular to the direction of the rotor, so that the direction of the torque can be calculated according to the pre-set electrical angle value and the direction of the rotor, which is convenient for applying the torque. This state is the basis for obtaining the Hall sensor and obtaining the position parameters corresponding to the encoder zero position.

[0076] Among them, the motor's given torque must overcome its own friction to rotate. According to the characteristics of the synchronous motor, the motor's rotation angle is consistent with the angle corresponding to the given incremental rotation position. Then, at a given constant speed, the direction of the minimum torque vector to maintain normal rotation must be perpendicular to the current electrical position of the motor rotor. When the positive and negative friction forces are the same, the positive and negative minimum torques must also be the same. Based on the above derivation, the size of the data feedback from the current sampling can be used to determine whether the motor has reached the required state.

[0077] Specifically, combined Figure 5 As shown, Figure 5The figure is a schematic diagram of the acquisition process of the forward and reverse stable operation state in an embodiment. In this embodiment, the motor and the driver are first correctly connected, and then when the motor output is unloaded, the control architecture of SVPWM (space vector pulse width debugging method) is used to configure the torque of the input motor so that the motor starts to rotate; the sampled current output when the motor is forward and reverse is collected; when the sampled currents are equal and minimum, the motor is in the forward and reverse stable operation state, for example, the ipark input parameters are configured as Id=0, Iq=0.2 (per unit value), where it should be noted that Id represents the current on the d-axis, and Iq represents the current on the q-axis, where since the current on the d-axis does not cut the magnetic flux lines when the rotor rotates, the induced current id does not generate the Lorentz force; the current on the q-axis cuts the magnetic flux lines when the rotor rotates, thereby generating the Lorentz force and then generating the torque, so different torque values ​​can be configured by configuring the current on the q-axis.

[0078] In this way, after the torque is configured, the rotation angle theta (i.e. the given electrical angle value) corresponding to the artificially given incremental position information is injected to ensure relative stability. Preferably, an electrical angle theta signal with an incremental frequency of about 20% of the rated frequency is injected, and then the above-mentioned torque is adjusted, mainly the size and direction of Iq, so that the rotation speed is stable, and the forward and reverse stable operation state is achieved when the input current is consistent.

[0079] In the above embodiment, space vector control is used as the basic framework. By artificially giving the rotation angle theta (i.e., the given electrical angle) corresponding to the incremental position information, the actual feedback information of the sensor is replaced. By artificially giving the torque information on the q-axis of the rectangular coordinate system, the motor will rotate in an open loop. The motor phase current will be collected inside the program, and after a series of transformations, the torque information feedback will be obtained; when the motor is rotating forward and reverse, the sampled current of the motor is equal and can maintain normal operation when it is at the minimum. This state is used as the operating state for subsequent dynamic identification.

[0080] In one of the embodiments, before obtaining a preset electrical angle value corresponding to the rotation position of the motor, it includes: obtaining the type of the position sensor; obtaining a position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle, including: obtaining the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value and the mechanical angle.

[0081] Specifically, the types of position sensors here include Hall sensors and encoders, wherein before calibrating the position sensor, the type of the position sensor is first determined, and then subsequent calibration is performed to avoid errors.

[0082] That is, different parameters are learned according to different position sensors. For this sensor type, you need to select the actual sensor to be used by setting parameters before starting the configuration. Otherwise, an error will be reported.

[0083] In one embodiment, the type of the position sensor is a Hall sensor; based on the type of the position sensor, the electrical angle value and the mechanical angle, the position deviation value between the position sensor and the motor is obtained, including: recording the electrical angle value corresponding to the signal jump edge output by the Hall sensor as the position deviation value between the position sensor and the motor.

[0084] Specifically, Hall sensors are generally used to assist commutation. Some are installed between the slots of the motor, some are combined with other sensors, and some are separate. Traditionally, this sensor is divided into 120-degree and 60-degree Hall sensors.

[0085] The position deviation value between the position sensor and the motor in this embodiment can be represented by the given electrical angle information corresponding to the Hall-assisted commutation signal, so the motor driver only needs to record the given electrical angle value corresponding to the Hall-assisted commutation signal.

[0086] In servo applications, if there is a higher precision incremental position sensor, the Hall sensor is only used for coarse positioning at startup to obtain the electrical angle corresponding to the startup position. Once the startup is successful, it is no longer used before power failure.

[0087] Combination Figure 6 As shown, Figure 6 This is a flow chart for obtaining the position deviation value of a Hall sensor in an embodiment. In this embodiment, first ensure that the motor is in a stable forward and reverse running state, and there is a Hall auxiliary commutation signal. When the rotation is greater than one circle and in the rotating state, record the electrical angle value corresponding to the signal jump edge output by the Hall sensor and store it.

[0088] In practical applications, the given electrical angle is an artificially given excitation signal, that is, the rotation angle value corresponding to the rotation voltage given by the voltage open loop. The auxiliary commutation signal changes in a cycle of 5, 1, 3, 2, 6, and 4 within one electrical cycle. The angle value of the given rotation voltage corresponding to the edge moment of the auxiliary commutation signal jump is recorded as the position deviation value between the position sensor and the motor.

[0089] In one embodiment, the type of the position sensor is an encoder; based on the type of the position sensor, the electrical angle value and the mechanical angle, the position deviation value between the position sensor and the motor is obtained, including: obtaining the electrical angle value corresponding to the zero position signal output by the encoder as the position deviation value between the position sensor and the motor.

[0090] Specifically, combined Figure 3As shown, when the torque is perpendicular to the rotor angle of the motor, the torque is output and the rotor rotates. Taking the encoder as an incremental position sensor as an example, obtaining its position offset and calculating the motor encoder offset angle include: in the above-mentioned forward and reverse stable running state, when the Z signal (zero position signal) is detected, the artificially given incremental position value at this time is recorded, and this value is the offset value of the position sensor.

[0091] Specifically, in the SVPWM motor drive control algorithm, the torque is synthesized by the three-phase current vector. The position information fed back by the position sensor and the position of the rotor are in a fixed relationship. In order to make the motor run with maximum efficiency, the given torque direction and the rotor direction are 90 degrees perpendicular. Leading by 90 degrees means forward rotation, and lagging by 90 degrees means reverse rotation.

[0092] Therefore, by artificially giving the torque angle (that is, the electrical angle value corresponding to the increasing position value mentioned in the document), the motor can run smoothly in forward and reverse directions, and the speed is low and the current is minimum, that is, the efficiency is highest.

[0093] In one embodiment, the type of the position sensor is an encoder, and the electrical angle value is set to 0; based on the type of the position sensor, the electrical angle value and the mechanical angle, the position deviation value between the position sensor and the motor is obtained, including: reading the output angle of the position sensor; and calculating the position deviation value between the position sensor and the motor based on the output angle of the position sensor.

[0094] Combination Figure 4 As shown in the figure, when the torque overlaps with the rotor of the motor, the given Iq force remains unchanged. At this time, the artificially given position feedback value is set to 0. Because the synchronous motor has force and a fixed position setting, the motor will also be fixed. At this time, read the data fed back by the encoder, and then convert it into electrical angle (per unit) on this basis, and then add the 90 degrees required for actual application, that is, 0.25 (per unit). This value is the electrical angle value corresponding to the position of the encoder offset, which is recorded and saved.

[0095] Specifically, according to the above SVPWM control algorithm, by giving the Iq torque angle as 0 and keeping it unchanged, the rotor direction coincides with the given torque direction, the motor remains stationary, and the position corresponding to the angle plus the lead amount can also obtain the required bias value.

[0096] It should be noted that, in this embodiment, in order to ensure accuracy, the data of the position sensor is read only after the motor runs smoothly.

[0097] In one of the embodiments, before obtaining the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value and the mechanical angle, the method further includes: calibrating the position sensor to obtain the counting direction and / or line number information of the position sensor.

[0098] In one of the embodiments, the counting direction verification method includes: determining whether the increase or decrease direction of the mechanical angle of the position sensor is consistent with the increase or decrease direction of the electrical angle value; when the increase or decrease direction of the mechanical angle of the position sensor is inconsistent with the increase or decrease direction of the electrical angle value, configuring the counting direction of the position sensor to be consistent with the increase or decrease direction of the electrical angle value.

[0099] Specifically, combined Figure 7 As shown, Figure 7 The present invention is a flow chart of a counting direction verification method in an embodiment. In this embodiment, the motor is first kept in the above-mentioned forward stable running state, and it is determined whether the counting direction of the encoder is an increasing count. When the motor is running in the forward direction, the value obtained from the encoder changes from small to large, which is an increasing count. When the data obtained from the encoder changes from large to small, it is a decreasing count.

[0100] This increase and decrease counting method can be set during peripheral verification. For example, taking the ST microcontroller as an example, the encoder corresponds to the microcontroller peripheral as a timer. The verification process is to configure the parameters of the timer related registers, such as: counting direction setting, counting cycle setting, zero-crossing signal interrupt configuration and other parameter verifications.

[0101] If the direction of increase or decrease of the mechanical angle of the position sensor is inconsistent with the direction of increase or decrease of the electrical angle value, you can modify the configuration parameters and reconfigure the peripheral.

[0102] The same method can also be used to determine whether the increase and decrease directions of absolute encoders are consistent. If not, make them consistent by selecting parameters or modifying logic.

[0103] In one of the embodiments, the verification method of the line number information includes: obtaining adjacent zero-position signals output by the position sensor, and counting the increment of the mechanical angle between the adjacent zero-position signals as the line number information.

[0104] Specifically, the purpose of checking the number of lines is to verify whether the line number information of the position sensor is correct. Regardless of whether it is an incremental encoder or an absolute position encoder, when the motor physically rotates one circle, the change in the count value can be calculated. The change is compared with the set position sensor through conversion. If the deviation is not large (especially for sensors such as optical encoders that count the number of pulses, there may be interference leakage or a large number of cases), the set value can be considered correct. Specifically, when the motor rotates, the zero position signal of the incremental encoder is triggered once per circle. The number of counts between the two trigger signals is the encoder's count cycle, and this value is used for calibration with the pre-set count cycle value.

[0105] Among them, the incremental rotary encoder is used as an example for explanation. The incremental rotary encoder consists of a code disk with a shaft in the center. When rotating, the engraved lines of the code disk are read by the photoelectric transmitting and receiving devices. A signal with a phase difference of 90 degrees between the A and B phases is obtained; at the same time, a Z phase pulse is output for each rotation to represent the zero reference position. Since the phase difference between the A and B phases is 90 degrees, the forward and reverse rotation of the encoder can be determined by comparing whether the A phase is in front or the B phase is in front. The zero reference position of the encoder can be obtained through the zero pulse.

[0106] The Z signal refers to the signal output by the Z-phase pulse of the incremental encoder, which represents the zero position reference, that is, the zero position signal.

[0107] In one embodiment, the position sensor is a Hall sensor; after reading the output value of the position sensor, the method further includes: determining whether the output value of the position sensor meets a preset requirement; when the output value of the position sensor does not meet the requirement, determining that the position sensor is faulty.

[0108] Specifically, when the position sensor is a Hall sensor, it is also possible to detect whether the Hall sensor signal is correct. The three signals are combined bit by bit, ranging from 0 to 7, but the electrical characteristics determine that the two values ​​of 0 and 7 will never appear (under the conventional 120-degree Hall condition). Once they appear, it indicates that the sensor input signal is faulty, with the possibility of short circuit or open circuit. Therefore, it can be used as a judgment condition for error detection. It is determined whether the output value of the Hall sensor contains the two values ​​of 0 and 7. If so, it is determined to be faulty.

[0109] In one embodiment, in order to enable those skilled in the art to fully understand the position deviation calibration method in the present application, the position sensor including the Hall sensor and the encoder is used as an example for explanation. Figure 8 As shown, Figure 8 This is a flow chart of a position deviation calibration method in another embodiment. In this embodiment, the method mainly includes the following steps:

[0110] First, the motor driver voltage is open-loop controlled so that the motor runs smoothly in forward and reverse directions and the feedback current is consistent. That is, the three-phase rotating voltage is directly given, and the rotating voltage will generate a rotating magnetic field, which will drive the motor rotor to rotate. The open loop does not go through the PID closed loop.

[0111] Secondly, calibrate the encoder, including checking the encoder, that is, determining the encoder counting direction; verifying the encoder line number information through the number of pulses obtained by the two zero-position signal intervals of the encoder, and re-checking the encoder counting configuration.

[0112] Third, obtain the corresponding position parameters of the Hall sensor signal (motor auxiliary commutation signal): collect the given electrical angle value corresponding to the jump edge of the motor auxiliary commutation signal and store it; the electrical angle value corresponding to the different signals of the Hall sensor obtained is the offset angle of the sensor when the signal is different.

[0113] Fourth, obtain the position parameters corresponding to the encoder zero position: after the driver runs stably, obtain and store the given electrical angle value corresponding to the encoder zero position signal jump edge. The electrical angle value corresponding to the encoder zero position signal moment is the motor encoder offset angle; or fix the given electrical angle to 0, at this time the motor remains locked in a certain position, record and store the electrical angle fed back by the encoder, and deduce the motor encoder offset angle.

[0114] According to the offset angle of the Hall sensor and the offset angle of the motor encoder, the configuration of the driver and the motor sensor is completed.

[0115] In one embodiment, Figure 8 As shown, a motor driving method is provided, which is applied to Figure 1 The motor driver in the example is used as an example to illustrate, including the following steps:

[0116] S802: Read the position deviation value obtained according to the above position deviation calibration method.

[0117] Specifically, the calculation of the position deviation value may refer to the definition of the position deviation calibration method in any of the above embodiments, which will not be repeated here.

[0118] S804: Read the output value of the position sensor.

[0119] S806: Calculate the motor rotation position according to the position deviation value and the output value.

[0120] Reading the position sensor information will get the corresponding motor rotation angle. The driver can calculate the motor rotation position by reading the feedback position of the position sensor and adding the corrected relative position offset.

[0121] S808: Process the motor rotation position to obtain a pulse width modulation signal for driving the motor to operate.

[0122] The motor phase current is collected mainly for current closed loop applications, where pulse width adjustment can include CLARK conversion, PARK conversion, control loop, IPARK conversion, and ICLARK conversion.

[0123] Specifically, CLARK transformation is the transformation from a three-phase rotating coordinate system to a two-phase rotating coordinate system. PARK transformation is the transformation from a two-phase rotating coordinate system to a stationary Cartesian coordinate system. IPARK transformation and ICLARK transformation are the inverse operations of CLARK transformation and PARK transformation. PWM refers to pulse width modulation. In the control process, the transmission parameters of each module are all per-unit values.

[0124] Among them, it should be noted that the above-mentioned motor drive method can be applied to robot joints. Through this method, the motor and encoder can be designed separately and installed independently, which can improve the flexibility of structural design, further reduce the volume and reduce costs. The motor production steps are simplified, that is, the alignment steps of the motor and encoder are reduced, the motor production process is optimized, and the efficiency is improved. Finally, the driver can be adapted to motors from different manufacturers. The problem of mismatch between the offset angle of the driver and the motor encoder is solved, and the opportunity for driver users to choose motor suppliers is increased. The monopoly of the bundled sales of drivers and motors is interrupted.

[0125] It should be understood that although Figure 2 and Figure 8 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 and Figure 8 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0126] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a position deviation calibration method and a motor driving method are implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the computer device housing, or an external keyboard, touch pad or mouse, etc.

[0127] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0128] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: obtaining a preset electrical angle value corresponding to the rotation position of a motor; outputting a torque corresponding to the electrical angle value to the motor; reading the mechanical angle of the motor rotor output by a position sensor; and obtaining a position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle.

[0129] In one embodiment, before the processor executes the computer program to obtain the position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle, it also includes: under open-loop control, making the forward current and reverse current fed back by the motor substantially equal in magnitude during forward and reverse rotation and the forward current and reverse current are minimized, and the motor is in a stable forward and reverse operation state.

[0130] In one embodiment, before the processor executes a computer program to obtain a preset electrical angle value corresponding to the rotation position of the motor, it includes: obtaining the type of the position sensor; when the processor executes the computer program to obtain a position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle, it includes: obtaining the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value and the mechanical angle.

[0131] In one embodiment, the type of position sensor involved when the processor executes a computer program is a Hall sensor; the position deviation value between the position sensor and the motor is obtained according to the type of position sensor, electrical angle value and mechanical angle implemented when the processor executes the computer program, including: recording the electrical angle value corresponding to the signal transition edge output by the Hall sensor as the position deviation value between the position sensor and the motor.

[0132] In one embodiment, the type of position sensor involved when the processor executes the computer program is an encoder; the position deviation value between the position sensor and the motor is obtained according to the type of position sensor, electrical angle value and mechanical angle implemented by the processor when executing the computer program, including: obtaining the electrical angle value corresponding to the zero position signal output by the encoder as the position deviation value between the position sensor and the motor.

[0133] In one embodiment, the type of position sensor involved when the processor executes the computer program is an encoder, and the electrical angle value is set to 0; the position deviation value between the position sensor and the motor is obtained according to the type of the position sensor, the electrical angle value and the mechanical angle when the processor executes the computer program, including: reading the output angle of the position sensor; and calculating the position deviation value between the position sensor and the motor according to the output angle of the position sensor.

[0134] In one embodiment, the processor executes a computer program and, before obtaining the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value, and the mechanical angle, it also includes: calibrating the position sensor to obtain the counting direction and / or line number information of the position sensor.

[0135] In one embodiment, a counting direction verification method involved in the execution of a computer program by a processor includes: determining whether the increase or decrease direction of the mechanical angle of the position sensor is consistent with the increase or decrease direction of the electrical angle value; when the increase or decrease direction of the mechanical angle of the position sensor is inconsistent with the increase or decrease direction of the electrical angle value, configuring the counting direction of the position sensor to be consistent with the increase or decrease direction of the electrical angle value.

[0136] In one embodiment, a verification method of line number information involved in the execution of a computer program by a processor includes: acquiring adjacent zero position signals output by a position sensor, and counting the increment of mechanical angle between adjacent zero position signals as line number information.

[0137] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the following steps when executing the computer program: reading a position deviation value obtained according to the above-mentioned position deviation calibration method; reading an output value of a position sensor; calculating a motor rotation position according to the position deviation value and the output value; and processing the motor rotation position to obtain a pulse width modulation signal for driving the motor to operate.

[0138] In one embodiment, the position sensor implemented when the processor executes the computer program is a Hall sensor; after reading the output value of the position sensor, it also includes: determining whether the output value of the position sensor meets preset requirements; when the output value of the position sensor does not meet the requirements, it is determined that the position sensor is faulty.

[0139] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: obtaining a preset electrical angle value corresponding to the rotation position of the motor; outputting a torque corresponding to the electrical angle value to the motor; reading the mechanical angle of the motor rotor output by the position sensor; and obtaining a position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle.

[0140] In one embodiment, before the computer program is executed by the processor and the position deviation value between the position sensor and the motor is obtained based on the electrical angle value and the mechanical angle, it also includes: under open-loop control, the forward current and reverse current fed back by the motor during forward and reverse rotation are basically equal in magnitude and the forward current and reverse current are minimized, and the motor is in a stable forward and reverse operation state.

[0141] In one embodiment, before obtaining a preset electrical angle value corresponding to the rotation position of the motor when the computer program is executed by the processor, it includes: obtaining the type of the position sensor; when the computer program is executed by the processor, obtaining a position deviation value between the position sensor and the motor based on the electrical angle value and the mechanical angle includes: obtaining the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value and the mechanical angle.

[0142] In one embodiment, the type of position sensor involved when the computer program is executed by the processor is a Hall sensor; the position deviation value between the position sensor and the motor is obtained according to the type of position sensor, electrical angle value and mechanical angle implemented when the computer program is executed by the processor, including: recording the electrical angle value corresponding to the signal transition edge output by the Hall sensor as the position deviation value between the position sensor and the motor.

[0143] In one embodiment, the type of position sensor involved when the computer program is executed by the processor is an encoder; the position deviation value between the position sensor and the motor is obtained according to the type of position sensor, the electrical angle value and the mechanical angle implemented when the computer program is executed by the processor, including: obtaining the electrical angle value corresponding to the zero-position signal output by the encoder as the position deviation value between the position sensor and the motor.

[0144] In one embodiment, the type of position sensor involved when the computer program is executed by the processor is an encoder, and the electrical angle value is set to 0; the computer program implemented when the processor is executed obtains the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value and the mechanical angle, including: reading the output angle of the position sensor; and calculating the position deviation value between the position sensor and the motor based on the output angle of the position sensor.

[0145] In one embodiment, the computer program implemented when executed by the processor also includes: calibrating the position sensor to obtain the counting direction and / or line number information of the position sensor before obtaining the position deviation value between the position sensor and the motor based on the type of the position sensor, the electrical angle value and the mechanical angle.

[0146] In one embodiment, the counting direction verification method involved when the computer program is executed by the processor includes: determining whether the increase or decrease direction of the mechanical angle of the position sensor is consistent with the increase or decrease direction of the electrical angle value; when the increase or decrease direction of the mechanical angle of the position sensor is inconsistent with the increase or decrease direction of the electrical angle value, configuring the counting direction of the position sensor to be consistent with the increase or decrease direction of the electrical angle value.

[0147] In one embodiment, a verification method of line number information involved in the execution of a computer program by a processor includes: acquiring adjacent zero position signals output by a position sensor, and counting the increment of mechanical angle between adjacent zero position signals as line number information.

[0148] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented: reading a position deviation value obtained according to the above-mentioned position deviation calibration method; reading an output value of a position sensor; calculating a motor rotation position according to the position deviation value and the output value; and processing the motor rotation position to obtain a pulse width modulation signal for driving the motor to operate.

[0149] In one embodiment, the position sensor implemented when the computer program is executed by the processor is a Hall sensor; after reading the output value of the position sensor, it also includes: determining whether the output value of the position sensor meets preset requirements; when the output value of the position sensor does not meet the requirements, it is determined that the position sensor is faulty.

[0150] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0151] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0152] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for calibrating a position deviation, characterized in that: The method comprises: Calibrate the position sensor to obtain the counting direction and / or line number information of the position sensor, and adjust the counting direction of the position sensor to be consistent with the increase and decrease direction of the electrical angle value; Obtaining a preset electrical angle value corresponding to the rotation position of the motor; outputting a torque corresponding to the electrical angle value to the motor; Read the mechanical angle of the motor rotor output by the position sensor; Obtaining a position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle; Before obtaining the preset electrical angle value corresponding to the rotation position of the motor, the method includes: Get the type of position sensor; The obtaining of the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle includes: Obtaining a position deviation value between the position sensor and the motor according to the type of the position sensor, the electrical angle value and the mechanical angle; Before obtaining the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle, the method further includes: Under open-loop control, the difference between the forward current and the reverse current fed back by the motor during forward and reverse rotation is within a preset range, the forward current and the reverse current are minimized, and the motor is in a stable forward and reverse operation state.

2. The position deviation calibration method according to claim 1, characterized in that: The type of the position sensor is a Hall sensor; and obtaining the position deviation value between the position sensor and the motor according to the type of the position sensor, the electrical angle value, and the mechanical angle includes: The electrical angle value corresponding to the signal transition edge output by the Hall sensor is recorded as the position deviation value between the position sensor and the motor.

3. The position deviation calibration method according to claim 1, characterized in that: The type of the position sensor is an encoder; and obtaining the position deviation value between the position sensor and the motor according to the type of the position sensor, the electrical angle value and the mechanical angle includes: The electrical angle value corresponding to the zero position signal output by the encoder is obtained, and the electrical angle value is used to represent the position deviation value between the position sensor and the motor.

4. The position deviation calibration method according to claim 1, characterized in that: The type of the position sensor is an encoder, and the electrical angle value is set to 0; and obtaining the position deviation value between the position sensor and the motor according to the electrical angle value and the mechanical angle includes: Reading the output angle of the position sensor; The position deviation value between the position sensor and the motor is calculated according to the output angle of the position sensor.

5. The position deviation calibration method according to claim 1, characterized in that: The verification method of the counting direction includes: Determining whether the increase or decrease direction of the mechanical angle of the position sensor is consistent with the increase or decrease direction of the electrical angle value; When the increase and decrease direction of the mechanical angle of the position sensor is inconsistent with the increase and decrease direction of the electrical angle value, the counting direction of the position sensor is configured to be consistent with the increase and decrease direction of the electrical angle value.

6. The position deviation calibration method according to claim 1, characterized in that: The verification method of the line number information includes: Adjacent zero-position signals output by the position sensor are acquired, and increments of mechanical angles between the adjacent zero-position signals are counted as the line number information.

7. The position deviation calibration method according to claim 1, characterized in that: The position sensor is a Hall sensor; after reading the output value of the position sensor, the method further includes: Determining whether the output value of the position sensor meets a preset requirement; When the output value of the position sensor does not meet the requirement, it is determined that the position sensor is faulty.

8. A motor driving method, characterized in that: The motor driving method comprises: Read the position deviation value obtained by the position deviation calibration method according to any one of claims 1 to 7; Reading the output value of the position sensor; The motor rotation position is calculated according to the position deviation value and the output value; The rotational position of the motor is processed to obtain a pulse width modulation signal for driving the motor to operate.

9. A motor drive system, characterized in that: The system includes a motor, a position sensor and a motor driver; the position sensor is connected to the motor and the motor driver respectively, and the motor is connected to the motor driver; The motor driver is used to perform the steps in the method of any one of claims 1 to 7 or claim 8.

10. A robot joint, characterized in that: The robot joint adopts the motor drive system described in claim 9.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 or claim 8 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 or claim 8 are implemented.

Citation Information

Patent Citations

  • A method of determining an angular offset of a position sensor

    CN111989857A

  • Electric motor control method, electric motor and movable platform

    CN112889213A

  • Rotary input type encoder adjusting method for electrical servo motor, involves determining angular deviation of reference and actual angular position, and adjusting encoder according to angular correction determined based on deviation

    DE102004028877A1