Home
GPS Robot Navigation Final Report - CS Course Webpages
Contents
1. LCD Input start from left Tea 4 1234 1234 1234567 sji2345678 J o oa IC oo ao Jogoo ee TIN 2272777 AA TT Frdnt Sdnar L Folpaks input elek Seals R pot 3 3 20 n oi 1 ver 2 2 Ground EJ i Battery Input 4 25232 to ttl Serial port conndetbr c vu 16 Te vec Volt Reg Vr u Hce cH ic x 1 JE Sa ml JE VOUT LT323 VIN 3 GND AW 2372 01 tren H 2 13 232 11 TTL 01H2 232 02 TTL 12H8 H bridge 4 gnd 2382 12 TTL 02R i 2 1 Jl 6 We 8 20 GND 15 F 40 S input 3 Fo 1 Daka shom GPS e a Daka tp GPS T 3 3 Grpuna od EG Ribbon cable to PIC NN 2 Ground 3 Rear Sonar Poner gt Pid 2 4 6 g 18 12 14 16 18 20 22 24 26 28 30 32 34 36 38 48 1 Poe ed ag AAR amp RAAR TERE k ee 1252 1 3 5 2 9 11 13 ts 17 19 e1 23 es 27 29 31 33 35 37 as 3 Basis s 4 8 86 819 91 9 7171714 AE AE AE SE HI AH H HIT HASIE 4 4 ver Schematic Schematic layout of the components on the RC car RC Car The Final Product Without the Cover 34 7 2 Volt BatteryMount Right Sonar Front of Car printed Circuit board OOPIC board Left Sonar GPS and remote control
2. 04 12 to 04 19 04 19 to 04 26 04 26 to 05 03 05 03 to 05 10 04 12 to 04 19 04 19 to 04 26 04 26 to 05 03 05 03 to 05 10 Current Week Weeks 02 02 02 09 02 16 02 23 03 01 03 08 03 15 03 22 03 29 04 05 to to to to to to to to to to Tasks 02 09 02 16 02 23 03 01 03 08 03 15 03 22 03 29 04 05 04 12 Components Arrive ml Throttle Control Algorithm Navigation Algorithm Coding the OOPic Testing Calibrating Debugging Fabrication Analysis Tasks 02 02 02 09 02 16 02 23 03 01 03 08 03 15 03 22 03 29 04 05 to to to to to to to to to to Weeks 02 09 02 16 02 23 03 01 03 08 03 15 03 22 03 29 04 05 04 12 Current Week 58 Appendix C Code LCD Variables oLCD LCD new oLCD If GPS Variables oSerial gps new oSerial uses VO Line 23 pin 39 Byte counter Byte string 1 1 Word Lat Word Lng Word prevLat Word prevLng Byte cycle Motor Variables oPWM motor new oPWM Compass Variables ol2C Compass new ol2C Steering Variables oServoSP1 StrServo new oServoSP 1 Sonar Variables oSonarDV rsonar New oSonarDV oSonarDV Isonar New oSonarDV Byte frtRS Byte frtLS Byte obsLR 1 left 2 center 3 right
3. generate x coordinate x 2 cos theta start_pos 1 1 generate x coordinate y 2 sin theta start_pos 1 2 generate y coordinate plot x y g plot red circle at stopping point Sx 1 2 cos theta gps_pos 1 1 generate x coordinate x 2 cos theta gps_pos 1 1 generate x coordinate y 2 sin theta gps_pos 1 2 generate y coordinate plot x y r Saxis equal hold off getNavinfo m function nav info getNavinfo gps_pos dest heading num dests sum cur_dest_num dest 1 1 dest_pts dest 1 2 dest 1 3 get path control information path nav info getPathNavlInfo gps pos dest_pts heading sum turn dir path nav info l 1 speed path nav info 1 2 new sum path nav info 1 3 71 ole get the distance away from the destination distance getDistInfo gps_pos dest_pts determine if the robot has reached its destination if it has set the current destination to the next destination or else finish oP ole next_dest cur_dest_num tolerance getTolerance 1 if distance lt tolerance speed 0 if cur_dest_num lt num_dests next dest cur_dest_num 1 else next_dest 0 finished course end end nav_info turn_dir speed next_dest new_sum getPathNavinfo m function path nav info getPathNaviInfo gps_pos dest heading sum 2 get information about obstacles from the sonar sensors obst info getObstInfo gps_pos hea
4. Below is a rough estimate of our budget to complete the project As with all projects problems can and will arise causing the need for additional funding However here is a list of the major parts that will be needed The other parts like resistors capacitors and amps should not drastically raise our budget 14 Stampede Monster Truck 154 99 TS 025 Electronic Compass 45 00 Mark III Electronic Board Kit 49 00 GPS Module Antenna 99 95 69 95 Subtotal 420 00 Schedule of Tasks Pert and Gantt Charts Monday 4 40 pm 15 minute meeting with faculty Monday 6 00 pm meeting with TA Wednesday 4 10 engineering group meeting Schedule of Tasks February March April Gather Select Order Parts Breadboard Fabrication Testing Calibrate Final Project Fabrication l Test 16 Gather information 1 d 26 Jan 04 __D9 Feb 04 Write Proposal 2 Md 10 Feb 04 _ P4 Feb 04 Select Parts 3 fd 10 Feb 04_ 17 Feb 04 5 iid TeFebO4 D3MarOd Begin _ Contruction 12 id 04 Mar 04__04 Mar 04 Breadboard Contruction 6 14 05 Mar 04 _ P5 Mar 04 Develop Navigation Alg H13 id 05 Mar 04 PSMar 04 RC hack as pm 05 Mar 04 P5Mar 04 17 Interface with compass 4 d 08 Mar 04 08 Mar 04 Interface with GPS 08 Mar 04 08 Mar 04 Write Navigation Code H14 id 08 Mar 04
5. CPSC 310 Databases current semester SPAN 101 102 201 202 Spanish PSYC 315 Social Psychology SCOM 203 Public Speaking 1 Sonar Fusion on PDA 2 Hack Furby 3 Wearable Sensors 4 Integrating GPS and Robots PROJECT CHOICES 23 INTERESTS My interests lie more in hardware than programming Other than that I don t really know yet what I am interested in I can only attend the section 502 lab time Richard Neil Pittman P O Box 14416 College Station TX 77841 979 847 6098 RNPittman tamu edu Academics Senior Computer Engineering Major Computer Science Track Minor in Mathematics Texas A amp M University College Station Texas Current Cumulative GPR 3 57 Elective Classes CPSC 625 Artificial Intelligence MATH 470 Cryptography amp Communications CPSC 310 Databases Interest Artificial Intelligence amp Robotics In the past year have discovered a great interest in robotics and Al This has lead me to seek information about the subject and would like an oppurtunity to apply what have learned and to learn more Networks amp Distributed Systems My interest in networks involves it use as a method of gathering and distributing data in an intelligent manner in order to provide services Web applications could also be added to some projects to expand their utility Cryptography While this may not be used directly for any project this background gives me unique perspective which may be useful for
6. get inputs from Navigator 51 4 20241 37076 nav info getNavInfo gps pos cur dest heading num dests integrator sum turn dir nav info 1 1 speed nav info 1 2 cur dest num nav info 1 3 integrator sum nav info 1 4 70 get the angular velocity based on the turn direction MAXTURN getMaxTurn 1 ang vel turn_dir 3 MAXTURN calculate new position and heading and add to path history ds ks gps pos 1 1 gps pos l 1 speed dT cos heading gps pos 1 2 gps_pos 1 2 speed dT sin heading heading heading ang vel dT path history i gps pos 1 1 gps_pos 1 2 aoo00000g0 00 L COCOCO0O0000000000000000000000000000000 4 plotting code TSSTSTSSSSTSSCSSTSSC SCS 6 6666666666666666 get the distance that is considered close enough to target tolerance getTolerance 1 theta variable for plotting circles theta linspace 0 2 pi 100 hold on plot destination circles j 1 while j lt num_dests Bx 1 tolerance cos theta dest_list j 2 generate x coordinate x tolerance cos theta dest_list j 2 generate x coordinate y tolerance sin theta dest_list j 3 generate y coordinate plot x y c JF gtk Ly end plot path splot 1 path_history 1 path_history 2 k plot path_history 1 path_history 2 k olo plot green circle at starting point Sx 1 2 cos theta start pos 1 1
7. xxxSpeed State Objects WES 00Pic 00Pic oWord ShaftPos New oWord oR oDemotor Motor loWord MotorSet New oWord oByte Thrstart New oByte GAS encode Shaftenc oBit Ramp New oBit ol2c Compass Speed Control Objectsxx E olod LCD oWord SpdError New oWord oWord SpdCorrection New oWord Re aClock Timerint oByte SpdKP New oByte gay Event Speedchk oByte TargetSpd New oByte xTarget Speed 127 to 127 xxx TargetSpd Signed 1 TargetSpd Value 325 Reference Speed 127 to 127 ReferenceSpd Signed 1 ReferenceSpd Value 325 xO0scilating function to slow Ramp Functions RampCount Value 6 Proportional Constant 127 to 127 SpdKP Signed 1 SpdKP Value 166 Speed Error 82767 to 32767 xxx SpdError Signed 1 SpdError Value 6 Speed Correction 32767 to 32767 SpdCorrection Signed 1 SpdCorrection Value 6 xCurrent Bearing 8 to 65535 er Bearing Signed 6 LCD set upxxx LCD IOLineRS 27 pin 34 RS line to the LCD module LCD IOLineE 26 pin 36 E line to the LCD module LCD 10Group 3 1 0 lines 28 31 pins 32 26 LCD Nibble 1 Upper half of data d4 d7 LCD Operate cuTrue Steering Servo set upxx x Steering IOLine 9 Steering Operate cutrue Steering Value 15 Compass set up Compass Node 96 Compass Mode cu16bit Compass NoInc 1 Compass Location 2 Compass Wi
8. LCD String str Lng LCD Locate 0 25 LCD String str heading LCD Locate 1 22 LCD String str dxa LCD Locate 1 30 LCD String str dya Sub void Steer void if turndir gt 10 amp turndir lt 32768 turndir gt 10 and positive turndir 10 else if turndir lt 65526 amp turndir gt 32767 turndir lt 10 and negative turndir 65526 10 if turndir lt 32768 turndir is positive StrServo Value 5 turndir 30 2 else StrServo Value 5 getAbs turndir 30 2 Function Word add Word xa Word ya if xa lt 32768 amp ya lt 32768 add xa ya else if xa gt 32767 amp ya lt 32768 xa getAbs xa if ya gt xa add ya xa else add absToNeg xa ya else if xa lt 32768 amp ya gt 32767 66 ya getAbs ya if xa gt ya add xa ya else add absToNeg ya xa else add absToNeg getAbs xa getAbs ya Function Word sbt Word xs Word ys if xs lt 32768 amp ys lt 32768 if xs gt ys sbt xs ys else sbt absToNeg ys xs else if xs gt 32767 amp ys lt 32768 sbt abSToNeg getAbs xs ys else if xs lt 32768 amp ys gt 32767 sbt xs getAbs ys else if getAbs xs gt getAbs ys sbt absToNeg getAbs xs getAbs ys else sbt getAbs ys getAbs xs Function Word mul Word xm Word ym if
9. Line 31 IO Line 19 is an additional I2C data line and Line 33 IO Line 20 is an additional I2C clock line Line 37 IO Line 22 is the serial transmit line for TTL level communications and Line 39 IO Line 23 is the serial receive For additional documentation on the mechanical specifications of the OOPic with the S control board go to www oopic com gt Manual gt OOPic connectors and mechanical gt S style board The OOPic Multi Language Compiler provided and large number of objects available to make the process of writing code easier For our project we used a large number of these objects including the oDCMotor ol2C oServoSP1 oLCD oClock oEvent and oSerial All these behavior like you would expect objects to behave in other programming environments Declarations Object Type Name New Object Type Attributes Name Attribute value Othervar Name Attribute Additional documentation on the objects and coding conventions of the OOPic go to www oopic com gt Manual Printed Circuit Board Design and Component Layout The hardware on the RC car is centered on the printed circuit board in the middle of the car Each component on the car plugs into the two layer printed circuit board The board was designed using the software from www expresspcb com the board was purchased from ExpressPCB com as well There is a 40 pin ribbon cable connector on the PCB that allows a ribbon cable to be connected to the OOPIC Microprocessor See figu
10. User Manual Operating the Robot Car Operation of the GPS guided robot car can be broken up into the following steps Preparing the course Modifying source code for desired coordinates Programming the robot car control board Remove Cover Connecting Batteries Replace Cover and Activating robot car systems Preparing the Course Before any modifications can be made to the robot car the course that it will run must be investigated and prepared First go out to the site where the course will be and investigate the site for suitability Take special care with regard to wet ground due prevent damage to electronics and tall grass that could interfere with sonar or impede the drive of the car Next select points on the site to create a course or path and walk the course taking careful note of any terrain features such as ledges or natural obstacles the robot cars systems will not be able to traverse These include but are not limited to large bodies of water and sudden drops in elevation Finally record your path coordinates for programming the robot car Modifying Source Code To modify the source code of the robot car to navigate to desired coordinates look in the GetDest subroutine and simply add the coordinates of the destinations into the list Programming the Robot Control Board To program the robot control board after modifying and saving the source code file nav osc follow the instructions at www oopic com or our user manual fo
11. e Interface micro controller with remote control vehicle e Use micro controller to interconnect global positioning system and remote control vehicle e Vehicle will be sturdy enough to cover mostly flat terrain while carrying a payload of electronic equipment including the global positioning system e Vehicle will be able to establish its own location on earth and use information from the global positioning system to navigate to a user defined point e Vehicle will be able to follow a path of points provided by a user Literature and Technical Survey Our team has utilized several resources to familiarize ourselves with the components that will make up our final project We researched general GPS related articles as well as specific data sheets of GPS units In addition we have learned about radio controlled cars and how to modify them The proposed design for the GPS unit will incorporate a compass system that has already been used by a CPSC 483 group from last semester Our group will need to be familiar with the literature provided by the compass group from last semester Below is the list of resources that we have used so far in researching our project www navtechgps com e This site allowed us to learn about several GPS units and compare prices www howstuffworks com e Contains general information about how GPS units work www junun org Marklll e Contains documentation of the Mark III board that we are using www dkits com e Ano
12. mine This robot could use GPS coordinates to navigate to a specific location to perform the necessary tasks In addition there must be some form of obstacle avoidance One example would be the use of sonar devices to avoid obstacles Needs Statement With so many dangers arising today and because of the advancement of technology there is a need for automated and unmanned devices The military has a need for GPS guided systems to protect the lives of soldiers Civilians also could benefit from GPS guided systems by making everyday navigation easier and safer Goals and Objectives Our goal is to develop a GPS guided system that will successfully navigate to a series of pre defined coordinates Our objectives consist of the following e Develop a system that will be sturdy enough to cover mostly flat terrain while carrying a payload of electronic equipment including the global positioning system e Develop a system that will be able to establish its own location on earth and use information from the global positioning system to navigate to a user defined GPS coordinate e Vehicle will be able to follow a path of points provided by a user e Vehicle will be able to avoid obstacles along the way and still navigate to the user defined coordinates Literature and Technical Survey Our team has utilized several resources to familiarize ourselves with the components that will make up our final project We researched general GPS related articles
13. Destination Variables Byte numDests Byte curDest Word destLat Word destLng State Variables Word heading Word turndir Word afn Word dx Word dy Word dxa Word dya Word it Byte index Integrator Variables INVord intBearingSum A A PERE EE AE AG NMAN AIR ae SORE Ce te ANE RE ee Renee te eae Sub void main void Setup 59 while curDest lt numDests cycle cycle 1 cycle cycle 4 if cycle 1 GetGPSReading GetDxDy GetAfn heading Compass Value 10 UpdateLCD if dxa gt 1 dya gt 1 GetPathNavinfo Steer else curDest curDest 1 GetDest GetGPSReading GetDxDy GetAfn motor value 135 LCD Locate 0 31 LCD String done Sub void GetDest void if curDest lt numDests switch curDest Case 0 destLat 37097 latitude destLng 20234 longitude break Case 1 destLat 37093 latitude destLng 20218 longitude break Sub void Setup void OOPic Node 3 destination setup curDest 0 numDests 2 GetDest kk k k k navigation setup 60 intBearingSum 0 turndir 0 sonar setup rsonar lOLineP 3 rsonar lOLineE 4 rsonar Operate 1 Isonar lOLineP 18 Isonar lOLineE 19 Isonar Operate 1 frtRS 255 frtLS 255 obsLR 0 Pore gps setup kk k k k gps Baud cv1200 Baud r
14. Objectsx Event Spaedchk oWord ShaftPos New oWord sie NEE spe oWord MotorSet New oWord oWord ShaftPos oByte Thrstart New oByte 1 oBit Ramp New oBit word MotorSet oByte Thrstart oBit Ramp oWord SpdE mor oWord SpdCorrection oByte SpdKP oByte TargetSpd oByte ReferenceSpd oBit RampCount Word Bearing Speed Control Objects oByte TargetSpd New oByte oByte ReferenceSpd New oote oBit RampCount New oBit xxNavigation State Objectsx oWord Bearing New oWord Sub void main void OOPic Node 3 Target Speed 127 to 127 TargetSpd Signed 1 TargetSpd Value 325 Reference Speed A 127 to 127 ReferenceSpd Sianed Ba BAO gt Dem Eloise estama 00P Home Page mer Busia he coPicandSc foo EET To program the OOP ic you may either the button with triangle pointing to the Right or press F5 The code will compile and download to the EEPROM on the control board Using the Network Connectors to Debug Code To use this function before programming the OOP ic in the main body of the program insert the line OOPic Node where is a number between 1 and 127 Next program the OOPic as it is described at www oopic com or in our user manual 52 Documents and Settings rnp9022 Desktop CPSC 483 compass_throttle2 osc rm File Edit Tools View Window Help le x olele S volslae gt Blafc joEvent Speedchk New oEvent NETWORK NODE
15. Ramp oWord SpdE ror oWord SpdCorrection oByte SpdKP oByte TargetSpd oByte ReferenceSpd oBit RampCount eee e s E El e s E 8 E s Sub void main void oWord Bearing OOPic Node 3 Target speed a 127 to 127 xxx TargetSpd Signe TargetSpd Deine gis Reference Speed 127 to 127 Referencespd Signed 1 These dialog windows will vary with the objects they are associated with them In these dialog windows you can view the current values of the attributes associated with that object However they do not update automatically In order to view the value of an attribute at any given time the user must press Refresh button to update the values When you are finished you press the x button in the upper right corner of the dialog window and it will close 55 Course Debriefing Group Management The management style of our group turned out to work successfully We all were responsible for our own portions of work but we helped each other out and kept each other on track as well For the most part we each had a specialty area in our project Neil and Kris both focused on the hardware and worked together well to figure out how to interface with the motor compass steering servo and sonar On the other hand Chris and Mike focused on the software integrating the GPS with the system and many of the problems that arose After we finished the individual components we worked togeth
16. antennas Schematic Schematic of the Final RC Car Velocity Control The velocity control for the GPS navigated robot was more difficult to configure than first expected We used a circuit called an H Bridge to interface the motor to the OOPic This allowed the OOPic to control the power or velocity of the robot The H Bridges we used burned out because the DC motor drew to much current for the H Bridges to handle After our second H Bridge burning out we decided to just reengineer the controller from the truck This would allow us to use an electronic speed controller a powerful MOSFET circuit that RC cars use to power the robot 35 Hacking the Controller We used the controller that came with the Traxxis Rampage truck above picture to control the speed of the robot The controller had to be torn apart to study how the electronics worked Since we only needed to manipulate the throttle we ignored any of the steering circuits as best we could The throttle was just a fancy potentiometer The potentiometer was fed 4 volts with the output voltage dictating how much power was fed to the motor Actually the output voltage was fed to an integrated circuit that sent signals to the antenna to be received by the receiver on the car Since we only needed to mimic the output voltage there was no reason on studying how the circuitry worked any further The output voltage ranged from 1 5 to 2 4 volts 1 5 being standstill and 2 4 b
17. dxa if DestLat gt Lat dya DestLat Lat dy dya else dya Lat DestLat dy mul 65535 dya 1 dya Sub void GetAfn void if dxa 0 afn 0 else if dya 0 afn 90 else if dya lt dxa index dya 16 index index dxa GetArctan afn 90 afn else index dxa 16 index index dya GetArctan if dx gt 32767 amp dy lt 32768 quadrant 2 afn 360 afn else if dx gt 32767 amp dy gt 32767 quadrant 3 afn 180 afn else if dx lt 32768 amp dy gt 32767 quadrant 4 afn 180 afn Sub void GetTurnDir void turndir sbt heading afn while turndir gt 32767 turndir add turndir 360 if turndir gt 180 turndir sbt 360 turndir turndir mul 65535 turndir LCD Locate 0 14 printNum turndir 41 turndir div turndir 3 turndir add turndir div intBearingSum 100 intBearingSum add intBearingSum turndir The GetDxDy subroutine simply determines the distance between the current latitude and longitude and the destination latitude and longitude The GetAfn subroutine then uses this information to determine the angle of the destination from the current position relative to north This calculation uses an approximation to arc tan since the OOPic does not support inverse trig functions This approximation is located in the GetArcTan subroutine and is a
18. finding patterns in data Class Schedule CPSC 463 500 Networks TR 3 55 5 10 CPSC 483 502 Computer Sys Design MW 4 10 7 00 KINE 199 287 Strength Train Beginning TR 8 00 10 50 KINE 199 039 Archery Beginning TR 9 35 10 50 Project Preference 1 Integrating GPS amp Robot 2 Robot Learning amp Whiskers 3 Facial Tracking 4 Navigate Maze 5 Hack Furby 6 Wearable Sensors 24 7 Sonar Fusion of PDA 8 Coff e mail 9 Circadian Circuits 25 KRISTOPHER J HORN Permanent Address Campus Address 2910 Rolling Hills Dr 117 Holleman Dr W 3308 Carrollton TX 75007 College Station TX 77840 214 906 0844 kjhorn tamu edu OBJECTIVE To obtain a summer and fall 2005 coop EDUCATION Texas A amp M University College Station Texas Dwight Look College of Engineering Bachelor of Science in Computer Engineering Minor in Mathematics Overall GPA 3 36 September 2000 May 2004 SKILLS Languages Java some C MIPS Verilog Ada and HTML Platforms Windows and some UNIX EMPLOYMENT Winter 2002 Netco Title Solutions Filer Arlington Texas e Organized policy files Summer 2002 Papa Johns Delivery Driver Dallas Texas o Delivered food orders to customers AFFILIATIONS Summer 2003 Undergraduate Math Research Research Program in Combinatorial Theory 2002 Present Institute of Electrical and Electronics Engineers IEEE 2002 2003 Recreational Sports Intramural Competed in soccer El Guapo Forward QUALLIFICA
19. the program to be run and the other may be used for storing data The power connector connects a 9 volt battery connector to provide power to the OOPic and board components We not would recommend using the connector that comes with the board because the connection over time with constant use was not very good Beside the power connector is the reset button which can be used to reinitialize the OOPic and restart the stored program Finally there are the programming and network connectors that can all connect to the 4 pin interface side of the programming cable To program the OOPic you plug the programming into the parallel port of a computer and the other into the programming connecter and follow the instructions in the documentation at 31 Wwww oopic com or our user manual The network connectors are connected to the 12C serial communications bus and can be used for debugging For instructions on using this function look at the www oopic com or our user manual The OOPic is a 40 pin chip including VCC line 4 GND line 2 two 5 volt power supplies lines 21 amp 22 two ground lines 23 amp 24 Reset line 5 and an I2C serial bus data line on line 1 and clock line on line 3 The OOPic has 31 input output lines lines 6 through 19 and 25 through 40 some of them with special functions Line 25 IO Line 16 and Line 27 IO Line 17 are Timer interrupt lines Line 27 IO Line 17 and Line 29 IO Line 18 are Pulse Width Modulation lines
20. 08 Mar 04 Combine GPS and compass 8 id 09 Mar 04 09 Mar 04 10 Mar 04 O Mar 04 11 Mar 04 1 Mar 04 Final Demo Report 11 id 12 Mar 04 2 Mar 04 18 Project Management and Team Work We have decided to generally divide the work as follows Kris Horn GPS hardware integration Chris Foley Software design budget procurement of parts Neil Pittman PIC Microcontroller specialist and hardware design Mike Willis Software and board design Societal Safety and Environmental Analysis A GPS guided mobile robot presents many benefits and changes to society One of the largest impacts may be in warfare A GPS guided robot will have the ability to travel to places where it may be dangerous for humans to travel While traveling features and sensors could be added to the robot to detect various things For example a GPS guided robot could be sent into a mine field to try and find the locations of mines If a mine triggers during the process it is far better to loose the robot than a human life This robot s application could be extended to various other situations in warfare and in everyday life The main idea behind it is that we can send a robot to places that are unsafe for humans or that humans would have difficulty getting to This could definitely change warfare and scientific research at the least The safety concerns associated with this robot are minimal Normal care should be taken when operating elec
21. 99999999999999999999999909 4 4 initialization code SSSSSSSSSSSSSESSSEEESEESEESEESSS programmed destination coordinates destination number longitude latitude est list 1 50 507 2 25 25 3 30 27 4 715 20 5 20 3 Sdest_list 1 50 50 dest list 1 20255 37087 2 20234 37098 3 20222 37088 5 20255 37087 Q de oe initial gps reading gps_pos 20270 37077 initial compass reading radians where North 0 heading pi 4 initial sonar reading left_dist 0 right_dist 0 tolerance range for destination and timeout tolerance getTolerance 1 timeout 2000 robot initialization speed 0 turn_dir 0 simulation initialization i 1 path history gps_pos i nav_info 0 0 0 dT 5 dl_size size dest_list num_dests dl_size 1 1 cur_dest_num 1 start pos gps pos heading convertFromCompass heading integrator_sum 0 coordinate change gplong abs gps_pos 1 1 360000000 gps_pos 1 gplong gps_pos 1 2 o for n 1 num dests o i templong dest_list n 2 0 0 9 099900000000099900000000099090099000000909990099009909999099 S6666666666666666666666666666666666666666666666666666666666 29999009900 L o99999999999999999999999999999999 4 Simulation code 8 8 9 8899 SS III II II II II II IS cur_dest_num 0 amp cur_dest dest_list cur_dest_num
22. D IOLineRS 27 pin 34 RS line to the LCD module LCD IOLineE 26 pin 36 E line to the LCD module LCD 10Group 3 1 0 lines 28 31 pins 32 26 LCD Nibble 1 Upper half of data d4 d7 LCD Operate cuTrue Steering Servo set up Steering IOLine 9 Steering Operate cutrue Steering Value 15 Compass set up Compass Node 96 Compass Mode cu16bit Compass NoInc 1 Compass Location 2 Compass Width cui6bit Motor set upx Psat Z O http courses cs tamu 00Pic Home Page Micr R Using the OOPic and Sc 4 00Pic c Document 2 al MEER N These icons represent objects you have declared in your program and when you double click on them a dialog similar to the following will appear 54 OOPic 0 xj File Edit Tools View Window Help osal al vis leslie gt Blafc ments and Settings rnp9022 Desktop CPSC 483 compass_thrattle2 ose NETWORK NODE 3 WES DOP OOP ic ORE Domotor Motor GBS oQencode Shattenc ER 0120 Compass E ocd Leo SB tock Timerint oE vent Speedchk Value 0 TT Signed NorZero Bis mj m mj mj E m E m mj m mj mj mj mj a 1 Sting MSB oWord SpdCorrection ee oWord oByte SpdKP New oByte oByte TargetSpd New gte oByte ReferenceSpd New oes oBit RampCount New oBit xxNavigation State de oWord Bearing New o oWord ShaftPos oWord MatorSet oByte Thistart oBit
23. GPS Robot Navigation Final Report Senior Design Project Computer Science Department Dwight Look College of Engineering Texas A amp M University May 10 2004 Chris Foley Kris Horn Richard Neil Pittman Michael Willis Table of Contents Project Proposal Review of Project Implementation Notes User Manuel Course Debriefing Timeline C Code MATLAB code 28 30 42 55 57 58 69 GPS Navigation for Field Mobile Robots Project Proposal Chris Foley Kris Horn Richard Neil Pittman Michael Willis CPSC 483 February 9 2004 Table of Contents Introduction Problem background Needs statement Goal and objectives Method of Solution Literature and technical survey Design constraints and feasibility Evaluation of alternative solutions Statement of work Proposed design Research Construction Testing Approach for design validation Mark III Controller Board Kit Garmin 15L Wired GPS Stampede Monster Truck TS 025 Electronic Compass Economic analysis and budget Schedule of tasks Pert and Gantt charts Project management and team work Societal safety and environmental analysis Appendices CV qualifications of team members Bibliography Project Datasheets Problem Background The purpose of this project is for the team of students to design and construct a vehicle capable navigating to a sequence of This effect is to be accomplished using a global positioning system to allow the vehicle to become aw
24. Hex C 278 Hex C 3BC Hex C Hex Find Serial Cable Then press the Find Parallel Cable button and you should see the following change 46 Cable Configuration C No Cable Connected Programming Delay Find Parallel Cable 50 Memory Size 4k IV Verify after downloa If the dialog window appears like this you may press Ok and the dialog will close Then go to Tools gt Language and select the language syntax that you would like to use or the language the code you will downloading into the OOPic is written in either C Java or Basic All of the developed for our project was written in C syntax because of our previous experience and familiarity File Edit Tools View Window Help Save Buffer to File Erase Offer Read EEPROM into Buffer Write Buffer to EEPROM Erase EEPROM Cable Configuration gt star 3 8 Dosc El httpi fcourses cs tamu OOPic Home Page mir E Using the OOPic and Sc ue OOPic 2 a teala 70m 47 Finally go to Tools Target Device and select the OOPic Firmware Ver B 2 x This is the latest firmware available at the time of our project and corresponds to the version of the OOPic we have on the control board D cg OPen Fie into Buffer Blafc Save Buffer to File Erase Buffer Read EEPROM into Buffer Write Buffer to EEPROM Erase EEPROM Cable Configuration v OOPic Firmware Ver B 2 x Bsr
25. LCD Locate 1 11 LCD String L else if obSLR 2 GetObstTurmDir frtRS turndir mul 65535 turndir 1 turndir LCD Locate 1 11 LCD String C else if obsLR 3 GetObstTurnDir frtLS LCD Locate 1 11 LCD String RY else GetTurnDir LCD Locate 1 11 LCD String N Sub void GetObstinfo void rsonar Operate 0 rsonar Operate 1 Isonar Operate 0 Isonar Operate 1 while rsonar Received cvFalse amp rsonar TimeOut cvFalse if rsonar TimeOut cvFalse amp rsonar 64 lt 10 frtRS rsonar 64 else frtRS 255 while lsonar Received cvFalse amp Isonar TimeOut cvFalse if lsonar TimeOut cvFalse amp Isonar 64 lt 10 frtLS Isonar 64 else frtLS 255 if frtRS lt frtLS 62 obsLR 1 oe if frtRS gt frtLS obsLR 3 ae if frtRS frtLS at frtRS 255 ER 0 else ors 2 Sub void GetObstTurnDir Byte mindist turndir 600 mindist if turndir gt 10 turndir 10 Sub void GetTurnDir void turndir sbt heading afn while turndir gt 32767 turndir add turndir 360 if turndir gt 180 turndir sbt 360 turndir turndir mul 65535 turndir LCD Locate 0 14 printNum turndir turndir div turndir 3 Aurndir add turndir div intBearingSum 100 intBearingSum add intBearingSum turndir Sub void GetDxDy void if Dest
26. Lng gt Lng dxa DestLng Lng dx mul 65535 dxa 1 dxa opposite because longitude is given as positive to the west else dxa Lng DestLng dx dxa 63 if DestLat gt Lat dya DestLat Lat dy dya else dya Lat DestLat dy mul 65535 dya 1 dya Sub void GetAfn void if dxa 0 afn 0 else if dya 0 afn 90 else if dya lt dxa index dya 16 index index dxa GetArctan afn 90 afn else index dxa 16 index index dya GetArctan if dx gt 32767 amp dy lt 32768 quadrant 2 afn 360 afn else if dx gt 32767 amp dy gt 32767 quadrant 3 afn 180 afn else if dx lt 32768 amp dy gt 32767 quadrant 4 afn 180 afn Sub void GetGPSReading void while gps Value 36 while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps 64 while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps rece
27. TIONS e Familiar with PIC Microcontrollers e Knowledge of using DC motors and servos 26 Bibliography www navtechgps com e This site allowed us to learn about several GPS units and compare prices www howstuffworks com e Contains general information about how GPS units work www junun org Marklll e Contains documentation of the Mark III board that we are using www dkits com e Another site that sells electronic kits such as GPS kits www epemag wimborne co uk Icd1 pdf e An article titled How to use Intelligent LCDs www doc ic ac uk ih doc lcd operatio html e Contains documentation on the HD44780 LCD standards http studentweb tulane edu jreasor e This site is the homepage of a Tulane graduate student who is doing a similar project www oopic com e Contains documentation of the OOPIC which is the microprocessor that we are using http www superdroidrobots com sensors compass htm e Contains information about the electronic compass http www digitalnemesis com catalogue RLC1 RLC1 htm e Contains information about an rs232 to TTL converter 27 Project Datasheets Attached are some of the project datasheets for parts of our project 28 Review of Project Problem Background Today many electronic devices are automated and unmanned There are many applications in which having an unmanned robot is safe and can save human lives An example is a robot that travels into a mine field to detonate a dangerous
28. an ZG O H OER Ej http courses cs tamu 00Pic Home Page mer FA Using the OOFic and S c femooPic gt gt 2 a Uld TR Now you may attach the 4 pin programming connector to the programmable cable You may now program the OOPic VO Connector Memory Sockets Network Connector Programming Connector Connector 48 Programming the OOP ic from a file To program the OOPic you must first prepare the OOPic Multi Language Compiler and the OOPic for programming as seen at www oopic com or our user manual When you have done this you may proceed Start with the OOPic Multi Language Software open as shown File Edit Tools View Window Help plela S lt le gt Blafc Asa GAO 8 Gerscass E hetpi courses cs tamu 00Pic Home Page mier using the OOPic and sc uemoomie gt gt gt 2 Bl Ula rem First go to File gt Open and the following dialog will open 49 21x Lookin OOP Ad PV E My Recent Documents E Desktop O My Documents File name Open My Network Files of type 00Pic Source Code osc 7 Cancel ss IF Open as read only Navigate the dialog window to the location of your source file It will have the extension osc When you have found the desired file click on it Its file name will appear in the File name text box and you may press the Open button 50 21x Look in E CPSC 483 c EA M
29. and the navigation code it is best to start with a high level approach and work downwards A copy of the code is located in the appendix of this document and may be useful with the following discussion The abstract design of the navigation code is represented in the following diagram Navigation System Path Navigator Steering Control Motor Control Heading Navigator Obstacle Avoidance Compass Abstract Navigation System Design The navigation system at the top takes the inputs from the path navigator and passes them to the steering and motor control This is primarily represented in the main subroutine of our code Sub void main void Setup while curDest lt numDests cycle cycle 1 cycle cycle 4 if cycle 1 Get GPSReading GetDxDy GetAfn heading Compass Value 10 UpdateLCD if dxa gt 1 dya gt 1 GetPathNavinfo Steer else curDest curDest 1 GetDest Get GPSReading GetDxDy GetAfn 38 motor value 135 LCD Locate 0 31 LCD String done The while loop is repeated until the final destination has been reached The first section of the loop gets the path navigator information Once this information has been received the code uses it to control the robot accordingly The steer subroutine controls the robot s steering servo and will turn it to the left right or straight Once a destination has been reached the navigation system mo
30. are of its position on the earth and the positions of wave points relative to its current location This device must be a robust vehicle capable of traveling outdoors on mostly flat ground and able to carry the load of what components are necessary for it to accomplish its function Needs Statement The project will provide the members of the team with experience in the design process from conception to implementation This experience will be necessary as the members of the team go into their careers and seek to participate in projects of similar and larger complexity Furthermore the project when completed will produce a vehicle capable in part of self navigation with users providing the path This can later be further expanded to have an artificial intelligent planner decide on the path with users only providing beginning and ending points The platform can be used in many ways depending on what additional hardware is added Such applications include information gathering transportation of small materials remote presence and environmental surveying Goals and Objectives Obvious goals for this project are fulfill the requirements provided by the professor and teaching assistant The set goals drawn up between the student team and the professor can be thought of a rubric with which our project will be judged The project goals include but are not limited to the following e Interface micro controller with global positioning system
31. as well as specific data sheets of GPS units In addition we have learned about radio controlled cars and how to modify them The proposed design for the GPS unit will incorporate a compass system that has already been used by a CPSC 483 group from last semester Our group will need to be familiar 29 with the literature provided by the compass group from last semester Below is the list of resources that we have used so far www navtechgps com e This site allowed us to learn about several GPS units and compare prices www howstuffworks com e Contains general information about how GPS units work www junun org Marklll e Contains documentation of the Mark III board that we are using www qkits com e Another site that sells electronic kits such as GPS kits www epemag wimborne co uk Icd1 pdf e An article titled How to use Intelligent LCDs www doc ic ac uk ih doc lcd operatio htmI e Contains documentation on the HD44780 LCD standards http studentweb tulane edu jreasor e This site is the homepage of a Tulane graduate student who is doing a similar project www oopic com e Contains documentation of the OOPIC which is the microprocessor that we are using http www superdroidrobots com sensors_compass htm e Contains information about the electronic compass http www digitalnemesis com catalogue RLC1 RLC1 htm e Contains information about an rs232 to TTL converter The Devantech SRF04 Ultrasonic Range Finder e Thi
32. ate is set to 2400 gps Operate cvTrue prevLat 0 prevLng 0 cycle 0 Rees Icd setup kk k k k LCD IOLineRS 27 pin 34 RS line to the LCD module LCD IOLineE 26 pin 36 E line to the LCD module LCD IOGroup 3 I O lines 28 31 pins 32 26 LCD Nibble 1 Upper half of data d4 d7 LCD Operate cvTrue OOPic delay 3 wait for LCD to come up LCD Init Perform LCD initialization OOPic delay 50 LCD Clear clear the screen LCD Locate 0 0 positions the cursor at the star OOPic delay 100 LCD Clear LCD Locate 0 0 LCD String LAT LCD Locate 1 0 LCD String LNG LCD Locate 0 20 LCD String CMP LCD Locate 1 20 LCD String X LCD Locate 0 11 LCD String A LCD Locate 1 28 LCD String Y kk k k k If servo setup StrServo lOLine 1 StrServo Operate cvTrue compass setup Compass Node 96 Decimal of Hex address 0xCO shifted right by 1 Compass Mode cv10bit 12C mode is 10 Bit Addressing Compass Nolnc 1 Don t increment Compass Location 2 Address of single byte bearing Compass Width cv16bit Compass Data is 1 byte wide kk k k k motor setup 61 motor lOLine 17 pin 29 motor prescale 3 motor period 255 motor Operate 1 motor Value 176 Sub void GetPathNavlnfo void GetObstInfo if ODSLR 1 GetObstTurDir frtRS turndir mul 65535 turndir 1 turndir
33. c joEvent Speedchk New oEvent xxxSpeed State Objectsxx loWord ShaftPos New oWord loWord MotorSet New oWord joByte Thrstart New oByte oBit Ramp New oBit Speed Control Objects oWord SpdError New oWord oWord SpdCorrection New oWord oByte SpdKP New oByte oByte TargetSpd New oByte NETWORK NODE 3 HESS 00Pic 00Pic OE oDcmotor Motor GB oGencode Shaftenc EET ol2c Compass E okod LCD oClock Timerlnt BBB oEvent Speedchk BP oByte ReferenceSpd New oByte 6 oWord ShaftPos oBit RampCount New oBit GB oword MotorSet xxNavigation State Objectsxx 8 oBye Thrstart loWord Bearing New oWord H T obit Ramp i E sword SpdError Sub void main void lt E sword SpdCorrection 00Pic Node 3 xTarget Speed 127 to 127 xxx 8 PERS od TargetSpd Signed 1 8 oByte TargetSpd TargetSpd Value 325 Reference Speed 127 to 127 xxx 8 byte ReferenceSpd ReferenceSpd Signed 1 m Bit RampCount ReferenceSpd Value 325 Oscilating function to slow Ramp Functions is oWord Bearing RampCount Value 6 Proportional Constant 127 to 127 xxx SpdKP Signed 1 SpdKP Value 1 8 Speed Error 82767 to 82767 SpdError Signed 1 SpdError Value 6 Speed Correction 32767 to 32767 SpdCorrection Signed 1 SpdCorrection Value 6 xCurrent Bearing 8 to 65535 ee Bearing Signed 6 LCD set upx LC
34. ccurate to approximately three degrees Once the angle of the destination relative to north is calculated the GetTurnDir subroutine subtracts this value from the heading in order to determine the angle from heading Based on this angle the turn direction for the robot is calculated using a proportional and integral calculation One final point about the code is the use of our own numbering system for all numbers that could have negative values The need for this system arose when we encountered problems while trying to use negative values for some of the variables The oWord and oByte objects in the OOPic are supposed to be able to handle negative values However after doing some simple tests we discovered that we could not rely on the results the OOPic would give us Therefore our system uses the Word data type which has an integer range from 0 to 65535 Positive numbers range from 0 32767 and negative values range from 65535 32768 were 1 equals 65535 and 32767 equals 32768 We then created add subtract multiply and divide functions for basic arithmetic with this system All of this code was originally created in MATLAB in order to test the results before transferring it to the robot The MATLAB code is also included in the appendix The main difference between the MATLAB code and the C code is that the sensory inputs i e GPS coordinates compass and sonar had to be simulated since we could not integrate them into MATLAB 42
35. ck gt Garmin 15L Wired GPS Remote Antenna The GPS concept is what makes this project unique We decided to use the Garmin 15L wired GPS module for a number of reasons Since the module had only what we needed we were able to save money With the antenna the GPS module was less than 200 The GPS module was also compact The Garmin 15L wired GPS unit is barely larger than an American guarter The small size makes construction easier since we could basically place the module anywhere on the car gt Stampede Monster Truck We decided to use a pre assemble remote control truck to navigate globally The Stampede Monster Truck was ideal for our situation Not only was the truck affordable but it was also large enough to conquer the grass out on the Polo Fields The remote controlled truck has a ground clearance of about four inches The only obstacle stopping this truck is a tree The Stampede Monster Truck also has a large pay load capacity The truck is roughly 12x16 inches in area This will provide adequate space for the electronic parts and components needed to navigate this truck by GPS gt TS 025 Electronic Compass We decided to use an electronic compass to tell the microcontroller the direction the truck is facing A friend of one of the group members referred the TS 025 Electronic Compass This compass is affordable easy to use and extremely accurate within a tenth of a degree Economic Analysis and Budget
36. ding obst_loc obst_info 1 1 speed obst_info 1 2 obst_dist obst_info 1 3 new_sum sum check if an obstacle exists and turn accordingly switch obst_loc case 1 obstacle is to the left right sonar picked it up turn dir getObstTurnDir obst dist turn dir l turn dir Case 2 o Obstacle is in the center both sonars picked it up turn dir getObstTurnDir obst dist turn dir l turn dir case 3 obstacle is to the right left sonar picked it up turn dir getObstTurnDir obst dist otherwise 5 get the angle from the current heading to the destination angle from heading getAngleFromHeading heading gps pos dest 72 o calculate the direction to turn head_turn_dir getHeadTurnDir angle_from_heading sum turn_dir head_turn_dir 1 1 new sum head turn dir 1 2 speed 2 end path_nav_info turn_dir speed new_sum convertFromCompass m function c convertFromCompass heading Sheading 1 heading Sheading heading pi 2 Swhile heading lt 0 o ae heading heading 2 pi heading heading 3 pi 2 heading mod heading 2 pi heading 2 pi heading c heading convertToDegrees m function c convertToDegrees heading heading heading 180 pi c heading getAngleFromHeading m function afh getAngleFromHeading heading gps pos dest dx dest 1 1 gps_pos 1 1 dy dest 1 2 gp
37. dth cui6bit Motor set up start Z O Ejhttpsffcourses cs tamu OOPic Home Page Mier BT Using the OOPic and S c feat 00Pic c Document 2 B te Qld 8 25PM Then in the OOPic Multi Language Compiler environment click on the icon labeled NETWORK NODE in the right pane and the following dialog will appear oByte TargetSpd oByte ReferenceSpd oBit RampCount oByte ReferenceSpd New oByte GI oWord ShaftPos oBit RampCount New oBit E Word MotoSet xxxNavigation State Objectsx 8 oByte Thrstart oWord Bearing New oWord m oBit Ramp oWord SpdEi Sub void main void s oi pd nee lt E sword SpdCorrection 00Pic Node 3 n oByte SpdKP Word Bearing the OOPic to debug Node NEE se In the field labeled Node enter the same number you entered for in the line of code you inserted in your code on the previous step Press the Set button and the dialog will close Next reset the OOPic by pressing the reset button on the S control board by the power connector 53 VO Connector Memory Sockets Network Connector Programming Connector Connector Now while the program is running you may double click on any of the icons in the right pane of the OOPic Multi Language Compiler environment as shown Documents and Settings rnp9022 Desktop CPSC 483 compass_throttle2 osc rm File Edit Tools View Window Help 18 xj olsa al slae gt Blaf
38. eing full throttle To impersonate the potentiometers voltage we needed a DAC Digital to Analog Converter or a creative way to represent the voltages in that range We decided not to use a DAC for a couple of reasons one reason is that the interface for the DAC was not very foretelling and second we did not have enough I O lines available from our OOPic Since the output of the OOPic was TTL voltage ranging from 0 to 5 we decided to use one of the I O lines to represent the output voltage from the potentiometer In order to do this we had to use PWM Pulse Width Modulation on one of the I O lines PWM is used mainly to control DC motors by varying the on time of a cycle The picture below shows a good example of how PWM works PWM allowed our OOPic to represent any voltage between 0 and 5 volts with one IO line 36 Pulse VVidth Modulation PVVM of a 12 Volt 4000 RPM DC Motor ADS rr Mean Voltage 3V 1000 RPM OV 25 duty Mean 12V Voltage 9V 3000 RPM OV 75 duty In order to impersonate the potentiometer we needed to smooth out the PWM signal The constant on and off waveform caused our robot to have choppy throttle response To make the PWM smoother we used three 4 7 micro farad capacitors This greatly smoothed out the signal and thus rounded out our throttle control The picture below show the circuit board we tore out of the controller and placed on our truck 37 Navigation Code To underst
39. er to integrate the parts and compose the system as a whole If we were to do the project again we would do most of the management the same as we have The only thing that we would change would be assigning deadlines as much as possible for individual parts of the project This would help us to ensure that we don t get behind with any one part of the project Societal Safety and Environmental Analysis A GPS guided mobile robot presents many benefits and changes to society One of the largest impacts may be in warfare A GPS guided robot will have the ability to travel to places where it may be dangerous for humans to travel While traveling features and sensors could be added to the robot for various detection needs For example a GPS guided robot could be sent into a mine field to try and find the locations of mines If a mine triggers during the process it is better to loose the robot than a human life This robot s application could be extended to various other situations in warfare and in everyday life The main idea behind it is that we can send a robot to places that are unsafe for humans or that humans would have difficulty getting to This could definitely change warfare and scientific research at the least The safety concerns associated with this robot are minimal Normal care should be taken when operating electrical equipment and caution should be placed when setting the coordinates for the robot s path It will be important t
40. h direction the car should turn In addition compass navigation has already been used in a previous project So it would be relatively simple to implement the compass into our system The compass hardware is already built and we have access to the software and the documentation of the compass design as well Each time the RC car goes to a desired set of GPS those must be programmed into the system One possible method of doing this is having everything needed to program a new coordinate set located on the car This would require an LCD screen to ask the user what to enter as well as a keypad of that would allow the user to input the However this solution may be too difficult to implement given our time constraints An alternative solution to programming the new coordinates would be the use of a PDA or a laptop For example whenever a new coordinate set is desired the laptop or PDA could be hooked up to the system and reprogrammed via a serial link Although this solution is not as desirable it is more feasible given the scope of this project Perhaps one of our primary concerns at this point in the project is being able to control the RC car It is difficult to know how we will o about controlling the RC car since there is not a large amount of documentation publicly available for RC cars One possible solution would be to directly tap into the servos of the steering and the drive motors of the car and completely bypassing the RC car s cont
41. i turn new sum 74 getMaxTurn m function mt getMaxTurn dummy mt pi 9 getObstInfo m function getObstInfo getObstI range to define angles in CENTER_RANGE 15 RANGE 30 CENTER_RANGE 2 o 5 create obstacles obsts 25 21 count size obsts obstacleCount count 1 1 o 6 Create wall obstacle for j 1 100 next obstacleCount obsts next 5 obstacleCount obstacl end plot obstacles plot obsts 1 obsts 2 de oP an obstac right_count left_count right_min left_min For di obstDistance i obstAng obsts i if abs obstAngle i i abs obs Toks f nfo gps pos heading which sensors pick up obstacles T 1 3 5 0 3 5 1 eCount 1 X compare the distance from all obstacles so we can know if there is le that is close to the robot 0 Biy 11 obstacleCount getDistInfo gps_pos obsts i i convertToDegrees getAngleFromHeading heading gps_pos lt lt tAngle i right count r left_count le right sonar rig if obstDistance right min end left sonar if obstDis le end tance ft min elseif obstAngle i else right_count right_sonar rig if obstDistance right_min end left_count le left_sonar left_ if obstDistance left RANG t_ count ht_count i lt rig obstDistance i obs
42. ion 5 and the path for the parallel cable programming interface for Windows NT 2000 amp XP Port95nt exe After downloading these two files you must first install the compiler and then the patch if you are running the compiler on one of the effected operating systems VO Connector Memory Sockets Network Connector Programming Connector Connector 44 Preparing the OOPic for Programming Start the OOPic Multi Lang uage Compiler op en N File Edt Tools View Window Help olea S ol xe gt Ble Untitled Source Bsrart Z O P Orsa El hetp itcourses cs tamun OOPic Home Page mer BE Using the OoPic and sc femore gt gt gt gt gt gt e a tala ram To prepare the OOPic for download of a program attach the parallel cable to the interface at the back of the computer but do not attach it to the four pin programming connector yet In the compiler software go to Tools gt Cable Configuration and a dialog window will appear 45 File Edit Tools View Window Help Bi Jjc D FI E Open Fie into Buffer Save Buffer to File Erase Buffer Read EEPROM into Buffer Write Buffer to EEPROM Erase EEPROM Cable Configuration Language Target Device esa 00Pic 2 al Cle Ala 7 29PM start BOS Ce Ej http courses cs tamu OOPic Home Page Mic ET Using the ooPic and S c Cable Configuration ee EE SE A Fe Pe Ee Re AA Find Parallel Cable 378
43. ived 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 1 gps while gps received 0 string 2 gps while gps received 0 string 11 gps while gps received 0 string 3 gps while gps received 0 string 4 gps while gps received 0 string 5 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 11 gps while gps received 0 string 6 gps while gps received 0 string 7 gps while gps received 0 string 11 gps while gps received 0 string 8 gps while gps received 0 string 9 gps while gps received 0 string 10 gps prevLat Lat prevLng Lng Lat 0 Lng 0 for counter 1 counter lt 5 counter 65 if counter 5 Lat stringlcounter 48 Lat 10 else Lat string counter 48 Lat for counter 6 counter lt 10 counter if counter 10 Lng string counter 48 Lng 10 else Lng string counter 48 Lng Sub void UpdateLCD void LCD locate 0 5 LCD String str Lat LCD locate 1 5
44. mputer systems last semester and enjoyed trying to learn how to design hardware systems although still have a lot to learn On the other hand my electrical engineering background is not too strong so I m sure will have to do some research to get a good understanding of things Schedule Monday Class Work from 10 00 to 7 00 Including this class and lab Tuesday Class Work from 9 00 to 5 15 Wednesday Class Work from 10 00 to 7 00 Including this class and lab Thursday Class Work from 9 00 to 5 15 Friday Class from 10 20 to 11 10 22 MICHAEL WILLIS 1114 S Dexter willis tamu edu College Station TX 77840 979 574 7169 EDUCATION 1999 Present Texas A amp M University College Station TX 1 Pursuing B S in Computer Engineering 2 G P R 3 136 3 Texas A amp M Men s Lacrosse Team 4 years WORK EXPERIENCE 2002 Present Texas A amp M University College Station TX 1 Help Desk Central Computing and Information Services phone walk up computer support for Texas A amp M students and staff dealt with the campus network virus traffic email and much more 2002 Spring Texas A amp M University College Station TX 2 Intramural Soccer Official Summer 2001 Kohutek Engineering Austin TX 3 Engineering Technician for a Civil Engineer field lab testing for construction sites Concrete testing soil analysis soil sample drilling ELECTIVES CPSC 436 Computer Human Interaction CPSC 463 Networks current semester
45. o make sure that the robot will not take a path that could lead to undesirable damage Finally the GPS guided mobile robot did not have much of an effect on the environment We used rechargeable batteries in order to minimize the effect on the environment There are no emissions of the RC car since everything on the car is operated by electricity It was important to make sure that the robot did not traverse any ground on which it may have a negative effect on the surroundings 56 For our test site we chose a low traffic grassy area in order to avoid collisions with other people Another step that our group could have taken to ensure safety would have been to add a remote kill switch that would shut off the car remotely There were times during the testing of the car when it sped off at a fast speed We then had to chase after the car in order to turn of its power to avoid hitting other objects If we had more time and resources a remote kill switch would have been a valuable safety feature Testing and Verification Our group tested each module individually as well as the final integrated product As each product was developed we tested that individual component before moving on to another component For example we first tested the sonar devices with the OOPIC and no other hardware We tested its accuracy of detecting objects as well as its consistency We also extensively tested the accuracy and consistency of the GPS by driving six times a
46. or a few hours and research on what major parts were needed for the project We wanted only what we needed Our engineering team decided to save money and purchase a GPS module rather than a GPS handheld because we did not need the LCD on the GPS handheld Construction After doing some extensive research we should have a detailed schematic of our design Below is a very high level design schematic As the research progresses this schematic will get considerably more detailed GPS Compass Testing This will be the final stage of our project development After constructing the car we will need to run a series of tests The testing will be done out on the Polo Fields at Texas A amp M University Our team decided to use these fields because it was the largest open space that is close to campus Since GPS modules are accurate within fifteen meters a large open space is a necessity Testing the completed project can be the most stressful 11 Approach for Design Validation gt Mark Ill controller board kit OOPic Version The microcontroller will be the heart and brains of our project We decided to use the OOPic on the Mark III board This board is very user friendly and capable of controlling just about anything The Mark III board can also be programmed in Java or C All of our team members are familiar with the programming language C This will greatly help us create an effective algorithm to navigate the RC tru
47. r Programming the OOP ic from a file Remove Cover To remove the top truck shaped cover of the robot car remove the four cotter pins Then carefully left off the cover from the car and set it aside Connect Batteries 43 To operate the GPS guided car you must install the 7 2V motor battery and two 9V batteries Place the 7 2V battery on the tray on the right of the car orientated from the rear Next locate the electronics battery connected towards the front of the car and the OOPic 9V connector towards the rear Insert a 9V battery into each of these Replace Cover Carefully place the truck shaped cover on the robot car and make sure that the support pegs on the body of the robot car chassis are protruding through the holes in the front and the back Then insert the cotter pins into these pegs Activating the Robot Systems To activate the GPS guided robot after it was been prepared for its course first place the robot can at the starting location Next flip the red switch orientated from the rear on the right side of the car behind the front wheels Then Programming amp Using the OOPic Before the OOPic can be used it must be programmed A great deal of the project development involved writing programs for the OOPic to interface with hardware To program the OOPic one should go the OOPic website www oopic com and download the latest version of the OOPic Multi Language Compiler which at the time of our project was in vers
48. re labeled PCB below The inputs on the PCB include GPS sonar compass and battery In addition the PCB has spots for additional circuitry and components There are spots for the RS232 to TTL Converter chip capacitors a potentiometer a voltage regulator and a DB 9 Serial connector Each of these components must be soldered into the PCB The figure labeled Schematic is a schematic of how each of the components of the car fit together The Schematic and the PCB layout are different from the 32 schematic in order to fit each component on a small enough board to mount on the car the board size is 2 5 x 3 8 Each component is mounted on the car according to where it is needed For example the sonar devices of course are mounted on the front of the car The compass is also mounted towards the front of the car in order to be the furthest away from the electronic noise of the motors and batteries The figure labeled RC car is a photograph of the final car The figure labeled Schematic show where on the car each of the components are located PCB Printed Circuit Board Layout 33
49. rols This may be the simplest solution since most servo motors are very similar to each other so it would not be very difficult to learn how to control them However another proposed solution is to use the remote control of the RC car to move the car in the desired direction This would require us to have extensive knowledge of how the remote control circuit works and may be too difficult Although we may be able to contact the manufacturer of the RC car and get a copy of the technical documentation which would help us to know how the remote control functions Having the documentation would allow us to make a more informed decision regarding which method of controlling the car would be best Throughout the design process we will be faced with possible alternative solutions to various problems With each new alternative solution it is imperative that we evaluate each proposed solution based on budget time constraints and feasibility Proposed Design Our project development will involve three stages for completion The stages in order are research construct and test These three stages are needed for every engineering development team Below is a more detailed description of what goes on in each stage Research Before any kind of action is done in a project extensive information gathering should be performed Learning more about the product you buy can really save your budget Every Monday and Wednesday our group would meet in the lab f
50. round the Texas A amp M golf course while recording the GPS coordinates The compass also was tested by itself before we integrated it with the rest of the system We used a handheld compass to validate the electronic compass After each individual component was tested we then put all of the components together We tested our product on a large patch of grass approximately the size of a football field This patch of grass is located between the Oceanography Building and the Langford Architecture building First we measured one GPS coordinate and programmed that point into our car Then we placed the car approximately 30 meters from the target and facing away from the target After sufficiently testing one coordinate another coordinate was programmed into the car and we repeated the same procedure except we used two coordinates instead of one Our product achieves the goal of navigating to predefined GPS coordinates However due to the drive system often it does not take the best path to the coordinate and may need a small push at times to get through thick patches of graph If we had more time we would more thoroughly test the obstacle avoidance portion of our project We have tested the obstacle avoidance without the motor running however we have not sufficiently tested and modified the obstacle avoidance portion of the car 57 Timeline The following Gantt chart shows how are time ended up being allocated throughout the semester
51. s is the data sheet for the Sonar devices that we are using Optical EC Encoder Kit Documentation from US Digital e This is the data sheet for the optical encoder that we are using 30 Implementation Notes OOPic and S control board The OOPic is a programmable microcontroller used to run the code necessary to accomplish navigation function This is possible through reading sensory input data and sending command via its input output pins to other components via its input output pins The OOPic is mounted on the S control board providing it with power easy access to input output pins and an interface to the EEPROM where programs running on the OOPic are stored and read from OOPic stands for Object Oriented Pic The most notable feature of this microcontroller is the number objects available to its users when writing code These objects make interfacing the OOPic with a number of popular devices and implementing hardware capabilities in the microcontroller very simple for anyone who has experience in object oriented programming This by itself has made the OOPic very popular for those seeking a controller that can be learned quickly and used in low to mid level applications VO Connector Memory Sockets Network Connector id OC NEL Programming Connector Connector The S control board includes all of the connections and functionality required operates the OOPic The board includes two EEPROM sockets One is specifically for storing
52. s_pos 1 2 if dx invtan 0 else invtan atan dy dx end if invtan gt 0 if dx 0 if dy gt 0 anglefromRobot pi 2 else anglefromRobot 3 pi 2 end elseif dx gt 0 anglefromRobot invtan else anglefromRobot pi invtan end else if dy gt 0 anglefromRobot pi invtan 73 else anglefromRobot 2 pi invtan end end angle_fh heading anglefromRobot while angle_fh lt 0 angle_fh angle_fh 2 pi end angle_fh mod angle_fh 2 pi if angle_fh gt pi angle_fh angle_fh 2 pi end afh angle fh getDistInfo m function dist_info getDistInfo gps_pos dest Sthis function calculates the distance to the next destination Scoordinate Sdistance deltaX 2 deltay 2 1 2 deltaX gps_pos 1 1 dest 1 1 deltaY gps_pos 1 2 dest 1 2 calc distance deltax 2 deltaY 2 5 dist_info calc_distance getHeadTurnDir m function head turn dir getHeadTurnDir angle from heading sum MAXTURN getMaxTurn 1 turn dir 1 angle from heading proportion Kp 2 5 MAXTURN pi p_turn Kp turn_dir integral SKi 01 Ki 005 new_sum sum turn_dir i_turn Ki sum i turn Ki new_sum pi pi turn p turn i turn de make sure pi turn is not greater than the max turn of the robot if abs pi turn gt MAXTURN if pi turn lt 0 pi turn 1 MAXTURN else pi turn MAXTURN end end head turn dir p
53. t of our time constraint is ordering parts It will be imperative that parts are ordered as soon as possible so that we are not waiting on parts to begin construction It will also be important that we hold the vendors responsible for shipping our ordered parts in a timely manner The technical scope of our project is yet another possible constraint This is partially related to the time constraint Since we are on a limited schedule a project that is too difficult and too technically challenging may not be possible given the teams experience with this subject However our project needs to be challenging enough so that we are generating the best possible product within the given time period Evaluation of Alternative Solutions Throughout the initial design process we have come up with several alternative solutions to various aspects of our project One solution that we have considered is not using a compass for the navigation of the RC car We have considered using a navigation algorithm that would not require the use of a compass This navigation algorithm is based on comparing the RC car s current location with its previous location From that data we can determine which direction the car needs to turn in order to get closer to its destination This process would be repeated every second or so until the destination is reached Although this solution may require less hardware it may not be as accurate as using a compass to determine whic
54. tAngle i obstDistance i count obstAngle i obstDistance i i lt left min obstDistance i lt 0 ight_count 1 ht count obstAngle i obstDistance i i lt right_min obstDistance i ft_count count obstAngle i i lt left min ae ds obstDistance i 75 left min obstDistance i end end end end determine which sensor sees the closet obstacle if right_min lt left_min loc 1 obstacle is closer to the left dist right_min elseif right_min gt left_min loc 3 obstacle is closer to the right dist left_min else loc 2 obstacle is equal distance from both sonar dist right_min end if the closet obstacle is not within the sonar s range don t count de ole it if dist gt 10 loc 0 dist 0 end o default speed speed 2 obst_info loc speed dist getObstInfo obst info getObstTurnDir m function path turn dir getObstTurnDir obst_dist MAXTURN getMaxTurn 1 dist obst dist turn dir 10 pi 3 dist if turn dir MAXTURN turn dir MAXTURN end path turn dir turn dir getTolerance m function t getTolerance dummy t 3 76
55. te rsonar Operate lsonar Operate lsonar Operate 0 1 0 1 while rsonar Received cvFalse amp rsonar TimeOut cvFalse if rsonar TimeOut cvFalse amp rsonar 64 lt 10 frtRS rsonar 64 fFrtRS 255 while lsonar Received cvFalse amp lsonar TimeOut cvFalse if lsonar TimeOut cvFalse amp lsonar 64 lt 10 frtLS lsonar 64 fFrtLS 255 if EPERS lt rt Ls obsLR 1 else if frtRS gt frtLS f frtRS frtLS if frtRS 255 e e un El D N Sending a positive edge to the sonar will trigger a ping to be sent out If an echo is received the value in feet will be noted and compared to the other sonar The code will then determine where the closet obstacle is at if any and record this in the variable obsLR The navigation system then uses this information to determine the path of travel The final subsystem of the navigation code is the heading navigator The heading navigator uses the current GPS coordinates along with the destination coordinates and the compass reading to determine the direction to steer the robot This is represented as a combination of the GetDxDy GetAfn and GetTurnDir subroutines shown below Sub void GetDxDy void if DestLng gt Lng 40 dxa DestLng Lng dx mul 65535 dxa 1 dxa opposite because longitude is given as positive to the west else dxa Lng DestLng dx
56. ther site that sells electronic kits such as GPS kits www epemag wimborne co uk Icd1 pdf e An article titled How to use Intelligent LCDs www doc ic ac uk ih doc lcd operatio html e Contains documentation on the HD44780 LCD standards http studentweb tulane edu jreasor e This site is the homepage of a Tulane graduate student who is doing a similar project www oopic com e Contains documentation of the OOPIC which is the microprocessor that we are using http www superdroidrobots com sensors compass htm e Contains information about the electronic compass http www digitalnemesis com catalogue RLGTVRLC1 htm e Contains information about an rs232 to TTL converter Design Constraints and Feasibility Through the design process we will be limited by several different types of constraints The first of these constraints is budget We do not have a fixed limit on how much we can spend for this project However we must justify each purchase by making sure that it is the most cost effective part and that it is necessary to reach the final goal We have been asked to keep the project to an approximate cost of five hundred dollars Another constraint of this project is time We only have one semester to complete the final product Therefore we have to be careful in how far we plan to take the project Our team must find a medium between a project that is feasible to complete and a project that is challenging A major effec
57. trical equipment and caution should be placed when setting the for the robot s path It will be important to make sure that the robot will not take a path that could lead to undesirable damage Finally the GPS guided mobile robot should not have too much of an effect on the environment If the batteries ever need replacing it is necessary to properly dispose of the used batteries Also it will be important to make sure that the 19 robot does not traverse any ground on which it may have a negative effect on the surroundings Unless it is intentional it should be plotted to avoid sensitive areas 20 Appendices e CV qualifications of team members e Bibliography e Product datasheets 21 Resume for CPSC 483 Computer System Design Section 502 Christopher Foley chris cbfoley com 979 574 1506 GPA 3 704 Project 1 Integrating GPS and Robots Courses Electives Microcomputer Systems Networking Databases E Commerce Interests Skills am very interested in learning and working with GPS systems and how to integrate GPS with other systems feel that my skills are about equivalent when it comes to hardware and software honestly do not have a lot of experience with either one but would like to gain and a fairly good understanding of both have less exposure to hardware design than software design so would like to use this course to help me gain more experience with some hardware design took microco
58. ves on to the next destination in the destination list This is accomplished through the GetDest subroutine When the last destination has been reached the code will exit the loop and send the motor a value to stop It will also print done on the LCD The path navigator portion of the code is primarily contained within the GetPathNavInfo subroutine The code for this section is as follows Sub void GetPathNaviInfo void GetObstInfo if obsLR 1 GetObstTurnDir frtRS turndir mul 65535 turndir 1 turndir LCD Locate 1 11 LCD String L else if obsLR 2 GetObstTurnDir frtRS turndir mul 65535 turndir 1 turndir LCD Locate 1 11 LCD String C else if obsLR 3 GetObstTurnDir frtLS LCD Locate 1 11 LCD String R else Get TurnDir LCD Locate 1 11 LCD String N The main purpose of the path navigator is to determine whether the robot should head for the target destination or avoid an obstacle If the obstacle detection system detects an obstacle the control commands for avoiding an obstacle will override the normal commands provided by the heading navigator section 39 The obstacle avoidance system is represented in the subroutine Get Obst Info This function checks the sonar feedback and determines the location of an obstacle if present The Get Obst Info subroutine is shown below Sub void GetObstInfo void rsonar Opera
59. xm lt 32768 amp ym lt 32768 mul xm ym else if xm gt 32767 amp ym lt 32768 mul absToNeg getAbs xm ym else if xm lt 32768 amp ym gt 32767 mul absToNeg xm getAbs ym else mul getAbs xm getAbs ym Function Word div Word xd Word yd if xd lt 32768 amp yd lt 32768 div xd yd else if xd gt 32767 amp yd lt 32768 div absToNeg getAbs xd yd else if xd lt 32768 amp yd gt 32767 div absToNeg xd getAbs yd else div getAbs xd getAbs yd Function Word getAbs Word ga 67 if ga gt 32767 getAbs 65535 ga 1 else getAbs ga Function Word absToNeg Word atn absToNeg 65535 atn 1 Sub void printNum Word pn if pn gt 32767 LCD String LCD String Str getAbs pn else LCD String LCD String Str getAbs pn Sub void GetArctan void switch index Case 0 afn 0 break Case 1 afn 4 break Case 2 afn 7 break Case 3 afn 11 break Case 4 afn 14 break Case 5 afn 17 break Case 6 afn 21 break Case 7 afn 24 break Case 8 afn 27 break Case 9 afn 29 break 68 Case 10 afn 32 break Case 11 afn 35 break Case 12 afn 37 break Case 13 afn 39 break Case 14 afn 41 break default afn 43 69 MATLAB Code 2999999909090 4 443 c 4 29999
60. y Recent Documents Desktop matlab pwm osc test throttle3 os compass throttlez osc ls serialtest osc test throttle osc compass throttle osc sonar complete osc ls test throttle sor compass throttle var osc a sonar encoder throttle osc a testarray osc E compassconfig osc sonar_encoder_throttle_2 0sc la encoder sonar throttle osc la sonar encoder throttle 3 osc la encoder sonar throttle 2 0sc ls sonar throttle osc lcd osc ls sonar throttle org osc nav code00 osc steer osc nav code01 osc Is steerx osc nav code02 osc a test2 osc la nav code07 osc la test osc la nav code10 osc ls test throttle2 osc Ras My Documents mr N a My Computer File name compass_throttie2 osc Open a ETE Files of type OOPic Source Code osc v Cancel EES Open as read only The dialog window will close and the program will open to a window in the OOPic Mult Language Compiler environment 51 OOPic o x File Edit Tools View Window Help Delta S lse gt Blafc ments and Settings rnp9022 Desktop CPSC 483 compass_throttle2 osc NETWORK NODE HESS vor 00Pic oDemotor Mot joServoSP1 Sas onii New oServoSP1 OF TAD NON OLCD LCD New oLCD GHB oBencode Shaftenc xxControl Objectsx ER 0120 Compass oClock TimerInt New oClock FEB oket LCD joEvent Speedchk New oEvent Bem oCtock Timerint Speed State
Download Pdf Manuals
Related Search
Related Contents
Electrolux EIED55H User's Manual NORDSTRAND CROSS LINE LASER Fiery EXP4110 Dienstprogramme Arquivo 1 T1000-20496 - Hyundai - navigation maps E 2200 - Wacker Neuson WarriorNet Connection Guide - Senatobia, MS Municipal School 取扱説明書 機械的信頼性評価システム Depósitos solares individuales. Serie WE. Manual de Instalación Copyright © All rights reserved.
Failed to retrieve file