The American Ivan Bukreyev December 3, 2012 University of Florida Department of Electrical and Computer Engineering EEL 4665C – IMDL – Final Report Instructors: A. Antonio Arroyo, Eric M. Schwartz TAs: Joshua Weaver, Tim Martin Table of Contents Abstract ......................................................................................................................................................... 3 Executive Summary....................................................................................................................................... 3 Introduction .................................................................................................................................................. 4 Integrated System ......................................................................................................................................... 5 Mobile Platform ............................................................................................................................................ 6 Actuation....................................................................................................................................................... 7 Sensors .......................................................................................................................................................... 8 Behaviors....................................................................................................................................................... 9 Experimental Layout and Results................................................................................................................ 10 Conclusion ................................................................................................................................................... 10 Documentation ........................................................................................................................................... 10 Appendices.................................................................................................................................................. 11 Abstract Many robot enthusiasts in the United States are concerned with making a robot that fulfills a specific purpose. Some create autonomous agents that help dispense medication to the ill; others make robots to alert police if intrusions have occurred; yet others call for help if the owner has fallen and cannot get up. In this report, I will describe a radically different outlook on robotics – making robots for the sake of robots themselves. In particular, I decided to use the average American citizen as a model for my robot – I wanted my robot to live the American dream. A question naturally comes to mind, “What is the American dream?”, to which I have a statistically justified answer. With television screen quality reaching the limits of the capabilities of a human eye, the media industry is at its peak. In fact, according to the A.C. Nielsen Co., the average American watches more than 4 hours of TV each day. To do the math, this equates to 28+ hours a week, or two straight months in a year, or approximately 12 years in a lifetime. With that in mind, I think that there is little doubt that watching television is the favorite activity of most Americans. My robot was designed to do just that – watch TV. Executive Summary The American, a six-legged hexapod was created with a particular purpose in mind – to locate a television and then watch it indefinitely. I originally intended for my robot to search for a TV, and upon successfully finding one, disable movement and stare at the screen, changing channels periodically. However, within the timeframe of the course, I was not able to fulfill all of my original design goals. In particular, I was not able to implement a TV detection algorithm. A simplified version of my original objective is color tracking. Essentially, instead of looking for a TV, my robot will look for a certain color and follow it around. There are two main algorithms responsible for the behavior of the robot. The body of the American has a microcontroller board that handles all low level interactions and movement, while the high level image processing is done remotely on a laptop. The American has a bidirectional communication interface with the laptop via Bluetooth radio. Both the robot and the computer pass data back and forth with handshaking, so that in case of a communication breach, both systems will shut down. When first turned on, the American waits indefinitely for a computer program to start, after which point the robot starts randomly patrolling the room. After a certain amount of time has passed, the American enters color tracking mode. During this mode, the robot will stop and look from left to right in search of a target color. If the target color is not found, then the robot returns to patrol mode. However, if during the color tracking mode the target color was detected, the American transitions to ‘color follow’ mode. The robot will try to get closer to the color while avoiding obstacles along the way. If the color disappears from view, the patrol mode will be re-entered. While the robot is active, obstacle avoidance is the highest priority. However, depending on the previous state, avoidance is executed differently. Introduction The objective of my project is to create an autonomous robot that will search the surrounding area for a TV to watch. This ambitious objective was later simplified to color detection and tracking. For a while now I wanted to build a hexapod, however, the inspiration for the American came from a simple observation – almost one-third of the population in the United States is obese, making us the world’s fattest nation. I intended my robot to be a sarcastic message to my fellow students. On a side note, my robot turned out to be heavy and chubby looking – only augmenting to my initial purpose. The rest of this report describes in detail the function of each individual sensor and the overall system. In the end, my robot turned out to be fairly expensive, mostly due to high quality components. The American was built for an Intelligent Machine Design Laboratory course with the intent of teaching me the basics of mechanical platforms. Having little background in mechanical engineering, I purposefully chose a challenging platform to build. However, during the course of the semester I have learned a great deal about software and electrical engineering aspects of robot design. Integrated System The architecture of my robot is shown in Figure 1. The heart of the American is an ATxmega64A1U microcontroller. Tim Martin, a TA for IMDL, provided me with a development board (EpiphanyDIY) that has many built in features that I used in my project. The ATxmega maintains continuous serial communication with the Atiny microcontroller, which in turn is responsible for servo movement. ATxmega is also responsible for sensor data acquisition, status update via LCD and RGB LEDs, and bidirectional communication with the laptop. The high level behavior of my robot (color tracking) is done outside the main platform. In front of the American is an Android camera that sends continuous Wi-Fi image data to the laptop computer. On the laptop, OpenCV algorithms transform incoming image into a color mask, with center of mass coordinates. These coordinates are then transmitted to ATxmega and are transformed into movement commands to the servos. Figure 1. Integrated system. Mobile Platform The model of the mechanical platform is shown in Figure 2. The entire robot was designed and simulated in Solidworks prior to cutting any parts. The platform consists of two main parts: body and legs. The main body consists of two wood pieces sandwiched together by standoffs. Both pieces are identical with the exception that the top piece has additional holes for wire routing. Body servos provide additional support to the platform. The legs are modeled after real insect anatomy and contain thee major joints: coxa, femur, and tibia. The servo on the body of the hexapod serves as the coxa. The femur is made up of two identical pieces of wood, connected together by a stand-off. The tibia is made of a single piece of wood and has rubber padding on the bottom for damped movement. The three leg parts are connected together by servos and servo mounting brackets. By controlling the position of each individual servo, complex movement algorithms can be accomplished. The American has six degrees of freedom per leg, allowing for ultimate movement control. Figure 2. Mobile Platform - Solidworks drawing. Actuation The American uses 12 Hitec HS-485HB and 6 Hitec HS-645MG servos for movement control. Each of the six legs uses three servos for complete XYZ motion control. The servo on the body controls the in plane movement (XY), the servo on the femur/coxa junction controls parallel movement (XY), and the servo on the tibia controls vertical movement (Z, ZX, ZY). Each servo is sent a 50 Hz pulse between 600 and 2400 us that directly controls the position angle. Atiny microcontroller is the dedicated servo driver for my robot. Due to the board limitations, the servos are powered by 5V supply line, which limits maximum output torque. HS-645MG servo turned out to be powerful enough to support the full weight of the hexapod (5 pounds) in tripod configuration. When body of the American was put together, extensive amount of time was dedicated to writing servo control software. The major bottleneck I encountered was (ironically) the size and weight of the robot. While the servos I used were strong enough to hold the body, the balancing proved to be tricky. In the end, I experimentally determined the set of stable leg positions and used it to generate motion waveforms for the American. I was able to implement ripple and tripod gaits, each being a big state machine. To reduce the jerkiness, I created many states that allowed pseudo smooth transitions. Sensors Two special sensors used on the American were Android camera and BlueSMiRF radio. The android camera was mounted toward the front of the robot, via the cut in the top frame. The camera was held in place by special stand at the bottom frame. Continuous data feed was sent from the camera to the laptop via Wi-Fi communication. On the laptop, I used OpenCV library to process the raw video data and used it to implement color detection. Once color’s center position is identified, it is then relayed to the American via Bluetooth radio. I implemented bi-directional data streaming with string parsing for code readability. For obstacle avoidance, the American uses two infrared rangefinders and one sonar rangefinder. The sonar rangefinder is XL_EZ1 model by MaxBotix, that is capable of obstacle detecting between 20cm and 7 m. EZ1 sonar has a wide sound cone that is effective at picking up obstacles in the front view of the robot. If such obstacle is detected, the values of infrared sensors are considered. The two IR sensors (GP2Y0A21YK0F) have 10cm – 80 cm effective range and are used to make decision on which way to turn. For example, if obstacle is picked up by the sonar and left IR has higher reading, the object is most likely on the left and hexapod should swerve right. On the other hand, if right IR has higher reading, the hexapod will turn left. If the sonar reading was below 30 cm threshold, the hexapod will immediately backup, completely ignoring IR readings. This behavior simulates sudden object appearance in front of the American (human foot for example). Lastly, all obstacle avoidance behaviors are interrupt based and have the highest priority. This implementation allows for speedy transition into obstacle avoidance mode regardless of the current state. Sensor Function Sonar Primary obstacle avoidance sensor IR rangefinder Secondary obstacle avoidance sensor Android camera Image detection, color tracking BlueSMiRF Bidirectional communication with laptop Behaviors The American has three core behaviors that are describe below. First is the patrol behavior. When first turned on, the American will walk straight until either an obstacle is encountered or timer condition has occurred. To prevent the American from walking indefinitely in a straight line, interrupt is fired if the hexapod has not turned in a specified amount of time. At certain points in the patrol behavior, the American will scan the surroundings for target color. Second is the obstacle avoidance behavior. If sonar detects an object 30-40 cm away, the robot will turn left or right, depending on which IR sensor has higher reading. Once the turn direction is established, a 1-6 die is rolled to determine the amount of rotation. This inherently random behavior allows for slight course corrections or complete turnarounds without deterministic logic. Third is the color tracking behavior. If during the scan phase the target color is detected, the American will try to move such that the color is directly in front. Then the American will slowly move towards the color, making sure that it has not moved away. If the color spontaneously disappears, the American resumes patrol routine. Experimental Layout and Results The American went through a series of revisions during the course of the semester. At the time of this writing, the American is capable of successfully performing all above describe behaviors. The only problem remains is the accuracy of color tracking phase. The color detection behavior is still sluggish and needs improvement. Conclusion IMDL could be hard. IMDL could be expensive. But IMDL is also rewarding. Prior to this class I had practically zero robotics experience, and now I feel empowered with new knowledge, ready to begin new projects. I learned a lot of mechanical aspects that go into robot design (especially challenging platforms like hexapod) as well as computer software. I feel that IMDL really does cover a great variety of topics and disciplines. This class has inspired my senior design project. I would like to improve my hexapod over the next semester. I plan on designing brand new platform with a lot of features I was not able to implement in the limited time I had to work on IMDL. Documentation Epiphany DIY board http://ootbrobotics.pixelgeko.com/ BlueSMirF https://www.sparkfun.com/products/158 Maxbotix XL_EZ1 sonar http://www.pololu.com/catalog/product/1651 IR GP2Y0A21YK sensor https://www.sparkfun.com/products/242 LCD http://www.crystalfontz.com/product/CFAH1602ZYYHET Appendices Please refer to the robot website, https://sites.google.com/site/theamericanatuf2012/, for all supplementary materials.
© Copyright 2025 Paperzz