What is a robot without its programming? Just a bunch of metal and electronics that lay in a garage. A good informatics design is just as important as a good mechanical and electronic design. Without them, robots cannot “live”.
With Parki, the mechanical part was very well designed. It was simple, but reliable. The electronics were at least as good as the mechanics, without it the robot would have just been a collection of aluminium pieces assembled together.
And we tried as much as possible to well design Parki’s mind software.:P
These were the steps we took to create the robot. First we decided what we wanted the robot to do, then we tried to imagine multiple designs to accomplish those tasks. The winner approach was a very simple mechanical design, yet powerful and easy to create, to assemble and control.
The “mechanical guys” don’t always know if something is feasible, so a good communication between the electronics team and the mechanics team was necessary. Although the kelebulc team was rather small, without good communication we could have ended with a very good looking but impossible design to make.
We designed the electronics with the mechanics in mind. We created custom boards that would work with almost any robot. Although some components were specifically design for the robot, such as the mother board and the servo control board most of the electronic boards are rather generalist.
The mother board is certainly one of the most important parts of the robot, it controls everything and it must do it well. Old members of the club had experience with PIC micro controllers, however I thought and I still think that AVRs micro controllers (from atmel) offer many advantages, they are more powerful and more reliable than PICs for almost any task. Unfortunately the PICs won this time and we ended up using a PIC18F4680. It’s a good micro controller I have to say. But it wasn’t reliable at all. We had lots of problems with it and it even stopped us from finishig the robot’s programming. We found the cause, there was a linker configuration file, that we usually don’t touch that comes with MPLAB (the IDE from microchip) that corrupted the robots memory. A simple code like this would work one out of ten times:
if(constructionElementFound)
placeItInside();
Not everyone in the team has the same knowledge in informatics. Some might have just started learning the basics, some may know very efficient high level algorithms, and some might be very good in low level stuff. To solve this problem. We created a high level C API, based on low level C functions that would control the robot very easily. For instance. The low level way of controlling the input/output of a PIC microcontroller pin is:
PORTA|=0x30;
and with the high level API we achieved to do something like this:
turnOn(redLED);
We did go further and we achieved to do things like this:
float distance = 1.5; // in meters
Speed topSpeed = NORMAL_SPEED;
moveRobot(ForwardDir, topSpeed, distance);
while(robotIsMoving){}
moveRobot(BackardDir, topSpeed, distance);
and the robot would advance 1.5 meters and then it would go back to the start point, by accelerating in the beginning of each new movement and decreasing speed before arriving to the desired destination. The result of the previous code can be seen in the following video:
By using this API the team could concentrate their efforts in the strategies and not in trying to make the robot move or take objects. This approach resulted to be very effective and the method should be applied in every informatics project, and why not, in every large project where one single person can’t do everything and specialized people is required for different tasks.