Difference between revisions of "Odometry Glitches"

From wikidb
Jump to: navigation, search
(Conclusion)
(Example Graph)
 
(11 intermediate revisions by the same user not shown)
Line 8: Line 8:
 
= Example Graph =
 
= Example Graph =
  
These measurements are under load.
+
These measurements are under no load. The robot is resting on a test bench with the wheel off the table.
  
 
Observations
 
Observations
* Notice the odometry glitches that report a 0 m/sec wheel speed. This issue appears to be an odometry node bug when the angular velocity stays at 0 rad/sec. See below.
+
* Notice the odometry glitches that report a 0 m/sec wheel speed. This issue appears to be an odometry node bug. See below.
* Notice the wheel speed short term oscillation. This issues appears to be an encoder node issue bug because of a lack of time precision. See below.
+
* Notice the wheel speed short term oscillation. This issue may be an encoder node issue bug because of a lack of time precision. See below.
  
 
[[Image:plot151520.png|600px]]
 
[[Image:plot151520.png|600px]]
Line 18: Line 18:
 
= Zero Wheel Speed Glitches =
 
= Zero Wheel Speed Glitches =
  
The motor Twist messages are generated with the following command which specifies a 0.2 m/sec linear x and 0.0 rad/sec angular z. As result, the robot cross the 0/360 degree boundary multiple times. Each time a bug result in reporting a 0 speed to odometry.  
+
== Tests Starting at 0 degree heading ==
 +
 
 +
These test start with the robot initially facing 0 degrees. The example graph above was the result publish com_vel messages with a linear x speed of 0.2 m/sec and an angular z speed of 0 radians/sec. They were generated by this command.  
  
 
   python motors_go_full.py 0.2 0.0
 
   python motors_go_full.py 0.2 0.0
  
A second Twist command adds confusion. The angular z component is now set to 0.4 rad/sec making the robot's angular position cross quadrant boundaries more often. There are not zero velocity glitches.
+
A second example below repeats with an angular velocity of 0.4 radians/sec. Notice that the 0 speed glitches reported by odom have disappeared. Is that because of the initial direction or angular component? Two additional tests will follow.
  
 
   python motors_go_full.py 0.2 0.4
 
   python motors_go_full.py 0.2 0.4
  
 
[[Image:rotate_odom_glitch2.png|800px]]
 
[[Image:rotate_odom_glitch2.png|800px]]
 +
 +
== Tests starting at 40 degree heading ==
 +
 +
In the following example plots the robot is first rotated about 40 degrees and then brought to a stop to stabilize. com_vel messages are publish like the ones above. In the next example the robot goes straight after completing the rotation.
 +
 +
  motors_turn_go.py 0.2 0.0
 +
 +
[[Image:rotate_straight_glitch.png|800px]]
 +
 +
In the following example the robot does a turn after the rotation completes
 +
 +
  motors_turn_go.py 0.2 0.2
 +
 +
[[Image:rotate_turn_glitch.png|800px]]
 +
 +
== Conclusion ==
 +
 +
The results indicate that odometry has more 0 speed glitches when it is going straight. I really don't know what to say.
  
 
= Short Term Oscillations =
 
= Short Term Oscillations =
Line 53: Line 73:
 
* Inspection indicates that 7 ms times are near messages with a count_change of 52. This needs to be verified.
 
* Inspection indicates that 7 ms times are near messages with a count_change of 52. This needs to be verified.
  
Observations based on above.
 
* There are roughly 23 encoder 7 ms time reading per second. Odometry is published roughly 22 times a second. I don't know if this is  meaningful.
 
* The speed dips are roughly 7 times a second. This doesn't appear to correlate with anything above.
 
 
I can't deduce anything meaningful about the cause of the speed oscillations. Regardless, I am not pleased that the encoder time reading returned by the phidget encoder driver is imprecise. The impact is a 10 to 15% error in time interval reading from the encoder.
 
  
 
   ---
 
   ---
Line 83: Line 98:
 
   ---
 
   ---
  
= Conclusion =
+
Example rostopic commands used:
 +
 
 +
  rostopic echo  /phidgets/encoder/351547
 +
  rostopic echo  /phidgets/encoder/351547/time
 +
  rostopic echo  /phidgets/encoder/351547/count_change
 +
  rostopic echo  /odom
 +
 
 +
== Observations based on above ==
 +
 
 +
* There are roughly 23 encoder 7 ms time reading per second. Odometry is published roughly 22 times a second. I don't know if this is  meaningful.
 +
* The speed dips are roughly 7 times a second. This doesn't appear to correlate with anything above.
 +
