You are currently viewing DIY 6 DOF Robotic Arm: A Step-by-Step Guide to Design, Print, and Program
3D-Modell des Roboterarms, entwickelt mit Autodesk Inventor und optimiert für 3D-Druck.

DIY 6 DOF Robotic Arm: A Step-by-Step Guide to Design, Print, and Program

Building a 6-DOF Robotic Arm (DIY) is an exemplary project that demonstrates the synergy between mechanical design, electronic control, and precise user interaction. This blog will guide you step by step through the entire process of creating a fully functional robotic arm controlled by six servos, each of which is directly manipulated by a dedicated potentiometer for real-time movement adjustments.

The project involves 3D designing all components with Autodesk Inventor, 3D printing the parts, assembling them, and finally wiring the electronics using an Arduino Uno and a PCA9685 servo driver. Whether you’re a hobbyist or a robotics enthusiast, this guide is ideal for anyone looking to explore advanced DIY robotics.

To successfully build this robotic arm, you will need a set of mechanical and electronic components, including servos, potentiometers, power supply, and mounting hardware. Below you will find the complete Bill of Materials (BOM) listing every required part with its quantity and description to help you source and prepare everything in advance.

Item Quantity Part Description
1
1
Base_1
3D printed base for the arm
2
1
base_link_upper1
3D printed upper base part
3
1
arm_link_1
3D printed first arm link
4
1
arm_link_2
3D printed second arm link
5
1
arm_link_3
3D printed third arm link
6
1
gripper_base
3D printed base of the gripper
7
1
Gripper_2
3D printed gripper second finger
8
1
Gear_right
3D printed gear for gripper finger (right)
9
1
Gear_left
3D printed gear for gripper finger (left)
10
1
Gripper
3D printed complete gripper assembly
11
4
Link
3D printed gripper link parts
12
2
Spacer
3D printed gripper joint spacers
13
3
MG996R Servo Motor
High torque servo for base and heavy joints
14
3
SG90 Micro Servo Motor
Compact servo for gripper and lightweight joints
15
14
ANSI B18.6.4 No.2-32 3/8″
Cross Recessed Truss Head Screw – Type AB – Form I
16
2
ANSI B18.6.4 No.2-32 1/4″
Cross Recessed Truss Head Screw – Type AB – Form I
17
3
DIN 7985 M1.6×2-Z
Cylinder Head Screw with Cross Recess – Type Z
18
7
ISO 4762 M3x16 (AS 1420)
Hex Socket Head Cap Screw
19
12
ISO 4032 M3 (AS 1112)
Hex Nuts, including thin and crown nuts
20
2
ANSI B18.6.4 No.2-32 1/2″
Cross Recessed Truss Head Screw – Type AB – Form I
21
3
MG955 Horn
Servo horns for MG996R servos
22
3
DIN 7985 M3x6-Z
Cylinder Head Screw with Cross Recess – Type Z
23
3
SG90 Servo Horn
Horns for SG90 servos
24
2
ANSI B18.6.4 No.2-32 3/8″
Cross Recessed Truss Head Screw – Type AB – Form I
25
12
ANSI B18.6.4 No.3-28 1/2″
Cross Recessed Truss Head Screw – Type AB – Form I
26
1
Ball Bearing 6806ZZ (30x42x7)
Deep groove ball bearing for base rotation
27
1
Arduino Uno or Mega
Microcontroller
28
1
PCA9685 Servo Driver Board
PWM driver board for up to 16 servos (I2C controlled)
29
6
10kΩ Potentiometer
For manual analog control of each servo
30
1
Breadboard
For wiring potentiometers to Arduino
31
1
5V 10A Power Supply
External power source for servos via PCA9685
32
1
Jumper Wires (male-male)
For connections between Arduino and PCA9685
33
1
Jumper Wires (male-female)
For connections between potentiometers and Arduino
34
1
Wooden Board
Base platform for mounting the robotic arm securely

Design with Autodesk Inventor

The first stage is to design each component of the robotic arm using Autodesk Inventor. This CAD software allows precise 3D modelling, ensuring that the parts are perfectly tailored to accommodate SG90 Micro Servos and MG996R Servos – chosen for their balance of weight, size, and torque capabilities. SG90 Micro Servos are ideal for smaller arm joints due to their compact size and sufficient precision. MG996R Servos are used for the base and other high-load areas due to their robust torque.

To ensure smooth assembly and functionality, all components were designed with detailed dimensions, which are visualized in the technical drawing below. This drawing includes sectional views, providing a clear overview of the mechanical design and assembly layout.

Technical drawing of a DIY 6-DOF robotic arm showing all mechanical parts, servos, and assembly dimensions.

3D printing the arm components

Once the models are complete, the next step is 3D printing. Each part is printed using a filament such as PLA for its ease of use and good detail accuracy. Print settings should be optimised for strength, especially for joints that will experience higher mechanical loads. Post-processing may include assembly adjustments and aesthetic enhancements.

