CN110954129A - Method, device, equipment and medium for determining mileage count data - Google Patents

Method, device, equipment and medium for determining mileage count data Download PDF

Info

Publication number
CN110954129A
CN110954129A CN201911318005.8A CN201911318005A CN110954129A CN 110954129 A CN110954129 A CN 110954129A CN 201911318005 A CN201911318005 A CN 201911318005A CN 110954129 A CN110954129 A CN 110954129A
Authority
CN
China
Prior art keywords
angle
time period
hub motor
determining
angle difference
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911318005.8A
Other languages
Chinese (zh)
Inventor
邢举
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Orion Star Technology Co Ltd
Original Assignee
Beijing Orion Star Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Orion Star Technology Co Ltd filed Critical Beijing Orion Star Technology Co Ltd
Priority to CN201911318005.8A priority Critical patent/CN110954129A/en
Publication of CN110954129A publication Critical patent/CN110954129A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01CMEASURING DISTANCES, LEVELS OR BEARINGS; SURVEYING; NAVIGATION; GYROSCOPIC INSTRUMENTS; PHOTOGRAMMETRY OR VIDEOGRAMMETRY
    • G01C22/00Measuring distance traversed on the ground by vehicles, persons, animals or other moving solid bodies, e.g. using odometers, using pedometers

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

The invention discloses a method, a device, equipment and a medium for determining odometry data, which are used for determining the odometry data based on a motor adopting an absolute value encoder. According to the embodiment of the invention, the first angle difference between the second angle and the first angle can be determined by acquiring the information of the first angle which is obtained by rotating the hub motor by adopting the absolute value encoder at the current moment and the information of the second angle which is obtained by rotating the hub motor at the previous moment; and determining second odometer data of the hub motor at the current moment according to the first angle difference and the stored first odometer data at the last moment, so that the odometer data can be determined based on the hub motor adopting the absolute value encoder. When the odometry data are determined by adopting the absolute value encoder, zero-angle offset does not need to be calibrated, and the operation process is simple, so that the determination efficiency of the odometry data is improved.

Description

