
Lalit Saini
Robotic Excavator
Caterpillar India Private Ltd., Thiruvallur organised a Contraption Event on 25 Oct, 2k16. The goal of the event was to remove the sand from the box without disturbing the box and the use of various forms of energy conversion techniques to accomplish the goal.
We were 4 members in a team which were shortlisted for the event. Each member had divided his work part.The other contraption chain was developed by them. My aim was to develop the machine which would work and remove the sand automatically.So, firstly i designed the basic structure of the machine on the solidworks.

The other things which i had to kept in mind was the minimum cost, recycled material,innovation while designing the machine.
The materials used while fabricating the machine:
-
Aluminium Sheet
-
Nut Bolts (3mm, 5mm)
-
Bearings
-
Rack and Pinion
-
Servo Motors
-
DC Motor
-
Arduino Controller
Features of the Robotic Excavator are:
-
3 axis of freedom.
-
Easy wiring with the help of connector.
-
Automatic control with one press of limit switch.
-
Flexible programming
-
180 degree rotation
#include <Servo.h>
// create servo object to control a servo
Servo motor_2_rotation;
Servo motor_3_updown;
Servo motor_4_digger;
int pos = 0; // variable to store the servo position
int SetMotorPos = 0 , UpDownTiltPrePos, SetTiltPos, Tilt, RotationTiltPrePos, DiggingTiltPrePos ;
bool switchstate;
const int button_2_cranewalk = 7; // to start action or start crane walk
const int button_3_syringe_2 = 6; // Stop crane at the end point
//const int button_7_weight_2 = 2;
const int Z_Control_Pin_1 = 2;
const int Z_Control_Pin_2 = 1;
void setup()
{
// attaches the servoes
motor_2_rotation.attach(12);
motor_3_updown.attach(11);
motor_4_digger.attach(10);
//----------------------------------------
pinMode(button_2_cranewalk, INPUT); //start crane walk
pinMode(button_3_syringe_2, INPUT); // Stop crane at the end point and start digging
pinMode(Z_Control_Pin_1, OUTPUT);
pinMode(Z_Control_Pin_2, OUTPUT);
//--------------------------------------------------
// motores initilationation
motor_2_rotation.write(100); // tell servo to go to desired position
RotationTiltPrePos = 100; // put same value as in previous line
//delay(10);
motor_3_updown.write(180); // tell servo to go to desired position
UpDownTiltPrePos = 180; // put same value as in previous line
//delay(1500);
motor_4_digger.write(0); // tell servo to go to desired position
DiggingTiltPrePos = 0; // put same value as in previous line
//delay(1500);
delay(3000);
//-------------------------------------------------------
Motor_Off(); //to Spin free crane motor
}
void loop()
{
//Second action crane walk after sensing water dropping **************************************************
switchstate = LOW;
while (switchstate == LOW)
switchstate = digitalRead (button_2_cranewalk);
Motor_Move_UP(); // move motor till switch-3 activate
switchstate = LOW;
while (switchstate == LOW)
switchstate = digitalRead (button_3_syringe_2);
Motor_Off(); // to Spin free crane motor
delay(1000);
//************************************************************************
// Dig -1
CraneUpDown(135); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(30); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
// Dig -2
CraneUpDown(130); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(180); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
// Dig -3
CraneUpDown(125); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(30); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
CraneUpDown(120); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(180); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
Motor_Move_DOWN(); //move motor back ward at required point
delay (3000);
Motor_Off(); // stop motor
delay (1000);
CraneUpDown(120); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(30); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
// Dig -2
CraneUpDown(117); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(180); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
// Dig -3
CraneUpDown(115); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(30); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
CraneUpDown(115); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(180); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
Motor_Move_DOWN(); //move motor back ward at required point
delay (3000);
Motor_Off(); // stop motor
delay(1000);
CraneUpDown(115); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(30); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
// Dig -2
CraneUpDown(115); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(180); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
// Dig -3
CraneUpDown(115); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(30); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (100);
CraneUpDown(115); //put required angle value for down-ward the arm
delay (10);
CraneDigging(110); //put required angle value for picking sand
delay (5);
CraneUpDown(180); //put required angle value for up-ward the arm
delay (10);
CraneRotation(180); //put required angle value to go sand dropping point
delay (30);
CraneDigging(0); //put required angle value for dropping sand
delay (5);
CraneRotation(100); //put required angle value to go sand dropping point
delay (30);
Motor_Move_DOWN(); //move motor back ward at required point
delay (6000);
Motor_Off(); // stop motor
delay(1000);
} // End of Void loop
//XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
//-------------------------------------------------------------------------------------------------
void Motor_Off() // make the DC motor free spin
{
digitalWrite(Z_Control_Pin_1, LOW);
digitalWrite(Z_Control_Pin_2, LOW);
delay (5); // for inertia neutralisations if any
}
//-------------------------------------------------------------------------------------------------
void Motor_Break() // make the stepper motor stuck
{
digitalWrite(Z_Control_Pin_1, HIGH);
digitalWrite(Z_Control_Pin_2, HIGH);
}
//-------------------------------------------------------------------------------------------------
void Motor_Move_UP() // make the DC motor move upward / clockwise
{
digitalWrite(Z_Control_Pin_1, HIGH);
digitalWrite(Z_Control_Pin_2, LOW);
}
//-------------------------------------------------------------------------------------------------
void Motor_Move_DOWN() // make the DC motor move downward / unticlockwise
{
digitalWrite(Z_Control_Pin_1, LOW);
digitalWrite(Z_Control_Pin_2, HIGH);
}
//HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
void CraneUpDown(int SetTiltPos) // int SetTiltPos for Tilt
{
if (SetTiltPos > UpDownTiltPrePos)
for (Tilt = UpDownTiltPrePos; Tilt <= SetTiltPos; Tilt += 1)
{
motor_3_updown.write(Tilt); // tell servo to go to position in variable 'Tilt'
delay (15); // time to slow down the speed
}
else
for (Tilt = UpDownTiltPrePos; Tilt >= SetTiltPos; Tilt -= 1)
{
motor_3_updown.write(Tilt); // tell servo to go to position in variable 'Tilt'
delay (15);
}
UpDownTiltPrePos = SetTiltPos ;
}
//HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
void CraneRotation(int SetTiltPos) // int SetTiltPos for Tilt
{
if (SetTiltPos > RotationTiltPrePos)
for (Tilt = RotationTiltPrePos; Tilt <= SetTiltPos; Tilt += 1)
{
motor_2_rotation.write(Tilt); // tell servo to go to position in variable 'Tilt'
delay (30); // time to slow down the speed
}
else
for (Tilt = RotationTiltPrePos; Tilt >= SetTiltPos; Tilt -= 1)
{
motor_2_rotation.write(Tilt); // tell servo to go to position in variable 'Tilt'
delay (30);
}
RotationTiltPrePos = SetTiltPos ;
delay(500);
}
//HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
void CraneDigging(int SetTiltPos) // int SetTiltPos for Tilt
{
if (SetTiltPos > DiggingTiltPrePos)
for (Tilt = DiggingTiltPrePos; Tilt <= SetTiltPos; Tilt += 1)
{
motor_4_digger.write(Tilt); // tell servo to go to position in variable 'Tilt'
delay (10); // time to slow down the speed
}
else
for (Tilt = DiggingTiltPrePos; Tilt >= SetTiltPos; Tilt -= 1)
{
motor_4_digger.write(Tilt); // tell servo to go to position in variable 'Tilt'
delay (15);
}
DiggingTiltPrePos = SetTiltPos ;
}
Programming Code








