SHORT FUSE

  • 格式:pdf
  • 大小:416.85 KB
  • 文档页数:30

SHORT FUSEFINAL REPORTEEL 5666: Machine Intelligence LaboratoryApril 29, 2000GREG PORTERTABLE OF CONTENTSExecutive Summary (1)Introduction (2)Integrated System (3)Mobile Platform (4)Actuation (7)Sensors (12)Behaviors (15)Experimental Layout and Results (18)Conclusion (20)Bibliography (21)Appendix A (Program Code) (22)Appendix B (Port Expansion) (27)ABSTRACTThe scope of this paper is to discuss the design and construction of the sensors and mechanics of the autonomous mobile robot, Short Fuse. In order for Short Fuse to be autonomous, he must be able to sense his environment so that he can respond somewhat intelligently. Short Fuse also will use animatronics to display his Happy, Stoic and Mad moods. Short Fuse will avoid obstacles while roaming around a room. Short Fuse uses Motorola’s 68HC11 with the TJPro board to interpret his sensors and respond to them accordingly. This exercise demonstrated that an animatronic face could be built that successfully expressed moods.EXECUTIVE SUMMARYThe scope of this robot design project involved building a robot from the ground up; starting with the platform and progressing to actuators, sensors and behaviors. The platform was made with PVC and plastic materials. The actuators developed for the face and laser gun arm allow Short Fuse to express his moods. The mechanics of the face move the eyes, eyebrows and mouth, expressing Short Fuse’s moods, which include Happy, Stoic and Mad. The sensors used in Short Fuse allow him to detect his surrounding environment and respond accordingly. Finally, behaviors were coded in ICC11 to give Short Fuse unique characteristics when responding to the external environment.INTRODUCTIONThis paper discusses the mechanics and sensors used in the autonomous mobile robot, Short Fuse. The major focus of this design has been to create a robot with animatronic facial features able to express mood. Most of the robots created in IMDL have no way of expressing their moods, so I decided to create a robot that could. Having a face that changes expression adds entertainment value to Short Fuse while giving him personality. In order for Short Fuse to be autonomous, he must be able to sense his environment so that he can respond somewhat intelligently.The book “Mobile Robots: Inspiration to Implementation” was a great reference for getting ideas for building a robot. It helped me understand how servos worked with pulse-width modulation. The following chapters will discuss the platform, actuators, sensors, behaviors and experimental layout and results of Short Fuse. For the remainder of the paper, I will refer to Short Fuse as Fuse.INTEGRATED SYSTEMFuse uses Motorola’s 68HC11 micro-controller and Mekatronix’s TJPro board for processing sensory input and controlling actuations of six servos. The body of Fuse is made on a plastic platform that holds the TJPro board, sensors, servos, batteries and laser gun. Sensors interface with the 68HC11 to allow Fuse to detect the external world.Behaviors dictate how Fuse responds to the sensor inputs. The behaviors were programmed using ICC11 and stored in external memory on the TJPro board. The block diagram below shows the main components of Fuse and how they connect together.The servos can change features of Fuse’s face and platform, showing his moodsand giving him a personality, with entertainment value.MOBILE PLATFORMThe platform is the framework that holds the robot together, providing durability and stability. There are many platform designs that have been tried and tested, such as the square, round, or six legged body styles. According to Scott Jantz, the most reliable platform shape for a simple robot is the circular body since it does not have corners that could get stuck on objects easily. Wanting Fuse to move smoothly, I chose to build a round platform. This shape would allow Fuse to avoid obstacles while squeezing through tight spaces. I used plastic to build the platform because it is durable and easy to mold, allowing me to bend pieces into custom shapes. The plastic I used was 1/8th inch PVC used by sign companies for making signs. By heating the PVC with a heat gun, I could form the plastic into any shape. The main platform and face were made from plastic plates and a bowl from Target. The diameter of the plates is 9 in and the bowl is 7 in.The platform has left and right servo wheels and a third castor wheel in front. I molded a cylindrical battery compartment with PVC, illustrated in Figure 1 with dimensions. The left and right wheel servos were mounted to either side of the battery holder. I made a radial hatch door for the battery compartment, illustrated below inFigure 1 Battery compartment and servo mounts.Figure 2. By turning a knob, six pins extend out from the center and enter holes in the battery compartment wall, securing the battery inside. The diameter of the door is 8.3 cm and the pins extend 1/8th in from the edge.Figure 2 Hatch door for battery compartment.I built a support leg for a third swivel wheel to balance the Fuse’s weight illustrated in Figure 3. The support leg and wheel were attached in front of the battery compartment on the platform. The wheel was attached to a small ball bearing to allowfree spinning in any direction. The wheel has a diameter of 3.5 cm and does not extendedbeyond the front of the platform.My platform design provides a stable structure for the head and laser gun arm to be attached. Figure 4 shows a front and side view of the platform with the wheelsattached to the servos. The diameter of the wheels is 2.75 in.Figure 4 Side and front view of platform with wheels attached.Building the platform took longer than I anticipated because I custom built every piece. I wanted to give my platform a unique look using plastic since most of the otherrobots used wood. I am pleased with the finished product.ACTUATIONFuse requires six servos to move various features of the face and body and to rotate wheels for locomotion. The mechanics of the face and body animatronics posed the most complicated design challenge for Fuse. The animatronics include movement of the eyes, eyebrows, mouth and laser gun. By changing features of his face, Fuse can display different moods including Happy, Stoic and Mad. He can also show aggression by whipping out his laser gun. I used hacked servos to actuate the wheels and laser gun. The face animatronics used non-hacked servos. The servos are made by Futaba, model number FP-S148, and have an average torque of about 42oz/in.For the laser gun, I stripped out the circuitry for the servo and replaced it with a simple H-bridge driver circuit shown in Figure 5. I included two switches with diodes in the circuit to control when the laser gun arm would stop moving. I also included a fly-back resistor to eliminate voltage spikes on the power and ground lines. The switches S1 and S2 are normally closed allowing current to flow through the motor. When the arm fully retracts, the S2 switch opens, stopping the motor. The diode allows current to flow in the opposite direction so the arm can still retract.Figure 5 H-Bridge circuit for laser gun hacked servo.Similarly, when the arm is fully extended, the S1 switch opens and stops the motor. Again, the diode allows current to flow in the opposite direction so the arm can still extend. Figure 6 shows the mechanical arm for the laser gun. The arm raises the laser gun 3 cm above Fuse’s head when activated. When the arm is retracted, the laser gun is hidden behind Fuse’s head.Figure 6 Laser gun arm mechanics.The mechanics for the eyes were very complicated to design. It took many hours to figure out a method to move the eyes with two degrees of freedom. The final design is illustrated in Figure 7. The eyes look up and down by moving point A along the Z-axis. The eyes look left and right by moving point B along the X-axis. Points A and B can move simultaneously, allowing multiple eye positions. The range of both eye movements are about 45°. Aluminum was used to make the frame of the eye mechanism strong and durable.Figure 7 Eye mechanism for two degrees of freedom.The mouth mechanics were also a challenge to design since I wanted the mouth to stay at relatively the same position when changing from Happy to Mad. A diagram of the mouth mechanics is shown in Figure 8. A mouthpiece, made of aluminum sheeting and blue hobby foam, attaches to the four pins sticking out of the mouth mechanics. When point C is moved to the +Y position, the mouth looks Mad. When point C is moved to the zero position, the mouth looks Stoic. When point C is moved to the –Y position, the mouth looks Happy. The range of motion is about 60°Figure 8 Mouth mechanics.I thought the eyebrows were going to be relatively simple to build. I soon realized that I had to create an elaborate mechanism to allow the eyes to move with the same servo as the mouth. Figure 9 shows a diagram of the eyebrow mechanics. The eyebrows, made of aluminum sheeting and black hobby foam, were attached to pins 1 and 2 in the diagram. When point D is moved to the +Y position, the eyebrows look Mad. When point D is moved to the zero position, the eyebrows look Stoic. When point D is moved to the –Y position, the eyebrows look Happy. The range of motion is about 60°.Figure 9 Eyebrow mechanics.The eyes, eyebrows and mouth will be shown together in the behavior section of this report. The servos were mounted to allow near linear movement of points A, B, C and D. Placement of the face mechanics within the bowl/head is illustrated in Figure 10.The three servos for the face actuators are connected to the TJPro board in the following way. Servo_0, which controls the Mouth and Eyebrow mechanics, is connected to PA4. Servo_1, which controls the Eye mechanics for left and right eye movement, is connected to PA5. Servo_2, which controls the Eye mechanics for up and down eye movement, is connected to PA6. The left and right wheeled servos are connected to PA7 and PA3, respectively.Figure 10 Face mechanics in bowl.SENSORSThe goal of this project is to build a robot that acts somewhat intelligent. In order to do this, the robot needs to be able to sense its surroundings so it can respond accordingly. The sensors I used include infrared (IR) emitters and detectors for short range (1in to 15in) obstacle avoidance, bump switches for last resort obstacle avoidance and a mercury tilt switch for sensing balance.The IR sensor is made by Sharp and was hacked to generate a variable voltage proportional to the IR light detected. The IR sensor works by emitting IR light and detecting the amount of IR light reflected back from an object. Depending on the signal strength from the detector, the robot can respond slowly or quickly. The IR sensor will connect to an analog input on the 68HC11. The IR sensor circuit is shown in Figure 11.The bump sensor is just a micro-switch that when pressed closes a circuit loop.Since more than one bump sensor is used in the robot, a circuit was made that connects to one analog input. This circuit allows the 68HC11 to determine which bump sensor waspressed in order to respond accordingly. The bump sensor circuit shown in Figure 12 uses Figure 12 Multi-bump sensor circuit.40 kHz R LEDdifferent resistor values to obtain a variable voltage signal at the analog input.The mercury tilt switch circuit, Figure 13, can sense if the platform is tipping over or being picked up off the ground. The circuit has a 1.5 kΩ resistor that pulls the voltage up to 5V when the switch is open. The switch remains open until its angle falls below 5°to the horizontal, then the voltage is pulled to ground.Figure 13 Mercury-tilt switch circuit.I had many problems with the mercury switch because the TJPro board kept resetting when the platform would tilt. I found out later that the tilt switch was shorting across the resistor. I fixed this problem and the tilt switch worked correctly.Figure 14 shows a transparent view of the platform from above including placement of the various sensors and control switches. The aluminum conduit ring used for the bump sensor can also be seen.The sensors are connected to the TJPro board in the following way. The Right IR sensor is connected to PE3. The Left IR sensor is connected to PE2. The tilt sensor is connected to PE4.Figure 14 Transparent view of sensors and control switches.BEHAVIORSThe behaviors I programmed into Fuse are Avoid, Happy, Stoic, Mad and Attack. The program code is in Appendix A. When Fuse is in Avoid mode, he roams around the room avoiding obstacles using his IR and bump sensors to detect objects. His face will look Happy, Figure 15, as long as he does not sense an object in front of him with the IR or bump sensors.If he senses an object with the IR, his face will look Stoic, Figure 16, and he will look toward the object until the turn threshold voltage is reached. Then his eyes will look in the direction of his turn. If his bump sensor is pressed, his face will look Stoic and his eyes will look in the direction of the bump switch. Then he will back up and turn away.When Fuse senses that he has been picked up or tipped over, his face will look Mad, Figure 17. In addition, his eyes will roll, and his laser gun will extend above his head. Another feature to I added to show Fuse’s mood was eye color, with a bi-colorLED. When he is Happy or Stoic, his eyes are green. When he becomes Mad, his eyes turn red.I added a digital output port at address 4000 hex with a 74HC573 latch and a 74LS04 inverter, utilizing the Y0 signal. A schematic of this port expansion is in Appendix B.MadFigure 17 Mad expression.EXPERIMENTAL LAYOUT AND RESULTSThe parameters and specifications of the mobile platform, actuators, sensors and behaviors were tested after completing each project. Testing began with the mobile platform then continued with testing of the sensors and actuators, finishing with the behaviors. The final test involved integrating all of the components into one robot and seeing how well they worked together.The IR sensor characteristics were measured with the following procedure. The IR detector was mounted 3 cm above a table to a plastic box. A centimeter ruler was taped to the table, extending out in front of the IR detector. An IR LED was placed next to the detector, facing out along the ruler. A beige plastic wall was positioned at the zero mark on the ruler and the A/D value was recorded. Next, the wall was moved to the 1 cm mark and the A/D value was recorded. The wall was moved in 1 cm increments until reaching the 40 cm mark, recording the A/D value for each position. The graph, in Figure 18 on the next page, shows the relationship between the IR value and distance.In order to maximize the sensitivity of the IR sensors, a cross-view configuration was implemented for the left and right IR’s. The IR positions and directions are shown in Figure 19 on the next page.Left IRRight IRgure 19 IR directions.CONCLUSIONShort Fuse uses bump switches, IR, and a tilt switch to sense his environment. He uses two hacked servos to maneuver around obstacles. He expresses his Happy, Stoic and Mad moods by moving his eyes, eyebrows and mouth. He also shows aggression by raising his laser gun and turning his eyes from green to red when he gets Mad. Facial expressions give Fuse a personality, increasing his entertainment value.I was not able to implement wall following or mirror acquisition in Fuse in one semester. I will try to implement these behaviors in the future. Upon beginning this project, I only planned on changing Fuse’s eye color to indicate his mood. During the semester, I decided to add movement to his eyes, which really added to Fuse’s facial expression. I am pleased with my results.I am pretty happy with Fuse’s hardware. I did not spend as much time coding his behaviors, as I would have liked. If I were to start this project again, I would spend more time coding unique behaviors.BIBLIOGRAPHYJ. L. Jones, B. A. Seiger, A. M. Flynn (1999). Mobile Robots: Inspiration to Implementation. (2nd ed.). Natick, Massachusetts: A K Peters, Ltd.APPENDIX APROGRAM CODE/*********************************************************************** ** Title eyestjp.c* Programmer Greg Porter* Date April 24, 2000* Version1** Description* A very simple collision avoidance program. Fuse will read* each IR detector, and turn away from any obstacles in its* path. Also, if something hits TJ PRO's bumper, it will back up,* turn, and go on. Three servos, connected to Servo_0 (PA4), Servo_1* (PA5), and Servo_2 (PA6) actuate the face animatronics of Fuse in* response to various sensor values. He can be happy, stoic, and mad.* His eyes also move in response to the IR and bump values.** Parts of this code were taken from avsrvtjp.c by Mekatronics.*************************************************************************/ /*************************** Includes ********************************/#include <tjpbase.h>#include <stdio.h>/************************ End of Includes ****************************//*************************** Constants ********************************/#define AVOID_THRESHOLD 100#define happy2300#define stoic2800#define mad4000#define lookl4000#define looklc3500#define lookc3000#define lookrc2300#define lookr1990#define lookup 4000#define lookupc3500#define lookdc2500#define lookd2000/************************ End of Constants ****************************//*************************** Prototypes *********************************/ void turn(void);/************************ End of Prototypes *****************************/ void main()/****************************** Main ***********************************/ {int bump, irdr, irdl, pw_count, pw_eyevert, pw_mouth, speedr, speedl;init_analog();init_motortjp();init_clocktjp();init_servotjp();IRE_ON; /* turn on IR emitters */*(unsigned char *)(0x4000)= 0x01;/* turn on Green Eyes */START; /*Press the rear bumper to start the program*/while(1){/*********************************************************************** The following block will read the tilt sensor, and if tilt is presentthe eyes will turn red and roll around, and the laser gun arm willextend.***********************************************************************/ if (analog(4)<100){*(unsigned char *)(0x4000)= 0x06;/* turn on Red Eyes, Extend gun */servo(0,mad);/* Mad face *//*********************************************************************** Roll Eyes***********************************************************************/ servo(1,lookc);/* eyes look center */servo(2,lookup); /* eyes look up */wait(300);/* wait 300 msecs */servo(1,lookrc);/* eyes look right of center */servo(2,lookupc); /* eyes look up of center*/wait(300);servo(1,lookr);/* eyes look right */servo(2,lookc); /* eyes look center */wait(300);servo(1,lookrc);/* eyes look right of center */servo(2,lookdc); /* eyes look down of center */wait(300);servo(1,lookc);/* eyes look center */servo(2,lookd); /* eyes look down */wait(300);servo(1,looklc);/* eyes look left of center */servo(2,lookdc); /* eyes look down of center */wait(300);servo(1,lookl);/* eyes look left */servo(2,lookc); /* eyes look center */wait(300);servo(1,looklc);/* eyes look left of center */servo(2,lookupc); /* eyes look up of center */wait(300);servo(1,lookc);/* eyes look center */servo(2,lookup); /* eyes look up */wait(300);}*(unsigned char *)(0x4000)= 0x01;/* turn on Green Eyes, retract gun *//*********************************************************************** The following block will read the IR detectors, anddecide whether Fuse needs to turn to avoid any obstacles.It turns the eyes away from an obstacle when the thresholdis reached. It changes the face from Happy to Stoic whenthe threshold is reached.***********************************************************************/ irdr = RIGHT_IR;irdl = LEFT_IR;if (irdl > AVOID_THRESHOLD){speedr = -MAX_SPEED;servo(1,lookr);/* Eyes look right */servo(0,stoic);/* Stoic face */}else{speedr = MAX_SPEED;servo(1,lookc);/* Eyes look center */servo(0,happy);/* Happy face */}if (irdr > AVOID_THRESHOLD){speedl = -MAX_SPEED;servo(1,lookl);/* Eyes look left */servo(0,stoic);/* Stoic face */}else{speedl = MAX_SPEED;servo(1,lookc);/* Eyes look center */servo(0,happy);/* Happy face */}motorp(RIGHT_MOTOR, speedr);motorp(LEFT_MOTOR, speedl);/***************************************************************** This "if" statement checks the bumper. If the bumper ispressed, the eyes look toward the switch that was bumped.Fuse will then back up and turn away from the object bumped.******************************************************************/ bump = BUMPER;/******************************************************************/ /*Turn eyes toward the bump if bump switch pressed *//******************************************************************/ if(1){pw_count = lookc;/* Eyes look center */pw_eyevert = lookc;/* Eyes look center */}if((bump>19) && (bump<31)){pw_count = lookr;/* Eyes look right */}if((bump>59) && (bump<64)){pw_count = lookrc;/* Eyes look right of center */}if((bump>39) && (bump<51)){pw_count = lookc;/* Eyes look center */pw_eyevert = lookup;/* Eyes look up */}if((bump>89) && (bump<105)){pw_count = looklc;/* Eyes look left of center */}if((bump>75) && (bump<85)){pw_count = lookl;/* Eyes look left */}servo(1,pw_count);/* Move eyes left or right */servo(2,pw_eyevert);/* Move eyes up or down */wait(10);if((bump>10)&&(bump<120)){motorp(LEFT_MOTOR, -MAX_SPEED);motorp(RIGHT_MOTOR, -MAX_SPEED);wait(600);turn();}wait(35);}}/**************************** End of Main ******************************/ void turn()/********************************************************************** * Function: Will turn in a random direction for a "random" amount of* time, dictated by the fast changine lower bits in* mseconds().* Returns: None** Inputs* Parameters: None* Globals: None* Registers: TCNT* Outputs* Parameters: None* Globals: None* Registers: None* Functions called: motorp(), wait()* Notes:***********************************************************************/ {int i;unsigned rand;rand = TCNT;if (rand & 0x0001)/*turn left*/{motorp(RIGHT_MOTOR, MAX_SPEED);motorp(LEFT_MOTOR, -MAX_SPEED);}else/*turn right*/{motorp(RIGHT_MOTOR, -MAX_SPEED);motorp(LEFT_MOTOR, MAX_SPEED);}i=(rand % 1024);if(i>250) wait(i); else wait(250);}/***********************End Function turn ****************************/APPENDIX BPORT EXPANSION CIRCUIT。