Professional Documents
Culture Documents
Hexapod Robot
This is a walking robot that has six legs and is controlled by ATmega128 CPU. This chapter explains the structure, how to make, and walking method.(Note : Let PCB faced to the floor. The actual product has PCB inside)
1.1 Operating principle of Hexapod Robot This robot is constructed as shown in above[Fig1], and is designed to be controlled remotely with the software or with joystick of playstation. User can design this robot to perceive as well as avoid the obstacles in front.
This robot has six legs, and each leg has three servo motors (Totally 18 servo motors).
[Fig4] Relation between operating angles of servo motor and signal pulses
1.2 Introduction
&
description
of
each
part
of
Hexapod
robot.
The following images show the shape of hexapod robot. The PCB at the bottom is the main board consisted of ATmega128 board.
(b) PCB View [Fig 6] Overall shape of robot and PCB circuit
Zigbee wireless module is shown at the lower part of right side in above picture, and this communicates with PC or Joystick remote controller. Turn on power to operate the robot. A chargeable battery(6.2V) is equipped inside.
[Fig8] is an input port to charge the battery of robot. The charger is an optional item.
[Fig9] is a port to download the program to download through printer port of PC. Connect printer port cable to PC and then connect 6 pin connector to robot. Then turn on power and download users program with downloading program.
[Fig10] shows the joystick to control the robot remotely. Refer to the datasheet for manuals.
1.3 Wiring diagram for Hexapod robot Connect each servo motor to ATmega128 port. Connect PB and PC in turn. Refer to the following picture. The wiring diagram is the same to round type or rectangular Hexapod robot
----------------------------------------------------------------
PB0, PB1, PB2 / PB3, PB4, PB5 / PB6, PB7, PE2 No. 1 leg No. 2 leg No. 3 leg - Front of Robot Back of Robot -
PC0, PC1, PC2 / PC3, PC4, PC5 / PC6, PC7, PD4 No. 4 leg No. 5 leg No. 6 leg
-----------------------------------------------------------------
[Fig15] Relation between operation angle of servo motor and signal pulse
Assemble the leg part of robot. Assemble on leg in advance and proceed the same procedures to the remaining legs. Set the axis of motor centered by adjusting it to the right or left side. You can easily set the center by using the control board.
Note: No.4 header pin by power switch connected is power input terminal. 2 pins in horizon are for battery connection, and other 2 pins are power input(Connect to electric jack terminal and check the polarity to assemble)
The above pictures show the leg connected with 3 servo motors. Connect the legs to the body after each leg is completed. The following are programs to experiment the operations.
[[ EX 1 ]] Program to operate servo motor[Fig 5.2] connected to ATmega128 at an angle of from +90 to -90 degrees in evry one minute(Using of PORTB) Program
/********************************************* CodeWizardAVR V1.0.1.5g Standard PBtest.Program by ds2fwz Homepage : www.roboblock.co.kr/www.roboblock.com E-mail : ds2fwz@hotmail.com Chip type : ATmega128 Clock frequency : 16.000000 MHz *********************************************/ #include <mega128.h> // mega128.h includes header file #include <delay.h> // includes time delay function // Declare your global variables here void main(void) // Declare your local variables here unsigned int i, j, k ;
// Input/Output Ports initialization DDRB=0xFF; // Port B output setting and default value HIGH signal PORTB=0xFF;
PORTB.0 = 0; PORTB.1 = 0; PORTB.2 = 0; while(1) delay_ms(1000); for(i=0;i<15;i++) PORTB.0 = 1; PORTB.1 = 1; PORTB.2 = 1; delay_us(700); PORTB.0 = 0; PORTB.1 = 0; PORTB.2 = 0; delay_ms(10);
/* Port default */
/* 10msec delay */
delay_ms(1000);
/* 10msec delay */
[[ Ex 2 ]] [5.5]Set three servo motors[Fig 5.5] connected to ATmega128 centered and move the leg up and down. Program #include <mega128.h> #include <delay.h> void initstep() { int i; for(i=0;i<40;i++) PORTB.0=1; PORTB.1=1; PORTB.2=1; //add--leg1 delay_us(1500); // 1.5ms pulse apply PORTB.0=0; PORTB.1=0; PORTB.2=0; //add delay_ms(10); // 10ms delay } void main(void) // Declare your local variables here // Port B initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTB=0x00; DDRB=0xFF;
// Port C initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=Out Func2=Out Func1=Out Func0=Out // State7=0 State6=0 State5=0 State4=0 State3=0 State2=0 State1=0 State0=0 PORTC=0x00; DDRC=0xFF; // Port D initialization // Func7=Out Func6=Out Func5=Out Func4=Out Func3=In Func2=In Func1=In Func0=In // State7=0 State6=0 State5=0 State4=0 State3=T State2=T State1=T State0=T PORTD=0x00; DDRD=0xF0; // Port E initialization // Func7=In Func6=In Func5=In Func4=In Func3=Out Func2=Out Func1=In Func0=In // State7=T State6=T State5=T State4=T State3=0 State2=0 State1=T State0=T PORTE=0x00; DDRE=0x0C;
initstep();
}; }