Wang Lin.Pdf 791KB Dec 05 2013 05:23:33 PM
Total Page:16
File Type:pdf, Size:1020Kb
University of Florida Department of Electrical and Computer Engineering EEL 4665/5666 Intelligent Machines Design Laboratory Written Report Student Name: Lin Wang Robot Name: Sh ake Shake Shake E-Mail: [email protected] Instructors: Dr. A. Antonio Arroyo Dr. Eric M. Schwartz TAs: Ryan Chilton Josh Weaver Table of Contents Abstract .......................................................................................................................... 4 Executive Summary ....................................................................................................... 4 Introduction .................................................................................................................... 5 Integrated system ........................................................................................................... 6 Mobile platform ............................................................................................................. 8 Actuation ........................................................................................................................ 9 Sensors ........................................................................................................................... 9 Behaviors ..................................................................................................................... 11 Experimental layout and results ................................................................................... 12 Conclusion ................................................................................................................... 13 Documentation ............................................................................................................. 14 Appendices ................................................................................................................... 14 Abstract Shake Shake Shake is a robot aiming at shaking dice. Playing dice with robot can be interesting. Player can interact with the robot to let the robot move around, shake the dice, and tell which color is the result of the shaked dice by turning on corresponding LEDs. Basically, it can move around and do collision avoidance. When the bumper is touched, it will stop and shake the dice, transmit video stream from WebCamera to my laptop, process the video using OpenCV, transmit the color recognition result back the to board by Xbee, and turn on the LED. Executive Summary ShakeShakeShake is a robot shaking dice. It can move around, shake dice, and tell the result color of the dice. The platform of my robot is made of wood. And I use Epiphany DIY board for my robot. First of all, there are two motors with two claps fixed in the front as the drive to make the robot to move. And for stability, there is one caster at back. The robot can move forward, backward, turn right, and turn left. When the robot is turning, there is only one motor works, the other one stop working. Secondly, I implement two sonars on my robot in the front, one to the left, and the other to the right. The aim of this is to detect whether there is something in front of my robot, so that it can avoid collision. When there is obstacle to the right, it will turn left. When there is obstacle to the left, it will turn right. When there is something right in the front, which is to say that both of the sonars detect there are something in the front, then the robot will go backward, and then turn randomly, either right or left. Thirdly, I use one servo to rotate the stick connected with the box for shaking dice. The range of the rotation angle for the servo is about 0 to180 degree. It rotates the entire 180 degree for three times as its name ShakeShakeShake. Then it stops in the position where is under the camera view. Fourthly, there is one bumper in the back to trigger when the robot will stop walking around and start to shake the dice. Once the bumper is touched, it will stop right there, rotate the servo, and all the following things about the dice. I made a dice by myself, instead of the real one. My dice has three colors, red, green, and yellow. There are two faces on the dice of the same color. The box for shaking dice is made of hard paper. And the top cover of the box is plastic and transparent, so that the camera can see the dice in the box without taking it out of the box. There is an iPhone on the top of the box, used to take the live video and transmit back to my computer to do processing. There is one app in iPhone called WebCamera, which can make my iPhone act as a web camera. Next, for the communication between my computer and my robot, I chose Xbee. One Xbee is on the board; the other is connected with my computer using USB port. After OpenCV has recognized the color of the dice, it will transmit a character back to the board to let the LED turn on. There are three LEDs there, red, blue, white, for red, green, and yellow on the dice, respectively. After the robot finishes one circle of all the action of the dice part, it will continue to move around until someone else touch the bumper again. Introduction ‘Shake Shake Shake’ is the name of my robot. The idea comes from one of the traditional game of China, Majiang. At the beginning of the game, there would be one of the four players to shake dices to decide where to start. I wanted my robot to play this role. But with further consideration, I changed my idea for the reason that I did not want my robot just standing on the table to shake the dice, which is kind of boring. Instead, I will let it to find a player to play with him. Therefore, the general idea of my robot is that, first of all, it can move around, and can do the collision avoidance. Then, whenever there is a player who wants to play with him with touching the bumper in the back of the robot, the robot will stop and play dice. And there will be LEDs to tell the result of the dice. This can be more interesting than the original idea. In the integrated part, there is a flow chart to tell how the robot will work. In the mobile platform part, it introduce the structure of my robot. In the actuation part, it talks about motors. In the sensor part, it introduces all the sensors I used. Behavior part talks about all the behaviors my robot can conduct. And then experimental results shows how opencv works to do the color recognition. And finally is the conclusion part, and all the codes are in the appendix. Integrated system Figure 1 Epiphany DIY board Figure 2 Epiphany DIY board The above figure is the Epiphany DIY board view with both sides. There is a port for two motor drivers. There is a servo port with a voltage regulator. The ADC port is for the sonar. And other ports can supply 5V voltage, which can be used by bumpers, LEDs and servo. In the back side, there is a port for XBee. The entire power supply is 12V with 8 AA batteries. Figure 3 Flow Chart of This System The above figure is the flow chart of how my robot will work, as described in the executive summary section. Mobile platform Figure 4 General View of Shake Shake Shake The above picture is the structure of my robot. There are two motors with two small wheels in the front, one caster at the back, two sonars in the front, three LEDs (red, blue, and white), one white box with a dice in it (with red, green, and yellow colors), a servo to rotate the stick connected with the dice box, 8 1.5V batteries under the Epiphany DIY board, bumpers at the back, and one iPhone on the top. Also, there is a switch for the batteries. It is hard to fix the location of iPhone after each time I take it off. There can be something else with the color similar to the color of the dice come into the view of the camera. As a result sometimes the camera cannot tell the right color of the dice because of this kind of noise. So every time I put iPhone on the robot, I have to adjust the position of it so that there is nothing else in the camera view to disturb the color recognition result. The other lesson learnt is that, at the beginning the position of the box and the camera are not good enough, for the reason that when the box is shaking, it can hit the camera. So I make the camera to be a little bit higher. All the wires on the board are kind of mass. I should have had a removable cover to cover it to make my robot looks nicer. Actuation I use two motors as the actuation. The motor I selected is 12V 300rpm 25mm DC Gear Motor Micro DC Gear Box Motor. It need a 12V power supply. The problem is have encountered is that, the diameter of wheel and motor are not that match, so two of them have relative movement, which is not what I wanted. The solution to this is that, I glue the entire hole of the wheel, and drill a hole with the size matched the motor, so that they can be fixed and work in the right way. Now my robot can move forward and backward, and also can turn left and turn right by stop one of the motors. Sensors Basically, I use three kinds of sensors, which are bumper, sonar, and camera. There are two bumpers at the back of the robot, two sonars in the front of the robot, and one IP Cam used to identify the points of the shacked dice. IP Camera I got an iPhone. There is a perfect app called IP webCam to let me be able to transfer video streaming from the phone camera to my laptop through an app called Mobiola WebCamera for iPhone. I can catch the video through program in OpenCV. This camera is used to identify the color on the top face of the shacked dice. Lessons learnt is that the position of the camera can really affect the result of the color recognition, for the reason that if it is not in the right position, the box of the dice can hit it when it is shaking, and also, there can be some other things come into the view to interrupt with the recognition process with the similar color of the dice.