Robotics EveryDay
Published © GPL3+

DIY Hybrid Delta Robot | Servo | Inverse Kinematics | SG-90

I built a cloud-controlled delta robot to draw coded shapes, Hoping to propose to my girlfriend with a perfect heart.

IntermediateFull instructions provided174

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1
9V 1A Switching Wall Power Supply
9V 1A Switching Wall Power Supply
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE
Arduino IoT Cloud
Arduino IoT Cloud
Python IDE

Hand tools and fabrication machines

Scissor, Electrician
Scissor, Electrician
Wire Cutter / Stripper, 5.25 " Overall Length
Wire Cutter / Stripper, 5.25 " Overall Length
Breadboard, 830 Tie Points
Breadboard, 830 Tie Points
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)
Premium Female/Male Extension Jumper Wires, 40 x 6" (150mm)

Story

Read more

Custom parts and enclosures

CAD Design of the Hybrid Delta Robot

TinkerCAD Model for the delta robot with aruino, servo motors, links and joints

Sketchfab still processing.

Schematics

CAD Design of the Hybrid Delta Robot

CAD Design of the Hybrid Delta Robot with arduino and servo motors

Code

Full code to control the hybrid delta robot

Arduino
Full code to control the hybrid delta robot with servo motors and arduino
#include <Servo.h>

Servo m1,m2;    
int i,j;
float l1=3.1,l2=7.2; //l = 6 cm length of link 
float x,y;
float d, d1, d2, h;
float ox1=0, oy1=0;
float ox2=ox1+7, oy2=0;
int dly = 10;

void setup() {
  m1.attach(5);  //left
  m2.attach(6);  //right
  Serial.begin(9600);
  m1.write(90);
  m2.write(90);

}

float angle(float x, float y, float ox, float oy){
  
  d= sqrt(((x-ox)*(x-ox))+((y-oy)*(y-oy)));

  d1=(l1*l1 - (l2*l2)+d*d)/(2*d);

  h = sqrt(l1*l1 - d1*d1);

  float phi=atan2(h,d1); 
  return phi;
  
}

float left_servo_angle(float x, float y){

  float theta= atan2(y-oy1,x-ox1); // phi 2, angle between d and l 

  float phi1 = angle(x, y, ox1, oy1);
  
  float phi = (theta + phi1)*180/PI;

  
  return phi;
}

float right_servo_angle(float x, float y){

  float theta= atan2(y-oy2,x-ox2); // phi 2, angle between d and l 

  float phi1 = angle(x, y, ox2, oy2);
  
  float phi = (theta - phi1)*180/PI;
  return phi;
  
}

void move(float x, float y){
  float phi1 = left_servo_angle(x,y);
  float phi2 = right_servo_angle(x,y);

  if (((phi1>10) && (phi1<170)) && ((phi2>10) && (phi2<170))){
    m1.writeMicroseconds((int)((phi1/180)*1500+700));
    m2.writeMicroseconds((int)((phi2/180)*1500+700));
    delay(dly);  
  }
}

void line(){
  float x = ox2/2;
  float y;
  float steps=0.01;
  
  for(y=0;y<12;y+=steps){
    move(x,y);
  }

  for(y;y>0;y-=steps){
    move(x,y);
  }

}

void loop() {
  line();
}

Credits

Robotics EveryDay
4 projects • 12 followers
Contact

Comments

Please log in or sign up to comment.