530 likes | 784 Views
Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008. Lawrence Technological University. Douglas G. Czinder IEEE SEM R&A Chairperson chair@semrobotics.org Professor Keith Bozin kbozin@greaybox.com CJ Chung, Ph.D. Associate Professor and Director of Robofest chung@LTU.edu.
E N D
Introduction to LEGO NXT robotics and Robot Sumo – Sept 20, 2008 Lawrence Technological University Douglas G. Czinder IEEE SEM R&A Chairperson chair@semrobotics.org Professor Keith Bozin kbozin@greaybox.com CJ Chung, Ph.D. Associate Professor and Director of Robofest chung@LTU.edu
This program is possible thanks to: • a grant from The Chrysler Foundation • the Southeastern Michigan Chapter of the IEEE Robotics & Automation Society
Workshop Schedule – Sept 20, 2008 • 9:30 – 10:00 Continental Breakfast (provided) • 10:00 – 10:20 Intro to Lego NXT & Robofest • 10:20 – 11:00 Basic NXTG programming • 11:00 - 11:15 Break • 11:15 - 12:30 Programming with Sensors • 12:30 - 1:30 Lunch (provided) • 1:30 - 2:15 Programming with Sensors (cont’d) • 2:15 – 2:30 Break • 2:30 – 3:00 Basic Sumo Program • 3:00 – 3:30 Improved Sumo Program • 3:30 – 4:00 Mini Competition
Introduction to Robotics • What is a true robot? • autonomous robot with an on board computer • Mechanical, electrical, and computational components • Six fundamental components of a robot • A brain or brains – computer • Body: physical chasses that holds other pieces • Actuators: motors, hydraulic pistons, pneumatics • Sensors • Power sources • Communication mechanism
What is Robofest? • 100% Autonomous • Affordable • Challenging: Unknown problem • No direct adult help allowed during the competition • Qualifiers and a World Championship • Various categories including Robot Sumo • Two divisions: • 5th – 9th grade: Jr. Division • 9th – 12th grade: Sr. Division
RoboSumo Push the other robot out of the Sumo ring
Why Sumo? • The most popular robot competition in the world • Integrator in Science Education – Math, Logic, Computers, Mechanics, and Physics • Good for rookie teams • Fun Motivator
Unknown Problem in Robofest Sumo • How to start is unknown • Need sensor(s) • Teams must bring a computer to program the unknown parts
Introduction to Lego NXT • Brain – RCX micro computer • Body: Lego Technic pieces • Actuators: up to 3 motors • Sensors: Light, Touch, Ultrasonic, Sound, etc. • Power source: 9V (six AA batteries or rechargeable battery pack) • Communication mechanism: USB or Blue Tooth
Introduction to “SB2 (Sumo Bot 2)” • Left motor: A • Right motor: C • Touch: 1 • Light: 3 • Ultra Sonic (distance): 4
Introduction to NXTG Programming • Please go through Getting Started and Software Overview after this class
First NXT program: Go forward for 2 sec. and stop • Let’s name the program first • Click on Go >> button • You’ll see a programming palette (canvas)
First NXT program using SB1: Go forward for 2 sec. and stop (2/3) • Click on Move button • Drag and drop the move block to the canvas
First NXT program using SB2: Go forward for 2 sec. and stop (3/3) • Change parameters for the Move • Port • Direction • Steering • Power • Duration • Next Action Block Configuration Panel
How to run your 1st program (2/2) • If “Found New Hardware” pops up, just follow the instruction • Click on “Download” button • Recommended to un-plug the cable from the Bot • Press the orange button 4 times (Turn on, My files, Software files, Run your program entitled go2stop)
How to rerun the program • Check the program name on the LCD • Press the orange button just once again
How to stop the program • Gray button
Do not forget: • Save your programs • Meaningful file (program) names • Use comments
2nd Program: ForwardBack • Go Forward 2 rotations • Wait 3 seconds, then • Backward 1 rotation
Go Forward 2 rotations, Wait 3 seconds then Backward 1 rotation – ForwardBack
Making Turns(Instructor Slide) • Turn left • Spin left • Face left • Objective • Challenge the students to think about how a turn is made • Two ways to turn using one motor (demonstrate by turning with your leg) • Demonstrate advantage of turning by spinning stop Left wheel Right wheel Left wheel Right wheel stop Left wheel Right wheel
Making Turns • Turn left • Spin left • Face left stop Left wheel Right wheel Left wheel Right wheel stop Left wheel Right wheel
Turn90Left – Using a Motor Block! • Forward 2 rotations, • Turn Left 90 Degrees, • and Forward 2 rotations
Forward 2 rotations, Turn Left 90 Degrees, and Forward 2 rotations – Turn90Left
14 cm Number of rotations needed? 21.98 / 17.27 = 1.2727 How do we make to turn 90 degrees? • Timer? • Trial errors • Let’s do the math!!! • Width of the robot: 14 cm • Diameter of the wheel: 5.5 cm • Perimeter of the wheel: 5.5 cm x pi = 17.27 Travel distance needed: (14 x 2 x pi) / 4 = 21.98 cm
Programming with Sensors • Programming with • Touch Sensor • Light Sensor • Ultrasonic Sensor • Repeat • Basic Sumo Program
Start-Touch • Wait until the touch sensor is pressed; • Then start the robot to go forward • Stop after a second
Start-Light • Locate the robot in the middle of the ring • Wait until the light sensor detects very bright (lantern) light • Then start the robot to go forward • Stop after a second
Stop-Touch • Go straight until the bumper is hit • then stop
Stop-Edge • Go straight until the white edge of the ring • Then stop
Loop • To repeat a sequence of code • Until • Elapsed time • Number of repetitions • Sensor condition is met • Logic becomes true • Forever
Make the robot move around in the ring – Basic Sumo (Sumo0) • Repeat the following forever: • Go forward until the edge • Backward slightly • Spin right
First Sumo Competition • Some matches • Ask students to list ideas to improve the Sumo robot
Improved Sumo Program • Improved Sumo program • Unknown Problem • Mini Competition • Tips and Ideas to improve your Robot!
Program for the Mini Competition Press “Shift” to connect parallel sequence beams
Ideas to improve your SumoBot • Improve (debug) your program! • Applying Theories learned in Physical Science • Mass, Newton’s laws • Friction • Gearing • Wheel size • Power level • Detecting the opponent (can be done later) • Touch sensor • US sensor(s)
Ideas to increase weight of your Robot • What is the max weight of each division? • Add more Lego technic pieces, if you have some at home • Add Coins, Used Batteries, or others – make a holder using cardboards • Put your team name on the robot. An idea: make a team flag
Ideas to increase friction of your Robot • Use rubber bands • Add more wheels later for Worlds
Gearing Ideas • Use gear train to increase gear ratio • Considering resources, this is not allowed for the school qualifier • The winner from the school qualifier may consider this idea later
Changing Wheels? • Using bigger wheels • Considering resources, this is not allowed for the school qualifier • The winner from the school qualifier may consider this idea later
Make sure the Power! • Default power level is 75% • Fully charge your battery!!! • How to check the voltage level? • See the icon on the LCD
Changing the shape of the Robot • Make it sturdy • Front part may need some changes (After the school qualifier)
Height of the robot matters? • Consider the “center of gravity”
Ideas using 2 Touch Sensors A touch sensor –front left Another touch sensor – front right • If left sensor is pressed – turn left and push hard • If right sensor is pressed – turn right and push hard • If both left and right sensors are pressed, push straight hard