+ All Categories
Home > Documents > ENGR-102 (Sections 30 and 33) Week 01: Introduction to...

ENGR-102 (Sections 30 and 33) Week 01: Introduction to...

Date post: 08-Jun-2018
Category:
Upload: vudan
View: 213 times
Download: 0 times
Share this document with a friend
25
ENGR-102 (Sections 30 and 33) Week 01: Introduction to NXT Robots and Programming Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author
Transcript

ENGR-102 (Sections 30 and 33)

Week 01: Introduction to NXT Robots and Programming

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Today’s Agenda

14:00 Role CallWelcoming RemarksForm teams of 4 students

14:15 Experiment 1: “Hello World” example* Text Display, Play Sound, Move motor

14:30 Experiment 2: Movement example* Move forward then backward* Zero-point turn and arc turn

15:00 Experiment 3: Sensors* Touch sensor* Ultrasonic sensor

15:30 Discussion Points, Lab Book

15:45 Adjourn

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Welcome to Drexel!• MEM Professor since August 2000• Director, Robotics Lab (street-level Bossone)• Advised teams who won design competitions• 5+ years of industry experience• Fellow at NASA, Office of Navy Research and Boeing• Served under POTUS at National Science Foundation• Email: [email protected]• Web: http://www.mem.drexel.edu/pauloh.html• TA: Robert Ellenberg ([email protected])

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

I am a Robotics Engineer

Prof. Paul Oh – Drexel University

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author``

What Do I (and Other Roboticists) Do?Robots designed for dull, dirty and/or dangerous work (Yesterday’s view)

Industrial Applications• Automobile: welding, painting

Cleaning and Maintenance• Roomba (over 6M unit sold)• Window washing• Nuclear Waste Disposal

Security and Emergency• Bomb disposal• Search-and-Rescue

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

What Do I (and Other Roboticists) Do?Broader Roles for Robots (Today and Tomorrow)

• Medical robotics (assistive surgery)• Super-strong: rehab and bionics• Personal robots for elderly• Eldercare robots• Mental Challenges (autism, Alzheimer)• Education robots• Distributed robotics • Micro robotics • Network/multimedia • Teleservice robots • Amusement robots • Intelligent transportation • Micro and nano mechatronics • Networked human-root systems • Robotic multi-media games

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Career OpportunitiesThink: Top 10 High-Tech Jobs did not exist 5 years ago!

Risk: Your knowledge may be outdated by the time you finished university!

Action: Observe the world around you – will there be a world without robots?

Frankfurt, 14. September 2010 - Since the beginning of 2010, the demand for industrial robots has been surging worldwide. “The trend towards automation which was stopped by the economic crisis in 2009, is continuing”, said Åke Lindqvist, IFR President, on the occasion of the publication of the study “World Robotics 2010 – Industrial Robots”, on Tuesday in Frankfurt. A strong recovery of worldwide robot installations in 2010 will result in an increase of about 27% or about 76,000 units. A further increase of about 10% per year on average will resume in the period between 2011 and 2013 attaining a level of more than 100,000 units in 2013.

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

In July, the heads of the Office of Management and Budget and the Office of Science and Technology Policy identified robotics as one of the Administration’s R&D priorities for the President’s FY2012 budget.

Robotics is an important technology because of its potential to advance national needs such as homeland security, defense, medicine, healthcare, space exploration, environmental monitoring and remediation, transportation, advanced manufacturing, logistics, services, and agriculture. Robotics is also nearing a tipping point in terms of its usefulness and versatility as technologies such as software, chips, and computer vision continue to improve

Computing Community Consortium (CCC) Roadmap: http://www.us-robotics.us

Ref: http://www.whitehouse.gov/administration/eop/ostp/blog?page=2

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Career OpportunitiesPragmatically Speaking:• Everyday products growing “intelligent” e.g. cars, microwaves, phones• Growing blur between product and service e.g. cell phone• Consumers are buying “systems”• Robotics are prime examples of systems• Robot engineers have the engineering training to design systems

