2023 Robot Instructions
Contents:
CAD Models of Completed Robot.............................................................................................. 1
Wiring Diagram and Electrical Components.............................................................................2
Manufacturing Plans................................................................................................................... 3
Sensors.......................................................................................................................................23
Code............................................................................................................................................25
Bill of Materials.......................................................................................................................... 33
Club Organizational Chart........................................................................................................ 35
Safety Data Sheets.................................................................................................................... 36
UNI Robotics Page 1
CAD Models of Completed Robot
UNI Robotics Page 2
Wiring Diagram and Electrical Components
UNI Robotics Page 3
Manufacturing Plans
Base Frame
Cutting:
● 4 - 1”x1”x34” Aluminum Square Tubing
● 2 - 1”x1”x28” Aluminum Square Tubing
● 2 - 1”x1”x22” Aluminum Square Tubing
● 3 - 1”x1”x14” Aluminum Square Tubing
● 2 - 1”x1”x11” Aluminum Square Tubing
● 4 - 1”x1”x5” Aluminum Square Tubing
UNI Robotics Page 4
Label:
● 1”x1”x34” Aluminum Square Tubing
○ “S-OL”
○ “S-IL”
○ “S-OR”
○ “S-IR”
● 1”x1”x28” Aluminum Square Tubing
○ “T-R”
○ “T-L”
● 1”x1”x22” Aluminum Square Tubing
○ “F”
○ “B”
● 1”x1”x14” Aluminum Square Tubing
○ “M-F”
○ “M-B”
○ “M-T”
● 1”x1”x11” Aluminum Square Tubing
○ “M-R”
○ “M-L”
● 1”x1”x5” Aluminum Square Tubing
○ “C”
UNI Robotics Page 5
Drilling:
● 1”x1”x34”
● 1”x1”x28”
● 1”x1”x22”
● 1”x1”x14” (M-F & M-B)
● 1”x1”x14” (T-M)
● 1”x1”x11” (M-R & M-L)
● 1”x1”x5” (C)
UNI Robotics Page 6
Assembly of Base:
● Connect S-OL, S-IL, S-OR, and S-IR to F & B
○ Using 16, 90 degree brackets
● Connect S-IL and S-IR to C
○ Using 8, 90 degree brackets
● Connect C to T-L and T-R
○ Using 4, 90 degree brackets
● Connect C to T-M
○ Using 2, 90 degree brackets
● Connect S-IL and S-IR to M-F and M-B
○ Using 8, T Brackets
● Connect M-F and M-B to M-L and M-R
○ Using 8, 90 degree brackets
UNI Robotics Page 7
Assembly of Traction Wheels:
● Assemble 6” Traction Wheels with 6” Traction Tires
● Connect Wheel Assembly to ½” Hex Bore Aluminum
Versahub
● Connect Ultraplanetary ½” Hex Adapter to ½” Hex Bore
Aluminum Versahub
● Connect Ultraplanetary Bent Mounting Bracket to REV
Hex Motor
● Attach Motor and Traction Wheels
UNI Robotics Page 8
Assembly of Omni-Directional Wheels:
● Connect 6” Omni-Directional Wheels to
½” Hex Bore Aluminum Versa Hub
● Attach 4.5” Hex Shaft to Versa Hub
● Attach 4 Shaft Collars to 4.5” Hex Shaft
UNI Robotics Page 9
Assembly of Wheels to Base:
● Flip Base Over, and attach 4 Ultraplanetary Bent Mounting Brackets (Other 4 are on the
motors already)
● Insert 4 ThunderHex Flanged Bearings into the Ultraplanetary Bent Mounting Brackets
● Connect Assembled Omni-Directional Wheels to Base
● Connect Assembled Traction Wheels to Base
UNI Robotics Page 10
3D Prints:
● 1 - Motor Bracket
● 8 - Pulley Guards
● 4 - ¾” Hole Caps
● 1 - REV Battery Holder
UNI Robotics Page 11
Assembly of Motor Bracket to Base:
● Take the Motor Bracket and Base. Bolt to M-L and M-R
Aluminum Sheets
Cut LxH:
● 2 - 36” x 4”
● 2 - 30” x 5”
● 2 - 22” x 4”
● 1 - 14” x 20”
● 1 - 16” x 5”
● 2 - 15.”5 x 1”
● 1 - 16” x 14.5”
UNI Robotics Page 12
Label:
● 36” x 4”
○ UL
○ UR
● 30” x 5”
○ CSL
○ CSR
● 22” x 4”
○ R-F
○ R-B
● 14” x 20”
○ EDT
● 16” x 5”
○ Back Sheet
● 15.5”x1”
○ Thin Sheets
● 16”x14.5”
○ TBS
UNI Robotics Page 13
Arm Extensions
Cut:
● 2 - 1”x1”x25”
● 2 - 1”x1”x12”
Label:
● 1”x1”x25”
○ AEL
○ AER
● 2 - 1”x1”x12”
○ AEM
Drilling:
● 1”x1”x25”
● 1”x1”x12”
Assembly:
● Connect AEL to AEM
○ Using 2, T Brackets
● Connect AER to AEM
○ Using 2, T Brackets
UNI Robotics Page 14
Sliders
Cut:
● 2 - 1”x1”x15”
● 2 - 1”x1”x12”
● 2 - 1”x1”x6”
Label:
● 2 - 1”x1”x15”
○ FRK
● 2 - 1”x1”x12”
○ FRKV
● 2 - 1”x1”x6”
○ FRKS
Drilling:
● 1”x1”x15”
● 1”x1”x12”
● 1”x1”x6”
Assembly:
● Attach FRK to FRKV
● Attach FRK-FRKV Assembly to FRKS
UNI Robotics Page 15
Forks Backing
Cut:
● 2 - 1”x1”x16”
● 2 - 1”x1”x14”
● 2 - 1”x1”x5”
Label:
● 2 - 1”x1”x16”
○ FBTB
● 2 - 1”x1”x14”
○ FBS
● 2 - 1”x1”x5”
○ FBAH
Drilling:
● 1”x1”x16”
● 1”x1”x14”
● 1”x1”x5”
UNI Robotics Page 16
Assembly:
● Attach FBTB to FBS
○ Using 8, 90 degree brackets
● Attach FBAH to FBS
○ Using 4, 90 degree brackets
Hex Shaft
Cut:
● 3 - 18 ⅝” Hex Shafts
● 1 - 15 ¼” Hex Shaft
UNI Robotics Page 17
Sliders & Forks Backing Assembly
Attach:
● Attach Sliders to Forks Backing
○ Using 2, 18 ⅝” Hex Shafts
■ Using 8, Hex Shaft Collars
UNI Robotics Page 18
Sliders & Forks Backing to Arm Assembly
Assembly:
● Attach the Sliders & Forks Backing Assembly to the Arm Assembly
○ Using 1, 18 ⅝” Hex Shaft
■ Using 4 Hex Shaft Collars
● Attach EDT to top of Arm Assembly
○ Using 4, Self Tapping Screws
● Attach Motors (2) and Motor Brackets (2) to bottom of Arm Assembly
○ Using 2, Self Tapping Screws/Motor Bracket
UNI Robotics Page 19
UNI Robotics Page 20
Forklift & Arm Assembly to Base
Attach:
● Attach Forklift & Arm Assembly to Base
○ Using 1, 15 ¼” Hex Shaft
UNI Robotics Page 21
Plates to Base
Attach:
● UL and UR to Bottom Sides of Robot
● CSL and CSR to Top Sides of Robot
● RF and RB to Bottom Front and Bottom Back of Robot
● Back Sheet to Top Back of Robot
● Thin Sheets to Top of Robot
● TBS to Back Top of Robot
UNI Robotics Page 22
Electronics Board:
UNI Robotics Page 23
Sensors
● Smart Sensors
○ Pixi 2
UNI Robotics Page 24
● Regular Sensors
○ IR Sensors
○ Temperature Sensor
UNI Robotics Page 25
Code
Main Code:
#include <Pixy2.h>
#include <Servo.h>
Pixy2 pixy;
Servo servoLeft;
Servo servoRight;
Servo servoLift;
Servo servoLiftL;
Servo servoLiftR;
int flag1=0; // flag to indicate the pick-up task or drop-off task is done 0: nothing 1: carrys an
object
int flag2=0; // flag to indicate if enabling or disabling barcodes detection 1: barcode, 0: color
int color=0; //indicate the color that have been picked up
int IR1=9; //Infrared 1
int IR2=10; //Infrared 2
int IR3=8; //Infrared 3
int data[3]; //for IR status
void forward(unsigned int time);
void backward(unsigned int time);
void liftup(unsigned int time);
void liftdown(unsigned int time);
void liftLR(unsigned int time);
void downLR(unsigned int time);
void TurnLeft(unsigned int time);
void TurnRight(unsigned int time);
void PivotTurnRight(unsigned int time);
void TurnAround(unsigned int time);
void setup()
{
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(2, OUTPUT);
pinMode(IR1, INPUT);
pinMode(IR2, INPUT);
pinMode(IR3, INPUT);
servoLeft.attach(5);
servoRight.attach(6);
servoLift.attach(3);
servoLiftL.attach(4);
UNI Robotics Page 26
servoLiftR.attach(2);
pixy.init();
Serial.begin(115200);
}
void loop()
{
data[1]=digitalRead(9); //middle IR
data[2]=digitalRead(10); //right IR
data[0]=digitalRead(8); //left IR
track();
}
void liftup(unsigned int time)
{
servoLift.writeMicroseconds(1000); //lift motor clockwise
delay(time);
}
void liftdown(unsigned int time)
{
servoLift.writeMicroseconds(2000); //lift motor counterclockwise
delay(time);
}
void forward(unsigned int time)
{
servoLeft.writeMicroseconds(1700); //left wheel spins counterclocwise
servoRight.writeMicroseconds(1200);//right wheel spins clockwise
delay(time);
}
void backward(unsigned int time)
{
servoRight.writeMicroseconds(1700); //right wheel spins counterclockwise
servoLeft.writeMicroseconds(1300); //left wheel spins clockwise
delay(time);
}
void TurnRight(unsigned int time)
{
servoRight.writeMicroseconds(1700); //right wheel spins counterclockwise
servoLeft.writeMicroseconds(1700); //left wheel spins counterclockwise
delay(time);
}
void TurnLeft(unsigned int time)
{
UNI Robotics Page 27
servoRight.writeMicroseconds(1300); //right wheel spins clockwise
servoLeft.writeMicroseconds(1300); //left wheel clockwise
delay(time);
}
void TurnAround(unsigned int time)
{
servoLeft.writeMicroseconds(1300); //left wheel clockwise
servoRight.writeMicroseconds(1300); //right wheel counterclockwise
}
void PivotTurnRight(unsigned int time)
{
servoRight.writeMicroseconds(1500); //right wheel stays still
servoLeft.writeMicroseconds(2000); //left wheel spins counterclockwise
delay(time);
}
void liftLR(unsigned int time)
{
servoLiftR.writeMicroseconds(1700); //right lift spins counterclockwise
servoLiftL.writeMicroseconds(1300); //left lift wheel spins clockwise
delay(time);
servoLiftR.writeMicroseconds(1500);
servoLiftL.writeMicroseconds(1500);
}
void downLR(unsigned int time)
{
servoLiftR.writeMicroseconds(1300); //right lift spins clockwise
servoLiftL.writeMicroseconds(1700); //left lift wheel spins counterclockwise
delay(time);
servoLiftR.writeMicroseconds(1500);
servoLiftL.writeMicroseconds(1500);
}
void Halt(unsigned int time) //both wheels stay still
{
servoLiftR.writeMicroseconds(1500);
servoLiftL.writeMicroseconds(1500);
delay(time);
}
void track()
{
UNI Robotics Page 28
char message[80];
if(flag2==0) // if barcode enabling flag is disabled, switch to the color mode.
{
Serial.println("change to color");
pixy.changeProg("color_connected_components");
pixy.ccc.getBlocks(); //get colors
}
else //if barcode enabling flag is enabled, switch to the line-tracking mode
{
Serial.println("change to line");
pixy.changeProg("line");
pixy.line.getMainFeatures();//read barcodes
}
//pixy.ccc.getBlocks();
Serial.print("pixy ccc numBlocks: ");
Serial.println(pixy.ccc.numBlocks);
if (pixy.ccc.numBlocks)
{
Serial.println(pixy.ccc.blocks[0].m_signature);
Serial.print("pixy.ccc.blocks[0].m_width= ");
Serial.println(pixy.ccc.blocks[0].m_width);
}
if(pixy.ccc.numBlocks && flag1==0) //if the object is too close, save the color data, pick it up
and turn around
{
color = pixy.ccc.blocks[0].m_signature;
Serial.print("color = ");
Serial.println(color);
//Halt(1000);
//liftup(1000);
//backward(1000);
// TurnAround(1000);
flag1 = 1; //now its knows it got something
flag2 = 0; //now it knows it ignores barcode
}
sprintf(message, "data[0] = %d, data[1] = %d, data[2] = %d \n", data[0], data[1], data[2]);
Serial.write(message);
if(data[0]==0 && data[1]==1 && data[2]==0) //if middle IR detects black line, both sides dont,
follow the line
{
forward(200);
}
UNI Robotics Page 29
if(data[0]==1 && data[1]==1 && flag1==1) // if left IR detects black line, and it is carrying the
pallet
{
backward(1000);
TurnLeft(200);
if(color==1)//if bring red back, PivotTurnLeft until middle IR detects white line and both sides
don't
{
TurnLeft(200);
}
else if(color==2) //if bring green back, PivotTurnRight until middle IR detects white line and
both sides don't
{
TurnRight(200);
forward(200);
}
}
if(data[1]==1 && data[2]==1 && flag1==1)//when got blue back, if right IR detects line,
PivotTurnRight until middle IR detects black line and both sides don't
{
backward(1000);
PivotTurnRight(200);
}
if(pixy.ccc.blocks[0].m_x <=10 && flag1==1 && pixy.ccc.blocks[0].m_signature==4) //when it is
carrying the pallet, and when it reaches the zone
{
Halt(1000);
liftLR(1000);
backward(1000);
TurnAround(1000);
flag1 = 0; // now it knows it has dropped the pallet
flag2 = 1; //now it knows it needs to detect the barcodes
}
//the robot finished one task! now it needs to go back and pick the pallet
if(flag2==1 && pixy.line.barcodes->m_code==1) // When barcode1 for turning right is detetced,
turn right
{
backward(1000);
TurnRight(200);
}
if(flag2==1 && pixy.line.barcodes->m_code==2) //when barcode2 for turning left is detected,
turn left
UNI Robotics Page 30
{
backward(1000);
TurnLeft(200);
flag2 = 0; //it has turned back to the main road and ready to pick up the pallet, disable
barcode detecting.
}
if(flag2==1 && pixy.line.barcodes->m_code==3) //when barcode3 for turning left is detectd, turn
left
{
backward(1000);
TurnRight(200);
flag2 = 0; //it has turned back to the main road and ready to pick up the pallet, disable
barcode detecting.
}
if(data[0]==0 && data[1]==0 && data[2]==0)//if lines are not detected anymore, make turns a
bit to find line
{
Serial.println("Turnright");
PivotTurnRight(200);
}
}
UNI Robotics Page 31
LCD Code:
#include <LiquidCrystal.h> // liquid crystal library contains
LiquidCrystal lcd(13, 12, 11, 10, 9, 8); // pins to display
float voltage = 0; //the voltage measured from the TMP36
float degreesC = 0; //the temp in C,
float degreesF = 0; //the temp in F,
void setup() {
lcd.begin(16, 2); //16 characters wide and 2 characters high
lcd.clear(); //clear the display
}
void loop() {
voltage = analogRead(A0) * 0.004882813; //convert the analog reading, which varies from 0
to 1023, back to a voltage value from 0-5 volts
degreesC = (voltage - 0.5) * 100.0; //convert the voltage to a temp in C
degreesF = degreesC * (9.0 / 5.0) + 32.0; //convert the voltage to a temp F
lcd.clear(); //clear the LCD
lcd.setCursor(0, 0); //set the cursor to the top left
lcd.print("Motor Temp(F): "); //print the degreesF
lcd.print(degreesF); //print the degrees F
lcd.setCursor(0, 1); //set the cursor
lcd.print("Motor Temp(C): "); //Print words
lcd.print(degreesC); //print the degrees C
delay(1000); //delay for 1 second
UNI Robotics Page 32
Button Code:
int pushButton = 13; //Set pin for pushbutton
void setup() {
Serial.begin(9600); // Set Data rate
pinMode(pushButton, INPUT);
void loop() {
int buttonState = digitalRead(pushButton); //Set low high value to pin
Serial.println(buttonState); //print out utput for button
delay(1); //one second delay
}
UNI Robotics Page 33
Bill of Materials
PART SIZE QTY COST
Aluminum Square Tubing 1”x1”x34” 4 $13.92
Aluminum Square Tubing 1”x1”x28” 2 $13.92
Aluminum Square Tubing 1”x1”x22” 2 $13.92
Aluminum Square Tubing 1”x1”x14 3 $13.92
Aluminum Square Tubing 1”x1”x11” 2 $13.92
Aluminum Square Tubing 1”x1”x5” 4 $13.92
Aluminum Square Tubing 1”x1”x25” 2 $13.92
Aluminum Square Tubing 1”x1”x15” 2 $13.92
Aluminum Square Tubing 1”x1”x12” 2 $13.92
Aluminum Square Tubing 1”x1”x6” 2 $13.92
Aluminum Square Tubing 1”x1”x12” 2 $13.92
Aluminum Square Tubing 1”x1”x16” 2 $13.92
Aluminum Square Tubing 1”x1”x14” 2 $13.92
Aluminum Square Tubing 1”x1”x5” 2 $13.92
Aluminum Sheeting 36” x 4” 2 Donated (Scrap)
Aluminum Sheeting 30” x 5” 2 Donated (Scrap)
Aluminum Sheeting 22” x 4” 2 Donated (Scrap)
Aluminum Sheeting 14” x 20” 1 Donated (Scrap)
Aluminum Sheeting 14” x 20” 1 Donated (Scrap)
Aluminum Sheeting 16” x 5” 1 Donated (Scrap)
Aluminum Sheeting 15.5” x 1” 2 Donated (Scrap)
Aluminum Sheeting 16” x 14.5” 1 Donated (Scrap)
Traction Wheel 6” 4 $71.96
Traction Tire 6” 4 $27.96
UNI Robotics Page 34
Omni-Directional Wheel 6” 2 $59.98
Steel Cable 25’ 1 $11
Small Pulley Bearings 12 mm OD 10 $12.50
Arduino Mega 1 Reused
Pixi 2 Smart Sensor N/A 1 $69.90
IR Sensors N/A 3 Donated
Temperature Sensor N/A 1 Donated
LCD Screen N/A 1 Donated
REV Slim Battery 12V 1 $55
Duracell Battery AA 4 N/A
REV Distribution Module N/A 2 Reused
REV Motor Controller Mini 5 Reused
PLA Motor Bracket N/A 1 $2
PLA Pulley Guard N/A 8 $2
PLA Hole Caps ¾” 4 $2
PLA REV Battery Holder N/A 1 $5
Hex Shaft 18 ⅝” 3 $74.97
Hex Shaft 15 ¼” 1 $24.99
90 Degree Brackets N/A 50 $89.80
T Brackets N/A 14 $62.86
Hex Shaft Collars ½” 18 $71.76
Acrylic 7 ¼” x 16” 1 Scrap
Hex VersaHubs ½” 12 $59.88
Total: N/A N/A $839.42
UNI Robotics Page 35
Club Organizational Chart
UNI Robotics Page 36
Safety Data Sheets