Method, device, equipment and medium for determining mileage count data
Technical Field
The invention relates to the field of robot navigation, in particular to a method, a device, equipment and a medium for determining mileage count data.
Background
In the field of robot navigation, odometer data is data that records the distance traveled by a robot, and plays an important role in planning a robot travel route, locating the position of the robot, and the like. In order to obtain odometer data, the robot needs to be capable of accumulating the mileage of the hub motor in real time, and reporting the accumulated mileage of the hub motor in real time through communication modes such as a bus and the like at a certain frequency and in a given unit.
In the prior art, a hub motor of a robot is a hub motor adopting an incremental encoder. However, when the hub motor using the incremental encoder is powered on, the processor of the hub motor needs to calibrate the zero angle offset according to the position of the zero angle when the hub motor is powered on, so that the operation of controlling the hub motor is complicated, and the efficiency of controlling the hub motor is influenced. Therefore, in order to improve the efficiency of the control of the hub motor, the hub motor using the incremental encoder may be replaced with the hub motor using absolute value encoding to simplify the operation of the control of the hub motor.
In the prior art, the rotating angle of the hub motor after being electrified can be determined by acquiring the pulse frequency output by the hub motor of the incremental encoder after being electrified, and then the odometer data of the hub motor can be determined. For the hub motor adopting the absolute value encoder, how to determine the odometer data is an urgent problem to be solved.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for determining odometry data, which are used for determining the odometry data based on an in-wheel motor adopting an absolute value encoder.
The embodiment of the invention provides a method for determining mileage data, which is applied to intelligent equipment with at least one in-wheel motor, wherein the at least one in-wheel motor is provided with an absolute value encoder, and the method comprises the following steps:
acquiring information of a first angle to which the hub motor rotates according to an output value of the absolute value encoder of the hub motor at the current moment;
determining a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment;
and determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the previous moment.
In one possible embodiment, the duration of the interval between the current time and the previous time is not greater than the duration of the rotation of the in-wheel motor through 180 degrees at maximum speed.
In a possible embodiment, the determining second odometry data of the hub motor at the current time according to the first angle difference and the first odometry data at the last time comprises:
if the first angle difference is determined to pass through a zero angle when the hub motor rotates in a time period between the current time and the previous time, adjusting the first angle difference;
and determining second odometer data of the motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
In one possible embodiment, determining that the in-wheel motor passes through a zero angle when rotating in a time period between a current time and the previous time comprises:
if the rotation direction of the hub motor in the time period is clockwise, and the first angle difference is a negative value, determining that the hub motor rotates through a zero angle in the time period; or
And if the rotation direction of the hub motor in the time period is in the anticlockwise direction and the first angle difference is a positive value, determining that the hub motor rotates through a zero angle in the time period.
In one possible embodiment, determining that the in-wheel motor has rotated through a zero angle in a time period between a current time and the previous time comprises:
if the first angle difference is larger than an angle threshold corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period, wherein the angle threshold corresponding to the time period is an angle value of the hub motor rotating in a time period corresponding to the time period at a preset maximum rotating speed; or
And if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
In a possible embodiment, if the in-wheel motor rotates through a zero angle in a time period between a current time and the previous time, the adjusting the first angle difference includes:
and adjusting the first angle difference according to the rotation direction of the hub motor in the time period.
In one possible embodiment, the direction in which the in-wheel motor rotates during the time period is determined according to the following:
if the first angle difference is a negative value, determining that the rotation direction of the hub motor in the time period is clockwise; or
And if the first angle difference is a positive value, determining that the rotation direction of the hub motor in the time period is a counterclockwise direction.
In a possible embodiment, the adjusting the first angle difference includes:
if the rotation direction of the hub motor in the time period is clockwise, determining an angle value obtained by adding 360 degrees to the first angle difference as an adjusted first angle difference; or
And if the rotation direction of the hub motor in the time period is in the anticlockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
The embodiment of the invention provides a device for determining mileage data, which comprises:
the acquisition module is used for acquiring information of a first angle to which the hub motor rotates according to an output value of an absolute value encoder of the hub motor at the current moment;
the determining module is used for determining a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment;
and the processing module is used for determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the last moment.
In a possible implementation manner, the processing module is specifically configured to adjust the first angle difference if it is determined that the in-wheel motor passes through a zero angle when rotating in a time period between a current time and a previous time; and determining second odometer data of the motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
In a possible implementation manner, the processing module is specifically configured to determine that the in-wheel motor passes through a zero angle when rotating in the time period if the direction in which the in-wheel motor rotates in the time period is a clockwise direction and the first angle difference is a negative value; or if the rotation direction of the hub motor in the time period is in the counterclockwise direction and the first angle difference is a positive value, determining that the hub motor rotates through a zero angle in the time period.
In a possible implementation manner, the processing module is specifically configured to determine that the hub motor passes through a zero angle when rotating in the time period if the first angle difference is greater than an angle threshold corresponding to the time period, where the angle threshold corresponding to the time period is an angle value at which the hub motor rotates at a preset maximum rotation speed for a duration corresponding to the time period; or if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
In a possible implementation manner, the processing module is specifically configured to, if the in-wheel motor rotates by a zero angle in a time period between a current time and a previous time, adjust the first angle difference according to a direction in which the in-wheel motor rotates in the time period.
In a possible implementation manner, the processing module is specifically configured to determine that a direction in which the in-wheel motor rotates in the time period is a clockwise direction if the first angle difference is a negative value; or if the first angle difference is a positive value, determining that the rotation direction of the in-wheel motor in the time period is a counterclockwise direction.
In a possible implementation manner, the processing module is specifically configured to determine, if the direction of rotation of the hub motor in the time period is clockwise, an angle value obtained by adding 360 degrees to the first angle difference as the adjusted first angle difference; or if the rotation direction of the hub motor in the time period is the counterclockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
An embodiment of the present invention provides an electronic device, where the electronic device at least includes a processor and a memory, and the processor is configured to implement the steps of the method for determining odometry data as described in any one of the above when executing a computer program stored in the memory.
An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of any one of the determination methods of odometry data described above.
According to the embodiment of the invention, the first angle difference between the second angle and the first angle can be determined by acquiring the information of the first angle which is obtained by rotating the hub motor by adopting the absolute value encoder at the current moment and the information of the second angle which is obtained by rotating the hub motor at the previous moment; and determining second odometer data of the hub motor at the current moment according to the first angle difference and the stored first odometer data at the last moment, so that the odometer data can be determined based on the hub motor adopting the absolute value encoder. When the odometry data are determined by adopting the absolute value encoder, zero-angle offset does not need to be calibrated, and the operation process is simple, so that the determination efficiency of the odometry data is improved.
Drawings
Fig. 1 is a schematic diagram illustrating a process of determining odometry data according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a motor according to an embodiment of the present invention, in which a rotation direction of the motor in a time period is clockwise and passes through a zero angle;
fig. 3 is a schematic diagram of a motor according to an embodiment of the present invention, in which a rotation direction of the motor in a time period is counterclockwise and passes through a zero angle;
fig. 4 is a schematic flow chart of an implementation of a specific method for determining odometry data according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an apparatus for determining odometry data according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to determine odometer data based on a hub motor adopting an absolute value encoder, the embodiment of the invention provides a method, a device, equipment and a medium for determining the odometer data.
Example 1:
fig. 1 is a schematic diagram of a process for determining odometry data according to an embodiment of the present invention, where the process includes the following steps:
s101: and acquiring information of a first angle to which the hub motor rotates according to the output value of the absolute value encoder of the hub motor at the current moment.
The method for determining the mileage count data provided by the embodiment of the invention is applied to the intelligent equipment provided with at least one hub motor, and the at least one hub motor of the intelligent equipment is provided with an absolute value encoder.
In the embodiment of the invention, after the hub motor is powered on, the output value of the absolute value encoder of the hub motor can be acquired through the processor of the hub motor, and the angle to which the corresponding hub motor rotates can be determined according to the output value of the absolute value encoder based on the corresponding relation between the output value of the absolute value encoder and the angle.
The corresponding relation between the output value of the absolute value encoder and the angle means that the zero angle position of the absolute value encoder is fixed, so that the output value of the absolute value encoder corresponds to the angle to which the hub motor rotates, namely the output value of the encoder corresponds to the angle to which only one hub motor rotates. For example, if the absolute value encoder has 15-bit accuracy, the output value of the absolute value encoder ranges from 0 to 32767, and according to the corresponding relationship between the output value of the encoder and the angle to which the hub motor rotates, the output value of the encoder is 0 and corresponds to 0 degree of rotation of the hub motor, the output value of the encoder is 16363 and corresponds to 180 degrees of rotation of the hub motor, the output value of the encoder is 32767 and corresponds to 360 degrees of rotation of the hub motor, and the value of the output value of the encoder between 0 and 32767 corresponds to a certain angle value of rotation of the hub motor between 0 and 360 degrees.
It should be noted that the accuracy of the absolute value encoder can be flexibly set according to actual requirements, and is not specifically limited herein.
If the odometry data is determined by the processor of the robot, after the processor of the hub motor of the robot acquires the output value of the absolute value encoder at the current moment, the output value is sent to the processor of the robot, the processor of the robot determines the information of the first angle rotated by the hub motor according to the corresponding relation between the output value of the absolute value encoder and the angle, and performs subsequent processing on the information of the first angle, so that the second odometry data of the hub motor at the current moment is determined.
If the odometry data is determined by the processor of the hub motor in the robot, after the processor of the hub motor acquires the output value of the absolute value encoder of the hub motor at the current moment, the processor of the hub motor can directly determine the information of the first angle to which the hub motor rotates according to the corresponding relation between the output value of the absolute value encoder and the angle, and the processor of the hub motor performs subsequent processing on the information of the first angle, so that the second odometry data of the hub motor at the current moment is determined.
In the embodiment of the present invention, it is preferable that the processor of the in-wheel motor determines the mileage count data because the processor of the in-wheel motor may cause a certain time delay in the process of sending the acquired output value of the absolute value encoder of the in-wheel motor at the current time to the processor of the robot.
S102: and determining a first angle difference between the second angle and the first angle according to information of a second angle rotated by the hub motor at the last moment.
In the actual rotation process of the in-wheel motor, the angle of rotation of the in-wheel motor in the time period between the current moment and the previous moment can be determined according to the absolute value of the difference between the angle of rotation of the in-wheel motor at the current moment and the angle of rotation of the in-wheel motor at the previous moment, for example, if the first angle is 12 degrees and the second angle is 15 degrees, the difference between the first angle and the second angle is 3 degrees, which indicates that the in-wheel motor rotates 3 degrees in the time period from the previous moment to the current moment. For another example, if the first angle is 26 degrees and the second angle is 20 degrees, the difference between the first angles is-6 degrees, that is, the in-wheel motor rotates by 6 degrees from the time period between the current time and the previous time. Therefore, after the information of the first angle rotated by the in-wheel motor is acquired, the information of the second angle rotated by the in-wheel motor at the previous moment is acquired, the acquired information of the first angle and the acquired information of the second angle are processed, and the first angle difference between the second angle and the first angle is determined, so that the angle rotated by the in-wheel motor in the time period between the current moment and the previous moment is determined.
S103: and determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the previous moment.
In the embodiment of the invention, the hub motor drives the hub to rotate, and the rotating mileage of the hub of the robot in the time period between the current moment and the previous moment can be determined by utilizing an arc length formula according to the absolute value of the first angle difference and the radius of the current hub. And adding the mileage with the saved first mileage counting data at the last moment to determine the second mileage counting data of the hub motor at the current moment.
According to the embodiment of the invention, the first angle difference between the second angle and the first angle can be determined by acquiring the information of the first angle which is obtained by rotating the hub motor by adopting the absolute value encoder at the current moment and the information of the second angle which is obtained by rotating the hub motor at the previous moment; and determining second odometer data of the hub motor at the current moment according to the first angle difference and the stored first odometer data at the last moment, so that the odometer data can be determined based on the hub motor adopting the absolute value encoder. When the odometry data are determined by adopting the absolute value encoder, zero-angle offset does not need to be calibrated, and the operation process is simple, so that the determination efficiency of the odometry data is improved.
Example 2:
in order to ensure the accuracy of the determined odometry data, on the basis of the above embodiment, in an embodiment of the present invention, determining second odometry data of the in-wheel motor at the current time according to the first angle difference and the first odometry data at the previous time includes:
if the fact that the hub motor rotates within the time period between the current moment and the previous moment and passes through the zero-crossing angle is determined, adjusting the first angle difference;
and determining second odometry data of the motor at the current moment according to the adjusted first angle difference and the stored first odometry data at the last moment.
Because the embodiment of the present invention employs the absolute value encoder, and the output value of the absolute value encoder is cleared when the hub motor rotates to the zero angle position every time, in order to accurately determine the second odometer data at the current time, in the embodiment of the present invention, in order to ensure that the determined odometer data is correct, after the first angle difference between the second angle and the first angle is obtained, it is necessary to determine whether the hub motor rotates through the zero angle in the time period between the current time and the previous time, so as to determine whether to correspondingly adjust the first angle difference, thereby obtaining the correct rotation angle of the hub motor in the time period between the current time and the previous time.
It should be noted that, because the output value of the absolute value encoder is cleared when the in-wheel motor rotates to the zero angle position each time, in order to further ensure the correctness of the determined odometer data, in the embodiment of the present invention, the in-wheel motor rotates through a zero angle only once in the time period between the current time and the previous time, and the angle of rotation of the in-wheel motor in the time period between the current time and the previous time does not exceed 180 degrees. In order to realize the above conditions, the interval duration of acquiring the output value of the absolute value encoder of the hub motor twice in any adjacent time is configured in advance, and the interval duration is not too long when the interval duration is set.
The interval duration can be flexibly set according to actual needs, the interval duration can be set to be shorter in order to ensure the accuracy of positioning based on odometer data, and the interval duration can be set to be longer in order to save computing resources. Specifically, the interval duration between the two times of acquiring the output value of the absolute value encoder of the in-wheel motor at any two adjacent times is not longer than the duration of the in-wheel motor rotating 180 degrees at the maximum rotating speed.
As a possible scenario, the first angular difference is adjusted if the in-wheel motor passes through a zero angle in the time period between the current time and the previous time. After the adjusted first angle difference is obtained, the rotating mileage of the robot hub in the time period between the current moment and the previous moment can be accurately determined by utilizing an arc length formula according to the absolute value of the adjusted first angle difference and the radius of the current hub. And adding the mileage with the saved first mileage counting data at the last moment to determine the second mileage counting data of the hub motor at the current moment.
As another possible scenario, if the hub motor does not pass through the zero angle in the time period between the current time and the previous time, the distance that the hub rotates in the time period between the current time and the previous time can be determined by using the arc length formula directly according to the absolute value of the first angle difference and the radius of the current hub. And adding the mileage with the saved first mileage counting data at the last moment to determine the second mileage counting data of the hub motor at the current moment.
According to the embodiment of the invention, whether the first angle difference is adjusted or not is determined by judging whether the hub motor passes through the zero angle in the time period between the current moment and the last moment, and the second odometer data of the hub motor at the current moment is determined according to the adjusted first angle difference and the stored first odometer data at the last moment, so that the determined second odometer data are more accurate.
Example 3:
in order to ensure the accuracy of the determined odometer data, on the basis of the above embodiment, in an embodiment of the present invention, in a possible implementation, the determining that the in-wheel motor rotates through the zero angle in the time period between the current time and the previous time includes:
if the rotating direction of the hub motor in the time period is clockwise and the first angle difference is a negative value, determining that the hub motor passes through a zero angle when rotating in the time period; or
And if the rotating direction of the hub motor in the time period is in the anticlockwise direction and the first angle difference is a positive value, determining that the hub motor passes through a zero angle when rotating in the time period.
In the embodiment of the invention, when the hub motor drives the hub to rotate, the real-time rotation direction of the hub motor can be determined according to the rotation direction of the control hub. Therefore, whether the hub motor passes through the zero angle in the time period between the current moment and the previous moment can be determined according to the rotating direction of the hub motor and the positive and negative of the first angle difference.
In a specific implementation, when the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is clockwise, the in-wheel motor should rotate by an angle from a small angle to a large angle, that is, from 0 degree to 360 degrees, and in the case that the in-wheel motor does not pass through a zero angle in the time period, the second angle is greater than the first angle, and the first angle difference is also positive. Since the interval between the current time and the previous time is not longer than the time when the in-wheel motor rotates 180 degrees at the maximum speed, the situation that the in-wheel motor passes through the zero angle in the time period and the second angle is larger than the first angle cannot occur. I.e. if the in-wheel motor has passed through zero angle during the time period, the second angle is smaller than the first angle, and the first angle difference is negative.
Based on this, when the rotation direction of the hub motor in the time period between the current time and the previous time is clockwise, if the first angle difference is a positive value, it is indicated that the second angle value is greater than the first angle value, and the hub motor does not pass through a zero angle when rotating in the time period; if the first angle difference is a negative value, it indicates that the second angle value is smaller than the first angle value, and the hub motor rotates through a zero-crossing angle in the time period, and the first angle difference needs to be correspondingly adjusted.
For example, if the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is clockwise, the first angle is 15 degrees, the second angle is 20 degrees, and the first angle difference is +5 degrees, the in-wheel motor does not pass through the zero-crossing angle when rotating in the time period.
For another example, if the rotation direction of the in-wheel motor in the time period between the current time and the previous time is clockwise, the first angle is 359 degrees, the second angle is 2 degrees, and the first angle difference is-357 degrees, the in-wheel motor rotates through the zero-crossing angle in the time period, and the first angle difference needs to be adjusted accordingly.
Accordingly, when the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is counterclockwise, the angle of rotation of the in-wheel motor should be from a large angle to a small angle, i.e., from 360 degrees to 0 degrees. In the case that the in-wheel motor does not pass through the zero angle within the time period, the second angle is smaller than the first angle, and the first angle difference is also negative. Since the interval between the current time and the previous time is not longer than the time when the hub motor rotates 180 degrees at the maximum speed, it is impossible for the hub motor to pass through the zero angle in the time period and the second angle is smaller than the first angle. I.e. if the in-wheel motor has passed through a zero angle during this period of time, the second angle is larger than the first angle and the first angle difference is positive.
Based on this, when the rotation direction of the hub motor in the time period between the current time and the previous time is the counterclockwise direction, if the first angle difference is a negative value, it is indicated that the second angle value is smaller than the first angle value, and the hub motor does not pass through the zero angle when rotating in the time period; if the first angle difference is a positive value, it is indicated that the second angle value is greater than the first angle value, and the first angle difference needs to be correspondingly adjusted when the hub motor rotates through the zero-crossing angle in the time period.
For example, if the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is counterclockwise, the first angle is 15 degrees, the second angle is 359 degrees, and the first angle difference is +344 degrees, the in-wheel motor passes through the zero-crossing angle when rotating in the time period, and the first angle difference needs to be adjusted accordingly.
For another example, if the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is counterclockwise, the first angle is 359 degrees, the second angle is 350 degrees, and the first angle difference is-9 degrees, then the in-wheel motor does not pass through the zero angle during the rotation in the time period.
According to the embodiment of the invention, whether the hub motor rotates by the zero angle within the time period is judged by the rotating direction of the hub motor within the time period between the current time and the last time and the positive and negative of the first angle difference, so that whether the first angle difference is correspondingly adjusted is determined, and the accuracy of the odometer data calculation is improved.
Example 4:
to further ensure the accuracy of the determined odometer data, in an embodiment of the present invention based on the above embodiments, in another possible implementation manner, the determining that the in-wheel motor rotates through the zero angle in the time period between the current time and the previous time includes:
if the first angle difference is larger than an angle threshold corresponding to the time period, determining that the hub motor passes through a zero-crossing angle when rotating in the time period, wherein the angle threshold corresponding to the time period is an angle value of the hub motor rotating in a time period corresponding to the time period at a preset maximum rotating speed; or
And if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
In the above embodiment, however, in practical implementation, the actual rotation direction of the hub motor may not be consistent with the rotation direction of the hub motor under the control of the processor of the robot, for example, the hub slides backwards a distance during climbing, so that the rotation direction of the hub is opposite to the rotation direction of the forward movement controlled by the smart device. In order to further ensure the accuracy of the determined odometer data, in the embodiment of the present invention, it may be determined whether the hub motor rotates in the time period to pass through a zero point according to whether the absolute value of the first angle value is greater than an angle threshold corresponding to the time period between the current time and the previous time.
The rotation angle of the hub motor in any time period should be smaller than the rotation angle of the hub motor in the time period corresponding to the time period at the preset maximum rotation speed, and based on this, the rotation angle value of the hub motor in the time period corresponding to the time period at the preset maximum rotation speed can be used as the angle threshold value corresponding to the time period. The preset maximum rotating speed of the hub motor can be determined according to the specification provided by the manufacturer of the hub motor, and is not described herein again.
In a specific implementation, when the in-wheel motor rotates in a time period between the current time and the previous time without passing through the zero angle, the absolute value of the first angle value is smaller than the angle threshold corresponding to the time period. And because the time period between the current time and the last time is not longer than the time period that the hub motor rotates 180 degrees at the maximum rotating speed, the angle corresponding to the major arc can not occur in the rotating angle of the hub motor in the time period. If the absolute value of the first angle difference corresponds to the angle corresponding to the major arc, the fact that the hub motor passes through a zero angle when rotating in the time period is indicated.
For example, if the interval duration between the current time and the previous time is 1s, the angle of rotation of the hub motor in 1s at the maximum rotation speed is 150 degrees, that is, the corresponding angle threshold in the time period is 150 degrees, the first angle is 15 degrees, the second angle is 359 degrees, the first angle difference is +344 degrees, and the absolute value 344 degree of the first angle difference is greater than the angle threshold 150 degrees corresponding to the time period, it indicates that the hub motor passes through zero angle during the time period.
In another possible implementation manner, in order to further ensure the accuracy of the determined odometer data, it may be further determined whether the in-wheel motor rotates through the zero angle within a time period between the current time and the previous time according to whether the mileage value corresponding to the first angle difference is greater than the mileage threshold corresponding to the time period.
The mileage value of the in-wheel motor rotating in any time period should be smaller than the mileage value of the in-wheel motor rotating in the time period corresponding to the time period at the preset maximum rotating speed, and based on this, the mileage value of the in-wheel motor rotating in the time period corresponding to the time period at the preset maximum rotating speed can be used as the mileage threshold value corresponding to the time period. For the case that the determination of the mileage value corresponding to the first angle difference is consistent with the method for calculating the mileage value in the above embodiment, the mileage value corresponding to the first angle difference can be determined by using the arc length formula according to the absolute value of the first angle difference and the radius of the current hub.
In specific implementation, when the in-wheel motor rotates in a time period between the current time and the previous time without passing through the zero angle, the mileage value corresponding to the first angle difference is smaller than the mileage threshold value corresponding to the time period. Because the time duration of the time period between the current time and the previous time is not longer than the time duration that the hub motor rotates 180 degrees at the maximum rotating speed, the rotating angle of the hub motor in the time period cannot be the angle corresponding to the major arc, and therefore, the mileage value corresponding to the first angle difference is not likely to be larger than the mileage threshold value corresponding to the time period. And if the mileage value corresponding to the first angle difference is determined to be larger than the mileage threshold value corresponding to the time period, indicating that the in-wheel motor passes through a zero angle when rotating in the time period.
E.g. in between the present and the last momentThe interval duration is 1s, the radius of the hub is 6 cm, the angle of the hub motor rotating in 1s at the maximum rotating speed is 150 degrees as an example, and the arc length formula is used
Figure BDA0002326369240000141
Wherein n is the angle of rotation of the hub motor in the time period between the current time and the previous time, r is the radius of the hub, and the mileage length corresponding to the 150 degrees is calculated to be 150 × pi × 6/180-5 pi cm, that is, the mileage threshold corresponding to the time period is 5 pi cm. The first angle is 15 degrees, the second angle is 355 degrees, the first angle difference is +330 degrees, the mileage value corresponding to the first angle difference is 330 × pi × 6/180 pi cm, 11 pi cm, and the mileage value 11 pi cm is greater than the mileage threshold value 5 pi cm corresponding to the time period, which indicates that the hub motor passes through a zero angle during the rotation of the hub motor in the time period.
Based on any one of the above embodiments, in order to further ensure the accuracy of the determined odometer data, if the in-wheel motor rotates through the zero angle in the time period between the current time and the previous time, the adjusting the first angle difference includes:
and adjusting the first angle difference according to the rotation direction of the hub motor in a time period.
In the above embodiment, after determining that the hub motor passes through the zero angle in the time period, it is further required to determine whether the rotation direction of the hub motor in the time period is clockwise or counterclockwise, so as to correspondingly adjust the first angle difference according to the determined rotation direction, to obtain the actual rotation angle of the hub motor in the time period, that is, to obtain the adjusted first angle difference.
Determining the rotation direction of the in-wheel motor in the time period may be based on the direction in which the intelligent device controls the rotation of the in-wheel motor in the time period, so as to determine the rotation direction of the in-wheel motor in the time period. For example, if the intelligent device controls the hub to rotate clockwise, it is determined that the rotation direction of the hub motor in the time period is clockwise, and if the intelligent device controls the hub to rotate counterclockwise, the rotation direction of the hub in the time period is counterclockwise. However, as described in the foregoing embodiment, in the process of controlling the hub to rotate in the control direction by the hub motor, the hub may not rotate according to the control direction of the smart device, and the hub motor may oscillate in the direction opposite to the current control direction, for example, the hub slides backwards by a distance in the climbing process, and a program is wrong.
Therefore, in order to further ensure the accuracy of the determined odometer data, in one possible implementation, the direction of the rotation of the in-wheel motor during the time period may be determined according to whether the in-wheel motor rotates during the time period through the zero angle and the positive and negative of the first angle difference.
Specifically, the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is determined according to the following modes:
if the first angle difference is a negative value, determining that the rotation direction of the hub motor in the time period is clockwise; or
And if the first angle difference is a positive value, determining that the direction of the rotation of the hub motor in the time period is a counterclockwise direction.
In a specific implementation, when the hub motor does not pass through the zero angle during the rotation in the time period between the current time and the previous time, if the first angle difference is a positive value, it indicates that the second angle is greater than the first angle, the rotation direction of the hub motor in the time period is from a small angle to a large angle, i.e., from 0 degree to 360 degrees, and the rotation direction of the hub motor in the time period is clockwise. When the hub motor rotates in the time period between the current time and the previous time without passing through the zero angle, if the first angle difference is a negative value, the second angle is smaller than the first angle, the direction of rotation of the hub motor in the time period is from a large angle to a small angle, namely from 360 degrees to 0 degrees, and the direction of rotation of the hub motor in the time period is counterclockwise.
For example, it is determined according to the above embodiment that the in-wheel motor does not pass through the zero angle when rotating in the time period between the current time and the previous time, the first angle is 15 degrees, the second angle is 20 degrees, the first angle difference is +5 degrees, the first angle difference is a positive value, it is indicated that the second angle is larger than the first angle, the in-wheel motor rotates from the small angle to the large angle, and the direction of the in-wheel motor rotating in the time period is clockwise.
Accordingly, when the in-wheel motor rotates through the zero-crossing angle in the time period between the current time and the previous time, if the first angle difference is a negative value, the first angle difference may be a negative value only when the in-wheel motor rotates clockwise through the zero-crossing angle in the time period. When the hub motor rotates through the zero-crossing angle in the time period between the current time and the previous time, if the first angle difference is a positive value, the first angle difference may be a positive value only when the hub motor rotates counterclockwise through the zero-crossing angle in the time period.
Based on the above, when the hub motor rotates in the time period between the current time and the previous time, the hub motor passes through the zero-crossing angle, and if the first angle difference is a positive value, the rotation direction of the hub motor in the time period is a counterclockwise direction; when the hub motor rotates in the time period between the current time and the previous time, the rotation direction of the hub motor is clockwise in the time period if the first angle difference is a negative value.
For example, when the in-wheel motor rotates through a zero angle in a time period between the current time and the previous time, the first angle is 359 degrees, the second angle is 2 degrees, the first angle difference is-357 degrees, and the first angle difference is a negative value, the direction in which the in-wheel motor rotates in the time period is clockwise.
According to the embodiment of the invention, whether the hub motor passes through the zero-crossing angle in the time period can be determined by judging whether the absolute value of the first angle difference is larger than the angle threshold corresponding to the time period or not, or judging whether the odometer data corresponding to the first angle difference is larger than the odometer threshold corresponding to the time period or not, so that the rotation direction of the hub motor is determined, the problem that the determined odometer data are inaccurate due to the oscillation of the hub motor is avoided, and the accuracy of the determined odometer data is improved.
Example 5:
in order to further ensure the accuracy of the determined odometer data, on the basis of the foregoing embodiments, in an embodiment of the present invention, the adjusting the first angle difference includes:
if the rotation direction of the hub motor in the time period between the current moment and the previous moment is clockwise, determining an angle value obtained by adding 360 degrees to the first angle difference as the adjusted first angle difference;
or
And if the rotation direction of the hub motor in the time period is the anticlockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
After the rotation direction of the in-wheel motor in the time period between the current time and the previous time and the zero angle are determined, the first angle difference needs to be correspondingly adjusted to obtain the actual rotation angle of the in-wheel motor in the time period, namely, the adjusted first angle difference. And aiming at different rotation directions of the hub motor, the method for adjusting the first angle difference is also different.
When the rotation direction of the in-wheel motor is clockwise and passes through a zero angle in the time period between the current time and the previous time, the first angle difference needs to be added by 360 degrees. Fig. 2 is a schematic view of a hub motor provided in an embodiment of the present invention, in which a rotation direction of the hub motor in a time period is clockwise and passes through a zero angle. As shown in fig. 2, when the rotation direction of the in-wheel motor in the time period between the current time and the previous time is clockwise and the rotation direction passes through a zero angle, a first angle difference between the second angle and the first angle is an angle corresponding to the major arc in fig. 2, and the rotation angle of the in-wheel motor in the time period should be an angle corresponding to the minor arc in fig. 2, in order to obtain the angle corresponding to the minor arc, the obtained first angle difference should be added by 360 degrees to obtain the adjusted first angle difference.
For example, when the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is clockwise and passes through a zero angle, the first angle is 359 degrees, the second angle is 2 degrees, the first angle difference is-357 degrees, and the first angle difference is added by 360 degrees to obtain the actual angle difference of rotation in the time period, that is, the adjusted first angle difference is +3 degrees.
When the rotation direction of the hub motor in the time period between the current moment and the previous moment is counterclockwise, if the rotation direction passes through the zero-crossing angle, the first angle difference needs to be reduced by 360 degrees, so as to obtain the adjusted first angle difference. Fig. 3 is a schematic diagram of a hub motor rotating in a counterclockwise direction and through a zero angle in a time period according to an embodiment of the present invention. As shown in fig. 3, when the rotation direction of the in-wheel motor in the time period between the current time and the previous time is counterclockwise and the rotation direction passes through a zero angle, a first angle difference between the second angle and the first angle is an angle corresponding to the major arc in fig. 3, and the rotation angle of the in-wheel motor in the time period should be an angle corresponding to the minor arc in fig. 3, in order to obtain the angle corresponding to the minor arc, the obtained first angle difference should be reduced by 360 degrees to obtain the adjusted first angle difference.
For example, when the direction of rotation of the in-wheel motor in the time period between the current time and the previous time is counterclockwise, the first angle is 15 degrees, the second angle is 359 degrees, the first angle difference is +344 degrees, the first angle difference is decreased by 360 degrees, and the adjusted first angle difference is 16 degrees.
Example 6:
fig. 4 is a schematic diagram of an implementation flow of a specific method for determining odometry data according to an embodiment of the present invention, which is described with a processor of an in-wheel motor as an execution main body, and the implementation flow of the method includes:
s401: and the processor of the hub motor acquires the information of the first angle to which the hub motor rotates according to the output value of the absolute value encoder of the hub motor at the current moment.
S402: and the processor of the hub motor determines a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment, and the duration of a time period between the current moment and the last moment is not more than the duration of the rotation of the hub motor at the maximum rotating speed of 180 degrees.
S403: and judging whether the first angle difference is larger than an angle threshold corresponding to the time period or not by the processor of the in-wheel motor, wherein the angle threshold corresponding to the time period is an angle value of the in-wheel motor rotating within a time period corresponding to the time period at a preset maximum rotating speed, if so, executing S404, and otherwise, executing S405.
S404: when the in-wheel motor rotates in the time period between the current time and the previous time, the processor of the in-wheel motor judges whether the first angle difference is a negative value, if so, S406 is executed, otherwise, S407 is executed.
S405: when the hub motor rotates in a time period between the current moment and the previous moment, the processor of the hub motor does not pass through the zero-crossing angle, and second odometer data of the hub motor at the current moment are determined according to the first angle difference and the stored first odometer data of the previous moment.
S406: when the rotation direction of the in-wheel motor in the time period is clockwise, the processor of the in-wheel motor adds 360 degrees to the first angle difference to obtain an adjusted first angle difference, and then S408 is executed.
S407: when the rotation direction of the in-wheel motor in the time period is the counterclockwise direction, the processor of the in-wheel motor subtracts the first angle difference by 360 degrees to obtain the adjusted first angle difference, and then S408 is executed.
S408: and the processor of the hub motor determines second odometer data of the hub motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
Specifically, the method for determining odometry data provided by the embodiment of the present invention may be implemented according to the following pseudo code:
Figure BDA0002326369240000181
Figure BDA0002326369240000191
wherein Δ Angle1 represents a first Angle difference, Angle t2 represents a second Angle value obtained at the previous moment, Angle t1 represents a first Angle value obtained at the current moment, Angle x represents an Angle rotated at the maximum rotation speed of the in-wheel motor in a time period between the current moment and the previous moment, Δ Angle2 represents an adjusted first Angle difference, Odometer represents an Angle value of the in-wheel motor rotation accumulated at the previous moment, and Odometer data of the in-wheel motor can be determined by using an arc length formula according to the value of the Odometer parameter and the radius of the in-wheel.
In the embodiment of the invention, based on the acquired second odometer data of the hub motor, the map of the surrounding environment of the robot can be built, the current position of the robot can be positioned according to the map of the current environment of the robot, and the robot can freely walk by path planning or avoid obstacles and other functions according to the positioning information of the robot.
Specifically, after each second odometer data is acquired based on the method for determining an odometer provided by the embodiment of the invention, corresponding processing is performed according to each second odometer data and other collected mapping data, such as radar data and a grid map of the determined current environment, so as to determine a coordinate system map of the current environment. Therefore, the coordinate system diagram of the current environment is determined based on the hub motor adopting the absolute value encoder, so that the robot is positioned subsequently.
When the robot is positioned, after each second odometer data is obtained based on the odometer determining method provided by the embodiment of the invention, each second odometer data is correspondingly processed based on each second odometer data, the pose of the current robot in a world coordinate system is determined, and the position of the current robot in the world coordinate system is determined according to the determined pose of the robot and a coordinate system diagram of the current environment stored in advance, so that the robot is positioned based on the hub motor adopting an absolute value encoder.
The specific determination of the coordinate system diagram of the current environment and the positioning of the robot belong to the prior art, and are not described herein again.
Example 7:
fig. 5 is a schematic structural diagram of an apparatus for determining odometry data according to an embodiment of the present invention, where the apparatus includes:
the obtaining module 51 is configured to obtain information of a first angle to which the in-wheel motor rotates according to an output value of an absolute value encoder of the in-wheel motor at the current time;
the determining module 52 is configured to determine a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the previous time;
and the processing module 53 is configured to determine second odometer data of the in-wheel motor at the current moment according to the first angle difference and the first odometer data at the previous moment.
In a possible implementation, the processing module 52 is specifically configured to adjust the first angle difference if it is determined that the in-wheel motor passes through a zero angle when rotating in a time period between the current time and the previous time; and determining second odometer data of the motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
In a possible embodiment, the processing module 52 is specifically configured to determine that the in-wheel motor rotates through a zero angle within the time period if the direction of rotation of the in-wheel motor within the time period is clockwise and the first angle difference is a negative value; or if the rotation direction of the hub motor in the time period is in the counterclockwise direction and the first angle difference is a positive value, determining that the hub motor rotates through a zero angle in the time period.
In a possible implementation manner, the processing module 52 is specifically configured to determine that the hub motor passes through a zero angle during rotation in the time period if the first angle difference is greater than an angle threshold corresponding to the time period, where the angle threshold corresponding to the time period is an angle value at which the hub motor rotates at a preset maximum rotation speed for a duration corresponding to the time period; or if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
In a possible embodiment, the processing module 52 is specifically configured to adjust the first angle difference according to a direction in which the in-wheel motor rotates in a time period between a current time and a previous time if the in-wheel motor rotates through a zero angle in the time period.
In a possible embodiment, the processing module 52 is specifically configured to determine that the rotation direction of the in-wheel motor in the time period is a clockwise direction if the first angle difference is a negative value; or if the first angle difference is a positive value, determining that the rotation direction of the in-wheel motor in the time period is a counterclockwise direction.
In a possible embodiment, the processing module 52 is specifically configured to determine, if the direction of rotation of the hub motor in the time period is a clockwise direction, an angle value obtained by adding 360 degrees to the first angle difference as the adjusted first angle difference; or if the rotation direction of the hub motor in the time period is the counterclockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
According to the embodiment of the invention, the first angle difference between the second angle and the first angle can be determined by acquiring the information of the first angle which is obtained by rotating the hub motor by adopting the absolute value encoder at the current moment and the information of the second angle which is obtained by rotating the hub motor at the previous moment; and determining second odometer data of the hub motor at the current moment according to the first angle difference and the stored first odometer data at the last moment, so that the odometer data can be determined based on the hub motor adopting the absolute value encoder. When the odometry data are determined by adopting the absolute value encoder, zero-angle offset does not need to be calibrated, and the operation process is simple, so that the determination efficiency of the odometry data is improved.
Example 8:
as shown in fig. 6, which is a schematic structural diagram of an electronic device according to an embodiment of the present invention, on the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device, as shown in fig. 6, including: the system comprises a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62 and the memory 63 complete mutual communication through the communication bus 64;
the memory 63 has stored therein a computer program which, when executed by the processor 61, causes the processor 61 to perform the steps of:
acquiring information of a first angle to which the hub motor rotates according to an output value of the absolute value encoder of the hub motor at the current moment;
determining a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment;
and determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the previous moment.
In a possible embodiment, the processor 61 is specifically configured to adjust the first angle difference if it is determined that the in-wheel motor passes through a zero angle when rotating in a time period between the current time and the previous time; and determining second odometer data of the motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
In a possible embodiment, the processor 61 is specifically configured to determine that the in-wheel motor rotates through the zero angle within the time period if the direction of rotation of the in-wheel motor within the time period is clockwise and the first angle difference is negative; or if the rotation direction of the hub motor in the time period is in the counterclockwise direction and the first angle difference is a positive value, determining that the hub motor rotates through a zero angle in the time period.
In a possible implementation manner, the processor 61 is specifically configured to determine that the hub motor passes through a zero angle during rotation in the time period if the first angle difference is greater than an angle threshold corresponding to the time period, where the angle threshold corresponding to the time period is an angle value at which the hub motor rotates at a preset maximum rotation speed for a duration corresponding to the time period; or if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
In a possible embodiment, the processor 61 is specifically configured to adjust the first angle difference according to a direction in which the in-wheel motor rotates within a time period between a current time and a previous time if the in-wheel motor rotates through a zero angle during the time period.
In a possible embodiment, the processor 61 is specifically configured to determine that the direction of rotation of the in-wheel motor in the time period is a clockwise direction if the first angle difference is a negative value; or if the first angle difference is a positive value, determining that the rotation direction of the in-wheel motor in the time period is a counterclockwise direction.
In a possible embodiment, the processor 61 is specifically configured to determine, as the adjusted first angle difference, an angle value obtained by adding 360 degrees to the first angle difference if the direction of rotation of the in-wheel motor in the time period is clockwise; or if the rotation direction of the hub motor in the time period is the counterclockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
Because the principle of the electronic device for solving the problems is similar to the method for determining the mileage data, the implementation of the electronic device can refer to the implementation of the method, and repeated details are not repeated.
The electronic device may be a robot or a wheel hub motor in a robot.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 62 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The processor may be a general-purpose processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
According to the embodiment of the invention, the first angle difference between the second angle and the first angle can be determined by acquiring the information of the first angle which is obtained by rotating the hub motor by adopting the absolute value encoder at the current moment and the information of the second angle which is obtained by rotating the hub motor at the previous moment; and determining second odometer data of the hub motor at the current moment according to the first angle difference and the stored first odometer data at the last moment, so that the odometer data can be determined based on the hub motor adopting the absolute value encoder. When the odometry data are determined by adopting the absolute value encoder, zero-angle offset does not need to be calibrated, and the operation process is simple, so that the determination efficiency of the odometry data is improved.
Example 9:
on the basis of the foregoing embodiments, the present invention further provides a computer-readable storage medium, in which a computer program executable by a processor is stored, and when the program runs on the processor, the processor is caused to execute the following steps:
acquiring information of a first angle to which the hub motor rotates according to an output value of the absolute value encoder of the hub motor at the current moment;
determining a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment;
and determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the previous moment.
In one possible embodiment, the duration of the interval between the current time and the previous time is not greater than the duration of the rotation of the in-wheel motor through 180 degrees at maximum speed.
In a possible embodiment, the determining second odometry data of the hub motor at the current time according to the first angle difference and the first odometry data at the last time comprises:
if the first angle difference is determined to pass through a zero angle when the hub motor rotates in a time period between the current time and the previous time, adjusting the first angle difference;
and determining second odometer data of the motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
In one possible embodiment, determining that the in-wheel motor passes through a zero angle when rotating in a time period between a current time and the previous time comprises:
if the rotation direction of the hub motor in the time period is clockwise, and the first angle difference is a negative value, determining that the hub motor rotates through a zero angle in the time period; or
And if the rotation direction of the hub motor in the time period is in the anticlockwise direction and the first angle difference is a positive value, determining that the hub motor rotates through a zero angle in the time period.
In one possible embodiment, determining that the in-wheel motor has rotated through a zero angle in a time period between a current time and the previous time comprises:
if the first angle difference is larger than an angle threshold corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period, wherein the angle threshold corresponding to the time period is an angle value of the hub motor rotating in a time period corresponding to the time period at a preset maximum rotating speed; or
And if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
In a possible embodiment, if the in-wheel motor rotates through a zero angle in a time period between a current time and the previous time, the adjusting the first angle difference includes:
and adjusting the first angle difference according to the rotation direction of the hub motor in the time period.
In one possible embodiment, the direction in which the in-wheel motor rotates during the time period is determined according to the following:
if the first angle difference is a negative value, determining that the rotation direction of the hub motor in the time period is clockwise; or
And if the first angle difference is a positive value, determining that the rotation direction of the hub motor in the time period is a counterclockwise direction.
In a possible embodiment, the adjusting the first angle difference includes:
if the rotation direction of the hub motor in the time period is clockwise, determining an angle value obtained by adding 360 degrees to the first angle difference as an adjusted first angle difference; or
And if the rotation direction of the hub motor in the time period is in the anticlockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
The computer-readable storage medium may be any available medium or data storage device that can be accessed by an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, nonvolatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
According to the embodiment of the invention, the first angle difference between the second angle and the first angle can be determined by acquiring the information of the first angle which is obtained by rotating the hub motor by adopting the absolute value encoder at the current moment and the information of the second angle which is obtained by rotating the hub motor at the previous moment; and determining second odometer data of the hub motor at the current moment according to the first angle difference and the stored first odometer data at the last moment, so that the odometer data can be determined based on the hub motor adopting the absolute value encoder. When the odometry data are determined by adopting the absolute value encoder, zero-angle offset does not need to be calibrated, and the operation process is simple, so that the determination efficiency of the odometry data is improved.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for determining odometry data, which is applied to an intelligent device with at least one in-wheel motor, wherein an absolute value encoder is configured on the at least one in-wheel motor, and the method comprises the following steps:
acquiring information of a first angle to which the hub motor rotates according to an output value of the absolute value encoder of the hub motor at the current moment;
determining a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment;
and determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the previous moment.
2. The method of claim 1, wherein a duration of an interval between the current time and a previous time is not greater than a duration of a rotation of the in-wheel motor by 180 degrees at a maximum rotation speed.
3. The method of claim 1, wherein determining second odometry data for the in-wheel motor at a current time based on the first angular difference and the first odometry data for a previous time comprises:
if the first angle difference is determined to pass through a zero angle when the hub motor rotates in a time period between the current time and the previous time, adjusting the first angle difference;
and determining second odometer data of the hub motor at the current moment according to the adjusted first angle difference and the stored first odometer data at the last moment.
4. The method of claim 3, wherein determining that the in-wheel motor has passed through a zero angle while rotating in a time period between a current time and the previous time comprises:
if the rotation direction of the hub motor in the time period is clockwise, and the first angle difference is a negative value, determining that the hub motor rotates through a zero angle in the time period; or
And if the rotation direction of the hub motor in the time period is in the anticlockwise direction and the first angle difference is a positive value, determining that the hub motor rotates through a zero angle in the time period.
5. The method of claim 3, wherein determining that the in-wheel motor has passed a zero angle while rotating in a time period between a present time and the previous time comprises:
if the first angle difference is larger than an angle threshold corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period, wherein the angle threshold corresponding to the time period is an angle value of the hub motor rotating in a time period corresponding to the time period at a preset maximum rotating speed; or
And if the odometer data corresponding to the first angle difference is larger than the mileage threshold value corresponding to the time period, determining that the hub motor passes through a zero angle when rotating in the time period.
6. The method of claim 5, wherein adjusting the first angular difference if the in-wheel motor has passed a zero angle while rotating within a time period between a current time and the previous time comprises:
and adjusting the first angle difference according to the rotation direction of the hub motor in the time period.
7. The method of claim 3 or 6, wherein said adjusting said first angular difference comprises:
if the rotation direction of the hub motor in the time period is clockwise, determining an angle value obtained by adding 360 degrees to the first angle difference as an adjusted first angle difference; or
And if the rotation direction of the hub motor in the time period is in the anticlockwise direction, determining an angle value obtained by subtracting the first angle difference by 360 degrees as the adjusted first angle difference.
8. An apparatus for determining odometry data, the apparatus comprising:
the acquisition module is used for acquiring information of a first angle to which the hub motor rotates according to an output value of an absolute value encoder of the hub motor at the current moment;
the determining module is used for determining a first angle difference between a second angle and the first angle according to information of the second angle rotated by the hub motor at the last moment;
and the processing module is used for determining second odometer data of the hub motor at the current moment according to the first angle difference and the first odometer data at the last moment.
9. An electronic device, characterized in that the electronic device comprises at least a processor and a memory, the processor being adapted to carry out the steps of the method of determining odometry data according to any one of claims 1-7 when executing a computer program stored in the memory.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the steps of the method for determining odometry data according to any one of claims 1 to 7.
CN201911318005.8A 2019-12-19 2019-12-19 Method, device, equipment and medium for determining mileage count data Pending CN110954129A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911318005.8A CN110954129A (en) 2019-12-19 2019-12-19 Method, device, equipment and medium for determining mileage count data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911318005.8A CN110954129A (en) 2019-12-19 2019-12-19 Method, device, equipment and medium for determining mileage count data

