Combination Report Einstein Robot



Download 10.84 Mb.
Page39/41
Date conversion08.07.2018
Size10.84 Mb.
1   ...   33   34   35   36   37   38   39   40   41

Head/Body Modifications

The third objective was to fix some of the robot, build parts and remove some requested parts by Prof. Perkawski. We have removed the arm that was attached to the robot base and placed it on the shelf to be reused in the future.
We needed to fix the position of one of the eyeball and how it was held in place. We ended up using a small screw to replace the broken pin to reattach it to its bracket. It was also noticed that one of the eyes is very loose which gave Einstein a lazy eye. We were unable to fix and decided not to since it gave him a little personality.  Also the LEDs for the eyes were falling out so we used hot glue to hold them in place.
We also found one servo that was bad (left ear) so we replaced it with a spare we found in a box full of servos which turned out was also broken too, searched again and found one that worked.
Head base was moving and was not held very well to the body, so we needed to drill through the wooden base into the plastic body base; now it does not move. We also fixed the forehead which was not attached; by using a small screw to secure it in place.


Figure 4.3 Modify Shoes

We attached shoes to Einstein with a screw going through the acrylic base into his shoes. His Shoes were modify by using power tools to cut out big sections in the heel in order for them to fit over the pipes that was holding the body to the acrylic wheel base (Red line represents cut in figure 4.1).
We have noticed that there was a speaker with bare two wires that was attached to the body that was not being used, so we soldered speaker terminals to it and connected it to an amplifier circuit board (see Appendix B for type used). The amplifier circuit had to be put together by some soldering of the 3.5mm audio jack, the power connector wires and the speaker wires. The small amplifier circuit was able to give us great amplification from our laptop even at low volume. This enabled Einstein to speak which was very useful since he has many speaking parts in the play.
In order to achieve mouth movement we implemented a bent wire hanger to push the bottom part of the mask down and connected to one of the servos in the right ear. A lot of time was spent on designing the mouth to give it an exaggerated movement with a stiff mask. Our first attempt was using a small piece of wire hanger and attaching it to the servos in the mouth (previously used for cheek movement) this gave it very little movement and was not very predictable since the wire moved freely. After deciding to use the servo in the ear more time was spent in custom bending the wire into a jaw shape and giving it enough length to reach the bottom of the mask for an exaggerated movement. This method proved promising, the only issue was that only one side of the wire was attached to the servo and the other side was free in order to give it freedom to move.
We did a lot of taping to secure the wires to the base to prevent them from breaking at the solder points or being pulled off the board, note it would be a good idea to secure them by staples since the tape will come lose as it gets older. Also the amplifier circuit board was secured to the base by tape since it was so small, so be careful when screwing items to the base that is covered with tape on one side.
5. Arduino Implementation

Originally Einstein’s head servos was controlled by board called “Mini SSC II” which through some google’ing we found out that the only way to send some commands was by using a phone-jack to serial to USB connector. This by today's standards is obsolete. So we use an up to date way to send commands to the servos an Arduino Uno. We chose Arduino Uno because it was relatively cheap $35, allows up to 14 digital I/O pins (2x more than the mini SSCII), USB connection (not serial) and easy programming. We also bought a Sensor shield (see appendix for board layout) in order to use the servo connections without any modifications. This allows us to easily connect all the servos the Arduino and to add Bluetooth and any other features later. We also used the bottom part of an Arduino case to hold the Arduino in place; this made mounting the Arduino to the back of the robot easier and safer from shorts caused by screws.

We started by first downloading an example servo code from Arduino website and modifying it to test our servos. We tested each servo (10 total) and recorded its min and max range of motion to achieve our desired effect. We then labeled each servo and wires connection to minimize any confusion. Our labeling technique consisted of a letter and a number. The numbering system came from how many servos there were in the head and to make it simpler the numbers matched digital I/O pin connection on the arduino. The lettering system consisted of the first letter of the facial area such as “E” for eyes, “N” for Neck, Mouth, Brows and Unknown.

We then created basic functions for facial/head movements such as eye, neck and mouth (see appendix A). Tested them with only that particular servo connected to the arduino and a final test with all the wires connected to the arduino. The final test did not go very well, the head had very erratic movements due to some random servos activating. We suspected it was because of a power issue since we tested all the servos for an extended period of time we may have reduced our battery capacity to below more than one servo running. We changed batteries and the issue went away.

One issue that kept coming back was when we started using some particular servos we would get some sound feedback coming from the speakers we connected. This could be because we were borrowing the power from a servo to turn on the speaker amplifier. Some shielding is probably needed to prevent this from happening.

We used a 9v battery to power the Arduino when it was not connected to the laptop; luckily we found a small switch connected with a power plug and 9v connector. We also used a 4xAA battery pack to power all the servos; this power pack came with a built in power switch which was very useful. We cut some jumper cables with alligator clips to use as the power connection from the Arduino to the battery pack, just in case if we ever want to change the type of power source. We also cut Einstein shirt to make easier to access the board and power without removing his shirt all time and used Velcro to close it back up.



Figure 5.1 Arduino



  1. Suggested Updates




  • Bluetooth to send commands to Einstein part was bought but were unable to fully integrate it since there was some difficulty with the coding part for Bluetooth.

  • Change the use of tape to secure the wires to staples.

  • Jaw upgrade for mouth movement instead of wire hanger. Suggest human like jaw maybe with some teeth, this will allow for much greater believable mouth movement.

  • Extra DOF in neck for ‘yes’ motion movement, maybe adding another axel to neck.

  • Arms It was also suggested that Arms will be attached at some point

  • Resurrect Base motors - Note when the arm was removed from Einstein this also removed the components needed to control the base motors.