Stanford DGC Vehicle Google Car Predator Aerial Robot

Where will the jobs be?• Robots will be as pervasive and common as the PC• Robots will impact every sector: medical, transportation, entertainment, sports• Starts from traditional sectors e.g. ME and EE (Pay: $50K+ annual for BS)• Specialized sectors e.g. medical robots (Pay: $100K+ annual for MS/PhD)• Growth from start-ups and IPO (think dot-com)

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Roadmap To Becoming a Roboticist (Before College)In schools:• Robot CompetitionsFIRST: http://www.usfirst.org/Botball: http://www.botball.org/

• Robot Clubs• Physics and Computer Science

Not Just for Boys!

Self-Teach:

• Make your own Robot (lots of books and kits)Ready to Build kits: LEGO NXT Kit ($280)Vex (Radio Shack)

• Build your own: Bookstores “Robot Builder’s Bonanza”

• Magazines e.g. Robot Magazine, ServoCopyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Roadmap To Becoming a Roboticist (College)Select a Major

• Few schools have undergraduate majors in robotics• Robotics typically is a specialization• Select mechanical or electrical engineering• Select computer science• Most universities with engineering college do something in robotics

Schools with dedicated or strong undergraduate robotics program:

• CMU, Georgia Tech, WPI (only school with dedicated undergraduate degree)

Schools with strong robotics programs (typically graduate school):Broad Range of Areas• UPenn• MIT• CMU• U Maryland• Georgia Tech

Medical Robotics• Johns Hopkins• Rice• U Washington• Columbia

Transportation• Stanford, Berkeley• Ohio State• U Michigan

Drexel: MEM Professors Paul Oh (UAVs, Humanoids), Ani Hsieh (Multi-robots, Swarms), James Tangorra (Bio-inspired and underwater)

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Take Home Messages• Robots will co-exist with us. Who will design and build them? You can!• Robot Design is fun – a life-long career and passion• Robot business is still in infancy – lots of opportunities!• Can get started today – lots of kits, books, online and in school (e.g. FIRST)• College: Mechanical or Electrical Engineering, or Computer Science• Salaries: trends follow engineering profession but can grow significantly

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Experiment 1: “Hello World”

Goal: Write, compile, and download code to ping NXT

Preamble: Robots are “programmable computers”. They consist of actuators(to move) and sensors (to react) i.e. Cognition, Action and Perception

• Programming Language (i.e. Cognition): low versus high-level• Humans instruct a robot through a program• Humans part: use human-readable text to prescribe instructions• Robot: computer can only understand 1’s and 0’s (i.e. binary)

You got to be kidding!

Human readable programming language e.g. C, BASIC, NXT G-Code, Matlab, LabVIEW

Programming Environment

Convert human language into binarycode (aka machine language)

Interpreter or Compiler

Downloader (both SW and HW)

Transfer binary code to robot: SW times the transfer while HW uses some connection e.g. USB or Bluetooth

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Step 1: • Connect USB cable between Tribot and PC• Press Orange Button on NXT Brick• Launch Mindstorms software

Enter program name e.g. helloWorldClick “Go” button

Results in the Programming Environment:

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Step 2: • Click on “Display” block and drag to programming area

Step 3:

Programming Area

Blo

cks

• At pull-down menu, select “Text”

• Type “Hello World!” in text box• Make position of text on Line 2

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Step 4: • Save: Click File – Save – helloWorld.rbt (to desired folder)

• Ensure connection to NXT: Click “NXT Window”• Select USB if needed and click “Connect” and “Close”

