You are previewing Building Robots with LEGO® Mindstorms® NXT.
O'Reilly logo
Building Robots with LEGO® Mindstorms® NXT

Book Description

The Ultimate Tool for MINDSTORMS Maniacs The new MINDSTORMS kit has been updated to include a programming brick, USB cable, RJ11-like cables, motors, and sensors. This book updates the robotics information to be compatible with the new set and to show how sound, sight, touch, and distance issues are now dealt with. The LEGO MINDSTORMS NXT and its predecessor, the LEGO MINDSTORMS Robotics Invention System (RIS), have been called "the most creative play system ever developed." This book unleashes the full power and potential of the tools, sensors, and components that make up LEGO MINDSTORMS NXT. It also provides a unique insight on newer studless building techniques as well as interfacing with the traditional studded beams. Some of the world's leading LEGO MINDSTORMS inventors share their knowledge and development secrets. You will discover an incredible range of ideas to inspire your next invention. This is the ultimate insider's look at LEGO MINDSTORMS NXT system and is the perfect book whether you build world-class competitive robots or just like to mess around for the fun of it. Featuring an introduction by astronaut Dan Barry and written by Dave Astolfo, Invited Member of the MINDSTORMS Developer Program and MINDSTORMS Community Partners (MCP) groups, and Mario and Guilio Ferrari, authors of the bestselling Building Robots with LEGO Mindstorms, this book covers: Understanding LEGO Geometry Playing with Gears Controlling Motors Reading Sensors What's New with the NXT? Building Strategies Programming the NXT Playing Sounds and Music Becoming Mobile Getting Pumped: Pneumatics Finding and Grabbing Objects Doing the Math Knowing Where You Are Classic Projects Building Robots Tha