Appendix A - Arduino Sensor Shield layout



Appendix B - Arduino Code
// einstein Head Arduino Code ECE478 - Fall15

// Waleed Alhaddad and David Hernandez

// Using arduino Uno R3 with Sensor Shield
#include // servo library
// Servo variables using wire labeling

Servo E7, E2; // eyes UpDwn=E7, LeftRight=E2

Servo M3, M5; // cheeks/mouth Right=M3, Left=M5

Servo B4, B6; // Brows Right=B4, Left=B6

Servo N9, N10; // Neck sideTilt=N10, rotate"No"=N9

Servo U8, U1; // Unknown-using for Jaw Left=U8, Right=U1


void setup(){

// assigning variable to i/o pins

E2.attach(2); // moves eyes left/right

E7.attach(7); // moves eyes up/down

M3.attach(3); // right cheek

M5.attach(5); // left cheek

B4.attach(4); // right brow

B6.attach(6); // left brow

N9.attach(9); // rotate neck left/right "No"

N10.attach(10); // tilt neck side to side

//U8.attach(8); // Not used

U1.attach(1); // moving jaw up/down


pinMode(11, OUTPUT); // left eye Led

pinMode(12, OUTPUT); // right eye Led

digitalWrite(11, HIGH); // turn left eye LED On

digitalWrite(12,HIGH); // turn right eye LED on


//Serial.begin(9600); // Default connection rate for my BT module
// initial state for head

neckNeutral();

eyesNeutral();

}
void loop(){

//test();

// eyesON();

//eyesOFF();

//eyesBlink();

//eyeWink();

//browRight();

//shiftyEyes();

//UpDownEyes();

//mouthOpenCloseSlow();

mouthOpenCloseFast();

//motionNo();

// NeckTilt();

}
void test(){

// function used for indivudual servo testing purposes

// DOWN:15 -- MIDDLE 165 --- UP:200 E7

// Left:25 -- Middle: 90 -- Right:145 N9

// tiltright:45 -- tiltmiddle: 60 --tiltleft: 100 N10

//E7.write(127);

U1.write(100);

delay(500);

U1.write(150);

delay(1000);

//B6.write(170);

//delay(1U100);

//B4.write(70);

//delay(1000);

//E2.write(30);

//delay(1000);

//N10.write(00);

//delay(2000);

//E2.write(100);

// E7.write(0);


}

void motionNo(){

neckNeutral();

delay(500);

neckTurnRight();

delay(500);

neckNeutral();

delay(500);

neckTurnLeft();

delay(500);

}

void NeckTilt(){



neckTiltLeft();

delay(500);

neckNeutral();

delay(500);

neckTiltRight();

delay(500);

}

void mouthOpenCloseFast(){



U1.write(100);

delay(200);

U1.write(150);

delay(200);

}

void mouthOpenCloseSlow(){



U1.write(100);

delay(500);

U1.write(150);

delay(500);

}

void mouthOpen(){



U1.write(100);

delay(200);


}

void mouthClose(){

U1.write(150);

delay(200);

}

void shiftyEyes(){



eyesNeutral();

delay(500);

eyesRight();

delay(500);

neckNeutral();

delay(500);

eyesLeft();

}

void UpDownEyes(){



eyesUp();

delay(500);

eyesDown();

delay(500);

}

void neckNeutral(){



N9.write(90);

delay(500);

N10.write(60);

}

void neckTurnRight(){



N9.write(145);

}

void neckTurnLeft(){



N9.write(25);

}

void neckTiltLeft(){



N10.write(100);

}

void neckTiltRight(){



N10.write(30);

}

void eyesNeutral(){



E2.write(50);

delay(500);

E7.write(165);

}

void eyesLeft(){



E2.write(80);

}

void eyesRight(){



E2.write(10);

}

void eyesUp(){



E7.write(200);

}

void eyesDown(){



E7.write(15);

}

void browRight(){



B4.write(200);

delay(1000);

B4.write(10);

delay(1000);

}

void browLeft(){



B6.write(220);

}

void eyesBlink(){



eyesON();

delay(4000);

eyesOFF();

delay(500);

}

void eyesON(){



digitalWrite(11,HIGH ); // turn left eye LED On

digitalWrite(12,HIGH); // turn right eye LED on

}

void eyesOFF(){



digitalWrite(11, LOW); // turn left eye LED On

digitalWrite(12,LOW); // turn right eye LED on

}

void eyeWink(){



digitalWrite(12,LOW); // turn right eye LED off

delay(1000);

digitalWrite(12,HIGH); // turn right eye LED on

delay(1000);



}
Appendix C – Bill of Materials


Item

Place Purchased

Price

Arduino Uno R3

RadioShack

34.99

Sensor Shield V5.0

ebay

2.30

Arduino Uno Case

ebay

2.00

3W+3W Dual Ch Pwr Digital Amp PAM8403

ebay

0.72

KEDSUM® Arduino Wireless Bluetooth Transceiver Module Slave 4Pin Serial + DuPont Cable

Amazon

9.99

Velcro

HomeDepot

4.00

3.5mm audio Jack

Goodwill

1.00

Double-ended Test Leads Jumper Alligator clips

Ebay

2.00

4xAA Battery Box On/OFF switch

ebay

1.00

9v battery connector+switch+pwr Plug

Found in lab

0.00

Batteries AA and 9v

Target

4.00

Various Screws and tape

Found in lab

0.00

White Dress Shirt + Black Tie

Goodwill

1.50

Total




63.50


Appendix D – Github Code for HW1

https://github.com/wrh2/ECE478/tree/master/Einstein
1   ...   33   34   35   36   37   38   39   40   41


The database is protected by copyright ©dentisty.org 2016
send message

    Main page