Publications (1)

Publication Number Publication Date
CN110954129A true CN110954129A (en) 2020-04-03

Family

ID=69982916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911318005.8A Pending CN110954129A (en) 2019-12-19 2019-12-19 Method, device, equipment and medium for determining mileage count data

Country Status (1)

Country Link
CN (1) CN110954129A (en)

Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1499324A (en) * 2002-11-06 2004-05-26 中国科学院自动化研究所 Method and device for reckonimg positioning position and posture of robot
CN101101223A (en) * 2006-07-03 2008-01-09 三丰株式会社 Displacement detecting encoder
CN101571409A (en) * 2008-04-28 2009-11-04 台达电子工业股份有限公司 Absolute optical code wheel as well as absolute coder and method for detecting absolute position thereof
CN102494711A (en) * 2011-12-12 2012-06-13 中国科学院长春光学精密机械与物理研究所 Absolute angular displacement measuring device for photoelectric encoder
CN102564416A (en) * 2011-12-30 2012-07-11 浙江国自机器人技术有限公司 System and method for reconstructing and positioning three-dimensional environment for mirror cleaning robot
CN202573774U (en) * 2012-03-29 2012-12-05 浙江吉利汽车研究院有限公司 Driving system of double-hub motor rear-driving electric automobile
JP2015500457A (en) * 2012-02-07 2015-01-05 三菱電機株式会社 Method and apparatus for determining position
CN105675030A (en) * 2016-03-23 2016-06-15 北京天诚同创电气有限公司 Measuring method and device for absolute value encoder
CN105823504A (en) * 2016-04-13 2016-08-03 北京航天发射技术研究所 Zero-point-crossing processing method of encoder
CN205655844U (en) * 2016-05-27 2016-10-19 四川理工学院 Robot odometer based on ROS
CN107403482A (en) * 2017-06-28 2017-11-28 北汽福田汽车股份有限公司 A kind of method, apparatus and system for determining VMT Vehicle-Miles of Travel number
CN107584501A (en) * 2017-09-26 2018-01-16 山东鲁能智能技术有限公司 A kind of substation equipment electrification cleaner device people and its control method
CN108254212A (en) * 2018-03-29 2018-07-06 天地科技股份有限公司上海分公司 Coalcutter guide slip shoe life prediction algorithm and service life early warning system
KR20180122377A (en) * 2016-03-13 2018-11-12 세르보센스 (에스엠씨) 엘티디. Position encoder
CN109959400A (en) * 2017-12-25 2019-07-02 深圳市优必选科技有限公司 Method and device for calculating absolute encoder parameters and terminal equipment
CN110514220A (en) * 2019-09-22 2019-11-29 武汉中海庭数据技术有限公司 A kind of vehicle mileage calibration method, device and storage medium

