Robot Builder: The Beginner's Guide To Building Robots

Transcription

ROBOT BUILDERThe Beginner’s Guide to Building RobotsJohn Baichtal800 East 96th Street,Indianapolis, Indiana 46240 USA

iiRobot Builder: The Beginner’s Guide to Building RobotsRobot Builder: The Beginner’s Guide toBuilding RobotsEditor-in-ChiefGreg WiegandExecutive EditorCopyright 2015 by John BaichtalRick KughenAll rights reserved. No part of this book shall be reproduced, stored ina retrieval system, or transmitted by any means, electronic, mechanical,photocopying, recording, or otherwise, without written permission fromthe publisher. No patent liability is assumed with respect to the use ofthe information contained herein. Although every precaution has beentaken in the preparation of this book, the publisher and author assumeno responsibility for errors or omissions. Nor is any liability assumed fordamages resulting from the use of the information contained herein.Development EditorISBN-13: 978-0-7897-5149-2ISBN-10: 0-7897-5149-6Copy EditorLibrary of Congress Control Number: 2014944096Printed in the United States of AmericaFirst Printing: November 2014TrademarksAll terms mentioned in this book that are known to be trademarks orservice marks have been appropriately capitalized. Que Publishing cannotattest to the accuracy of this information. Use of a term in this book shouldnot be regarded as affecting the validity of any trademark or service mark.Ginny MunroeManaging EditorSandra SchroederProject EditorMandie FrankBarbara HachaIndexerErika MillenProofreaderAnne GoebelTechnical EditorPete ProdoehlEditorial AssistantKristin WattersonLEGO and MINDSTORMS are registered trademarks of The LEGO Group.DesignerWarning and DisclaimerMark ShirarEvery effort has been made to make this book as complete and as accurateas possible, but no warranty or fitness is implied. The information providedis on an “as is” basis. The author and the publisher shall have neitherliability nor responsibility to any person or entity with respect to any loss ordamages arising from the information contained in this book.CompositorSpecial SalesFor information about buying this title in bulk quantities, or for specialsales opportunities (which may include electronic versions; customcover designs; and content particular to your business, training goals,marketing focus, or branding interests), please contact our corporate salesdepartment at corpsales@pearsoned.com or (800) 382-3419.For government sales inquiries, please contact governmentsales@pearsoned.com.For questions about sales outside the U.S., please contact international@pearsoned.com.Studio Galou

Contents at a GlanceContents at a GlanceIntroduction xviiCHAPTER 1You, Robot BuilderCHAPTER 2Robots of the WorldCHAPTER 3Rolling RobotsCHAPTER 4Going SolarCHAPTER 5Controlling Your RobotCHAPTER 6Introduction to ProgrammingCHAPTER 7Harnessing InfraredCHAPTER 8Building SetsCHAPTER 9Robot-Builder’s Toolbox215383111161191CHAPTER 10 ManipulatorsCHAPTER 11 Water RobotsCHAPTER 12 Art Bots351Glossary385Index1283329391ONLINE:CHAPTER 13 Web-Interacting Robots247143iii

ivRobot Builder: The Beginner’s Guide to Building RobotsTable of ContentsINTRODUCTION xviiChapter 1What’s in This Book?xviiYou, Robot Builder1What Are Robots?2Myths About RobotsTypes of Robots4Anatomy of a RobotSafety479Build a Vibrobot10Pizza Saver Vibrobot11Computer Fan Buzzbot15Summary 19Chapter 2Robots of the WorldWatercolor BotSparki212223OpenROV 24Astro Droids25Drink-Making Unit26Mars Rover Replica27MindCub3r28Ball-Balancing Robot29LEGO Turing MachineSir Mix-a-BotArc-O-Matic303132Soft-Boiled Eggbot 33Legonardo 34Sisyphus 35Orbital Rendersphere36Clash of the Fractions37Lava Lamp Centrifuge38Quakescape 39InMoov40

