Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering

How to make a cheap robotic arm

By Gurmeet Singh

REQUIREMENTS:

1.  DC servo motors (2)

2.  Compact Disc (for base of the arm)

3.  Broom stick (for the arm)

4.  Pencil/Pen

5.  AtMega 16 IC

DESCRIPTION:

Recently I joined an MOOC on Introduction to Robotics by Queensland University of Technology, Australia. For those who don’t know what MOOC is, it stands for Massive Open Online Course. Professor Peter Corke was the mentor in introducing me to the world of robotics. Apart from the learning side of this course there was an optional project on building  one’s own robotic arm which could track a given path provided by them. Here’s a look at the worksheet which was needed to be worked on:

Typical Image of Robotic Worksheet

Fig. 1: Typical Image of Robotic Worksheet

The task was simple;  the robotic arm should 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 within the grey coloured box (20mm X 20mm) while the arm was supposed to have only two joints for its movement.

To solve this task, I decided to go with Servo motors as they come with high precision movements  when compared  to steppers and normal DC motors. According to me, this project involved two major parts to be worked on: Mechanical structure and Microcontroller coding. The pictures below show the robotic arm that I came up with:

Image showing Motor Setup for Simple Robotic Arm

Fig. 2: Image showing Motor Setup for Simple Robotic Arm

Image showing Test of Simple Robotic Arm for Drawing on the robotic worksheet

Fig. 3: Image showing Test of Simple Robotic Arm for Drawing on the robotic worksheet

Image showing Robotic Arm placing Pencil Tool at fixed coordinate within the workspace

Fig. 4: Image showing Robotic Arm placing Pencil Tool at fixed coordinate within the workspace

Image showing Robotic Arm moving Pencil Tool over the robotic worksheet

Fig. 5: Image showing Robotic Arm moving Pencil Tool over the robotic worksheet

Image showing movement of Robotic Arm to a fixed coordinate on Robotic Worksheet

Fig. 6: Image showing movement of Robotic Arm to a fixed coordinate on Robotic Worksheet

Image of Robotic Worksheet with Robotic Arm placed over it

Fig. 7: Image of Robotic Worksheet with Robotic Arm placed over it

Image showing movement of Pencil Tool by Robotic Arm to a fixed coordinate over the Worksheet

Fig. 8: Image showing movement of Pencil Tool by Robotic Arm to a fixed coordinate over the Worksheet

So as you can see , my constructed robotic arm contains two servo motors, one for the base (black one) and one for moving the arm (blue one) connected to the pencil. Now comes the coding part which you can check out from the code section. To brief you with the same, let me tell you that I have used timers to operate these servo motors. A 16 bit seemed to be a good choice. In AtMega 16 MCU, timer1 is 16 bit and has two independent output PWM pins (OC1APD5 and OC1BPD4).

We know that servos need a 20ms cycle with 1ms to 2 ms high pulse for its operation, so I chose the clock frequency to be 1 MHz which results in 1us for every clock cycle. Thus we require total of 20,000 incriminations to make it 20ms. This can be achieved by initializing ICR1 register with 20,000 value, this will let the TOP value to be 20,000, just what we want. Now what’s left is to just update the OCR1A and OCR1B values for 1ms -2ms high pulse.

Simply telling you guys, I started working with searching the OCR1A and OCR1B values for 5 coordinate points and it was all hit and  trial. Once I got them, I moved on for a smooth transition between two consecutive coordinates. You’ll be able to see that 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); //initialising 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


Filed Under: Electronic Projects

 

Questions related to this article?
👉Ask and discuss on EDAboard.com and Electro-Tech-Online.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


Featured Tutorials

  • Introduction to Brain Waves & its Types (Part 1/13)
  • Understanding NeuroSky EEG Chip in Detail (Part 2/13)
  • Performing Experiments with Brainwaves (Part 3/13)
  • Amplification of EEG Signal and Interfacing with Arduino (Part 4/13)
  • Controlling Led brightness using Meditation and attention level (Part 5/13)
  • Control Motor’s Speed using Meditation and Attention Level of Brain (Part 6/13)

Stay Up To Date

Newsletter Signup

Sign up and receive our weekly newsletter for latest Tech articles, Electronics Projects, Tutorial series and other insightful tech content.

EE Training Center Classrooms

EE Classrooms

Recent Articles

  • What are the battery-selection criteria for low-power design?
  • Key factors to optimize power consumption in an embedded device
  • EdgeLock A5000 Secure Authenticator
  • How to interface a DS18B20 temperature sensor with MicroPython’s Onewire driver
  • Introduction to Brain Waves & its Types (Part 1/13)

Most Popular

5G 555 timer circuit 8051 ai Arduino atmega16 automotive avr bluetooth dc motor display Electronic Part Electronic Parts Fujitsu ic infineontechnologies integratedcircuit Intel IoT ir lcd led maximintegratedproducts microchip microchiptechnology Microchip Technology microcontroller microcontrollers mosfet motor powermanagement Raspberry Pi remote renesaselectronics renesaselectronicscorporation Research samsung semiconductor sensor software STMicroelectronics switch Technology vishayintertechnology wireless

RSS EDABOARD.com Discussions

  • Slope compensation ramp calculation for UCC38084
  • Parts storage / inventory best practices and organization
  • Unusual gap shape of ETD59 ferrite core?
  • Vco cadencd
  • WH-LTE-7S1 GSM module and SIM card problem

RSS Electro-Tech-Online.com Discussions

  • HV Diodes
  • intro to PI
  • Very logical explanation on low calue C3
  • Need help working with or replacing a ferrite tube
  • Help wanted to power an AC120v induction motor ( edited from Brushless motor - thank you @SHORTBUS= )
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • About Us
  • Contact Us
  • Advertise

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Projects and Tutorials
    • Electronic Projects
      • 8051
      • Arduino
      • ARM
      • AVR
      • PIC
      • Raspberry pi
      • STM32
    • Tutorials
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Products News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • EE Resources
    • DesignFast
    • LEAP Awards
    • Oscilloscope Product Finder
    • White Papers
    • Webinars
  • EE Learning Center
    • Design Guides
      • WiFi & the IOT Design Guide
      • Microcontrollers Design Guide
      • State of the Art Inductors Design Guide
  • Women in Engineering