A friend of mine was really inspired by a robot he saw in a music studio.
It allowed you to auto EQ or position a microphone remotely without
the burden of being in front of high decibel guitar amps.
Since he didn't have much knowledge of robotics he asked me to recreate this robot for him.
Below is the step by step process I took on this project.
IMAGE
Using this video (skip to 0:50)
I was to recreate the 3 axis positioning robot with wireless functionality.
Using the video, I made a design in solidworks to see if I could recreate it in 3D.
Here is the simulation.
Here is the video of collapse and reassembly.
Orthographic View/ Exploded View
The build changed as I went along however I stayed close to the original design. I chose an arduino micro controller as the brains for this project. I did some research and was able to find a RF arduino wireless inventors shield. It took a bit of tweaking but I was eventually able to send and receive bytes.
Started off by cutting the U-channel into 3, 13" pieces
13" U-channel
Cutting the remaining U-channel into 3, 3" pieces
Detailed Drawing : 3" U-channel

3" U-channel pieces cut into a T
Mounted T to the bottom of 2nd U-channel


Cutting 4 1" pieces of angled brackets for later.
Drilling a 5/16" hole for the 3/8" tap.
Making sure the design is on track.

SparkFun motors finally arrive.

Instructions for wiring 3 Stepper motors
Soldering is taking place and igus(cable carries) are added.
Testing out some code with the arduino and checking wiring.
Tubing was 3/8in OD X 1/4in ID

Gotta make do sometimes.

The motors are mounted into to place using zip ties and the angled brackets that were cut earlier.
The mounting varied from motor to motor but they were all mounted in a way that was accessible
in the event of maintenance.


This little device seems to have a pretty good range. I tried it from my backyard and it worked fine.

That wraps up just about everything.
Bill of Materials - BOM
As far as the code, I had to implement a debounce method to properly switch through each axis, otherwise it would have ran several iterations of the loop over a second and randomly switched between axises.
#define DIR1_PIN (11) //FWD BACK
#define STEP1_PIN (10)//FWD BACK
#define DIR2_PIN (13) //Left Right
#define STEP2_PIN (12)//Left Right
#define DIR3_PIN (9) // Up Down
#define STEP3_PIN (8)// Up Down
#define DELAY (1600/10)
#define BAUD (4800)
String mid = "32178148120197" ;
String right = "64178148120197";
String left = "16178148120197";
String B = "";
int axis = 0 ;
int incomingByte = 0;
int Hold_Delay = 500;
int c = 0;
int n = 0;
int r = 0;
int x = 1 ;
int y = 1;
int z = 0;
double lastDebounceTime = 0.0;
double bdelay = 800.0;
boolean debounce = true;
void setup()
{
Serial.begin(9600);
pinMode(DIR1_PIN,OUTPUT);
pinMode(STEP1_PIN,OUTPUT);
pinMode(DIR2_PIN,OUTPUT);
pinMode(STEP2_PIN,OUTPUT);
pinMode(DIR3_PIN,OUTPUT);
pinMode(STEP3_PIN,OUTPUT);
}
void loop()
{
Serial.print("Program Start") ;
Serial.print("\r\n");
switch (axis)
{
case 0:
Serial.print("\r\n");
Serial.print("Start Case 0") ;
while(true)
{
recieve();
if(B.equals(right))
{
B="";
x +=1;
lastDebounceTime = millis();
while((x % 2) == 0)
{
// Serial.print("Forward");
digitalWrite(DIR1_PIN, LOW); // Set the direction.
digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
recieve();
if(B.equals(left) || B.equals(mid))
{
Serial.print("Stop");
digitalWrite(STEP1_PIN, LOW); // Stop
break;
}
}
}
if(B.equals(left))
{
B="";
y +=1;
lastDebounceTime = millis();
while((y % 2) == 0)
{
// Serial.print("Forward");
digitalWrite(DIR1_PIN, HIGH); // Set the direction.
digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP1_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
recieve();
if(B.equals(right) || B.equals(mid))
{
Serial.print("Stop");
digitalWrite(STEP1_PIN, LOW); // Stop
break;
}
}
}
if(B.equals(mid)&& millis() - lastDebounceTime > bdelay)
{
digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates the
lastDebounceTime = millis();
Serial.print("\r\n");
Serial.print(lastDebounceTime);
B="";
axis = 1;
break;
}
}
case 1:
Serial.print("\r\n");
Serial.print("Start Case 1") ;
while(true)
{
recieve();
if(B.equals(right))
{
B="";
x +=1;
lastDebounceTime = millis();
while((x % 2) == 0)
{
// Serial.print("Forward");
digitalWrite(DIR2_PIN, LOW); // Set the direction.
digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP2_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
recieve();
if(B.equals(left) || B.equals(mid))
{
Serial.print("Stop");
digitalWrite(STEP2_PIN, LOW); // Stop
break;
}
}
}
if(B.equals(left))
{
B="";
y +=1;
lastDebounceTime = millis();
while((y % 2) == 0)
{
// Serial.print("Forward");
digitalWrite(DIR2_PIN, HIGH); // Set the direction.
digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP2_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
recieve();
if(B.equals(right) || B.equals(mid))
{
Serial.print("Stop");
digitalWrite(STEP2_PIN, LOW); // Stop
break;
}
}
}
if(B.equals(mid)&& millis() - lastDebounceTime > bdelay)
{
digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates the
Serial.print("Up and Down");
lastDebounceTime = millis();
Serial.print("\r\n");
Serial.print(lastDebounceTime);
B="";
axis=2;
break;
}
}
case 2:
Serial.print("\r\n");
Serial.print("Start Case 2") ;
while(true)
{
//
recieve();
if(B.equals(right))
{
B="";
x +=1;
lastDebounceTime = millis();
while((x % 2) == 0)
{
// Serial.print("Forward");
digitalWrite(DIR3_PIN, LOW); // Set the direction.
digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP3_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
recieve();
if(B.equals(left) || B.equals(mid))
{
Serial.print("Stop");
digitalWrite(STEP3_PIN, LOW); // Stop
break;
}
}
}
if(B.equals(left))
{
B="";
y +=1;
lastDebounceTime = millis();
while((y % 2) == 0)
{
// Serial.print("Forward");
digitalWrite(DIR3_PIN, HIGH); // Set the direction.
digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP3_PIN, HIGH); // "Rising Edge" so the easydriver knows to when to step.
delayMicroseconds(300); // This delay time is close to top speed for this
recieve();
if(B.equals(right) || B.equals(mid))
{
Serial.print("Stop");
digitalWrite(STEP3_PIN, LOW); // Stop
break;
}
}
}
if(B.equals(mid)&& millis() - lastDebounceTime > bdelay)
{
digitalWrite(STEP1_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP2_PIN, LOW); // This LOW to HIGH change is what creates the
digitalWrite(STEP3_PIN, LOW); // This LOW to HIGH change is what creates the
Serial.print("Forward and Backward");
lastDebounceTime = millis();
Serial.print("\r\n");
Serial.print(lastDebounceTime);
B="";
break;
}
}
axis=0;
}
}
void recieve()
{
if(Serial.available() > 0 ) // && //set the current time) // checking for signal
{
if(c==5)
{
Serial.print("\r\n");
Serial.print(B);
B="";
c=0;
}
incomingByte = Serial.read();
// Serial.print("I recieved:");
// Serial.write(incomingByte);
B +=incomingByte;
// Serial.print("\r\n");
// Serial.print(B);
// Serial.print("\r\n");
c+=1;
}
}


















No comments:
Post a Comment