Upload
others
View
3
Download
0
Embed Size (px)
Citation preview
1. LEGO Mindstorms
=> Instructions within LEGO Mindstorms software
2. Riley Rover
https://www.damienkee.com/rileyrover-ev3-classroom-robot-design/
3. Robocoaster
Build OptionsTuesday, 18 June 2019 11:47 AM
Robotics Challenge Page 1
https://docs.wixstatic.com/ugd/ecb80d_778397542a974d57b2fe94cc3ebdad9d.pdf
ecb80d_778397542a...
4. QUICK BUILD
http://www.damienkee.com/workshop-ev3-quick-build/
DamienKee_Quickbuild
Robotics Challenge Page 2
DamienKee_Quickbuild
5. Tommabot
https://robocupjunior.org.au/sites/default/files/Soccer/Tommabot%20Instructions.pdf
TommabotInstructions
6. YayaBot
From <http://www.drgraeme.org/Dr/EV3G10.html>
Robotics Challenge Page 3
Robotics Challenge Page 4
BasicsTuesday, 18 June 2019 12:03 PM
Robotics Challenge Page 5
Robotics Challenge Page 6
Robotics Challenge Page 7
Robotics Challenge Page 8
Robotics Challenge Page 9
Robotics Challenge Page 10
Robotics Challenge Page 11
- Investigate different ways of controlling a Driving Base, moving in a straight line
- Explain what each block does and how it works- Drive forward
Move Steering BlockThe Move Steering block can make your robot drive forward, backward, turn, or stop. You can adjust the steering to make your robot go straight, drive in arcs, or make tight turns.
Use the Move Steering block for robot vehicles that have two Large Motors, with one motor driving the left side of the vehicle and the other the right side. The Move Steering block will control both motors at the same time, to drive your vehicle in the direction that you choose.
InstructionsPlay the Straight Move tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=blocks%2FLEGO%2FMove.html
Straight MoveTuesday, 18 June 2019 12:03 PM
Robotics Challenge Page 12
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Move Tank Block
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=blocks%2FLEGO%2FMoveTank.html
The Move Tank block can make a robot drive forward, backward, turn, or stop. Use the Move Tank block for robot vehicles that have two Large Motors, with one motor driving the left side of the vehicle and the other the right side. You can make the two motors go at different speeds or in different directions to make your robot turn.
Instructions
=> Develop your algorithm for the challenge below, using the tank move block
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 13
- Use the Move Steering block to steer the Driving Base.- Explain how to steer a curve
- Steer a curve
InstructionsPlay the Curved Move tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
4/5 Recreate the program shown, then download and run to test.
Challenge 1
Add three more Move Steering blocks to your program so that it makes the Driving Base return to its starting position.
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Now with the Tank Move Block
InstructionsPlay the Tank Move tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Curved MoveTuesday, 18 June 2019 12:40 PM
Robotics Challenge Page 14
4/5 Recreate the program shown, then download and run to test.
Challenge 2
Add three more Tank Move blocks to your algorithm so that it makes the Driving Base return to its starting position.
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Extension Challenge
=> Develop your algorithm for the challenge below
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 15
Move Steering InputsTuesday, 18 June 2019 1:18 PM
Robotics Challenge Page 16
Robotics Challenge Page 17
- Use the Colour Sensor to stop the Driving Base when a line is detected.
- Explain how to use the colour sensor- Stop when a line is detected
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=editor%2fUsingSensors_Color.html
https://www.youtube.com/watch?v=aJToMY-3Mq4
Calibrate the Colour Sensor
InstructionsPlay the Stop at Line tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Colour Sensor: Stop at LineTuesday, 18 June 2019 1:07 PM
Robotics Challenge Page 18
ExplanationThe colour sensor compare block is just a modified wait block. Instead of a Time Indicator, we change it to a Colour Sensor that compares either the reflected light or the ambient light.
In the tutorial example, we are comparing the Reflected light. When the Colour Sensor is in Reflected Light Intensity mode, a red LED light on the front of the sensor will turn on. If the sensor is close to an object or surface, this red light will reflect off of the object and then enter the sensor to be detected. You can use this to measure shades of colour on a surface or object, because darker shades of colour will reflect less of the red light back to the sensor.
You can use this mode to, for example, make your robot follow a black line on a white surface. As the sensor passes over the black line, the light measurement will gradually decrease as the sensor gets closer to the black line. This can be used to tell how close the robot is to the line.
In Reflected Light Intensity mode, the Colour Sensor detects the intensity of light that enters the sensor. The intensity of the light is measured as a percentage from 0 to 100, with 0 being very dark, and 100 being very bright.
We then compare using standard mathematical operators:
4/5 Recreate the program shown, then download and run to test. Set the sensor threshold for best results.
Need help?
Robotics Challenge Page 19
Challenge 1
See if you can make the Colour Sensor detect a lighter-coloured line.
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 20
Robotics Challenge Page 21
- Use the Ultrasonic Sensor’s Wait for Change mode to detect proximity to an object
- Explain how to use the ultrasonic sensor- Stop when an object is detected
Reference:http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=editor%2fUsingSensors_Ultrasonic.html
https://www.youtube.com/watch?v=B49J93rSsTg
InstructionsPlay the Stop at Object tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Explanation
The Ultrasonic Sensor can measure the distance to an object in front of it. It does this by sending out sound waves and measu ring how long it takes the sound to reflect back to the sensor. The sound frequency is too high for you to hear (“ultrasonic”).
You can measure the distance to an object in either inches or centimetres. You could use this, for example, to make your robo t stop a certain distance from a wall.
The ultrasonic sensor compare block is just a modified wait block. Instead of a Time Indicator, we change it to an Ultrasonic Sensor that compares the distance in cm.
Ultrasonic Sensor: Stop at ObjectTuesday, 18 June 2019 1:48 PM
Robotics Challenge Page 22
We then compare using standard mathematical operators:
The Ultrasonic Sensor can give the following data:
Data Type Range Notes
Distance in Centimetres Numeric 0 to 255 Distance to object in centimetres.
Distance in Inches Numeric 0 to 100 Distance to object in inches.
Ultrasound Detected Logic True/False True if another ultrasonic sensor is detected.
Robotics Challenge Page 23
Ultrasound Detected Logic True/False True if another ultrasonic sensor is detected.
Start the program1.
Turn both motors on at speed 50.2.
Wait for the Ultrasonic sensor the detect and obstacle at a distance of less than 10 cm.3.
Turn both motors off.4.
4/5 Recreate the program shown, then download and run to test. Set the sensor threshold for best results.
Challenge 1
Move the Cuboid farther away before running the program again. What happens?
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 24
- Use the Gyro Sensor to navigate the Driving Base through a 45-degree turn.
- Explain how to use the Gyro sensor- Make a 45-degree turn.
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=editor%2FUsingSensors_Gyro.html
https://www.youtube.com/watch?v=mky8sVmpKzg
InstructionsPlay the Stop at Angle tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
ExplanationThe first block is the Tank Move block and this will make one wheel rotate at 40 power; and the robot will start to spin in one direction.
The second block is a modified wait block that is set to sense a change in angle.
The Gyro Sensor detects rotational motion. If you rotate the Gyro Sensor in the direction of the arrows on the case of the sensor, the sensor can detect the rate of rotation in degrees per second. You can use the rotation rate to detect, for example, when a part of your robot is turning, or when your robot is falling over.
In addition, the Gyro Sensor keeps track of the total rotation angle in degrees. You can use this rotation angle to detect, for example, how far your robot has turned.
The Gyro Sensor can give the following data:
Data Type Notes
Angle Numeric Rotation angle in degrees.Measured from the last reset. Reset with the Reset mode of the Gyro
Gyro Sensor: Stop at AngleTuesday, 18 June 2019 1:48 PM
Robotics Challenge Page 25
Measured from the last reset. Reset with the Reset mode of the Gyro Sensor block.Rate Numeric Rotation rate in degrees per second.
So, the wait block says, wait or keep the move block spinning until the robot has spun 45 degrees.
4/5 Recreate the program shown, then download and run to test. Set the sensor threshold for best results.
Challenge 1
Make the Driving Base turn 90 degrees.
Tips:
Program Accurate 90 Degree Turns with the EV3 Gyro Sensor
From <https://www.youtube.com/watch?v=8B1LwzkLKXs>
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Extension Challenge
Robotics Challenge Page 26
Extension Challenge
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 27
Beyond the BasicsWednesday, 19 June 2019 9:02 AM
Robotics Challenge Page 28
- Use multitasking to move the Driving Base and play a sound at the same time.
- Explain how the multitasking block works- Perform a series of actions at the same time
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=editor%2fCreatingPrograms.html
InstructionsPlay the multitasking tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Explanation
You can run more than one set of tasks simultaneously. For example, you might have one sequence of Programming Blocks controlling the robot’s forward motion, and a second sequence of Programming Blocks controlling the robotic arm on top of the robot.
You can create a parallel sequence by dragging a new Sequence Wire from the Sequence Plug Exit of the Programming Block before the parallel sequence
Recreate the program shown below, then download and run to test. Set the sensor threshold for best results.
MultitaskingWednesday, 19 June 2019 9:36 AM
Robotics Challenge Page 29
Challenge 1
Add blocks to the program that will make the Driving Base move backwards while playing the [Backing alert] sound.
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Challenge 2
Make your robot dance to music
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 30
Robotics Challenge Page 31
- Use the Loop block to repeat a series of actions.
- Explain how the loop block works- Repeat a series of actions.
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=blocks%2FLEGO%2FLoopCondition.html
InstructionsPlay the Loop tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Explanation
The Brick Status Light block turn the light on the top of the brick off or on with a choice of three colours
Status light is red
We then want the light to stay on for 2 seconds, so we can use a loop that will repeat for 2 seconds.
LoopsWednesday, 19 June 2019 9:02 AM
Robotics Challenge Page 32
Recreate the program shown below, then download and run to test. Set the sensor threshold for best results.
Challenge 1
Flash all three colours of the status light, twice
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Hint
Challenge 2
Robotics Challenge Page 33
Play a sound for 3 seconds, using a loop
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Extension Challenge
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Hints
1. Using Move Steering
2. Use the Gyro sensor to turn 90 degrees
Robotics Challenge Page 34
- Use the Switch block to make dynamic sensor-based decisions.
- Explain how the switch block works- Act on sensor-based decisions
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=blocks%2FLEGO%2FCaseSelector.html
InstructionsPlay the Loop tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Explanation
The Switch block is a container that can contain two or more sequences of programming blocks. Each sequence is called a Case. A test at the beginning of the Switch determines which Case will run. Only one Case will run each time the Switch is executed.
The Switch test shown here can decide which Case to run based on a sensor data value or a value from a Data Wire. After one Case is selected and run, the program continues with any blocks after the Switch.
SwitchWednesday, 19 June 2019 9:36 AM
Robotics Challenge Page 35
For our program, the switch block tests to see if the light intensity on the ground is less than 50 (from the light sensor). Ie. Is it white or light coloured. If it is, the robot turns to the left (towards the black line).
Motor C off, B on
Or right motor on
If it is not and the intensity is greater than 50 (darker), then it turns to the right, away from the line.
Motor B off, C on
Or left motor on
This then loops forever
Robotics Challenge Page 36
This then loops forever
NOTE: The simplest of line-following programs will be a dual-state program, where the colour sensor either sees black or white and adjusts accordingly. The robot is not actually trying to follow the line but is trying to find the edge of it.
Recreate the program shown below, then download and run to test. Set the sensor threshold for best results.
Hint
Robotics Challenge Page 37
Challenge 1
Test if your Driving Base works when following a lighter-coloured or Green line! If not, try setting the threshold again.
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Extension Challenge 1
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Hints
Robotics Challenge Page 38
Extension Challenge 1
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 39
- Program the Driving Base to move and turn when it detects different colours.
- Explain how the switch block works with more than one decision- Act on sensor-based decisions
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=blocks%2FLEGO%2FCaseSelector.html
InstructionsPlay the Loop tutorial within LEGO Mindstorms
3/5 Interactive Animation:
Predict and explain what these blocks do and how it works
Explanation
The Switch block is a container that can contain two or more sequences of programming blocks. Each sequence is called a Case. A test at the beginning of the Switch determines which Case will run. Only one Case will run each time the Switch is executed.
This program has 3 test cases, rather than the standard two.
When no colour is detected, it drives forward
Multiple SwitchWednesday, 19 June 2019 10:36 AM
Robotics Challenge Page 40
When blue is detected, it turns to the right
When yellow is detected, it turns to the left
Recreate the program shown below, then download and run to test. Set the sensor threshold for best results.
Challenge 1
Robotics Challenge Page 41
Challenge 1
Add a fourth case to make the motors stop when red is detected.
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 42
- Use the medium motor to raise and lower the robot arm
- Explain how the medium motor works- Move the Cuboid
Reference: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/ev3_user_guide.pdf#medium_motor
So far, we have used the large motors for driving the robot wheels. We can also use Medium motor to perform other actions, such as lifting and turning things.
Instructions
Build this base
Predict and explain what these blocks do and how it works
ExplanationThe medium motor lowers the arm; the robot moves forward; and then the arm raises
Medium Motor MovementWednesday, 19 June 2019 11:01 AM
Robotics Challenge Page 43
Recreate the program shown below, then download and run to test. Set the sensor threshold for best results.
Challenge 1
Try reversing and turning 90 degrees
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Extension Challenge 1
Robotics Challenge Page 44
Test your code. If it doesn’t work as expected, alter the parameters and try again until it does.
Robotics Challenge Page 45
Arena Design
need a circle 1200mm in diameter, 20mm thickness, with some feet so that it is raised 100mm from the ground. The Arena is painted black in the middle and 50mm white around the outside. The starting lines will need to be brown and placed as indicate below.
Diameter Arena Thickness Height Border Width Starting Line Length Starting Line Width Starting Line separation distance
1200mm 20mm 100mm 50mm 200mm 20mm 200mm
SumobotWednesday, 19 June 2019 1:10 PM
Robotics Challenge Page 46
Ruleshttps://robocupjunior.org.au/sites/default/files/RoboCup%20Junior%20South%20Australia%20sumo%20rules%202018.pdf
Robotics Challenge Page 47
Build
Use a Combination of these two builds.
gear-bot-bi-e1011649...https://le-www-live-s.legocdn.com/sc/media/lessons/mindstorms-ev3/ev3-dep/building%20instructions/gear-bot-bi-e1011649d42f190b289bebb8c1398010.pdf
Sumo Bot
Need the gear down advantage for 4 times the torque.
What is our Gear Ratio for the build below?
Want to know more?
Gears
Coding
Simple Robot Sumo Programming (no ultrasonic sensor)
From <https://www.autismcrc.com.au/educationresearch/node/33>
Sumo Bot Strategy 1Wednesday, 19 June 2019 11:16 AM
Robotics Challenge Page 48
From <https://www.autismcrc.com.au/educationresearch/node/33>
Robotics Challenge Page 49
Robotics Challenge Page 50
Robotics Challenge Page 51
Robotics Challenge Page 52
Build
Build Options
Strategies
Game Playing – Basic Strategy
There are two major tasks that your SumoBot will need to be able to do in order to be competitive.
Firstly it needs to be able to find the edge of the ring and then turn around. At a basic level if your Bot can continually drive forward to the edge of the ring and turn around you can enter the SumoBot competition
1.
Secondly it needs to search for the opponent and charge when the opponent is located, while still staying in the ring.
2.
1. Finding the edge of the ring
Algorithm for edge detection
Wait 5 sec
Stop motorsReverse motors at -50 for 1 rotationSpin around (motor B -100, motor C 100)
If sense colour that is less than 50 (white), then: [or >20]
Else it is black, so drive forward (motor B 100, motor C 100)
Using senor wait blocks: ●
Start the motors running. o
Wait until the colour sensor sees black. o
SumoBot Strategy 2Wednesday, 19 June 2019 1:13 PM
Robotics Challenge Page 53
If black, stop, reverse. ▪
If not black (white), move forward turning. ▪
Inside a loop use a switch that is conditional on the colour sensor. o
You can use the colour sensor in either colour model or reflected light intensity mode. In a switch, the top section is executed if the conditional statement is true. The bottom section is executed if the statement is false.
o
Using a loop and a switch:
Reference: https://www.youtube.com/watch?v=O5qfz6HPB_0&feature=youtu.be
Alternative
Reference: https://youtu.be/QAUhY6BJRY4?list=PLFd4sjeVCkV9hATGDPD6W_z7igg9fFCam
Reference: https://youtu.be/a1vGJDur6Os?list=PLFd4sjeVCkV9hATGDPD6W_z7igg9fFCam
Algorithm for edge and opponent detection
Wait 5 sec
Stop motorsReverse motors at -50 for 1 rotation
If sense colour that is less than 50 (white), then:
Robotics Challenge Page 54
Reverse motors at -50 for 1 rotationSpin around (motor B -100, motor C 100)
drive forward at opponent (motor B 100, motor C 100)If ultrasonic sensor detects object (distance < 20) then:
Else spin around slowly (motor B -25, motor C 25)
Else
The objective here is to find the opponent using a sensor such as the ultrasonic sensor then charge at the opponent while ensuring that your SumoBot still stays within the ring.
This requires nested switches inside a loop:
If no, then turn around. oIf yes then enter the second switch based on the ultrasonic sensor:oIn the second switch, if the opponent cannot be seen, turn in a circle at low speed looking for the opponent. If the opponent can be seen then charge full power.
o
Inside a loop you need a switch that is checking whether you are on the playing surface. ●
Take care when you turn the motors on, if you ask for a set number of revolutions or time, the execution will stop whilst the motors are turning. Setting the motors to ON, allows the execution to carry on, leaving the motors running.
Reference: https://www.youtube.com/watch?v=O5qfz6HPB_0&feature=youtu.be
Alternative 1
Robotics Challenge Page 55
Reference: https://youtu.be/GoOcdngDeYw
Alternative 2
Reference: https://www.youtube.com/watch?v=ZC2WVCtvtM8&feature=youtu.be
Robotics Challenge Page 56
Basic Program
Advanced Program
Use Strategy 2 and multi-task with medium motor with spinning arm
Build: Robocoaster, but with spinning attachment
Robocoaster
https://docs.wixstatic.com/ugd/ecb80d_778397542a974d57b2fe94cc3ebdad9d.pdf
ecb80d_778397542a...
SumoBot Strategy 3Wednesday, 19 June 2019 1:15 PM
Robotics Challenge Page 57
Robotics Challenge Page 58
From <https://www.ironreignrobotics.com/2016-04-12-sumo-tips/>
SumoBot Strategy 4Wednesday, 19 June 2019 1:13 PM
Robotics Challenge Page 59
Reference, Data Wires: http://localhost:58401/localizedMapping_B90BDB05-F70E-4B0B-8CEA-031DCF197215/en-GB/editor/page.html?Path=editor%2FDataWires.html
Robotics Challenge Page 60
Path=editor%2FDataWires.html
Robotics Challenge Page 61
Robotics Challenge Page 62
Robotics Challenge Page 63
http://www.sugobot.com/
https://www.lego.com/en-us/mindstorms/build-a-robot/track3r
SumoBot Strategy 5Wednesday, 19 June 2019 1:16 PM
Robotics Challenge Page 64