Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction Level Gobbit Assembly and Programming

Similar presentations


Presentation on theme: "Introduction Level Gobbit Assembly and Programming"— Presentation transcript:

1 Introduction Level Gobbit Assembly and Programming
SCOUTBOTICS Introduction Level Gobbit Assembly and Programming Compiled for October 27, 2018

2 Part I Robotics Merit Badge Discussions
SCOUTBOTICS Part I Robotics Merit Badge Discussions

3 Robotics Merit Badge Requirements
Scouts during this section please complete the merit badge workbook sections: 1: Safety 2: Robotics Industry 3: General Knowledge 7: Careers

4 Robotics Merit Badge – Safety Review
Robotics MB Req #1 What are the most likely hazards you may encounter while working with robots? What do you think you should do to anticipate, mitigate and prevent, and respond to these hazards? What do you think the appropriate safety gear and clothing is that should be used when working with robotics? Discuss first aid and prevention for the types of injuries that could occur while participating in robotics activities and competitions, including cuts, eye injuries, and burns (chemical or heat).

5 Robotics Merit Badge – Industry
Robotics MB Req #2 Discuss the following with your counselor: The kinds of things robots can do and how robots are best used today. The similarities and differences between remote-control vehicles, telerobots, and autonomous robots. Three different methods robots can use to move themselves other than wheels or tracks. Describe when it would be appropriate to use each method.

6 Robotics Merit Badge – General Overview
Robotics MB Req #3 Discuss with your counselor three of the five major fields of robotics (human-robot interface, mobility, manipulation, programming, sensors) and their importance to robotics development. Discuss either the three fields as they relate to a single robot system OR talk about each field in general. Find pictures or at least one video to aid your discussion.

7 Robotics Merit Badge – Careers in Robotics
Robotics MB Req #7 Name three career opportunities in robotics. Pick one and find out the education, training, and experience required for this profession. Discuss this with your counselor, and explain why this profession might interest you. Today’s robotics professionals are at the forefront of solving some of our most challenging problems. Robotics professionals help treat disease, increase the country's defenses, improve living standards and explore space.

8 Robotics Merit Badge – Design, Build, Program, Test
Robotics MB Req #4 With your counselor's approval, choose a task for the robot or robotic subsystem that you plan to build. Include sensor feedback and programming in the task. Document this information in your robot engineering notebook. Design your robot. The robot design should use sensors and programming and have at least 2 degrees of freedom. Document the design in your robot engineering notebook using drawings and a written description. Build a robot or robotic subsystem of your original design to accomplish the task you chose for requirement 4a. Discuss with your counselor the programming options available for your robot. Then do either option 1 OR option 2. Option 1. Program your robot to perform the task you chose for your robot in 4a. Include a sample of your program's source code in your robot engineering notebook. Option 2. Prepare a flowchart of the desired steps to program your robot for accomplishing the task in 4a. Include procedures that show activities based on sensor inputs. Place this in your robot engineering notebook. Test your robot and record the results in your robot engineering notebook. Include suggestions on how you could improve your robot, as well as pictures or sketches of your finished robot.

9 Robotics Merit Badge – Engineer’s Notebook
Why do we keep one? The purpose of an Engineering Notebook is to document in written form the efforts of its author on one or more projects in a time-sequential form. It is the equivalent of a technical diary. It is used to record your progress, ideas, notes, sketches, questions, and thoughts. It is your evidence of the work you have completed.

10 Robotics Merit Badge – Engineer’s Notebook

11 Robotics Merit Badge – Demonstrate / Competitions
Robotics MB Req #5/6 Do ONE of the following. Attend a robotics competition and report to your counselor what you saw and learned about the competition and how teams are organized and managed. Learn about three youth robotics competitions. Tell your counselor about these, including the type of competition, time commitment, age of the participants, and how many teams are involved.

