Home

DE2Bot User`s Manual Georgia Institute of Technology ECE2031

image

Contents

1. e The DE2Bot beeps for 0 2s e The battery voltage is displayed in hexadecimal on the HEX5 and HEX4 seven segment displays o Voltage is in tenths of volts A7 16 7V is fully charged and 6C 10 8V is dead e The battery level is displayed as a bar graph on red LEDs 0 14 o Afully charged battery will light all LEDs O 14 A dead battery will light only LED O e Green LEDs O 1 and 2 light mirroring the inactive state of pushbuttons 1 2 and 3 respectively o Pressing a PB will turn off the respective green LED e The LCD displays a menu prompting the user to choose Self Test or Troubleshoot Power up Errors If the battery is too low to safely operate the DE2Bot the user is warned with beeps flashes and a written warning on the LCD In this case turn off the DE2Bot immediately and plug it in to a charger If nothing happens when the DE2Bot is turned on there is likely a problem with the battery or power circuitry Turn the DE2Bot switch to the OFF position and notify an administrator Automated Self test At the LCD prompt after power up pressing PB1 will begin a mostly automated self test routine The LCD will provide prompts that allow the user to execute the automated self test without this document but detailed information is provided here for first time users or in the case of errors 1 Battery Check The battery voltage is tested and displayed in decimal on the LCD screen Battery voltage should be 11 17V for
2. 0 e 12C_RDY read write status indicator o Writing to I2C RDY begins an I2C transaction o Reading I2C RDY will return zero if the controller is idle or non zero if a communication is in progress Do not modify I2C CMD or I2C DATA while I2C RDY reads as non zero 10 Odometry The Quartus DE2Bot project contains a device that performs dead reckoning odometry continuously integrating the movement of the wheels to maintain an estimate of the robot s position and heading This estimation can be read from IO registers XPOS YPOS and THETA At power up or reset the position of the robot defaults to X Y 8 0 0 0 The coordinate system is shown in Figure 3 the reset orientation is defined as facing the positive X direction with positive Y to the left and theta following the normal right handed convention with Z upwards Writing to IO location RESETODO will also reset the odometry to this position Figure 3 Coordinate system used for DE2Bot odometry The units for the X and Y positions are 2 1mm count exactly half the resolution of LPOS and RPOS For theta one full rotation of the robot is divided in to 702 segments a product of the specific robot geometry giving an approximate resolution of 0 51 count The theta value will always be 0 701 rotating counterclockwise past 701 will rollover to 0 and rotating clockwise past O will rollover to 701 Dead reckoning is highly susceptible to accumulated error from wheel slippage wheel
3. battery voltage already been run 0x0190 write OB read 1B addr 0x90 to I2C CMD start the communication wait for it to finish get the returned data he I2C for reading batt voltage after each reset SetupI2C LOAD I2CWCmd OUT I2C CMD LOAD Zero H OUT I2C DATA OUT I2C_RDY CALL BlockI2C RETURN Subroutine to block until 0x1190 write 1B read 1B addr 0x90 to I2C CMD register 0x0000 A D port 0 no increment to I2C DATA register start the communication wait for it to finish I2C device is idle BlockI2C IN I2C RDY E JPOS BlockI2C H RETURN Having some constants can Zero DW O One DW 1 Two DW 2 Three DW 3 Four DW 4 Five DW 5 Six DW 6 Seven DW 7 Eight DW 8 Nine DW 9 Ten DW 10 Mask0 DW amp B00000001 Mask1 DW amp B00000010 Mask2 DW amp B00000100 Mask3 DW amp B00001000 Mask4 DW amp B00010000 Read busy signal If not 0 try again Else return be very useful 15 one meter in 2 1mm units half meter in 2 1mm units 11V minimum safe battery voltage write one byte read one byte addr 0x90 write nothing read one byte addr 0x90 e switches LEDs r usually running at 10 Hz buttons and some misc inputs n segment display 4 digits only n segment display 4 digits only HO6 primitive 4 digit LCD display n LEDs and Red LE
4. cobededs 7 MIERISELMESEIRREERIEUTERICODE EIOS 7 zo ACER teas 7 Battery Test iS WO ecce oeste ttes UC UM LM ALL 8 Speaker ONT uos messa MAI ML MI ILL 8 Switches and Pushbuttons SW2 cccssecssscesssscssssecseececsaeeessaecssseeceseeeseaecessaecseaeecueeessuecsesseceeesessaeeseauecseseeesaess 8 Sonars SWS Me 8 LEDs 7 segment displays LCD SWA cccssccsssecssececssecesseeseseeceseeecsuecssaaecsneeceaeeessaesseasecseeeseaeessaaeeseaaeseeeess 8 Wheel Encoders SW uito ict i te Oe HR E RU DO raa rte vt Ee E Te o DE 8 Motors SWO Der 8 Programming GUIDE aac eod eri pete tero eme teet oeete e ed a eerte mede tr ve Dese rove te iow eed ve e tote a e er eet 9 Quick Reference oec en egere re in e d e sve eoe ET utere eve ie al eese e ed ee uer i Petre eee 9 Detailed Description of Select Devices raserede er ete e I ande eed e e LEE Eee EY ees 10 jon 10 Wheel Position Velocity and Velocity COMMANAS ccccseessssecececeesessaececeeecessesseaeceeeescesseuaeaeeeesseesenenaees 10 S nar SENSO S AETERNUM 10 Pe Controller and Battery Voltage editore te e et eet Depende ere eti pretio pu bec peo pea 10 eeepc Et 11 Good Practices for Robot Programmitig c ett tote eese ev One ed ov EE Poss d EV Ea eon x e E EY enne 11 At Program Statt ci rco beer E o
5. proper robot operation 2 Sonar Test Each of the eight sonar sensors is tested starting with SonarO left facing sonar and proceeding clockwise Each sonar is polled until either a valid reading is obtained or 5 seconds elapse If the test pauses on a particular sonar move an object such as your hand in front of that sonar so that a reading can be obtained The current sonar is indicated on the red LEDs or you can listen for the characteristic clicking sound Once all sonar sensors are tested and working the message All sonars are working is displayed on the LCD and the program automatically proceeds to the next test Sonar Errors If a sonar does not return a valid reading within 5 seconds it is assumed to be defective At the end of the sonar test the green LEDs display which sonar s are not working Note the number s and return the DE2Bot to an administrator 3 Encoder Test Warning The test immediately following this test will cause the robot to move under its own power Ensure that the DE2Bot is either on the floor in a clear area or its wheels are raised off of the supporting surface Continuing this test with the robot on a table can cause it to fall when the following test begins Once the sonar test is complete the LCD will display Rotate left wheel 30 degrees At this prompt rotate the left wheel in either direction until the LCD changes to Rotate right wheel 30 degrees then repeat the rota
6. size and wheel base errors mathematical rounding and other sources The odometry values will likely contain significant error after as little as a few meters of travel or one rotation of the robot Good Practices for Robot Programming This section details some recommended practices for safe and effective use and control of the DE2Bot At Program Start As soon as the program starts or is reset the following should be done e Immediately stop the robot by writing 0 to LVELCMD and RVELCMD e Check the battery voltage and prevent execution if it is below 11V e Wait for the safety switch SW17 to be toggled e Wait for some form of user input e g pressing a PB An example of this initialization procedure can be found in Appendix A and should be provided in the initial DE2Bot project 11 Testing Values Two points must be kept in mind when making decisions based on values obtained from LPOS RPOS odometry sonars or any other real world measurement e Never test for exact values as there is no guarantee that a particular value will occur Instead always test for a range O Oo Example1 polling LPOS while the robot is moving might return OxFE at one sample and 0x100 at the next sample so testing for OxFF will never pass Testing for 20xFF would correctly trigger even if OxFF itself never occurs Example2 Many values are impossible to obtain from the sonar measurements because of the resolution and minimum and maximum dist
7. D16 17 the beep on the beep off Mask5 DW amp B00100000 Mask6 DW amp B01000000 Mask7 DW amp B10000000 StartMask DW amp B10100 EnSonars DW amp B11111111 OneMeter DW 476 HalfMeter DW 238 r MinBatt DW 110 I2CWCmd DW amp H1190 I2CRCmd DW amp H0190 IO address space ma SWITCHES EQU amp H00 slid LEDS EQU amp HO1 red TIMER EQU amp H02 time XIO EQU amp HO3 push SSEG1 EQU amp HO4 seve SSEG2 EQU amp HO5 seve LCD EQU amp GLEDS EQU amp HO7 Gree BEE PON EQU amp HOA Turn BEEPOFF EQU amp HOB Turn LPOS EQU amp H80 pe Left VEL EQU amp H82 curr VELCMD EQU amp H83 2 det RPOS EQU amp H88 same RVEL EQU amp H8A RVELCMD EQU amp H8B P usus I2C CMD EQU amp H90 I2C I2C DATA EQU amp H91 I2C RDY EQU amp H92 SONAR EQU amp HAO base DISTO EQU amp HA8 the DIST1 EQU amp HA9 DIST2 EQU amp HAA DIST3 EQU amp HAB H DIST4 EQU amp HAC r DIST5 EQU amp HAD DIST6 EQU amp HAE DIST7 EQU amp HAF ToS SONAREN EQU amp HB2 regi XPOS EQU amp HCO Curr YPOS EQU amp HC1 Y po THETA EQU amp HC2 o CUr RESETODO EQU amp HC3 rese wheel encoder position read only nt left wheel velocity read only wheel velocity command write only values for right wheel module s CMD register DATA register and BUSY register address for more than 16 registers eight sonar distance readings ster to c
8. DE2Bot User s Manual Georgia Institute of Technology ECE2031 Introduction This document is intended for the end user of the DE2Bot students in ECE2031 It provides an overview of the hardware a walkthrough of the built in self test program and a programming guide for use with the version of SCOMP provided during the final design project Table of Contents Table Of COnEents preteen eee Serre ce i ary ere DEED ery pee IDEE 2 DEZBot Hardware OvervieW Rm 3 Feature Descriptions 2 222 e 4 Wheelsand Encoders RETE 4 Sonar Distance SEMSOMS seinoria a eaaa a aa aae aa rea sed ie ERE aa EA EA reaa 4 Battery and Charge POrt econtra cente in te Aen eee Ae 5 DE2 Development Board rte ee certe fov etc ras ine nee tris enne Na tees eee nas enda loidheneedoee banned 5 Wireless Serial Connection planned cccccccccssssccceessececeeaeeecsesaeeecsesaeeecsesaeeeceesaeeecsesaeeecsesaeeecsesaeeecseaaeeeeeeaas 5 Selft test Operation eec eere cte de ee ra ie esee ec cec nob tee a les sue Poo eet co ee e RU etre fetal eO eh as Red 6 Io TEMERE TI m 6 Automated Self test noe eee ete adve du vagi Pese te a a dap eee aviae a esce Pusat eb ed ceria 6 Ty Battery Checked EI MMID MM MIL 6 DY SOMA Test ccr N E PENE ON E E Meu MEL nM Dem uM 6 ENOCE T SES oot hune A IRE 7 A MOtOF Test orien Reni eiit i IM EEAL E 7 Sel zr FINS Mseev s sessed vensaedesateddeessantve suseut de
9. N register Bits 0 7 of this register correspond to sonars 0 7 e g writing 0b00000001 will enable only SonarO and writing Ob11111111 will enable all sonars Each enabled sonar makes its measurements available at the corresponding DIST register DISTO DIST7 This value is in mm but only has a resolution of 17mm So for example all distances in the range 255mm 272mm will be reported as 272mm Additionally if no ping is returned the value is set to 1 OxFFFF Sonars update in a round robin fashion at 20Hz skipping any that are not enabled If all sonars are enabled each measurement will update at 2 5Hz 20Hz 8 If only one sonar is enabled it will update at the full 20Hz I C Controller and Battery Voltage The DE2Bot contains an I C bus which is currently used to communicate with the A D converter that measures the battery voltage SCOMP interfaces with the I C bus through a controller with three I O registers e 2C CMD write only contains configuration information for the controller o bits 15 12 number of bytes to write 0 1 or 2 o bits 11 9 number of bytes to read 0 1 or 2 o bits 8 1 7 bit IC address of device to communicate with excludes RnW bit o bitO ignored the RnW bit is set on the fly according to the current operation e 2C DATA read write data to send and data received o If transmitting or receiving one byte bits 7 0 are used o If transmitting or receiving two bytes bits 15 9 are the first byte then bits 7
10. ances e Beaware of edge conditions which can erroneously cause tests to pass or fail Q Example 1 after reset theta should be 0 but a test for theta gt 100 intended to check if the robot has turned some amount CCW will immediately pass if the robot turns even slightly CW because theta will rollover to 701 Example 2 checking for a sonar distance by subtracting a constant and testing for a negative result will erroneously pass if the sonar could not make a measurement at all returns 1 Before using a sonar value test for and handle OxFFFF 12 Appendix A Example starting point for ASM code 13 Simple Robot Program Crea no This ted by Kevin Johnson copyright applied edit freely no attribution necessary program 1 performs basic robot initialization 2 waits for the user to Init WaitFo Main Subroutine to wait block Waitl Wloop and BattCheck CALL GetBattLvl SUB MinBatt JNEG DeadBatt ADD MinBatt RETURN If the battery is too low sure that the user realiz DeadBatt OUT BEEPON CALL GetBattLvl ORG amp H000 nable the motors and press KEY3 Begin program at x000 Always a good idea to make sure the robot Stop motors Disable sonar not required Configure the I2C Get battery voltage and end if too low Display batt voltage on S32 arbitrary reminder to toggle SW17 XIO contains KEY
11. ces XIO The value read from XIO contains the following signals e XIO 15 5 GPIO pins on the DE2 header e XIO 4 SAFETY signal which indicates whether or not SW17 has been toggled e XIO 3 SW16 e XIO 2 0 Pushbuttons PB3 PB1 PBO is global reset and cannot be read Note that the pushbuttons are active low an un pressed pushbutton will appear as a 1 in XIO Wheel Position Velocity and Velocity Commands The values read from LPOS and RPOS provide the wheel encoder counts since reset The encoders provide 304 ticks revolution which corresponds to linear movement of approximately 1 05mm count for LPOS and RPOS LVEL and RVEL provide approximations of wheel velocity by sampling the position every 0 1s and calculating the difference 10 The units are thus approximately 1 05mm s LVELCMD and RVELCMD accept values in the same units as LVEL and RVEL and attempt to control the wheel velocities to match that value Be aware that very low speeds usually 100mm s may not be able to overcome the static friction of the motors gearboxes axles and wheels and so may not result in any movement However once moving the lower bits of LVELCMD and RVELCMD do provide additional resolution to the speed The values sent to LVELCMD and RVELCMD should not exceed 511 If a value outside that range is provided the motor controller will interpret it as O stopped Sonar Sensors Each sonar can be independently enabled through the SONARE
12. e eo tone ve cbe De ERE EXE EE eee he ee spada 11 Testing tlrge Cm 12 PDDENGIXAS oerte rr 13 DE2Bot Hardware Overview The DE2Bot is comprised of the commercially available AmigoBot with its electronics removed and replaced with custom hardware and an Altera DE2 FPGA development board This configuration allows complete control of the robot hardware using custom digital circuits created within the FPGA Locations of important features are shown below in Figure 1 Figure 1 Locations of important DE2Bot features Feature Descriptions Wheels and Encoders The DE2Bot has two drive wheels one on each side allowing it to use differential steering to move around smooth or dense carpeted surfaces A rear caster wheel helps to support the robot without interfering with movement The drive wheels are powered by DC motors through a reduction gearbox Each motor is equipped with a high resolution 2000 ticks revolution quadrature encoder which can be used to keep track of wheel rotation and calculate angular position velocity and acceleration The addition of specialized hardware can enable dead reckoning estimation of robot position The drive circuitry for the motors includes a watchdog timer that disables the motors if no alive signal is received for approximately one second In the default Quartus project for ECE2031 an additional safety mechanism disables the motors until SW17 has been toggled both up and down at least once after p
13. enter manual test troubleshooting mode where specific hardware can be tested more thoroughly Entering Tests Once in troubleshooting mode raising a switch and pressing PB1 will enter the corresponding test see Table 1 below While in a test pressing PB2 and PB3 together will return to the troubleshooting test selection mode Use PBO to return to the main menu TABLE 1 MANUAL TEST SELECTION mo o pe C NR wa 5 Switches and Pushbuttons w e ts Tsamen dis LANNNL RN LNNNNL NN Battery Test SWO The battery voltage is continuously read and displayed on the LCD in decimal and 7 segment display in hex Speaker SW1 The robot emits a stream of beeps with 0 15s on and 0 5s off The LEDs light when the beep should be on Switches and Pushbuttons SW2 Switches 0 16 are reflected on red LEDs 0 16 The pushbuttons are reflected on the green LEDs 0 2 Sonars SW3 Switches 0 7 will individually enable sonars 0 7 The value returned by sonar is displayed on the 7 segment display in hexadecimal If more than one sonar is enabled only the lowest indexed one s value is displayed LEDs 7 segment displays LCD SW4 All LEDs flash at 1Hz The 7 segment displays alternate between 0x1111 and OxEEEE exercising all segments The LCD alternates between blank and black Wheel Encoders SW5 SWO up down selects between the left and right wheels The selected wheel s current position value is displayed on HEX3 0 and the immediate vel
14. n Care should be taken to never discharge the battery below 11V Doing so will reduce the life of the battery and may cause permanent damage DE2 Development Board The Altera DE2 board provides access to a Cyclone Il FPGA as well as various I O such as e 18 slide switches e four push buttons e 27 LEDs e a16x2 character LCD e eight 7 segment displays e audio in and out with ADC DAC e VGA video output e anRS 232 serial port e SD card slot The DE2 on the DE2Bot connects to the robot s internal circuitry through its GPIO ports allowing direct digital control of all robot functions Note that the DE2 s power button red button at top left of board should not be used Leave the DE2 ON and use the robot s main power switch to turn the DE2Bot on and off Wireless Serial Connection planned An internally mounted XBee wireless communication module enables remote communication either robot to robot or robot to PC The module is connected to the DE2 s RS 232 port and by default transparently emulates a direct connection to a central node Self test Operation On power up a self test program is automatically loaded from non volatile memory This program enables the user to quickly test for proper operation of the DE2Bot hardware Note the self test program uses PBO as RESET Press PBO to restart the program at any time Power up Tests As soon as the DE2Bot is turned on or when the self test is restarted with PBO
15. ocity on HEX7 4 Motors SW6 Hold PB1 to power the right motor and PB2 to power the left motor Raise SWO to reverse the right motor and SW1 to reverse the left motor Programming Guide At the beginning of the final project in ECE2031 students are provided with a Quartus project containing the SCOMP processor and many IO devices which interface with the DE2 and DE2Bot hardware Each of these devices is assigned an IO address in the SCOMP system as detailed in Table 2 Quick Reference TABLE 2 SCOMP QUARTUS PROJECT I O DEVICE DESCRIPTIONS SWITCHES 0x00 IN Read DE2 switches SWO S15 LEDS Write to DE2 LEDs LEDRO LEDR15 TIMER IN OUT Read 10Hz timer value Write anything to reset to 0 Xo 003 Read PB1 PB3 SW16 SAFETY signal and some GPIO SSEGL 004 UT Write to left 4 digit seven segment display SSEG2 005 UT Write to right 4 digit seven segment display UT Write to LCD 16 bit hexadecimal GLEDS UT Write to DE2 LEDs LEDGO LEDG7 BEEP OA UT Write 1 7 for beep frequency 360Hz N Write O to turn off beep UT UT UT UT UT we p Somen oz OUT wien she me Rl O wos oa n LLL NNNM LN La O O Oo O O O O O O LPOS 080 JIN Read the current position of the left wheel encoder 1 05mm tick YPOS Read dead reckoning Y position estimation THETA Read dead reckoning angle estimation RESETODO Reset dead reckoning odometer X Y 9 gt 0 0 0 Detailed Description of Select Devi
16. ontrol which sonars are enabled ent X position read only sition ent rotational position of robot 0 701 t odometry to 0 16
17. ower up or reset This is to ensure that the robot does not move immediately after being programmed and guarantees that the robot will stop when PBO is pressed Sonar Distance Sensors The DE2Bot is equipped with eight sonar transducers that can be used to measure distances to objects The sensors are arranged around the robot as shown in Figure 2 and numbered clockwise starting with Sonar O which is facing left from the robots forward orientation downwards in the figure Figure 2 Sonar sensor numbering positions and directions The sonar sensors can measure distances from 20cm up to 5m or more depending on the reflectivity of the object The resolution of the measurement is dependent on the sampling speed of the interfacing hardware the default resolution of the DE2Bot hardware is 17mm Each sonar sensor can be enabled independently The sonar firing rate is 20Hz divided between all enabled sonars if only one sonar is enabled it is refreshed at 20Hz if all eight sonars are enabled the overall refresh rate is 2 5Hz 20Hz 8 Battery and Charge Port The DE2Bot contains a 5 5Ah rechargeable LiPo battery enabling approximately an hour of continuous use between charges A charge port on the side of the robot provides easy attachment of an external charger Note that when the robot s main power switch is ON the charging port is physically disconnected from the battery In order to charge the power switch must be in the OFF positio
18. s and SAFETY mask with 0x10100 KEY3 and SAFETY KEY3 is active low invert SAFETY to ease testing either KEY3 or SAFETY failed so try again reset odometry in case wheels have moved Continue checking for low battery stops in the event of a reset LOAD Zero OUT LVELCMD r OUT RVELCMD OUT SONAREN gt CALL SetupI2C CALL BattCheck A OUT SSEG2 2 LOAD Zero ADDI amp H17 OUT SSEG1 rUser IN XIO AND StartMask A XOR Mask4 n JPOS WaitForUser OUT RESETODO program goes here CALL BattCheck P JUMP Main OUT TIMER IN TIMER ADDI 10 JNEG Wloop RETURN for 1 second This subroutine will get the battery voltage stop program execution if it is too low get original value back we want to make Stas start beep sound get the battery level 14 OUT SSEG1 OUT SSEG2 OUT LCD LOAD Zero ADDI 1 OUT EDS OUT GLEDS CALL Waitl gt OUT BEEPOFE LOAD Zero OUT LEDS A OUT GLEDS CALL Waitl gt JUMP DeadBatt Subroutine to read the A Assumes that SetupI2C has GetBattLvl LOAD I2CRCmd OUT I2C CMD OUT I2C RDY CALL BlockI2C IN I2C DATA T RETURN Subroutine to configure t Only needs to be done onc display it everywhere OxFFFF all LEDs on wait 1 second stop beeping LEDs off wait 1 second repeat forever D
19. tion with the right wheel During this test the current encoder position value is displayed on HEX3 0 Encoder Errors If no wheel motion is detected within 10 seconds the test fails and an error is displayed on the LCD Inform an administrator 4 Motor Test Immediately after the encoder test completes the motor test begins If the safety switch SW17 has not been toggled since reset the LCD will prompt Toggle SW17 at which point you should raise and lower SW17 Once the safety is disabled the left wheel will begin turning forwards and the LCD will display Left wheel turning 2 N 1 Y If the wheel is turning press PB1 If not press PB2 The test will then repeat with the right wheel Motor Errors If either wheel does not turn when expected If LEDG8 between HEX4 and HEX3 is flashing the battery is too low to operate the motors Turn the DE2Bot off and plug it in to a charger If LEDG8 is not flashing there is likely a problem with the motors or supporting electronics Notify an administrator Self test Finish Once the motor test is complete the LCD will display Self Test Finish PB1 Main Menu If any errors occurred during the self test a red LED will be lit as follows e LEDO 7 indicate sonar 0 7 errors e LED8 and LED9 indicate left and right encoder errors e ED9 and LED10 indicate left and right motor errors Press PB1 to return to the main menu Manual Tests From the main menu pressing PB2 will

Download Pdf Manuals

image

Related Search

Related Contents

MSI Wind Top AE2240  14 04 AS en psy V2 5ter.pub  Anuncio de licitación - Escuela Universitaria Politécnica de La  Inspiration User Guide  ks05manualparaemail  

Copyright © All rights reserved.
Failed to retrieve file