Step 5: • Click “Download” (this is compile and download stage”• Click “Download and Run”

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

What Happened?

• Click “Timer” and Drag to programming areaStep 6:

• Pull-down menu: select “Time”• Change field to “5 seconds”

Step 7: • Save – Download and Run

Lesson: Program runs so quickly that need timer to delay and display text

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

1-1: Have NXT say “Good Job”. Hint: Click “Complete Panel” to see more blocksFilename: helloWorld-GoodJob.rbt

1-2: Move NXT Motor “B” for 5 seconds. Hint: Use “Move” block, not “Motor” blockFilename: helloWorld-MotorTurn.rbt

Exercises: Write and execute following programs. Paste screen image in notebook

Click to see more blocks

“Move” block versus “Motor” block

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Experiment 2: Movement example (i.e. Action)

Goal: Program Tribot to translate and rotate

Step 1: • Start new program: Click “File – New”• Click “File – Save As” with filename: moveForward.rbt

Step 2: • Click “Motor” block and drag to programming area

• Port: Select “B” and “C”• Direction: Up arrow means forward• Steering: slide bar determines ratio of B to C. Middle means Tribot moves forward• Power: Set to 10% - this determines speed• Duration: Pull down menu set for “Seconds” and set for 3 seconds• Next Action: Select brake

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

What Happened?

• Save, Download and RunStep 3:

Step 4: • Change power to 75% and repeat Step 3

Step 5: • Create new program with filename: moveForwardBackward.rbt• Click and drag “Move” block and set for 3 rotations

Move forward with 3 rotations

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Step 3: • Click and drag a second “Move” block• Set Direction to down arrow i.e. move backward• Set Duration to 2 rotations• Save, download and run

Exercise: Write and Execute program. Paste screen image in notebook

2-1: Move Tribot forward 24-inches and backward 12-inches. Hint: Wheel radius = 1”Filename: moveForwardBackwardMeasured.rbt

2-2: Perform zero-point turn for 3 secondsFilename: zeroPointTurn.rbt

2-3: Perform arc-turnFilename: arcTurn.rbt

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Experiment 3: Sensors (i.e. Perception)

Goal: Use sensors so robot can react to events

Step 1: • Start new program: Click “File – New”• Click “File – Save As” with filename: haltWhenTouched.rbt

Step 2: • Click “Motor” block and drag to programming area• Set to move straight and forward at 75%• Set Duration to “Unlimited”

Step 3: • Attach Touch Sensor to NXT on Port 1• Click “Touch” block and drag to programming area

Control: Pull down menu and set to “Sensor”Sensor: Pull down menu and set to “Touch Sensor”

Port: Select 1 (sensor plugged there)Action: Select “Pressed”

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Exercise: Write and execute programs. Paste screen image in notebook

3-1: Move forward indefinitely. When touch sensor triggered, reverse 12-inchesFilename: reverseWhenTouched.rbt

3-2: Attach ultrasonic sensor to Port 4. Move forward indefinitely but haltwhen Tribot is within 12-inches of an obstacleFilename: haltUltrasonic.rbt

• Save, Download and RunStep 4:

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Discussion PointsTake Home Points:

• Cognition through Programming: human-based language (e.g. NXT code), compile/interpret, download

• Action through Actuators: Enables robot to move e.g. motors (any others?)

• Perception through Sensors: Enables robot to react to events e.g. ultrasonicMany 3rd party ones: http://www.hitechnic.com/products

Pneumatic inchworm: http://technicbricks.blogspot.com/2008/04/week-techvideo-2008-16-pneumatic.html

Robots: A way to motivate programming; LEGO: rapidly build (complex) robots without a machine shop or electronics workbench.

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author

Discussion Points

Take Home Points:

• Understand and visualize output signals (hence function generator)• Question: Why only sine, square, ramp, triangle?• Hint: Fourier theorems, derivatives and integrals

• Measure signals (hence oscilloscope)• Question: What’s a transducer? • Hint: Oscilloscope only measures voltages

• Autoscale is nice feature but usually works for periodic signals

Copyright © by Paul Oh at Drexel University, 2011 – to be used by permission from author


Recommended