12 Robotics Merit Badge – Youth Competitions
FIRST Robotics Competition - The FIRST Robotics Competition is an exciting, nationwide competition that teams professionals and young people to solve an engineering design problem in an intense and competitive way. Botball Robotics - The Botball Robotics Competition gives young people the opportunity to design, build, and program their own autonomous mobile robots to compete against other teams regionally and nationally. VEX Robotics - The VEX Robotics Competition provides a challenging, affordable and accessible opportunity for students to design, build and program robots to compete in exciting tournaments throughout the United States and the world. National Underwater Robotics Challenge - The mission of the National Underwater Robotics Challenge is to bring science and technology educational opportunities to students of all ages across the country. Best Robotics - BEST Robotics aims to inspire students to pursue careers in engineering, science, and technology through participation in a sports-like, science- and engineering-based robotics competition.

13

14 Part II Gobbit Assembly
SCOUTBOTICS Part II Gobbit Assembly

15 Robotics Merit Badge Requirements
Scouts during this section please complete the Engineering Workbook pages: 4a: Choose Robot Task 4b: Design Your Robot 4c: Build Your Robot

16 “RedBoard” / Arduino Uno Ardumoto Motor Driver Shield
Gobbit Overview Let’s look over your robot kit before we start building … Battery Pack QTR-8RC Sensor array Ball Caster Switch “RedBoard” / Arduino Uno Ardumoto Motor Driver Shield Jumper Wires Upper Deck Lower Deck Velcro Small Open End Plate Gear Motors Motor Brackets Wheels

17 Gobbit Overview Examine the electronic components in the kit …
Sparkfun Redboard Arduino UNO R3 Clone (brains of the robot listens to sensors and commands motor driver) Ardumoto Motor Driver (brain commands this to speed up or slow down the 2 DC gearmotors enough to steer the robot and sensor over the line to maintain sensor feedback of the line centered under the sensor) Pololu QTR-8RC RC Reflectance Sensor Array (line sensor reads light reflections to detect where a dark line is on a light background, then tells the brain what parts of the sensor the line is under)

18 Gobbit Overview When building and programming your robot know which end is the front, and which sides are the left, and the right … Front Left Right Back

19 Gobbit Overview …Double check your wiring diagrams match your hardware… …and always follow the instruction sheets when building and wiring your robot.

20 Gobbit Overview Useful Links: Further information and help:
Gobbit Assembly - BSA Course Examples (03/25/2017) - Further information and help: Gobbit Assembly, Wiring, Arduino IDE installation, Add-on Features, files, Projects, and Program video examples including the BSA Course - Replacement parts, additional sensors, and other fun devices to build onto your robot

21

22 Part III Gobbit Testing
SCOUTBOTICS Part III Gobbit Testing

23 Scoutbotics Robot Testing
Complete each step in order before you go on to the next. If you have questions, first discuss with your buddy, then ask a STEM Guide or instructor. Make a drawing of your robot in your Engineering Notebook. Label the Power Switch, the Arduino board, and the USB connector (part of the Arduino board). This section adopted from a deck created by Zagros Robotics on November 3, 2016

24 Before Programing: Check your Robot
Let’s look over your Robot before we start programming: Look at the drawing you made of your robot in your Engineering Notebook. Where is the front of your robot? Which is your Left and Right Motor? Tip: The QTR sensor is in the front of the robot, and the ball caster is at the back. The most common error is incorrect or poorly seated wiring. Check your Robot with the proper wiring diagram that matches your motor shield to make sure your Robot is wired correctly.

25 Arduino IDE Setup What is Arduino?
Arduino is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs - light on a sensor, a finger on a button, or a Twitter message - and turn it into an output - activating a motor, turning on an LED, publishing something online. The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. It runs on Windows, Mac OS X, and Linux. The environment is written in Java and based on Processing and other open-source software. This software can be used with any Arduino board. The Arduino Software (IDE) allows you to write programs and upload them to your board.

