
Tutorial: Making It Move: Steering Command Brighton H.S Engineering By: Matthew Jourden 1. Build Bas Robot. See Build Manual in the Lego Core Set Kit for details or Build Instructions Base Robot File on Website 1. Two types of movement Linear Direction and Tank Method. Each has their advantages and disadvantages. We will experiment with both. a. Move Steering Command will apply the same power, time direction to both motors at the same time b. Move Tank Command will allow the user to control each motor independently from each other. I.E Power can be different from the Right and the Left Motors. 2. Open Lego Mindstorm EV3 Labview Software (From Desktop or Start Menu)> Create a New Program a. File > New Project > Program b. Select Wrench at the Top Left Corner next to Tab Program > This will Open Up the Project Settings Select Wrench c. Adjust the Following i. Project Title: Make It Move ii. Project Description: See Below d. Select Tab Program > This will navigate back to the program area > Double Click on Program Tab > Change the Name to Steering Tutorial e. Save Project (File > Save) > Change Name to Make It Move > Save to Student Directory f. Double Click on Program > Change the Name to Tutorial Steering Tabs should look as follows g. Add the Following Program Tabs 3. Command Code Tabs Data Operations Tab Sensors Tab (Red) Code Blocks Flow Control Tab (Yellow) that allow Variable (Orange) Code Blocks that and Mathematical Action Tab (Green) Code Blocks that has controls Sensors Calculations to be Code Blocks that Loops, If/Then used with other controls Motors, Statements, etc. codes blocks( I.E Sound, EV3 Screen, Etc. Sensors ) My Blocks Tab (Teal) Advanced Tab (Blue) Code Blocks that the user Code Blocks with advanced has created. User setup a functions (I.E File Data retrieval, series of code that equals Bluetooth connections, etc. only one block instead of multiple blocks Move Steering Movement 1. Click on the Action Tab (Green) at the bottom of the screen > Drag Move Steering Code Block (Looks like two motors w/ a steering wheel) on the work screen and connect to the Play button Steering Movement Options Overview Ports: Lists which Ports the Motors are wired too on the EV3 Brick Motor Control Options Controls how power will be applied to the motors thus Movement Options controlling how long the changes based on the On motors will turn for the Rotations Selections Off: Turns Motors off On for Seconds: Turns Motors on for a series of time On: Turns Motors On until user turns them off Steering and Power: See On Option for Details Brake/Coast Power: controls Option Steering: controlled amount of power Time: Set values 100 to -100. supplied to motors. duration Controls Direction of Values 100 to -100 motors Movement. Positive #’s=Forward will Positive #’s = Right Turns operate in U-Shape Direction Negative #’s= Reverse Continued on Next Page Negative #’s= Left Turns in U –Shape Direction Steering Continued On for Rotations: Controls how many times the motors will cycle through before turning off. On for Degrees: Controls how many degrees of rotation the motors will have. Brake/Coast Brake/Coast Steering and Option Option Power: See On Option for Details Steering and Rotations: Power: See On Number of times engine will run Option for Details Degrees of before turning Movement: Type off how many degrees motors will turn 2. Set the Motor Control to On for Seconds > Set the following below a. On for Seconds b. Steering = 0 c. 2 Seconds d. Brake at End = Brake 3. Attach your Lego Base Robot to your computer using the USB-MicroUSB Wire > Wait till the computer recognize the EV3 Brick 4. Upload Steering Tutorial Program to the EV3 Brick > Wait till the upload is complete > Detach the MicroUSB Wire from the EV3 Brick > Test the Steering Tutorial Program Making the Lego Robot Turn 5. Add a Wait Code Block from the Flow Tab (Orange) to the Right of the Steering Command > Set time to 2 Seconds (See Code Below). This will make the Lego Drive Base pause before carry out the next command. It is recommend to have any robot pause and sense their environment before immediately starting to move again. The Wait/Pause can vary depending the task being performed. NOTE: The Wait command can be controlled by a variety of sensors (I.E. The robot will pause until on the sensors conditions are either true or false) 6. Add another Action (Green Tab) > Move Steering Command to the Right of the Wait Command > Set the following a. On for Rotations b. Steering = 40 c. 3 Rotations d. Brake at End = Coast NOTE: Can calculate the distance of Rotation by the following method: 1. Measure the circumference of the wheel 2. Run one rotation forward 7. Attach the EV3 brick to the computer using the USB to MicroUSB Wire > Upload Program to Brick > Detach wire after upload is complete > Run the Program 8. Add the following set of Code Blocks 9. Attach the EV3 brick to the computer using the USB to MicroUSB Wire > Upload Program to Brick > Detach wire after upload is complete > Run the Program Adding a Start Button 1. Flow Control > Drag the Wait Command at the beginning of the program line as follows > Change the setting to Brick Buttons > Compare > Set button to 2 (Middle button) > State 1 (Pressed). Once the middle mouse button is pressed the program will run and begin moving the robot > Test the Program Press State = Pressed Brick Setting > Compare > Brick Button Choice Buttons > 2 2. Complete the Lab Report Steering Questions (Page 1 and 2) Tutorial: Making It Move: Tank Command 1. Two types of movement Linear Direction and Tank Method. Each has their advantages and disadvantages. We will experiment with both. 2. Open Lego Mindstorm EV3 Labview Software (From Desktop or Start Menu)> File > Open Project Make It Move 3. Select Tank Tutorial Tab 4. Tank Command allows the user to control each motor independently from each other, whereas the Move Steering Command controls both motors at the same time. Which allows the operator to self correct the robot if the motors that are running together start to sway off path, by adjusting one motor faster or slower than the other the operator can keep the robot moving in a correct path or make turns using shorter command. 5. Go to Action Tab (Green) > Drag and Drop Move Tank code block next to start button. Braking same as Move Steer Command Move Command has all of the same options as Move Steer Command. See Controls Power Tutorial Make It Move: Steering Right Motor Controls Power to the Left Motor 6. Write the Following Program to make the robot turn in an S formation Note: If Program becomes too long code can be split up and connected with wires Hold Left Mouse Key down on Wire Connection Holding Left Mouse Key > Drag Wire to wire Connection Point 7. Test the Program 8. Modify the Code a. Mark a Starting Spot on the Floor b. Modify the Code so the Robot Starts and Finishes at the same start spot c. Run Code 2 Times to Verify the Robot Starts and Finishes at the same spot NOTE: No New Code Should be Added Program 1: Steering and Tank Command Movement Create the a program that does the following (Note does not need to be in this order) May setup a course to move through for reference a. Select Project Make It Move > Tab Tank Assignment b. Add a start button from the brick c. Steering: Move Forward in a Straight Line for 6 inches d. Steering or Tank: Turn 45 Degrees to the Right in Shortest Distance (Hint: 1 Motor will have power of 0) e. Steering or Tank: Turn 90 Degrees to Left in Shortest Distance (Hint: 1 Motor will have power of 0) f. Steering: Reverse 12 inches and Play a Sound while backing up g. Make a U-Shape Move with the following Dimensions May Use i. On for Seconds ii. On for Rotations iii. On for Degrees h. Place a Wait between each movement Submission for Programs Email the following to [email protected] 1. EV3 Labview Code 2. Video Showing the Robot Completing the Tasks 3. Answer the following questions on Lab Report Program 2: Line Follow Select Project Make It Move > Tab Tank Assignment Write a Program that will follow the black taped line, keeping your robot centered on the line between the front forks, provided by the teacher. Have your Robot stop at the end of the tape. Use any combination of Steering and Tank Commands Submission for Programs Email the following to [email protected] 1. EV3 Labview Code 2. Video Showing the Robot Completing the Tasks 3. Answer the following questions on Lab Report 4. What type of Movement (s) commands did you use to follow the line? i. How many movements did you need to incorporate in your program? ii. How long did it take for your robot to complete the course? iii. How did you figure out how to keep your robot closest to the line Add Front Forks to Robot iv. Did you robot stray off the course? Program 3: Picture Draw 1. Select Project Make It Move > Tab Tank Assignment 2. Design a holder with the Medium Motor to your robot that will hold a predefined marker 3. Draw a picture that uses a minimum of 8 lines/arcs. Be sure the image is school appropriate. 4. Marker Must be Picked up and Replaced minimum of 1 time Submission for Programs Email the following to [email protected] 1.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages10 Page
-
File Size-