Table of ContentsDIWire Bender41Plant-Watering RobotNerf Sentry Gun4243Yellow Drum MachinePancake Bot45Balloon Bot4644Piccolo: The Tiny CNC BotXylophone Bot48Flyer-Distributing RobotFlowerbot50CoolerBot514749Summary 52Chapter 3Rolling Robots53All About Motors54Choosing a MotorWheels5558Configuration 58Measurements 61Tires or Treads 61Project: DIY Wheels 65Parts List 66Step-by-Steps 67The Chassis70Use a Pre-Made Chassis70Make Your Own Chassis71Use a Building SetPowering Your Robot7272Batteries 73Solar Panels74House Current75Project: Building a Rolling RobotParts List77Step-by-Steps 78Summary 8176v

viRobot Builder: The Beginner’s Guide to Building RobotsChapter 4Going Solar83How Do Solar Panels Work?BEAM Robotics8485Three Hobbyist-Friendly Solar CellsFlexible Film8686Glass and Silicon87Plastic and Silicon88Prototyping Circuits89How to BreadboardHow to Solder9091Using Solar Power to Charge BatteriesProject: DIY Solar PanelParts List101102Step-by-Steps 103Project: Making a Solar SpinnerParts List106107Step-by-Steps 107Summary 109Chapter 5Controlling Your RobotAutonomous112Infrared112Internet113Radio ter 116Motor Control Options117Adafruit Motor Shield117Schmalzhaus EasyDriver118Makeblock Me Motor DriverControlling a Robot with RCTransmitter118119120Receiver 121Electronic Speed Controller 121100

Table of ContentsProject: Use an Arduino Uno to Control a RobotParts List123Step-by-Steps 125Programming the Arduino127Project Remix: Swapping Motor BoardsParts List130131Step-by-Steps 132Code140Summary 141Chapter 6Introduction to Programming143What Is Programming? 144DelayFor144144If/Else 144Loops and Interrupts145Switch/Case 145Variables145While Loops145The Arduino IDE146The Blink Sketch148Finding Code Examples149Adapting Example Code151Simple Debugging Using the Serial MonitorProgramming and Robotics BookshelfProject: Adding an Ultrasonic Sensor toYour Robot 154Parts List154Step-by-Steps 155Code157Summary 159Chapter 7Harnessing Infrared161Uses for Infrared Signals162Passive Versus Active IR163IR Remote Controls165152151123vii

viiiRobot Builder: The Beginner’s Guide to Building RobotsAdafruit Mini Remote Control165Sparkfun Infrared Remote Control166Makeblock Infrared Receiver and Remote ControllerMini Project: Discover Your Remote’s IR CodesParts List166167168Step-by-Steps 169Code169Project: Controlling a Robot with IR 169Parts List 169Step-by-Steps 170Code171Project: Dart SentryParts List173174Step-by-Steps 175Code187Operating the Dart Sentry189Summary 189Chapter 8Building Sets191Uses for Building Sets192Enclosures 192GantriesChassis193194Hardware Mounts195Furniture 196Examples of Building Sets 197Vex Robotics Design System (Vexrobotics.com) 197LEGO Mindstorms and Technic Sets (Mindstorms.com) 198Actobotics Building System (Servocity.com) 199Makeblock (Makeblock.cc) 200MicroRax (Microrax.com) 200MakerBeam (Makerbeam.eu) 202Tamiya (Tamiyausa.com) 203Choosing a Building Set 203Material204

Table of ContentsBeams205Motor Mounts206Connector Plates207Electronics 208Gears208Wheels and Tank Treads 209Customizing Building Sets 210Combining Building Sets 210Creating New Parts 214Chassis Designs 216LEGO Mindstorms EV3 Chassis 216Step-by-Steps 217Makeblock Chassis 226Parts List 227Step-by-Steps 228Actobotics Chassis 234Parts List 234Step-by-Steps 236Summary 245Chapter 9Robot-Builder’s Toolbox247Choose Your Toolbox 248Size248Construction 1Compartments 252Belly252Handle253Four Toolboxes254Pelican 1460 Mobile Tool ChestStack-On 39-Bin Drawer Cabinet254255ix