26 Why Arduino? Inexpensive - Arduino boards are relatively inexpensive compared to other microcontroller platforms. Cross-platform - The Arduino Software (IDE) runs on Windows, Macintosh OSX, and Linux operating systems. Simple, clear programming environment - The Arduino Software (IDE) is easy-to-use for beginners, yet flexible enough for advanced users to take advantage of as well. Open source and extensible software - The Arduino software is published as open source tools, available for extension by experienced programmers. Open source and extensible hardware - The plans of the Arduino boards are published under a Creative Commons license, so experienced circuit designers can make their own version of the module, extending it and improving it.

27 Knowing your Files Watch the installation Video: Installing Arduino IDE, Redboard, and Gobbit Line Command library 1. Make sure your computer is loaded with the Arduino IDE.   Download the Arduino Software from: 3. Connect the USB Cable between your RedBoard Arduino and the computer. The FTDI VCP drivers (Virtual COM Port) for the RedBoard should automatically install when the Redboard is plugged into your computer. If not, the FTDI will need to be downloaded to your PC. Run the FTDI driver setup executable file.

28 Test the Installation 4. Run the Arduino IDE from your new desktop icon. Check your Board: Open a basic Arduino program. From the menu bar, select File>Examples>Basics>Blink

29 Test the Installation cont…
Set your board type. From the menu bar, select Tools>Board>Arduino Uno

30 Test the Installation cont…
6. Set your Serial Port. From the Menu bar, select Tools>Serial Port>COM(some number) Usually, if there is more than one listed, the correct COM port number will be the highest numbered port. However, a simple test is to unplug your RedBoard while watching the list of ports, and note which one disappears. Make sure to plug the board back in and select its port. If you are unable to select a Port then the FTDI VCP drivers are not installed

31 Test the Installation cont…
7. Click on the “Upload” icon Near the bottom of the window, the status bar will say “Compiling Sketch,” then “Uploading…,” then “Done uploading” if it was a success. While it is uploading, there should be some LED’s flickering on the RedBoard. When it is done uploading, the LED near digital pin 13 should be blinking slowly if it was successfully programmed. Look at the code in the sketch. Can you see how the blink speed is set? Change the code to make it blink twice as fast. Upload and try it out. Unplug your Arduino from the laptop. Use the power button to turn your robot off and on. Does the LED start blinking again when the power comes back on? You should now have a functioning Arduino IDE with RedBoard communication.

32 Troubleshooting: Redboard Attempt these before asking for help
Don’t see the Arduino Uno Board or any Board Verify that the board is installed Check connection of your Mini B Cable to the RedBoard: disconnect and reconnect to make sure it cable is pushed in completely into the Board. Verify the correct Com Port is selected. Don’t see a COM Port or Unable to select. Check connection of your Mini B Cable to the RedBoard: disconnect and reconnect to make sure it cable is pushed in completely into the Board. Verify the correct Com Port is selected. FTDI VCP Drivers are not installed #13 Light does not blink Check connection of your Mini B Cable to the RedBoard: disconnect and reconnect to make sure it cable is pushed in completely into the Board. Verify the correct Com Port is selected.

33 Installing the Libraries
8. Check to make sure the following Libraries are installed: GobbitLineCommand v0.0.95 9. Go To Sketch > Included Library > Manage Libraries

34 Installing Libraries Cont.
Under Library Manager, search for the libraries needed. If the library is already installed, it should display and say next to the name and version. If it is not installed, click on the description of the library, then click on the right. If it already says make sure you have the current version by clicking on the description of the library, and then click the button if it is present on the right. Search for the GobbitLineCommand. If it is installed, the GobbitLineCommand Library should display and show

35 Open the Libraries Once all three Libraries are installed:
Go to the File Menu> Examples > GobbitLineCommand. Here you will find all of the example sketches you will need to test your Gobbit Motors, QTR Sensor, install the Basic Line following program, and other examples of additional functions that can be used to program your robot. NOTE: Some of the examples included under the GobbitLineCommand library are for use with the Gobbit Gripper feature or other modifications. Read the comments in the beginning of the sketch that explain how it is intended.

