Chapter 4 - Boe-Bot Navigation |
Outcomes: By the time you complete this section you will be able to:
Assignments:
|
Videos and Simulations
Activity Videos:
|
Example Program Code Activity #1 : Activity #2 : Activity #4 : Activity #5 : Activity #6 :
|
Key Points or FAQs: How can I center the Boe bot to make it drive a straight line? Making the Boe-Bot drive in a straight line consists of a lot of trial and error. Run the Boe-Bot as it is to determine which way the bot is moving off course. Then adjust the pulse duration command sent to the servos to increase or decrease the number of pulses sent to the servo. The faster the right servo turns the more left it will correct while the slower the right servo turns, the more it will move to the right. Repeat this process until the robot drives straight. What is the formula to calculate distance? Time = distance/speed For example: Time = 20 inches / 9 inches per second. Or if time is known 5 Seconds = X inches / 9 inches per second The distance X inches = 45 inches How do you determine the number of pulses to send to the servo when you know the amount of time to travel? Use the known number of pulses that the BOE board sends to the servos each second (40.65 pulses / sec) and multiply it by the number of seconds to travel For Example: 40.65 pulses / sec X 12 seconds = 478 pulses What is the ramping process? Ramping is the process of gradually increasing the speed until full speed is achieved. Rather than going from a stop position to full speed in one command, the speed is slowly increased until the speed desired is reached. This prevents jerkiness and results in more precise movements. What is a subroutine and why are they useful? Subroutines allow you to create modular, reusable code sections that can be called multiple times. Different values can be sent to the subroutines, and they provide different results without having to rewrite a separate group of code for each scenario. What is the EEPROM on the BOE? Why would you use it over RAM? EEPROM stands for erasable programmable read only memory. Writing to EEPROM is slower than RAM, holds less information, and can only be written to a limited number of times. Typically use EEPROM to store programs that you can access over and over again, even after the power is turned off and back on. What is the Command to store information into EEPROM? The DATA Directive command is used to store information in the EEPROM. How is a Select statement different that an IF Statement? The case statement is different in that there can be several different conditions in a case statement. If you were using an IF statements to see if a values was 5,6,7,8 or 9, you would have to use several different IF statements. With the Select Case statement, you can use one command and have a different line for each potential value. For Example: Select MyVAR
Case 5: … Case 6: … Case 7: … Case 8: … Case 9: …
ENDSELECT What is the command to access a subroutine? Gosub is used to call an existing subroutine. For Example: GOSUB MyRoutine |
|||