xRobot Builder: The Beginner’s Guide to Building RobotsHusky 41-inch 13-Drawer Tool Cabinet 256Craftsman 21-inch Toolbox 257Tools257Drivers and Wrenches 257Electronics 259Soldering 262Measurements 263Writing and Drawing Tools 264CNC Tools 265Woodworking Tools 266Attaching267Cutting 269Cables269Introduction to CNC Tools 270Laser Cutter 101 270Anatomy271Using the Laser Cutter 274CNC Router 101 276Anatomy277Using the CNC Router3D Printer 101Anatomy279280280Using the 3D Printer282Summary 282Chapter 10 Manipulators283Types of ManipulatorsUniversal GripperScoop284284285Tentacle 286Pneumatic 287Pincer 288Humanoid Hand288Electromagnet 289Claw290

Table of ContentsWinchPen291291Commercial Manipulator OptionsMakeblock Strong Robot GripperVEX Claw292292293uFactory uArm294Dagu Robotic Claw, MK IIProject: LEGO PincerParts List294296296Step-by-Steps 298Project: Laser-Cut Pincers 307Parts List 307Step-by-Steps 309Project: Coffee Grounds Gripper 314Parts List 315Step-By-Steps317Summary 328Chapter 11 Water Robots329Anatomy of a Water Robot330Flotation lization332Submersibles 332Moisture 333Waterproof Enclosures 333Project: Floating Fanbot 334Parts List 335Step-by-Steps 337Code348Summary 350xi

xiiRobot Builder: The Beginner’s Guide to Building RobotsChapter 12 Art Bots351Types of Art Bots352V-plotter 352Vibration352Plotter 353Eggbot354Sand Plotter355Car-Based 355Paint PendulumDot Matrix356357Converting an Image to G-Code358Converting a Line Drawing into G-CodeProject: Rolling ‘RiterParts List361362363Step-by-Steps 365Code380Summary 383Glossary 385Index391ONLINE (WWW.INFORMIT.COM/TITLE/9780789751492):CHAPTER 13 Web-Interacting Robots 1Types of Web-Interacting Robots 2Sniffers 2Autotweeters 2Telepresence 2Interactive Robots2Home Automation3Sensor NetsHardware34Arduino Ethernet Shield4Adafruit CC3000 BreakoutArduino Wi-Fi ShieldRoving Networks WiFly564

xiiiMicrocomputers: Non-Arduino Solutions 7BeagleBone Black (beaglebone.org) 7Raspberry Pi (raspberrypi.org) 7pcDuino (pcduino.com) 7Arduino Yún (arduino.cc/en/main/ArduinoBoardYun) 7Dart Texter 8Parts List 9Step-by-Steps 9Code12Summary 13

xivAbout the AuthorJohn Baichtal writes books about toys, tools, robots, and hobby electronics. He is theco-author of The Cult of LEGO (No Starch Press) and author of Hack This: 24 IncredibleHackerspace Projects from the DIY Movement; Basic Robot Building with LEGO Mindstorms NXT 2.0;and Arduino for Beginners (all from Que Publishing). Most recently he wrote Make: Lego andArduino Projects for MAKE, collaborating with Adam Wolf and Matthew Beckler, and he is theauthor of the upcoming Que book, Building Your Own Drones: The Beginner’s Guide to UAVs andROVs. He lives in Minneapolis, MN, with his wife and three children.