36 Test Motors and Wiring with Serial Monitor
Review your drawing in your Engineering Notebook of your robot’s right/left and front/back sides and what should be the proper forward and backward rotation of the wheels TIP : The ball caster is in the back of the robot and the sensor is in the front. Set your robot on end or prop it with the wheels just off the ground 13. From within the Arduino IDE examples, use the File menu> Examples> GobbitLineCommand> MotorDirTest 14. Read the beginning section of the sketch and uncomment the proper Motor Driver for your Robot Kit. 15. Make sure your robot and computer are plugged into the USB cable, your COM port is correct, then Upload the sketch. 16. Open the Serial Monitor from the menu Tools>Serial Monitor, or use Control+Shift+M to open. The baud rate (in the bottom right corner) should still be at

37 Test Motors and Wiring with Serial Monitor cont…
17. Set your robot on end or prop it with the wheels just off the ground. You will need the USB cable to stay connected for this step, so you don’t want your robot to roll away or fall off the table. Within the serial monitor, follow the menus to test the motors individually first (l or r). Enter the command letter in the prompt at the top of the monitor window and hit either enter or the send button on the right. a. If the wrong motor moves, swap the Ardumoto A1-A2 terminal wires with the B3-B4. b. If the correct motor moves, but the wrong direction, swap the black and red motor wires at the Ardumoto A or B terminals for just that motor. c. Re-test individual motors after any wiring changes and make any additional needed wiring changes. d. After the individual motors appear to run correctly, run the test for both motors to confirm individual setup is correct. TIP : If you are having trouble, there is a link to a video of this test noted in the beginning comments of the example sketch.

38 Troubleshooting the Motors
Wrong Motor moves or moves in opposite direction: Check motor connections to the Ardumoto or Motor Shield Did you set the proper motor driver in the test program? Check your Robot with the proper wiring diagram that matches your motor shield to make sure your Robot is wired correctly. Motors do not move: Open robot and check wiring: verify wires are not loose or pinched during assembly

39 Test the QTR line sensor and Wiring with Serial Monitor
On one of the drawings you made in your Engineering Notebook, label the reflectance sensor array. There are eight small LEDs along the bar matched with eight light sensors to measure the reflected light. Can you see light from the LEDs? Look at the array with a cell phone camera. Now can you see the lights? Note: The reflectance array works with infrared (IR) light. 18. From within the Arduino IDE examples, use the File menu>Example>GobbitLineCommand> QTRTest 19. Read the beginning section of the sketch and uncomment the proper Motor Driver for your Robot Kit. 20. Make sure your robot and computer are plugged into the USB cable, your COM port is correct, then Upload the sketch. 21. Open the Serial Monitor from the menu Tools > Serial Monitor or Control+Shift+M. The baud rate should still be at

40 Test the QTR line sensor and Wiring with Serial Monitor cont…
22. Stand the robot up on end, with the sensor facing away from you so the left and right perspective of the robot are the same as your left and right, and pass your finger or a large pencil/pen/marker near the sensors. If it is wired correctly, the readout should show “XX” at a sensor that is seeing little reflection, such as a dark line or open space, and “___” where it sees a bright reflection, such as your finger or white paper. It will also display “—” where it is seeing somewhere between no reflection and a lot of reflection. a. The display should match left/right with the left/right of the sensors you are covering. If they are opposite, you will need to change your wiring. In this example, my finger was covering the 3rd and 4th sensor from the left. b. If some of the sensors do not change, and only show “XX” they may be either unplugged or non functional. Check your wiring for loose connections and your solder joints on the sensor. TIP : If you are having trouble, there is a link to a video of this test noted in the beginning comments of the example sketch.

