|Bipedal Robot Using PIC microcontroller|
|This domain had been registered for a while now. I think back from the late 90's during my experiment with html. But it has never been put up to good use, so now I decided to put on my bipedal robot - Sigmo 2 - journal here for everyone to see. This site will roughly describe the work that I did for my Microcontroller II project. Bear in mind that this site was put up after the robot actually walked.|
As the name suggests, this is my second attempt to build a walking bipedal robot. My first attempt is during a previous subject called Engineering Team Project. Yeah it was a team effort but my knowledge was limited back then to digital logics only (no exposure to microcontroller yet). As a result, the robot we named Sigmo cannot walk at all. It was actuated by four high torque DC motors driven by H-bridges controlled by discrete logic gates with a 555 oscillator. After being exposed to microcontrollers then I suppose its my responsibility to try it again...
The first attempt on bipedal robot results Sigmo. Though it never walk, it pointed out the mistakes and shortcomings in the design. From the picture we can see that the batteries that powers the robot are used for counterbalancing weight. If there was no Sigmo, I would not even dare to attempt Sigmo 2.
DOF configuration of the robot. This is the minimal layout usually used by servo based robot for a humanlike walking movement.
Mechanical frame was designed by me and produced in the workshop myself. They are 1mm thick aluminum, drilled and folded into shape. Picture above is the final revision of the mechanical design which I think would work best. The servos were not installed yet then because I was waiting for my scholarship to buy them...
Sigmo 2 is actuated by ten servos meaning it has 10 DOFs and controlled by two PIC16F877s; one to control servo position and another acts as the master where I store the walking algorithm. The servo PIC receives command from the master PIC for one servo at a time and the position for the respective servo will not change until a newer command. Putting it simpler, the servo PIC will retain the last position commanded for all servos. Doing it this way I think will save me later because the master PIC does not have to deal with the PWMs, and it did! Programming the PICs were done in C using compiler from CCS. Firmware for the servo PIC was finalized first before going to the walking algorithm. Initially, the servo PIC was programmed in assembly but switched to C due to the length of the program after I decided to add another bit to the servo position resolution. Assembly listing for the servo program can be found further below.
Layout and the board to control the robot. Notice that there are two crystal cans, because the two PICs are running at different clock speed. This is so that the master PIC can change pins state faster without being detected by the slave/servo PIC reducing glitches.
PIC to PIC interface
The master PIC controls the servo PIC through the I/O bus. Servo PIC will scan for data at the designated input port every 2ms which is conected to the master PIC output port. Using such approach, the master PIC will need to hold the data at the output port for at least 2ms so that data are properly transfered to the servo PIC.
The servos finally arrived! After waiting for the scholarship, the servo were bought from Kuala Lumpur. Servo used is Multiplex Mini HD. The servo program was designed with Futaba S3003 all the while and testing the Multiplex servo for the first time I found out that the direction is reversed to the Futaba's. But it is not a big deal then since I haven't program any movements yet.
PIC to PC interface
Making a walking robot should have some control method to control the robot. Or you will have to chase it around to stop it. The robot is controlled through the serial port of a PC and hosted by the master PIC. You can choose what action to perform through the terminal screen and the master PIC will enter the appropriate subroutines.. Relaying patterns of servo movement to the servo PIC.
Servos installed, not much problem during assembly. Just that the horn's mounting holes are different from Futaba's which the frame is designed on.
Basically thats the way I do it and the bipedal robot walks! It is nowhere near perfect though. One constraint is cost, because there is no funding available, I was only able to buy cheap servos to move the robot around. Which are not strong enough even to lift the leg off the ground. As a result, the robot drags its feet while walking, so it can only walk on a smooth and hard surface. A video of the robot walking can be downloaded below.
servo3.asm - assembly listing for early servo PIC (later written in C) - not properly commented.
schematic.gif - schematic diagram for the robot controller board. Drawn using Eagle.
walk2.avi - (7.76MB) video of Sigmo 2 walking forward and backward. Requires DIVX.
There's a lot of small details have been left out from the discussion in this page. This is because I do not feel like disclosing them. All in all, I'm satisfied with what I've done despite the drawbacks. I'm also thinking about improving the robot so to use stronger servos first. Then maybe add gyroscope and accelerometer so that it can be autonomous... the journey does not end here.
Microchip - PICs manufacturer
CCS - PICmicro C compiler that I used
PonyProg - Programmer that I used
About the Author
Name : Aidil Jazmi
Email : firstname.lastname@example.org
Country : Malaysia
School : UTP (Universiti Teknologi Petronas)
Aidil also cloned Magic-1 designed by Bill Buzbee. Click here to go to the repository website.