xvDedicationTo my grandmother, Marion Lillie, for her continued inspiration and support.To my wife Elise and kids Eileen Arden, Rosemary, and Jack, for putting up with and participating in a lotof nerdy stuff.Finally, to my cousins Sean Fields and Will Fields, the next generation of robot builders. I hope this bookintrigues you!AcknowledgmentsThanks to (in no particular order) Jude Dornisch, Steven Anderson, Adam Wolf, MichaelFreiert, John Wilson, Susan Solarz, Akiba, Mark Frauenfelder, Chris Berger, MichaelKrumpus, Alex Dyba, Brian Jepson, Becca Steffen, Dave Bryan, Actobotics, Eric Wang,Mike Hord, Makeblock, Pat Arneson, Erin Kennedy, uFactory, Windell H. Oskay, CreativeRobotics, Johngineer, Matthew Beckler, Riley Harrison, Limor & Phil @ Adafruit, TylerCooper, Beatty Robotics, Arcbotics, David Lang, Trammell Hudson, Pete Prodoehl, DanieleBenedettelli, Bruce Shapiro, Alex Allmont, John Edgar Park, Miguel Valenzuela, PeteMcKenna, Steve Norris, and, well, obviously, Rick Kughen.A special thanks to my mother Barbara for assembling the Glossary, and for all her support.And to my gaming group, without whom I might not be sane: Big Ryan, Little Ryan, Drew,Gabe, Ned, Dave, Graham, and Jess.

xviRobot Builder: The Beginner’s Guide to Building RobotsWe Want to Hear from You!As the reader of this book, you are our most important critic and commentator. We valueyour opinion and want to know what we’re doing right, what we could do better, whatareas you’d like to see us publish in, and any other words of wisdom you’re willing to passour way.We welcome your comments. You can email or write to let us know what you did or didn’tlike about this book—as well as what we can do to make our books better.Please note that we cannot help you with technical problems related to the topic of this book.When you write, please be sure to include this book’s title and author as well as your nameand email address. We will carefully review your comments and share them with the authorand editors who worked on the book.Email:feedback@quepublishing.comMail:Que PublishingATTN: Reader Feedback800 East 96th StreetIndianapolis, IN 46240 USAReader ServicesVisit our website and register this book at quepublishing.com/register for convenient accessto any updates, downloads, or errata that might be available for this book.

What’s in This Book?INTRODUCTIONRobots are incredible machines. The more complicated ones are entrusted with buildingcars and digging tunnels, projects that require lots of moving and lifting power but alsoprecision. You may even have heard of experimental robots that are used for surgical procedures and can sew sutures or make incisions.It’s almost a science-fiction phenomenon in a way—how could anyone actually build oneof those contraptions? It’s not science fiction, of course. Robots are built by people, andyou’re a person—so let’s make a robot! I call the first chapter of my book, “You, RobotBuilder,” because that’s what this book is about—showing how you can build a robot fromthe wheels up as you learn about motors, controllers, grippers, wheels, and everything elseyou need to create your first bot.Your creation may not dig a tunnel or sew up an incision, but you will have built it, and thatmeans you can build any robot, so long as you have the knowledge and parts.What’s in This Book?The following list describes what you’ll find in each chapter:Chapter 1, “You, Robot Builder,” begins with the age-old question: What exactly is arobot? You’ll learn about the various categories of robot and even try out a couple ofabsurdly simple robots that use vibration motors to move around.Chapter 2, “Robots of the World,” shares a bunch of cool robots that other hobbyistshave built around the world, with a variety of shapes and configurations.Chapter 3, “Rolling Robots,” shows you how to build a wheeled robot, a basic platform that will serve you

Nerf Sentry Gun 43 Yellow Drum Machine 44 Pancake Bot 45 Balloon Bot 46 Piccolo: The Tiny CNC Bot 47 Xylophone Bot 48 Flyer-Distributing Robot 49 Flowerbot 50 CoolerBot 51 Summary 52 Chapter 3 Rolling Robots 53 All About Motors 54 Choosing a Motor 55 Wheels 58 Configuration 58 Measurements 61 Tires or Treads 61 Project: DIY Wheels 65 Parts List 66 Step-by-Steps 67 The Chassis 70 Use a