* I am not pleased that the encoder time readings returned by the phidget encoder driver are imprecise. The impact is a 10 to 15% error in time interval reading from the encoder. This precision is determined by the core Phidgets drivers written by Phidgets or by their hardware.
 +
 
 +
== Conclusions ==
 +
 
 +
I can't deduce anything meaningful about the cause of the speed oscillations.
 +
 
 +
= Overall Conclusion =
  
I don't see a simple resolution to these glitches. Debugging the Encoder and Odometry code does not look time effective. I'm going to live with it for now.
+
I don't see a simple resolution to these glitches. Digging into the core Pidgets driver and debugging the Encoder and Odometry ROS code does not look time effective. I'm going to live with it for now.

Latest revision as of 20:03, 20 October 2017

Background and Set Up

These odometry glitches were discovered during motor control PID tuning. See

Example Graph

These measurements are under no load. The robot is resting on a test bench with the wheel off the table.

Observations

  • Notice the odometry glitches that report a 0 m/sec wheel speed. This issue appears to be an odometry node bug. See below.
  • Notice the wheel speed short term oscillation. This issue may be an encoder node issue bug because of a lack of time precision. See below.

Plot151520.png

Zero Wheel Speed Glitches

Tests Starting at 0 degree heading

These test start with the robot initially facing 0 degrees. The example graph above was the result publish com_vel messages with a linear x speed of 0.2 m/sec and an angular z speed of 0 radians/sec. They were generated by this command.

 python motors_go_full.py 0.2 0.0

A second example below repeats with an angular velocity of 0.4 radians/sec. Notice that the 0 speed glitches reported by odom have disappeared. Is that because of the initial direction or angular component? Two additional tests will follow.

 python motors_go_full.py 0.2 0.4

Rotate odom glitch2.png

Tests starting at 40 degree heading

In the following example plots the robot is first rotated about 40 degrees and then brought to a stop to stabilize. com_vel messages are publish like the ones above. In the next example the robot goes straight after completing the rotation.

 motors_turn_go.py 0.2 0.0

Rotate straight glitch.png

In the following example the robot does a turn after the rotation completes

 motors_turn_go.py 0.2 0.2

Rotate turn glitch.png

Conclusion

The results indicate that odometry has more 0 speed glitches when it is going straight. I really don't know what to say.

Short Term Oscillations

One candidate for the short term oscillations that ride on top of the wheel speed line is the lack of encoder time precision. This has not been verified. What follows are some data points.

Odometry Publication Rate

Odometry is published 22 times a second. See the frequency definition in line 407 of odometry.cpp.

Wheel Speed Publication

The motor controller publishes wheel speed and power values whenever it receives a odometry publication. The Example Graph above

  • Displays 22 points every second.
  • Displays 7 dips every second. (Roughly 1/3 have speed values significantly lower than average.

Encoder Publications

There are roughly 125 encoder messages published each second by each encoder like the two below. The rate of 125 corresponds to one roughly every 8 milliseconds. See the time field. Measurement show that

  • 102 or about 80% have a time value of 8 ms
  • 23 or about 20% have a time value of 7 ms
  • 80% have a count_change value of 32.
  • 20% have a count_change value of 33.
  • Inspection indicates that 7 ms times are near messages with a count_change of 52. This needs to be verified.


 ---
 header: 
   seq: 2171
   stamp: 
     secs: 0
     nsecs:         0
  frame_id: 
 index: 0
 count: -64455
 count_change: -33
 time: 7
 ---
 header: 
   seq: 2172
   stamp: 
     secs: 0
     nsecs:         0
   frame_id: 
 index: 0
 count: -64488
 count_change: -33
 time: 8
 ---

Example rostopic commands used:

 rostopic echo  /phidgets/encoder/351547
 rostopic echo  /phidgets/encoder/351547/time
 rostopic echo  /phidgets/encoder/351547/count_change
 rostopic echo  /odom

Observations based on above

  • There are roughly 23 encoder 7 ms time reading per second. Odometry is published roughly 22 times a second. I don't know if this is meaningful.
  • The speed dips are roughly 7 times a second. This doesn't appear to correlate with anything above.
  • I am not pleased that the encoder time readings returned by the phidget encoder driver are imprecise. The impact is a 10 to 15% error in time interval reading from the encoder. This precision is determined by the core Phidgets drivers written by Phidgets or by their hardware.

Conclusions

I can't deduce anything meaningful about the cause of the speed oscillations.

Overall Conclusion

I don't see a simple resolution to these glitches. Digging into the core Pidgets driver and debugging the Encoder and Odometry ROS code does not look time effective. I'm going to live with it for now.