Saturday 11 November 2023

Developing a small robot as a code test platform

I have learned from previous experience in the Pi Wars robotics competition how important it is to get testing code early. So rather than working on the physical build of my robot, I have been working on programming robotics code around areas which are new to me. I was already developing a small robot for STEM outreach events, based around the Inventor HAT mini board from Pimoroni.

This board supports encoder motors, something I have not developed code for previously. I wanted more feedback from my robot to better control it autonomously. Encoders enable you to read the speed of rotation of your motors, and count how many rotations they have made. This makes speed control possible, and distance travelled to be tracked. All my previous robots have been manual control only, so this was all new for me. I also added and IMU, which would enable measuring the orientation of the robot. This makes accurate turns possible.

The triangular tracked robot I was already developing is a little too small for Pi Wars, but the code developed on it should be portable to my competition robot once I have that built. I wrote a hardware abstraction interface so that my code talks to an interface which is independent of the specific hardware it is running on. I converted my manual control robot program from my STEM event robots to use the interface, creating this Universal Robot project on Github.

No comments:

Post a Comment