Assembling the Robotic Arm

 Once all the parts have been printed, assembly involves carefully placing the servos in their designated mounts and accurately connecting the arm segments. Joints should be tested for smooth operation to ensure they can handle the expected range of motion without stressing the servos.

Step 1: Assembling the Base

  • Securing the Servo Motor
    Start by installing the first servo motor onto the base of your robotic arm. Utilize the screws that come with the servo package to ensure it is firmly attached (you can use cross-self-tapping screw M3x12). This servo acts as the pivotal rotation point for the entire structure of the arm, allowing for the foundational movement.
  • Adding a Ball Bearing 6806ZZ 30*42*7
    Install a ball bearing to facilitate smooth rotational movement between the base and the arm’s upper rotating part. Carefully place the ball bearing into the designated slot on the base. This component is critical for reducing friction and wear during the arm’s operations, enhancing both the precision and longevity of the movement.
  • Connecting the Servo Horn
    Attach the servo horn to the rotating upper part of the arm. Use the screws provided in the servo package to secure the horn directly to the rotating part that sits atop the ball bearing (you can use cross-self-tapping screw M2x12). Ensure that the connection is snug and secure, as this will transmit the rotational forces from the servo motor through to the upper parts of the arm.

Step 2: Mounting the Servo Horns to Robot Arm Links

To assemble the servo horns to the robot arm links, align the servo horns with the arm’s attachment points, ensuring the holes line up correctly. Secure each horn with two screws, firmly tightening them to ensure stability and prevent slippage during operation. Double-check each connection to confirm the horns are attached securely, as this will be crucial for the precise and reliable functioning of your robotic arm. 

Step 3: Mounting Servo Motors to Robot Arm Links

To mount the servo motors to the robot arm links, align each motor with the designated mounting points on the arm links, ensuring correct orientation. Secure each motor using two screws, threading through the arm into the motor’s mounting holes for a tight fit. After securing, test each connection for stability by applying gentle pressure to ensure the servo is firmly attached without any movement. This step is vital for the durability and functionality of the robotic arm during operation.

Step 4: Connecting Robot Arm Links

After securing the servo motors and horns to the robot arm links, align and connect the links. Position the links so the holes on one link’s horn match the next link’s attachment points. Secure them using screws to ensure a firm connection crucial for seamless joint movement. Tighten the screws properly to maintain stability and functionality during the robotic arm’s operation. This step ensures structural continuity and effective motion across the robotic arm’s joints.

Step 5: Assembling the Gripper

In the final assembly step, attach the gripper to the robot arm’s end link. Ensure it aligns properly and secure it with screws (Screws used in gripper joints are M3x20), checking that the gripper operates smoothly and without hindrance. This integration completes the physical construction of the robotic arm, setting the stage for functional testing and adjustments to ensure precise operation of the articulated movements.

Step 6: Mounting the Robotic Arm on a Wooden Base

Secure the fully assembled robotic arm to a wooden base to ensure stability during operation. Use screws to fasten the arm’s base securely to the wood, allowing for a solid foundation that prevents any movement during its use. I used cross-self-tapping screw M3x12.

Electronic configuration and wiring

The electronics for this project revolve around integrating the PCA9685 servo driver with the Arduino Uno to control the six servos:

Arduino Mega: Acts as the main controller.
PCA9685 servo driver board: This I2C controlled PWM driver efficiently manages up to 16 servos, perfect for expanding beyond six if required in future iterations of the project.
Wiring Guide:
Powering the PCA9685 and servos: It’s important to use an independent power source (such as a 5V 10A power supply) to handle the current demands without overloading the Arduino’s power regulator.
Connect each servo to the PCA9685: The servos are connected to individual channels on the PCA9685, matching the correct orientation for power, ground and control signals.
Connect each potentiometer to the Arduino: Connect the middle pin of each potentiometer to one of the Arduino’s analogue inputs, configuring each to control a servo.

more about PCA9685 servo driver card

Controlling servos directly from an Arduino is easy, but you may run into limitations, especially if your project involves multiple servos or other PWM-dependent components. Using all available PWM pins or potential library conflicts over timer resources are common challenges that can hinder the scalability of your designs.

To efficiently manage multiple servos without overloading the Arduino, integrating a dedicated servo driver board, such as one equipped with the PCA9685 chip, is an excellent strategy. This board uses I2C communication, which simplifies connections to just two wires – CL (clock) and SDA (data) – regardless of the number of servos being controlled. It supports control of up to 16 servos per board, and can be daisy-chained with other PCA9685 boards. This setup allows up to 992 servos to be controlled by cascading multiple boards, ideal for large projects.

Each board has simple connections:

GND: Ground connection.
OE: Output enable, usually left unconnected to keep all outputs enabled.
SCL: Clock line for I2C communication.
SDA: Data signal for I2C communication.
VCC: Logic supply at +5 volts.
V+: Power for the servomotors, which can also be supplied via a protected connector on the top of the board for greater protection against reverse polarity.
The board features sets of 3-pin connectors for each servo motor, greatly simplifying the wiring process and providing a robust solution for projects requiring extensive servo control without taxing the resources of the primary controller. This approach not only increases the reliability of the project, but also streamlines the development process, allowing you to focus on higher-level programming and design tasks.

To effectively manage and control 16 servo motors using a PCA9685-based driver with your Arduino, follow these detailed steps to correctly set up and wire the components:

Connecting to the Arduino
The PCA9685 servo driver uses I2C communication and requires only four connections to your Arduino. Here’s how to connect it depending on your Arduino model:

Classic Arduino (Uno, etc.)
+5V -> VCC (powers the PCA9685 chip, not the servos)
GND -> GND
Analog 4 -> SDA
Analog 5 -> SCL

Powering the servos:

VCC on the PCA9685 board only powers the chip itself. To power the servos you must also connect the V+ pin, which can handle up to 6V even if VCC is at 3.3V.
A polarised terminal block is recommended for connecting the servo power.
As servos can draw considerable current, especially under load, you should consider these power sources:
5V 2A switching power supply for smaller or fewer servos.
4xAA battery holder – Provides 6V from alkaline cells or 4.8V from NiMH cells.

Connecting the servos:

Connect each servo to the PCA9685 board using its standard 3-pin socket. Ensure that the ground wire (usually black or brown) matches the bottom row of pin headers on the board and that the signal wire (usually yellow or white) matches the top row.

Programming for interactive control

Programming involves setting up the Arduino to read from the potentiometers and command the servos via the PCA9685. This interaction allows dynamic control, with each potentiometer controlling one of the arm’s six servos.

/**
 * Author: Omar Draidrya
 * Date: 2024/05/05
 * This code controls multiple servos using the PCA9685 PWM driver and analog input from potentiometers.
 */

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver(); // Default address 0x40

void setup() {
    Serial.begin(9600);           // Start serial communication for debugging purposes.
    pwm.begin();                  // Initialize the PCA9685 module.
    pwm.setPWMFreq(60);           // Set the PWM frequency suitable for servos.
}

void loop() {
    // Servo 0
    int potValue0 = analogRead(A0);           // Read analog value from potentiometer connected to A0
    int servoPos0 = map(potValue0, 0, 1023, 125, 575); // Map the analog value to servo position
    pwm.setPWM(0, 0, servoPos0);              // Set servo 0 position

    // Servo 1
    int potValue1 = analogRead(A1);           // Read analog value from potentiometer connected to A1
    int servoPos1 = map(potValue1, 0, 1023, 125, 575); // Map the analog value to servo position
    pwm.setPWM(1, 0, servoPos1);              // Set servo 1 position

    // Servo 2
    int potValue2 = analogRead(A2);           // Read analog value from potentiometer connected to A2
    int servoPos2 = map(potValue2, 0, 1023, 125, 575); // Map the analog value to servo position
    pwm.setPWM(2, 0, servoPos2);              // Set servo 2 position

    // Servo 3
    int potValue3 = analogRead(A3);           // Read analog value from potentiometer connected to A3
    int servoPos3 = map(potValue3, 0, 1023, 125, 575); // Map the analog value to servo position
    pwm.setPWM(3, 0, servoPos3);              // Set servo 3 position

    // Servo 4
    int potValue4 = analogRead(A4);           // Read analog value from potentiometer connected to A4
    int servoPos4 = map(potValue4, 0, 1023, 125, 575); // Map the analog value to servo position
    pwm.setPWM(4, 0, servoPos4);              // Set servo 4 position

    // Servo 5
    int potValue5 = analogRead(A5);           // Read analog value from potentiometer connected to A5
    int servoPos5 = map(potValue5, 0, 1023, 125, 575); // Map the analog value to servo position
    pwm.setPWM(5, 0, servoPos5);              // Set servo 5 position

    delay(20);   // Short delay for stability
}
    

Calibration and testing

After programming, extensive testing is carried out to ensure that each joint operates smoothly and responds accurately to the potentiometer inputs. Calibration may be required to fine-tune the range and response of the servos to achieve the desired precision and fluidity of movement.

Conclusion


Building a 6-DOF robotic arm is a complex but highly rewarding project that combines several engineering disciplines, from mechanical design to electronics and programming. This project will not only broaden your engineering skills, but also provide a platform for further exploration into more sophisticated robotics applications.

omartronics

Welcome to OmArTronics, the hub for technology enthusiasts and creative minds! I'm Omar, the founder of this website and YouTube channel, and a passionate engineer with a background in electrical and mechanical engineering. I'm currently pursuing my master's in mechatronics in Germany.

Leave a Reply