Academia.eduAcademia.edu

SiMPLE SPiDER ROBOT

Simple Spider Robot by using 6 Servo Motors & PIC16F877A

With advancing technology, the place and importance of robots in human life is increasing day by day. When we look at the present from the past, it can be seen that there are differences in the purpose of creation of robots. The ability to operate autonomously and the ability to operate on an operator control allow them to be indispensable. As days go by, these machines that are used in place of humans have faster, longer life and higher working capacities. One of the robots working in these work areas is the spider robots. Spider robots can be divided into robots with Hexapod (6 legged), Quadruped (4 legged) and similar types. In this project, a hexapod (6-legged) spider robot is dealt with.

ABSTRACT: With advancing technology, the place and importance of robots in human life is increasing day by day. When we look at the present from the past, it can be seen that there are differences in the purpose of creation of robots. The ability to operate autonomously and the ability to operate on an operator control allow them to be indispensable. As days go by, these machines that are used in place of humans have faster, longer life and higher working capacities. One of the robots working in these work areas is the spider robots. Spider robots can be divided into robots with Hexapod (6 legged), Quadruped (4 legged) and similar types. In this project, a hexapod (6-legged) spider robot is dealt with. Materials needed for spider robot construction: Servo Motors: Servo motors are motors that can be rotated in a special angular position with the transmitted encoded signals. The servomotor maintains the angular position of the shaft as long as the coded signal is applied to the servo motor input. If the coded signal is changed, the angular position of the shaft also changes. Servo motors are often used in various robot projects, robotics, remote controlled applications. At the same time, high-power servo motors can also be used in industrial automation. The basic configuration of a servo motor is shown. A DC motor drives a gearbox with a high reduction ratio. The shaft at the end rotates at a very slow speed and rotates the potentiometer on the rotation axis. The purpose of the potentiometer is to provide position feedback of the shaft of the servo motor by feedback. The potentiometer sends the voltage corresponding to the sensed position to the op-amp used as the voltage comparator. The output voltage of the comparator is determined by comparing this voltage value with the input voltage which determines the desired position of the shaft. This output voltage provides the power to move the motor shaft in the direction required to conform to the angle corresponding to the signal applied at the input. A signal consisting of 20 ms period pulses is sent to the control input of the servo. The pulse duration determines the position in the 180º range of the shaft of the servo motor. If the pulse is 1.5 ms long, the position of the shaft of the servo motor is in the middle of 180 º range. If the pulse is 1 ms long, the servo motor moves 90 º to the left, and if it is 2 ms, it moves 90 º to the right. PIC16F877A Microcontrollers: PCB (Printed Circuit Board) (Copper-Plate) Pin Headers Chassis Batteries (12V-1A Charging Adapter & 9V-1A Cell) 7.) Regulators (7805) 8.) Electric Terminals 9.) 4_Mhz Crystal 10.) Capacitors 11.) Resistors 3D Design of Chassis by using SolidWorks: Proteus Simulations: Ares in Proteus: 3D Visualizer in Proteus: (4_TBLOCKM2 which is at same column is used instead of buttons. 6_7805 which is at same column is used instead of headers of servo.) Code of Spider Robot Servos Control by using CCS C Compiler #include <16F877A.h> #fuses XT,NOWDT,NOPROTECT,NOBROWNOUT,NOLVP,NOPUT,NOWRT,NODEBUG,NOCPD #use delay(clock=4000000) #use fast_io(a) #use fast_io(b) #define forward pin_a0 #define back pin_a1 #define right pin_a2 #define left pin_a3 #define right_servos pin_b0 #define middle_servos pin_b1 #define left_servos pin_b2 int16 i=0; // PWM Duty Cycles for Servo Control: // (1000 us per [20 ms (50Hz)] = -90 degree) // (1500 us per [20 ms (50Hz)] = 0 degree) // (2000 us per [20 ms (50Hz)] = 90 degree) void main () { setup_psp(PSP_DISABLED); setup_spi(SPI_SS_DISABLED); setup_timer_1(T1_DISABLED); setup_timer_2(T2_DISABLED,0,1); setup_adc_ports(NO_ANALOGS); setup_adc(ADC_OFF); setup_CCP1(CCP_OFF); setup_CCP2(CCP_OFF); set_tris_a(0x0F); set_tris_b(0x00); output_b(0x00); //PWM Duty Cycles for Servo Control: // (1000 us = -90 degree) // (1500 us = 0 degree) // (2000 us = 90 degree) while(TRUE) { /*******GO_FORWARD*******/ if (input(forward)) { for(i=0;i<=25;i++) //FOR is used for produce enough pwm signals for servo { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); // 1300 1300 1300 --> All Servos = -36 degree output_low(right_servos); output_low(middle_servos); output_low(left_servos); delay_us(18700); } for(i=0;i<=25;i++) // 1300 1700 1300 // Right & Left Servos = -36 degree // Middle Servos = +36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(right_servos); output_low(left_servos); delay_us(400); output_low(middle_servos); delay_us(18300); } for(i=0;i<=25;i++) // 1800 1700 1800 // Right & Left Servos = +54 degree // Middle Servos = +36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1700); output_low(middle_servos); delay_us(100); output_low(right_servos); output_low(left_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1800 1300 1800 // Right & Left Servos = +54 degree // Middle Servos = -36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(middle_servos); delay_us(500); output_low(right_servos); output_low(left_servos); delay_us(18200); } } /*******GO_BACK*******/ if (input(back)) { for(i=0;i<=25;i++) // 1300 1700 1300 // Right & Left Servos = -36 degree // Middle Servos = +36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(right_servos); output_low(left_servos); delay_us(400); output_low(middle_servos); delay_us(18300); } for(i=0;i<=25;i++) // 1300 1300 1300 --> All Servos = -36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(right_servos); output_low(middle_servos); output_low(left_servos); delay_us(18700); } for(i=0;i<=25;i++) // 1800 1300 1800 // Right & Left Servos = +54 degree // Middle Servos = -36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(middle_servos); delay_us(500); output_low(right_servos); output_low(left_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1800 1700 1800 // Right & Left Servos = +54 degree // Middle Servos = +36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1700); output_low(middle_servos); delay_us(100); output_low(right_servos); output_low(left_servos); delay_us(18200); } } /*******TURN_RIGHT*******/ if (input(right)) { for(i=0;i<=25;i++) // 1300 1300 1800 // Right & Middle Servos = -36 degree // Left Servos = +54 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(right_servos); output_low(middle_servos); delay_us(500); output_low(left_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1300 1700 1800 // Right Servos = -36 degree // Middle Servos = +36 degree // Left Servos = +54 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(right_servos); delay_us(400); output_low(middle_servos); delay_us(100); output_low(left_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1800 1700 1300 // Right Servos = +54 degree // Middle Servos = +36 degree // Left Servos = -36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(left_servos); delay_us(400); output_low(middle_servos); delay_us(100); output_low(right_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1800 1300 1300 // Right Servos = +54 degree // Middle Servos = -36 degree // Left Servos = -36 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(middle_servos); output_low(left_servos); delay_us(500); output_low(right_servos); delay_us(18200); } } /*******TURN_LEFT*******/ if (input(pin_a3)) { for(i=0;i<=25;i++) // 1800 1300 1300 // Left & Middle Servos = -36 degree // Right Servos = +54 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(left_servos); output_low(middle_servos); delay_us(500); output_low(right_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1800 1700 1300 // Right Servos = +54 degree // Middle Servos = +36 degree // Left Servos = -37 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(left_servos); delay_us(400); output_low(middle_servos); delay_us(100); output_low(right_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1300 1700 1800 // Right Servos = -36 degree // Middle Servos = +36 degree // Left Servos = +54 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(right_servos); delay_us(400); output_low(middle_servos); delay_us(100); output_low(left_servos); delay_us(18200); } for(i=0;i<=25;i++) // 1300 1300 1800 // Right Servos = -36 degree // Middle Servos = -36 degree // Left Servos = +54 degree { output_high(right_servos); output_high(middle_servos); output_high(left_servos); delay_us(1300); output_low(middle_servos); output_low(right_servos); delay_us(500); output_low(left_servos); delay_us(18200); } } } } Reference Sources: http://www.aytekinguclu.com/orumcek-robot-2/ http://320volt.com/alti-bacakli-orumcek-robot-basic-stamp-2/ http://320volt.com/pic16f877-arx34-atx34-rf-robot/ http://home.earthlink.net/~henryarnold/ http://www.elektrik.gen.tr/2017/05/mikrodenetleyici-kontrollu-uzaktan-algilamali-orumcek-robot/6012 https://grabcad.com/library/tag/servomotor Finally,