Como fazer um braço robótico barato

How to make a cheap robotic arm

REQUIREMENTS:

1. DC Servomotors (2)

2. Compact Disc (for tonearm base)

3. Broomstick (for the arm)

4. Pencil/Pen

5. AtMega 16 IC

DESCRIPTION:

I recently participated in a MOOC on Introduction to Robotics at the Queensland University of Technology, Australia. For those who don't know what MOOC is, it means Aggressive M Oh pen Oh online C ours. Professor Peter Corke He was the mentor when introducing me to the world of robotics. In addition to the learning part of this course, there was an optional project about building one's own robotic arm that could track a certain path provided by them. Here's a look at the spreadsheet that needed work:

Imagem típica de planilha robótica

Fig. 1: Typical robotic spreadsheet image

The task was simple; the robotic arm must be able to hold a pen/pencil and track the dotted path from coordinates (X1,Y1) to (X5,Y5). The base of the robot should fit inside the gray box (20mm X 20mm) while the arm should have only two joints for movement.

To solve this task, I decided to opt for servo motors, as they have high precision movements when compared to stepper motors and normal DC motors. In my opinion, this project involved two major parts to be worked on: Mechanical structure and microcontroller coding. The photos below show the robotic arm I created:

Imagem mostrando a configuração do motor para braço robótico simples

Fig. 2: Image showing the motor configuration for a simple robotic arm

Imagem mostrando o teste de braço robótico simples para desenho na planilha robótica

Figure 3: Image showing the simple robotic arm test for drawing in the robotics spreadsheet

Imagem mostrando o braço robótico posicionando a ferramenta Lápis em uma coordenada fixa na área de trabalho

Figure 4: Image showing the robotic arm positioning the Pencil tool at a fixed coordinate on the work area

Imagem mostrando o braço robótico movendo a ferramenta Lápis sobre a planilha robótica

Figure 5: Image showing the robotic arm moving the Pencil tool over the robotic spreadsheet

Imagem mostrando o movimento do braço robótico para uma coordenada fixa na planilha robótica

Figure 6: Image showing the movement of the robotic arm to a fixed coordinate in the robotic spreadsheet

Imagem de planilha robótica com braço robótico colocado sobre ela

Figure 7: Image of robotic spreadsheet with robotic arm placed on it

Imagem mostrando o movimento da ferramenta Lápis pelo braço robótico para uma coordenada fixa na planilha

Figure 8: Image showing the movement of the Pencil tool by the robotic arm to a fixed coordinate in the spreadsheet

As you can see, my built robotic arm contains two servo motors, one for the base (black) and one for moving the arm (blue) connected to the pencil. Now comes the coding part which you can check in the code section. To inform you about the same, let me tell you that I have used timers to operate these servo motors. A 16-bit seemed like a good choice. On the AtMega 16 MCU, timer1 is 16-bit and has two independent output PWM pins (OC1APD5 and OC1BPD4).

We know that servos need a cycle of 20ms with a high pulse of 1ms to 2ms for their operation, so I chose the clock frequency as 1MHz which results in 1us for each clock cycle. Therefore, we require a total of 20,000 incriminations to make 20 ms. This can be achieved by initializing the ICR1 register with a value of 20,000, this will allow the TOP value to be 20,000, exactly what we want. Now what remains is just updating the OCR1A and OCR1B values ​​for 1ms -2ms high pulse.

Simply telling you, I got to work researching the OCR1A and OCR1B values ​​for 5 coordinate points and everything was correct and tested. Once I got them, I moved on to a smooth transition between two consecutive coordinates. You'll be able to see this in my coding section for sure.

Project source code

###

#include

#include

void main

{ int i=0,j=0,small_time=50,big_time=1000;

TCNT1=0;

TCCR1A =(1<

TCCR1B =(1<

DDRD =(1<<5) (1<<4); //initializing OC1A and OC1B pins as output

ICR1=19999;

OCR1A=1050;

OCR1B=695;

_delay_ms(big_time);////////////(X1,Y1)////////////////////////

for(i=1050,j=695;i>450&&j<1425;i-=5,j+=6)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1A=450;

OCR1B=1425;

_delay_ms(big_time);////////////(X2,Y2)////////////////////////

for(i=450,j=1425;i<1000&&j>700;i+=10,j-=7)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1B=1050;

for(i=1000;i<1600;i+=10)

{ OCR1A=i;

_delay_ms(small_time);

}

for(j=1050;j<1200;j+=10)

{ OCR1B=j;

_delay_ms(small_time);

}

for(i=1600,j=1200;i>1350&&j<1475;i-=10,j+=10)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1A=1350;

OCR1B=1475;

_delay_ms(big_time);////////////(X3,Y3)////////////////////////

for(i=1350,j=1475;i<2300&&j>500;i+=10,j-=7)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1A=2400;

OCR1B=800;

for(i=2400;i<2650;i+=10)

{ OCR1A=i;

_delay_ms(small_time);

}

for(j=800;j<1300;j+=10)

{ OCR1B=j;

_delay_ms(small_time);

}

for(i=2600,j=1300;i>1825&&j<2225;i-=10,j+=12)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1A=1825;

OCR1B=2225;

_delay_ms(big_time);////////////(X4,Y4)////////////////////////

for(i=1825,j=2225;i<2500&&j>1000;i+=7,j-=10)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1A=2550;

for(j=1200;j>1100;j-=10)

{ OCR1B=j;

_delay_ms(small_time);

}

for(i=2550;i>2100;i-=10)

{ OCR1A=i;

_delay_ms(small_time);

}

for(i=2100,j=1100;i>895&&j<2125;i-=12,j+=10)

{ OCR1A=i;

OCR1B=j;

_delay_ms(small_time);

}

OCR1A=895;

OCR1B=2125;

_delay_ms(big_time);////////////(X5,Y5)////////////////////////

}

###

Circuit diagrams

Circuit Diagram-AVR-ATMega16-Based-Control-Circuitry-Simple-Robotic-Arm

Project video

Related Content

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.