Beacon tracking is a very exciting robotics area that can be used on things like Robocup, a football tournament played by robots. This robot demo how it can be done.
This weekend I have been playing with my new LEGO Education EV3 Core Set. So it was a fantastic time to revisit the IR Sensor and use one of its functionalities: tracking.
This little robot will follow the IR Beacon when you move it… my kids took a few seconds to realize that I was joking them with the beacon. :)
The Robot is quite simple to build, so you shouldn’t have any problems getting it. It is just a stand for the ev3 brick and the M-motor attached to it.
The program is amazingly simple. If you recall the Line Following tutorial I wrote last week, I just applied the same idea for this robot.
The IR Sensor gives you a heading value that ranges from -25 to 25 to tell you where the beacon is, from top left to top right. So I just use this reading and use a P-Controller to make sure the error is 0. But what is the error? It is the heading, when the IR beacon is exactly in front of the robot it will report 0.
So this is the EV3 code.
You can download the source code here.
EV3 Source Code file
Perhaps I built a player for the Robocup :). Time to built a spherical IR beacon for cheap…