dimanche 29 janvier 2012

Wheel odometry for beginners

This is the third and last step of the wheel encoders training provided by Parallax. We are going to learn how to record the robot path : it's called Wheel Odometry.

After the usual program modifications to fit my robot specs, the "wheel_odometry.bs2" is loaded into the BS2.

I tried to run the program with the default calibration values. The Boe-Bot follows a clover shape while each encoder pulse is recorded and stored to EEPROM. Then I used Excel to plot the path because the coordinates were not properly centered when using the Parallax "botplot.exe". At first, the result seems to be good, just like the manufacturer example !


Actually, the robot was not following this path... Need calibration data ?

The program accuracy relies on 2 constants that are specific to each robot :
- SDIRINC : this value is given by the "calibrate_all.bs2" program that I used after mounting the sensors.
- SPOSINC : this constant depends partly of the distance between the wheels. This distance is normally about 10 cm, but on my robot, the wheel servos are mounted outside of the chassis and there is a camber angle due to the bot weight. The constant had to be recalculated :


After a couple of tests, I came to the conclusion that my calibration constant SDIRINC is false. I kept setting this value lower and lower to get a plotting that looked like the actual robot path. The initial value was $7211 (dec 29201)...

What I want now is to improve accuracy. To do so, I'll try another calibration with day light (because this part of the calibration process uses a photoresistor...).
If I can't have better results with the "math" method, I will have to work with dichotomy in order to approximate this value. I must admit that I did not get exactly what constant produces what effect on the measure... Maybe understanding this could be a good start.

Well, I am closing this post with more questions than answers...

dimanche 1 janvier 2012

Wheel encoders, part 2

Bonne Année !

Last post was about wheel encoders calibration. Following the Parallax instructions, I got 64 bytes of data and 3 constants which are specific to my robot.

Today, I tried the provided "proactive" navigation. The "Wheel_Motion.bs2" demo program has been modified to meet the configuration of my Boe-Bot :
- Calibration data bytes and constants
- Pin assignment

This routine works quite well ! The program starts with a 1 meter square motion, each side being achieved with speed ramping, a angular correction. The robot finishes its path with a constant error : a 3 cm gap and always in the same direction. This value could probably be improved with a better calibration. I could change the rubber bands on the wheels or execute the calibration procedure on the floor (instead of the desk) to get the same friction...


Please note that to get this constant level of accuracy, the start position has to be constant either, and the wheels have to be at the same angle relatively to their sensor.

Then I ran the complete demo sequence : square, octagon, 2 spins. The final position and azimuth are still constant. Of course, errors keep adding at each path, like always on a robot.

By reusing this program I will be able to have the robot to come back to its mission starting location. Example of behavior : leave the base to find a labeled obstacle, push it down, come back to base". To do that, it will have to monitor/record its path during the beginning of the mission.

This should the next step in this encoders training...