Hi there,
I have been digging in on some odometry topics and got the bot running in (rather) straight lines at a certain speed for a certain distance using optical encoders and 3 PID’s.
The video isn’t thrilling, but shows an intermediate result in calibrating the positioning and RB almost finishing a full square with a total perimeter of 12.2 meters.
Video:
https://www.youtube.com/watch?v=8z0CsYaxo8Y
For those who are interested, the following blog contains a more detailed description of the background, approach and a way to use squared runs for further calibration:
https://plus.google.com/113179308235478830494/posts/UiFYacTvDLr
If wanted remarks, suggestions and/or questions can be dropped there as well.
The Python script can be found at:
https://bitbucket.org/RoboBasics/raspberry-robo-cars/src/8df278bd8786da754462197c3b553d1aaa40f599/Scripts/Odm_2_running_squares.py?at=master
I noticed in the forums that several people raised questions on having the robot running straight. The bitbucket repository also contains a Python script for mere proportional correction of the wheel differences. If just straight driving is desired, this script might be helpful.
The approach is a bit raw (left out some things like the acceleration), but it provides a good start for further exploration.
For sure I will work on some improvements in the future (and surely acquire some magnetic encoders for better actuating).
For now I will be working on adding digital compass data to the control loops (or replacing the balancing loop by a compass loop)
Enjoy !