Patent Citations (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1499324A (en) * 2002-11-06 2004-05-26 中国科学院自动化研究所 Method and device for reckonimg positioning position and posture of robot
CN101101223A (en) * 2006-07-03 2008-01-09 三丰株式会社 Displacement detecting encoder
CN101571409A (en) * 2008-04-28 2009-11-04 台达电子工业股份有限公司 Absolute optical code wheel as well as absolute coder and method for detecting absolute position thereof
CN102494711A (en) * 2011-12-12 2012-06-13 中国科学院长春光学精密机械与物理研究所 Absolute angular displacement measuring device for photoelectric encoder
CN102564416A (en) * 2011-12-30 2012-07-11 浙江国自机器人技术有限公司 System and method for reconstructing and positioning three-dimensional environment for mirror cleaning robot
JP2015500457A (en) * 2012-02-07 2015-01-05 三菱電機株式会社 Method and apparatus for determining position
CN202573774U (en) * 2012-03-29 2012-12-05 浙江吉利汽车研究院有限公司 Driving system of double-hub motor rear-driving electric automobile
KR20180122377A (en) * 2016-03-13 2018-11-12 세르보센스 (에스엠씨) 엘티디. Position encoder
CN105675030A (en) * 2016-03-23 2016-06-15 北京天诚同创电气有限公司 Measuring method and device for absolute value encoder
CN105823504A (en) * 2016-04-13 2016-08-03 北京航天发射技术研究所 Zero-point-crossing processing method of encoder
CN205655844U (en) * 2016-05-27 2016-10-19 四川理工学院 Robot odometer based on ROS
CN107403482A (en) * 2017-06-28 2017-11-28 北汽福田汽车股份有限公司 A kind of method, apparatus and system for determining VMT Vehicle-Miles of Travel number
CN107584501A (en) * 2017-09-26 2018-01-16 山东鲁能智能技术有限公司 A kind of substation equipment electrification cleaner device people and its control method
CN109959400A (en) * 2017-12-25 2019-07-02 深圳市优必选科技有限公司 Method and device for calculating absolute encoder parameters and terminal equipment
CN108254212A (en) * 2018-03-29 2018-07-06 天地科技股份有限公司上海分公司 Coalcutter guide slip shoe life prediction algorithm and service life early warning system
CN110514220A (en) * 2019-09-22 2019-11-29 武汉中海庭数据技术有限公司 A kind of vehicle mileage calibration method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
杨福广等: "全方位轮式移动机器人控制器设计与实现", 《系统工程与电子技术》 *

Similar Documents

Publication Publication Date Title
CN109444932B (en) Vehicle positioning method and device, electronic equipment and storage medium
CN109215372B (en) Road network information updating method, device and equipment
CN111339802B (en) Method and device for generating real-time relative map, electronic equipment and storage medium
CN109885058B (en) Driving track planning method and device, electronic equipment and storage medium
CN112147994B (en) Robot and recharging control method and device thereof
CN111637877B (en) Robot positioning method and device, electronic equipment and nonvolatile storage medium
CN112985462B (en) Method and device for correcting inertial measurement data based on convolutional neural network model
CN104050832A (en) Position information completion method and device
CN104457789A (en) Inertial-navigation-based parameter correcting method and device
CN111026081B (en) Error calculation method, device, equipment and storage medium
CN112834249B (en) Steering parameter detection method, device, equipment and storage medium
CN113899374A (en) Automatic driving vehicle positioning method and device, electronic equipment and storage medium
CN114754778B (en) Vehicle positioning method and device, electronic equipment and storage medium
CN110377031B (en) Motion model updating method and device, electronic equipment and storage medium
CN115096320A (en) Vehicle positioning method, device, equipment and medium
CN113252060B (en) Vehicle track calculation method and device based on neural network model
CN110954129A (en) Method, device, equipment and medium for determining mileage count data
CN113172658A (en) Robot positioning method, device, equipment and medium
CN111798517A (en) Method and device for determining travel track, readable medium and electronic equipment
CN115082580A (en) Coordinate conversion relation adjusting method and system and electronic equipment
CN114323009B (en) Inertial navigation track correction method and device, storage medium and electronic equipment
CN113156962B (en) Motion control method, motion control device, robot and storage medium
CN111380562A (en) Method and device for calibrating odometer parameters of double-wheel differential robot
CN112985463A (en) Calibration method and device for inertial measurement unit based on convolutional neural network model
CN109341684A (en) Combined inertial nevigation equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200403