41 Troubleshooting the Sensor
Nothing happens when performing the Sensor Test or the result is out of order Check sensor connections: make sure all jumper wires are pushed in completely and no wires were pinched during assembly Did you set the proper motor driver in the test program? Look for simple first. Does your Robot have power? Is your sensor correctly wired? Check your Robot with the proper wiring diagram that matches your motor shield to make sure your Robot is wired correctly.

42 Upload and Run the Line Follower Sketch
23. From within the Arduino IDE examples, use the File menu> Example> GobbitLineCommand> GLC_BasicLine 24. Read the beginning section of the sketch and uncomment the proper Motor Driver for your Robot Kit. 25. Make sure your robot and computer are plugged in to the USB cable, your COM port is correct, then Upload the sketch. 26. Set your robot on your lined course and turn it on. You should see the robot turn back and forth over the line as it calibrates its sensors, then begin following. TIP : If the robot is following very slowly or roughly, you should try turning it off, make sure to place it back on the line all the way, and turn it on again to get a better calibration. The line sensor is using light and its reflection from the environment to make readings. Sometimes varying lighting in the room, direct sunlight, or even your own shadow can affect the calibration enough that the robot does not get good sensor readings. Moving your course to a location with more even lighting, or sometimes just recalibrating, can make a big difference in performance. You should make note of any observations of this kind in your notebook.

43 Troubleshooting the Line Follower
Error Uploading the Line Follower sketch Make sure you have the correct COM Port Selected Check connection of your Mini B Cable to the RedBoard: disconnect and reconnect. Make sure it cable is pushed in completely into the Board. Verify the correct Com Port is selected Verify that all the example files are installed. Robot Does nothing when turned on: Check connection from our battery to switch to board. Red to positive, and Black to Negative. Check your batteries – are they new? Are they installed correctly into the battery box? Robot just spins in a circles or does not find the line: Check over your robot. Are the pins from the Ardumoto and Redboard seated correctly? Is your robot wired correctly – QTRsensor to Ardumoto, motors to Ardumoto, Battery to Switch to Ardumoto? Did you set the proper motor driver in the program? Verify no wires are pinched or became loose during assembly.

44

45 Part VI Gobbit Programming
SCOUTBOTICS Part VI Gobbit Programming

46 Robotics Merit Badge Requirements
Scouts during this section please complete the Engineering Workbook pages: 4d: Design and program flow chart and Program your robot 4e: Test and refine your program Make Sure your Merit Badge Cards are signed before leaving your room

47 Start Programming Gobbit
From the Arudino IDE Open File->Examples->GobbitLineCommand->ScoutBotics->Level_1->BSA_Course This example will drive straight through all the intersections eventually getting Gobbit from the start line to the finish line. There are faster routes through the playing field. Change the program to follow the path of your choice. Read the beginning section of the sketch and uncomment the proper Motor Driver for your Robot Kit. The GobbitLineCommand toolbox has support for following lines, turning corners, driving without the line and finding the line once lost.

48 GobbitLineCommand Library Functions Useful in this event
// Run a calibration of the line sensor by sweeping back and forth // over a line at the called speed between // Speed can be blank or 0 or a positive value // blank () or (0) will load the default values based upon voltage if declared. void calibrateLineSensor(int calSpeed) Examples: MyBot.calibrateLineSensor(); // Run the calibration at preset power MyBot.calibrateLineSensor(0); // Run the calibration at preset power MyBot.calibrateLineSensor(90); // Run the calibration at 90% power

49 GobbitLineCommand Library Functions Useful in this event (cont.)
// Drive will start driving/following the line and continue following // until it is able to complete the requested direction at the next // found intersection or end. If it cannot make the requested // direction, it will spin around fast and stop performing all other commands. // Turn direction value of ('L')eft, ('R')ight, ('F')orward, ('S')top, // or ('U')turn. // The U-turn will be evaluated by the found intersection turns available to // achieve a 180 degree turn. void drive(char turn) Examples: MyBot.drive('F'); MyBot.drive('L'); MyBot.drive('R'); MyBot.drive('S');