Table of Contents

  1. Copyright
  2. Visit us at www.syngress.com
  3. Lead Author and Technical Editor
  4. Lead Authors
  5. Contributors
  6. Foreword Contributor
  7. Foreword
  8. Preface
  9. 1. Understanding LEGO® Geometry
    1. Introduction
    2. Expressing Sizes and Units
    3. Squaring the LEGO World: Vertical Bracing
    4. Tilting the LEGO World: Diagonal Bracing
    5. TECHNIC Liftarms: Angles Built In
    6. Summary
  10. 2. Playing with Gears
    1. Introduction
    2. Counting Teeth
    3. Gearing Up and Down
    4. Riding That Train: The Geartrain
    5. Worming Your Way: The Worm Gear
    6. Limiting Strength with the Clutch Gear
    7. Placing and Fitting Gears
    8. Using Pulleys, Belts, and Chains
      1. Pulleys and Belts
      2. Chains
    9. Making a Difference: The Differential
    10. Summary
  11. 3. Controlling Motors
    1. Introduction
    2. Pacing, Trotting, and Galloping
      1. Internals of NXT Servo Motor
    3. Mounting Motors
    4. Wiring Motors
      1. Using Power Function Motors with the NXT
    5. Controlling Power
      1. Detecting Motor Overload
      2. Braking the Motor
    6. Coupling Motors
    7. Summary
  12. 4. Reading Sensors
    1. Introduction
    2. Digital Sensor Ports with the I2C (Inter-Integrated Circuit) Interface
    3. The Touch Sensor
    4. The Light Sensor
      1. Measuring Reflected Light
      2. Line Following
    5. The Ultrasonic Sensor
      1. Proximity Detection
    6. The Servo Motor Encoder (Rotation Sensor)
    7. Sensor Tips and Tricks
      1. Emulating a Rotation Sensor
      2. Connecting Multiple Sensors to the Same Port—Multiplexing
    8. Other Sensors
      1. The Passive Infrared Sensor
      2. The Pressure Sensor
      3. The Acceleration Sensor
      4. The Compass Sensor
      5. The NXT-to-RCX Communication Bridge
      6. The Color Sensor
    9. Summary
  13. 5. What’s New with the NXT?
    1. Introduction
    2. Notable Enhancements
      1. Studless Construction
      2. Electrical Connectors
      3. Rechargeable Battery Pack
      4. Flash Memory
      5. Multiple Types of Sensors
    3. The NXT File System
      1. File-Handling Functions
      2. Using File Space Efficiently
    4. The LCD Screen
      1. Games
    5. Digital Interfaces and Bluetooth
      1. Bluetooth Communication
      2. A Surveillance Robot Using NXT and Bluetooth
      3. A Bluetooth-Based Remote Controller
      4. Spatial Motion Controllers
      5. I2C for Spatial Motion Controllers
    6. Future Possibilities
      1. An NXT Robot Controlled from a Web Server
      2. NXT Puppet Show
      3. GPS and the NXT
    7. Summary
  14. 6. Building Strategies
    1. Introduction
    2. Studless Building Techniques
    3. Maximizing Modularity
    4. Loading the Structure
    5. Putting It All Together: Chassis, Modularity, and Load
    6. Hybrid Robots: Using Studless and Studded LEGO Pieces
    7. Summary
  15. 7. Programming the NXT
    1. Introduction
    2. What Is the NXT Programmable Brick?
      1. MINDSTORMS: A Family of Programmable Bricks
    3. Introduction to Programming the NXT Brick
      1. How Does a Program Run?
      2. Using NXT-G
    4. Using RobotC
    5. Using Other Programming Languages
      1. Using NBC/NXC
      2. Using pbLUA
      3. Using LeJOS NXJ
      4. Using Other Programming Tools and Environments
    6. Code Samples
      1. Code Sample: A Simple Clock
      2. Code Sample: Following a Line
    7. Running Independent Tasks
    8. Summary
  16. 8. Playing Sounds and Music
    1. Introduction
    2. Communicating through Tones
    3. Playing Music
    4. Converting Sound and Music Files
      1. MIDI and MIDIBatch
      2. WAV2RSO
      3. The Sound Sensor
    5. Summary
  17. 9. Becoming Mobile
    1. Introduction
    2. Building the Simple Differential Drive
      1. Keeping a Straight Path
        1. Using Servo Motor Encoders to Go Straight
        2. Using Gears to Go Straight
        3. Using Casters to Go Straight
    3. Building a Skid-Steer Drive
    4. Building a Steering Drive
    5. Building a Synchro Drive
    6. Other Configurations
    7. Summary
  18. 10. Getting Pumped: Pneumatics
    1. Introduction
    2. Recalling Some Basic Science
    3. Pumps and Cylinders
    4. Controlling the Airflow
    5. Building Air Compressors
    6. Building a Pneumatic Engine
    7. Summary
  19. 11. Finding and Grabbing Objects
    1. Introduction
    2. Operating Hands and Grabbers
      1. Using Pneumatics to Drive Your Grabber
    3. Finding Objects
      1. Positioning the Grabber
    4. Distinguishing Objects and Obstacles
    5. Summary
  20. 12. Doing the Math
    1. Introduction
    2. Multiplying and Dividing
    3. Averaging Data
      1. Simple Averages
      2. Weighted Averages
    4. Using Interpolation
    5. Understanding Hysteresis
    6. Higher Math
    7. Summary
  21. 13. Knowing Where You Are
    1. Introduction
    2. Choosing Internal or External Guidance
    3. Looking for Landmarks: Absolute Positioning
      1. Following the Beam
    4. Map Matching Using Ultrasonic Sensor
    5. Combining Compass Sensor to Increase Precision
    6. Measuring Movement: Relative Positioning
    7. Measuring Movement: Acceleration Sensor
    8. Summary
  22. 14. Classic Projects
    1. Introduction
    2. Exploring Your Room
      1. Detecting Edges
      2. Variations on Obstacle Detection
    3. Following a Line
      1. Further Optimization of Line Following
    4. Summary
  23. 15. Building Robots That Walk
    1. Introduction
    2. The Theory behind Walking
    3. Building Legs
    4. Building a Four-Legged Robot
    5. Building a Six-Legged Steering Robot
    6. Designing Bipeds
      1. Interlacing Legs
      2. COG Shifting
      3. Making Bipeds Turn
    7. Summary
  24. 16. Robotic Animals
    1. Introduction
    2. Creating a Monkey
      1. Step 1: Center Motor Assembly
      2. Step 2: Shoulder Assembly
      3. Step 3: Shoulder/NXT Brick Bracing
      4. Step 4: Shoulder-to-Arms Support
      5. Step 5: Arm Motors
      6. Step 6: Monkey Fingers
      7. Step 7: NXT Brick Backbracing and Ultrasonic Sensor
      8. The Final Step: Wiring Your Monkey
    3. Programming Your Monkey
    4. Creating a Mouse
      1. Step 1: Mouse Frame and Motor Assembly
      2. Step 2: Castor Bottom
      3. Step 3: Tail Assembly
      4. Step 4: The Mouse Head Frame
      5. Step 5: Motorized Mouse Head Assembly
      6. Step 6: Mounting the Mouse Head to the Body
      7. Step 7: A Programming Example
    5. Creating Other Animals
    6. Summary
  25. 17. Solving a Maze
    1. Introduction
    2. Finding the Way Out
      1. Using the Left Side-Right Side Strategy
      2. Applying Other Strategies
    3. Building a Maze Runner
      1. Constructing the Maze Runner
      2. Programming the Runner
      3. Creating the Maze
    4. Building a Maze Solver
      1. Constructing the Maze Solver
      2. Programming the Solver
      3. Improving the Program
    5. Summary
  26. 18. Drawing and Writing
    1. Introduction
    2. Creating a Logo Turtle
      1. Building the Turtle
      2. Programming the Turtle
    3. Tape Writer
      1. Building the Writer
      2. Programming the Writer
      3. What to Write
    4. Further Suggestions
      1. Copying
      2. Emulating Handwriting
      3. Learning by Example
    5. Summary
  27. 19. Racing Against Time
    1. Introduction
    2. Hosting and Participating in Contests
    3. Optimizing Speed
      1. Drag Racing
    4. Combining Speed with Precision
      1. Line Following
      2. Wall Following
      3. Other Races
    5. Summary
  28. 20. Hand-to-Hand Combat
    1. Introduction
    2. Building a Robotic Sumo
      1. Setting the Rules
      2. Maximizing Strength and Traction
    3. Attack Strategies
      1. Finding the Enemy
      2. Using Speed
      3. Using a Transmission
      4. Other Sumo Tricks
    4. Getting Defensive
    5. Testing Your Sumo
    6. Summary
  29. 21. Searching for Precision
    1. Introduction
    2. Precise Positioning
    3. Shooting with Precision
    4. Fine Motor Skills of Your Robot
      1. Removing the Bricks
      2. Freeing the Magnets
    5. Fire Fighting in a Maze
    6. Playing Soccer
    7. Summary
  30. A. Resources
    1. Introduction
    2. Bibliography
    3. General Interest Sites
    4. Chapter 1 Understanding LEGO Geometry
    5. Chapter 2 Playing with Gears
    6. Chapter 3 Controlling Motors
    7. Chapter 4 Reading Sensors
    8. Chapter 5 What’s New with the NXT
    9. Chapter 6 Building Strategies
    10. Chapter 7 Programming the NXT
    11. Chapter 8 Playing Sounds and Music
    12. Chapter 9 Becoming Mobile
    13. Chapter 10 Getting Pumped: Pneumatics
    14. Chapter 11 Finding and Grabbing Objects
    15. Chapter 12 Doing the Math
    16. Chapter 13 Knowing Where You Are
    17. Chapter 14 Classic Projects
    18. Chapter 15 Building Robots That Walk
    19. Chapter 16 Robotic Animals
    20. Chapter 17 Solving a Maze
    21. Chapter 18 Drawing and Writing
    22. Chapter 19 Racing Against Time
    23. Chapter 20 Hand-to-Hand Combat
    24. Chapter 21 Searching for Precision
  31. B. Matching Distances
  32. C. Note Frequencies
  33. D. Math Cheat Sheet
    1. Sensors
    2. Averages
    3. Interpolation
    4. Gears, Wheels, and Navigation