50 GobbitLineCommand Library Functions Useful in this event (cont.)
// Turns the robot using the line sensor on a lined course. // Uses the 'turnSpeedHigh' and 'turnSpeedLow' motor values while turning. // Turn direction values of ('L')eft, ('R')ight, or ('U')turn // Left turns left until the next line is found, regardless of 90 or 180 degree. // Right turns right until the next line is found, regardless of 90 or 180 degree. // U-turn turns left and assumes a 180 degree turn is requested where one line is // to be passed then stop at next. This is actually the same as running two // turn('L') commands, therefore, if there was no line at 90 degree to the left, // the turn will pass the 180 mark and stop at the next line, wherever it may be. // If that was the case, a single Left or Right turn request would have been // better. void turn(char turnDir) Examples: MyBot.turn(‘L'); MyBot.turn(‘R');

51 GobbitLineCommand Library Functions Useful in this event (cont.)
// Follow the line in called Mode: // Mode 0, along the line and never exit so it will not do anything else outside // of the function. // Mode 1, do 1 thing... run through the followLine function one time and make // only one motor adjustment then exit. // Mode 2, do 2 things... run through the followLine function one time and make // only one motor adjustment while checking if an intersection is // present then exit. // Mode 3, follow along the line until an intersection is found, update // intersection turn flags, then exit. void followLine(byte followMode) Examples: MyBot.followLine(0);

52 GobbitLineCommand Library Functions Useful in this event (cont.)
// Catch the Line by calling detectLine('A') until any sensor sees the line, // then calling followLine(1) enough times to align the robot with the line. // This assumes there was already some move or other motor command prior that // has the robot moving towards a line. // The function does not exit until it has caught the line. void catchLine(void) Examples: MyBot.catchLine();

53 GobbitLineCommand Library Functions Useful in this event (cont.)
// Detect if a line is found in the called part of the QTR sensor, then return a // byte of 1 if found, 0 if not. // Sensor location value of far ('L')eft, far ('R')ight, the two in ('C')enter, // or ('A')ny sensor. byte detectLine(char sensorLRCA) Examples: byte isItFound6 = MyBot.detectLine('L')

54 GobbitLineCommand Library Functions Useful in this event (cont.)
// Simple moves without any line following. Typically used with delay // statements as sensorless control. // First float value is the Speed/Velocity, value of -100 to 100. // moveSpeed = reverse full speed // = forward full speed // = stopped; // Second float value is the Turn, value of -100 to 100. // moveTurn = full left // = full right // = straight void move(float moveSpeed, float moveTurn) Examples: MyBot.move(80,65); // move forward at 80% speed and turn to the right MyBot.move(0,0); // stop the robot

55 GobbitLineCommand Library Functions Useful in this event (cont.)
// Set the speed and direction of the motors for both motor // shield/driver types. // Receives Left motor velocity/speed, Right motor velocity/speed. // Both are float values: // full reverse // full forward // 0 stopped void setMotors(float leftVelocity, float rightVelocity) Examples: MyBot.setMotors(100, 100);

56 GobbitLineCommand Library Functions Useful in this event (cont)
// These variables are byte "flags" to indicate if the robot has seen a line to the // left, forward (straight ahead), or right. Also "flags" to indicate if an // end or if a marker was found. // 1 if found // 0 if not found // Calling the drive (not when drive('S')), move, turn, and backup will reset // the flags. byte isItFound1 = MyBot.foundLeft; byte isItFound2 = MyBot.foundRight; byte isItFound3 = MyBot.foundForward; byte isItFound4 = MyBot.foundEnd; byte isItFound5 = MyBot.foundMark; Examples: if(MyBot.foundForward){…} if(MyBot.foundLeft){…}


Download ppt "Introduction Level Gobbit Assembly and Programming"

Similar presentations


Ads by Google