t r e p x E
g n i r e e n i g En Since 1983, Hitec has designed, developed and manufactured servo technologies that push the boundaries of imagination and innovation. Consider, for example, our EMI-shielded case, giant scale duo: the HS-1005SGT, with its specially-handmade cored motor and steel gears or our HS-1100WP, with robust torque and an IP-67 waterproof rating. Their unrivaled reliability, strength and durability deliver expert performance for your most challenging and demanding industrial and commercial applications.
HS-1005SGT Amplifier Type
High Response Digital MOSFET
Motor Type
5 Pole Cored Carbon Brush
Operating Voltage Range No Load Speed Range
11.1 ~ 14.8 Volts DC 0.19 - 0.26 Sec @ 60°
Peak Torque Range
84.0 - 110.0 kg-cm 1166 - 1528 oz-in
Dimensions
64 x 33 x 73mm 2.52 x 1.3 x 2.90in
Weight
363g / 12.8oz
HS-1100WP Operating Voltage Range No Load Speed Range Peak Torque Range Maximum Current Draw
Gear Type
Hardened Steel with MP First Gear
Dimensions
Bearings
2 Ball Bearings and 2 Needle Bearings
Weight
Output Shaft
10mm 15 tooth
Gear Type Output Shaft
11.1 ~ 14.8 Volts DC 0.19 - 0.26 Sec @ 60° 84.0 - 110.0 kg-cm 1166 - 1528 oz-in 5500 - 6500mA 64 x 33 x 73mm 2.52 x 1.3 x 2.90in 363g / 12.8oz Hardened Steel with MK™ First Gear 6.5mm Square
Custom design and manufacturing available. RCD USA, Inc. | 12115 Paine St. | Poway, CA 92064 | [858] 748-6948 | www.hitecrcd.com
Full Page.indd 2
10/3/2016 6:25:34 PM
Full Page.indd 3
9/6/2016 5:42:12 AM
TOC - Nov 16_TOC SV Mar 15.qxd 10/4/2016 12:49 AM Page 4
11.2016 VOL. 14
NO. 11
Subscription Information SERVO Magazine — PO Box 15277 North Hollywood, CA 91615-9218 Call 877-525-2539 or go to www.servomagazine.com Subscribe • Gift • Renewal • Change of Info
Columns 60 Then and Now by Tom Carroll
The Ideal Home Robot So, what exactly is a home robot? Let’s take a look at some of the key aspects of a viable automaton for a home environment.
The Combat Zone 16 Bots in Brief • • • •
New EMIEW Doesn’t Stink Impressive Strides Multi-Motion Minitaur Trying to Clean Up
18 Witch Doctor’s Secret Recipe Revealed 20 Florida BattleBots Storm Kennedy Space Center 21 The Evolution of Algos
Departments 06 Mind/Iron
Facebook and Microsoft Messenger Bots
37 MaxRoboTech Comics Boston Dynamics Wins the Race
07 Events Calendar 07 Showcase
14 54 59 65
New Products SERVO Webstore RoboLinks Advertiser’s Index
SERVO Magazine (ISSN 1546-0592/CDN Pub Agree#40702530) is published monthly for $26.95 per year by T & L Publications, Inc., 430 Princeland Court, Corona, CA 92879. PERIODICALS POSTAGE PAID AT CORONA, CA AND AT ADDITIONAL ENTRY MAILING OFFICES. POSTMASTER: Send address changes to SERVO Magazine, P.O. Box 15277, North Hollywood, CA 91615 or Station A, P.O. Box 54, Windsor ON N9A 6J5;
[email protected]
4
SERVO 11.2016
TOC - Nov 16_TOC SV Mar 15.qxd 10/4/2016 12:49 AM Page 5
In This Issue ... PAGE 56
PAGE 28
PAGE 08
08 Animatronics for the Do-It-
44 The Multi-Rotor Hobbyist
Yourselfer
by John Leeman Training for Flight We will go through the steps to train our flight controller to our hardware and (finally) take our quadcopter on its official maiden voyage!
by Steve Koci Prop Builder’s Gift Wish List Once again, it’s that time of year when the air turns cool and our thoughts turn to the holidays and what the heck we’re gonna buy for our DIYers. No need to panic! We’re sure you can find an item or two on this gift list that even the most persnickety builder will appreciate.
24 Serving Raspberry Pi — Meet Berry Bot by William Henning Our series on using the popular Raspberry Pi platform in robot builds is back, and with a new bot to introduce.
28 Getting Started with ROS
50 Hobby Robotics — It’s Really About Sensors and Programming by John Blankenship Hobbyists new to robotics often wonder what sensors their first robot should have, but seldom appreciate the role programming plays when turning sensor data into a robotic behavior. Simulators can make it easy to acquire this knowledge before constructing or purchasing a robot that does not meet your needs.
by Lentin Joseph Ever wonder how to interface an Arduino to ROS (Robot Operating System)? This tutorial shows you how.
56 Getting a Handle on
38 Building the KReduCNC
by Chris Savage As we continue our mini series on automated doors which explores the fundamentals of robotic control systems, we’ll cover stepper motors using magnetic switches and Halleffect sensors.
by Michael Simpson In this installment of building our own CNC machine, learn how to connect the controller to the stepper motors to get the CNC moving for the first time.
Automatic Doors
SERVO 11.2016
5
Bergeron - Mind-Iron - Nov 16_Mind-Iron - Feb15.qxd 10/4/2016 12:08 AM Page 6
Mind / Iron by Bryan Bergeron, Editor ª
Facebook and Microsoft Messenger Bots: It’s Déjà vu All Over Again
2016
is the year of the chat bot — a forecast supported in part by the launch of messenger bots for Facebook and Microsoft platforms, among others. Chat bots — introduced nearly 50 years ago — are software agents that can create text dialogue that resembles something that a human might produce. Eliza — a bot programmed to mimic a psychotherapist — was one of the earliest examples of natural language processing (NLP) that made it to the masses. There are numerous web based versions available if you’d like to try your hand at selfpsychoanalysis. The last big push for NLP based bots was two decades ago, when web based software bots were seen by many as the marketing, sales, and customer service forces of the future. Why pay for call centers to handle complaints when a chatter bot can do the same for pennies on the dollar? Banks began the practice of handling customers with large balances with human operators and everyone else with chatter bots. This made sense in a perverse way. Worst case scenario, a bank customer with a small balance would become upset and move their savings to another bank. This left the high value customers, which was better for the bank’s bottom line. When I was involved with a startup that leveraged NLP technology and medical chatter bots in the ‘90s, the focus was on personal avatars, speech recognition and generation, and the end of email communications
6
SERVO 11.2016
as we knew it. Well, post-bubble, that company (and a lot more like it) failed to survive, and the excitement about chatter bots calmed to a murmur. The latest announcements regarding chatter bots once again taking over the world of e-commerce may be more than simply Déjà vu. Two decades ago, we weren’t all toting smartphones, using them to pay for items at the point of sale, and ordering from Amazon and other online retailers on our commute home. Today, there just may be enough of a user base accustomed to texting everyone and every business to make e-commerce using chatter bots viable. I’m, of course, curious to see to what extent the various tool boxes announced by Microsoft and others can be applied to mechanical robots as well. Good speaking manners would be a big plus in creating an emotionally intelligent interface to a social robot. Similarly, I expect the latest generation of chatter bots — tied to voice recognition and generation — to make a significant impact in the car market. After all, what good is a selfdriving car if you can’t have an intelligent conversation with the driver? SV
FOR THE ROBOT INNOVATOR
ERVO
Published Monthly By T & L Publications, Inc. 430 Princeland Ct., Corona, CA 92879-1300 (951) 371-8497 FAX (951) 371-3052 Webstore Only 1-800-783-4624 www.servomagazine.com Subscriptions Toll Free 1-877-525-2539 Outside US 1-818-487-4545 P.O. Box 15277, N. Hollywood, CA 91615 PUBLISHER Larry Lemieux
[email protected] ASSOCIATE PUBLISHER/ ADVERTISING SALES Robin Lemieux
[email protected] EDITOR Bryan Bergeron
[email protected] VP of OPERATIONS Vern Graner
[email protected] CONTRIBUTING EDITORS Tom Carroll Kevin Berry R. Steven Rainwater Michael Simpson Steve Koci John Leeman Chris Savage John Blankenship William Henning Mike Jeffries Lentin Joseph CIRCULATION DEPARTMENT
[email protected] WEBSTORE MARKETING COVER GRAPHICS Brian Kirkpatrick
[email protected] WEBSTORE MANAGER/ PRODUCTION Sean Lemieux
[email protected] ADMINISTRATIVE STAFF Re Gandara Copyright 2016 by T & L Publications, Inc. All Rights Reserved All advertising is subject to publisher’s approval. We are not responsible for mistakes, misprints, or typographical errors. SERVO Magazine assumes no responsibility for the availability or condition of advertised items or for the honesty of the advertiser. The publisher makes no claims for the legality of any item advertised in SERVO. This is the sole responsibility of the advertiser. Advertisers and their agencies agree to indemnify and protect the publisher from any and all claims, action, or expense arising from advertising placed in SERVO. Please send all editorial correspondence, UPS, overnight mail, and artwork to: 430 Princeland Court, Corona, CA 92879.
Rainwater - Events - Nov 16_Events - Aug 15.qxd 10/4/2016 12:09 AM Page 7
EVENTS NOVEMBER 5
12
12
14-18
Bloomington VEX Tournament Bloomington, IN Events include Recovery and Tractor Pull. http://sites.google.com/site/ bloomingtonroboticsclub DPRG RoboRama Dallas, TX Events include Five Spot and Six Can. https://dprgblog.wordpress.com STHLM Robot Championship Stockholm, Sweden Events include Sumo, LEGO Sumo, Folkrace, Line Following, and Freestyle. www.robotchampion.se
KheperaSot. www.fira.net 18-20
All Japan MicroMouse Contest Meisei University, Tokyo, Japan Events include Micromouse classic, Micromouse half-size, and Robotrace. www.ntf.or.jp/mouse
19
AHRC Robot Rally Pinckneyville Community Center, Norcross, GA Events include Maze Solving, Cube Quest, Mini Sumo, and Polyathlon. www.botlanta.org
20
Robocon Tokyo, Japan See the website for details of this year's contest. www.official-robocon.com
FIRA Robot World Cup Amirkabir University of Technology, Tehran, Iran Events include HuroSot, RoboSot, MiroSot, NaroSot, and
SERVO 11.2016
7
Koci - DIY Animatronics - Nov 16_Steve Koci Animatronics #1 Parrot.qxd 10/3/2016 11:21 PM Page 8
DIY Animatronics Prop Builder’s Gift Wish List
By Steve Koci
It is once again that time of year when the air turns cool and our thoughts turn to the holidays. However you celebrate, I am sure we all enjoy receiving a special gift that we can appreciate and put to good use in our hobby.
I
remember as a kid marking up the toy catalogs with the gifts I wanted and leaving them for my parents to find. Things have not changed all that much over the years, as I still look forward to unwrapping those thoughtful items that my loved ones have carefully selected for me. They may need a hint or two, so I try to aid them in their search for that perfect gift. Maybe these ideas will prove useful in your search for that special someone on your list whose time is spent designing and building. Either way, you are sure to find something here that any builder would appreciate. I will include a variety of options in a range of prices. I hope you can find a few items that you would like to find under your tree as well!
Tools Half the fun of building things is getting new tools! The right tool for the job makes building more enjoyable, safer, and saves time!
1. Pencil style AC power tester — http://tinyurl.com/ hhhw3lq The most important consideration when tackling any job is safety. Take no chances — especially when working with AC electricity. Check lines before working on them. With this device, it is a simple process to check to see if an AC line is live (Figure 1). 2. Calipers — http://tinyurl.com/hds9tay Constructing many of the projects we dream up is not “a game of inches” like football. We require much greater accuracy in our measurements than that! A tape measure is fine for rough cuts but when real precision is needed, I reach for my calipers. Although you can spend considerably more, I have found that these suit my purposes quite well. I like the digital display, and the six inch size has been sufficient for my needs (Figure 2). 3. Ratcheting pin crimpers — http://tinyurl.com/nuo4jwy This handy tool has greatly simplified the process of assembling the multitude of servo headers my projects require. I have used other models, but they were always
Figure 1. Is this on? Test it first!
Figure 3. Making cables can be simple. Figure 2. Accurate measurements are a must.
8
SERVO 11.2016
Koci - DIY Animatronics - Nov 16_Steve Koci Animatronics #1 Parrot.qxd 10/3/2016 11:21 PM Page 9
DIY Animatronics Post comments on this section and find any associated files and/or downloads at www.servomagazine.com/index.php/magazine/article/November2016_Animatronics_Prop-Builders-Wish-List.
Figure 4. A quality soldering iron helps get the job done right.
Figure 5. Keep a firm grip on your work with a PanaVise unit.
cumbersome. The ability of this set to ratchet down and secure the connector while I insert the wire makes assembly a snap. Although I kept my old pair of crimpers, I hope I am never forced to use them again (Figure 3)! 4. Tap and drill set — http://tinyurl.com/zgazvth The materials we work with do not always come with nice, tapped, conveniently located screw holes. This is where a tap and drill set can be an invaluable tool. A good set that includes a variety of sizes will simplify your assembly process, allowing you to customize your project to exactly fit your design parameters. 5. Hakko soldering iron — http://tinyurl.com/oy277tb Looking to get your first soldering iron or is it time to upgrade your current model? Then, it is hard to beat the value provided by this soldering station bundle which includes a pair of cutters. It has an easy-to-read digital display and has adjustable temperature control — two items I think are mandatory (Figure 4)! 6. Maker shirt — www.makershed.com/products/makerfaire-2016-main-event-shirt-mens Not necessarily a tool, but we all need a little help occasionally getting in the prop building mood. The proper apparel may be just what the doctor ordered to help inspire our creativity and motivate us. I am a big fan of the maker movement as it incorporates so many opportunities to expand and showcase our creativity. 7. PanaVise holder — http://tinyurl.com/gq7lpft Over the years, I have purchased three different models and have been extremely pleased with their construction and usefulness. Each unit is different, so I always have the
most appropriately sized vise for the job at hand. Securely holding my project while I work on it makes the job significantly easier. I hate chasing a board across my bench as I try to solder components (Figure 5)! 8. Wire strippers — http://tinyurl.com/jbns45h Sometimes you find a tool that simplifies and speeds up a process. I had never given much Figure 6. Make quick thought to the chore of stripping work of stripping wires until I purchased a pair of wires. these strippers. What a difference they make! They make quick work of the stripping and since they grip the wire, they do not pull on the other end of the wire. They automatically adjust to fit wire sizes between 10 and 24 gauges (Figure 6).
Components It takes the proper parts to bring a character to life! Allow that special someone the chance to help you stock the shelves. 1. Brick In The Yard molding and casting kit — http://tinyurl.com/j9lrn8w There is more to building functioning characters than the mechanical and electronic components. We need to take into consideration how we will be covering and dressing our creations. This is where we need to educate ourselves in the art of molding and casting. If you have never ventured into this aspect of our craft, a good place to begin would be with a starter kit such as the one offered by Brick In The Yard. This kit includes everything you need to get started as you experiment with molding and casting. SERVO 11.2016
9
Koci - DIY Animatronics - Nov 16_Steve Koci Animatronics #1 Parrot.qxd 10/3/2016 11:21 PM Page 10
DIY Animatronics
Figure 8. Select the ideal joint angles with Spider Joints. Figure 7. Actobotics components are real time savers.
animated head? Virtually every This kit may be just what you need to character I build incorporates a threetake the next step in your prop axis head, so it is something I can building education. always use. Whether we are using the 2. Actobotics attachment ideas — skeleton head as it was intended or http://tinyurl.com/hrxjjf4 using it as a base to sculpt upon, there As my projects continue to is always room in the shop for one increase in complexity, my time more! becomes even more valuable and in 5. Economy spur gear motors from short supply. I have turned to the ServoCity — http://tinyurl.com/ Actobotics line of products from j2atlh9 ServoCity to speed up the prototyping and build phases of my character I am always on the hunt for creation process. The wide selection of economical low RPM motors to power available components has simplified my creations. ServoCity stocks a wide and streamlined my work flow so range of choices in RPM and torque. much that I would be hard-pressed to These very reasonably priced motors go back to the way I used to do things may be just what you need to complete (Figure 7). that next project. 3. Spider joints — http://tinyurl .com/pshd3cn I do not use them for their intended purpose, but find them Keep those electrons flowing and extremely helpful when prototyping a the props running at their maximum new design. They allow me to Figure 9. All the components you need efficiency with the right kinds of to start in electronics. construct a basic body shape, then electronics. adjust the proportions and position of the various body parts. With this method, any mistakes or 1. Arduino Inventor’s Kit — http://tiny url.com/kdetrlu alterations are corrected using PVC instead of metal (Figure Are you putting off the leap to learn the electronics side 8). The addition of a few well-placed pool noodles helps of animatronics construction? Starting a new endeavor can flesh out the body parts. be much easier when a complete already assembled kit is at 4. Three-axis skull kit — http://tinyurl.com/q8s3hno hand. This one contains everything you need to construct 16 Seriously! Is there anyone that could not use another projects. No previous knowledge is required (Figure 9).
Electronics
10
SERVO 11.2016
Koci - DIY Animatronics - Nov 16_Steve Koci Animatronics #1 Parrot.qxd 10/3/2016 11:21 PM Page 11
DIY Animatronics
Figure 10. Taking the guesswork out of energy usage.
Figure 11. An electronics troubleshooting must-have.
2. Servo programmer — http://tinyurl.com/j2vfyfo This super gadget gives you a tremendous amount of flexibility in the use of digital servos. It permits you the opportunity to adjust the speed, direction of travel, and end points of your servo. The large screen is easy to read and the unit allows you to test and program all Hitec digital servos. 3. Kill-A-Watt electricity usage monitor — http://store.nutsvolts.com/project-kits/toolsprogramming/sku16502 Determining the amount of power your creations are using is always a concern. There is no longer a need to wonder when you employ this useful item. Take the guesswork out of determining the consumption of a particular prop and keep from overloading your electrical circuits (Figure 10). 4. Digital multimeter — http://tinyurl.com/gvmavfe This is one tool that should be in every prop builder’s toolkit. They come in a wide range of prices, but for most the added features may not be worth the extra expense. Even an inexpensive unit will help diagnose a wide variety of problems. I feel it is such a critical piece of equipment that I carry one to all my speaking engagements where I will be demonstrating mechanisms and controllers. I do not leave home without it (Figure 11). 5. Smartphone camera lenses — http://tinyurl.com/ h5qc2nm There are a variety of options available such as the 4-IN1 camera lens system for Olloclip. You can quickly choose to use the fisheye, wide angle, or 10X or 15X macro lens. You will find many opportunities to use this gift both in your
Figure 12. Put a charge in those batteries.
project construction as well as your “off” time (we do have other hobbies besides building). 6. X2 battery charger — http://tinyurl.com/zo6mjyp Providing power to our props can be a challenge, and in some cases, we do not have access to a wall outlet. In these circumstances, we are forced to turn to battery power. Keeping batteries sufficiently charged can be a challenge. Using a charger such as the X2 can make this process a breeze. This power-packed twin-channel charger even allows you to control it via your smartphone (Figure 12).
Controllers Let your creative juices flow and take your props to the next level with a controller upgrade. 1. LED dimmer — http://tinyurl.com/hl2k252 An often overlooked or under-appreciated feature in our displays is the quality of the lighting we use to focus attention where we want it. This handy little device allows you to adjust the intensity of your LED lighting to the proper levels. The devil is in the details, but this dimmer will assist you in achieving the perfect light levels (Figure 13). 2. PWM for wiper motor — http://tinyurl.com/h6lghh7 Wiper motors fulfill a very useful role for the prop builder. They provide an incredible amount of torque for the cost. They also allow you to select between high and low speeds. The motor speed can further be adjusted by a careful choice of the power supply voltages used. Even with these opportunities to dial in the speed in which the motor operates, we sometimes need even finer control. That is SERVO 11.2016
11
Koci - DIY Animatronics - Nov 16_Steve Koci Animatronics #1 Parrot.qxd 10/3/2016 11:21 PM Page 12
DIY Animatronics make changes on the go. It includes eight programmable relays and five servo headers. In addition, it allows for HD video using an HDMI port. With the rising popularity and availability of appropriate videos, this feature is a huge bonus (Figure 14).
Reading & Viewing Material Figure 14. Terror Tech’s contribution to easy controller programming. Figure 13. Dimming LEDs gives plenty of lighting options.
where a pulse width modulator can provide the perfect solution. 3. PicoVolt unit — http://tinyurl.com/jyjb2ju Combining the useful traits of the two previous suggestions and then taking the functionality to the next level is all possible with the PicoVolt from FrightProps. It allows the user to not only control a DC motor or the brightness of LED lights, but to program and replay a show. It also allows you to not only loop your show, but to choose from several trigger options to add even greater versatility. 4. Wee Little Talker board — http://tinyurl.com/h2jvmxg This little board is packed with features. Designed to simplify the process of syncing jaw movements with an audio track, it is a breeze to use! Simple audio prompts lead you through the setup process which can be completed in a couple of minutes. It incorporates a full seven-band audio spectrum analyzer to drive the jaw servo in sync with the audio. 5. Raspberry Pi — http://tinyurl.com/a8792gn This small and inexpensive single-board computer has taken the market by storm. It packs plenty of features and opens up a wide range of programming opportunities for the prop builder. They continue to improve in speed and features as new models are released and the online community grows. 6. Propeller Activity Board — http://tinyurl.com/zev2eaa This board has become one of the key components in our scene programming. We use it extensively to puppeteer our characters and find it fulfills our needs quite admirably. It features an attached breadboard which allows for prototyping without soldering. This element alone has made this board a favorite. (Watch for my article next month to learn exactly how we utilize this board to bring our creations to life!) 7. Terror Board — http://tinyurl.com/ob4tdqq Looks can be deceiving as this black box holds a few secrets. This new generation controller uses a smartphone, tablet, or computer for programming, which allows you to
12
SERVO 11.2016
Put your feet up and take some time to further your knowledge.
1. Cool Tools book — http://tiny url.com/lampdk5 Here is a gift for that one person on your list who says they have no gift ideas to suggest. I challenge anyone to go through this tome and not find something they would like to add to their toolbox. It includes reviews of over 1,500 tools and why you need them. I have made several purchases since getting my copy and still have many more items highlighted. (Figure 15) 2. SERVO Magazine subscription — http://tinyurl. com/cxv8la This is the gift that gives all year long. A new issue comes every month for the entire year and is filled with projects, the newest gadgets, and plenty of other useful information. I look forward to my issue every month and it never fails to reignite my passion for coming up with and building new characters (Figure 16). 3. Stan Winston videos — http://tinyurl.com/br7zgfj For when you need a break from all the strenuous building projects, why not sit down and enjoy an educational video? Get inspired to take your craft to the next level with these choices. Virtually any builder will find something of interest among the wide variety of topics available. Many of the titles are included in my personal collection and I plan to add more. This is the first place I turn whenever I am considering expanding my expertise in a relevant subject. The videos are well done and filled with the knowledge we need. Support is also available on their forum, making this an invaluable resource. 4. Halloween2Go videos — http://tinyurl.com/ zvcw8u8 This video series is not only entertaining, but packed full of useful information. This was one of the first commercial prop building videos I discovered when getting my start in this mad adventure. It fueled my determination to take the leap and convinced me that I could actually accomplish my creature building vision, setting me on a path from which there is no going back!
Koci - DIY Animatronics - Nov 16_Steve Koci Animatronics #1 Parrot.qxd 10/3/2016 11:22 PM Page 13
DIY Animatronics Time to Wrap this Up I hope you found some items here that are new to you and will be useful in your prop building endeavors. My suggestions were chosen with cost playing a huge role as I wanted gifts that would not “break the bank” of those purchasing the items. There is a myriad of Figure 16. SERVO Magazine keeps on products available that will giving all year! make your job as a prop builder easier and allow you Figure 15. Something for everyone to do it faster. to the list, I would love to hear about it! Post it in can be found inside. New and exciting the “Gift Guide” thread on our DIY Animatronics products are hitting the forum at http://tinyurl.com/z2a4l3h. market every day that will assist you in taking your projects to the next level. Make sure to leave this list for others to Until next month, May the Passion to Build Be with find so they know exactly what you want to receive this You! SV year! If you have a gift idea that you think should be added
BOTKITS.COM
7 Colors!
black / red / purple / green / orange / blue / pink
D2
COMBAT ROBOTS
SJ-1 Spider Joint
UMB-2 Universal Mounting
MNT-PVC Wiper Motor Pipe Bracket
SAM6-KIT 6 RPM Gear Motor
Beetleweight domination at 2016 RoboGames! + Battle-tested motors + Spare parts + Electronics + Hardware
+ Arduino educational and R&D chassis kits
412-491-4638
Scan Scan to to visit our site site
www.SpiderHillPropWorks.com SERVO 11.2016
13
New Products - Nov 16_Mar15 - NewProd.qxd 10/4/2016 12:30 AM Page 14
NEW PRODUCTS 6WD Mini Mantis™
T
he new Mini Mantis™ 6WD rover from ServoCity has a bug-like chassis which offers extreme A-arm style suspension and 3.3125” of independent wheel travel. With 485 RPM Economy gear motors, there is plenty of torque to turn the aggressive 4.3” off-road tires even when up against the toughest obstacles. The suspension incorporates 3.85” aluminum beams and ServoCity’s 130 mm oil-filled aluminum bodied shocks. The 11.75” wide (full extension), 14.75” long, 6.875” tall (full extension) boxed channel chassis provides a rigid backbone with endless mounting and customization options, making it easy to bolt Actobotics® components and electronics directly to the chassis of the rover. Rubber grommets and end caps are included for protecting the motor wires as they get routed to the motor controller of choice. The 1.90" black robot wheels are driven using 12 mm aluminum hex wheel adapters to ensure a solid no-slip connection. Price for the Mini Mantis is $299.99.
V-Wheel Kit
T
he new ball-bearing V-Wheel kit also from ServoCity works in conjunction with 80/20® (1010 series) as well as ServoCity’s own X-Rail to create smooth linear motion. The Acetyl construction of the V-Wheels offers high durability and wear resistance. The internal ball bearing has an ID of 5 mm and the overall V-Wheel diameter is 0.60”. Four 5 mm to 1/4” tapped standoffs are included to make it easy to attach the V-Wheel to channel or other Actobotics components. The 0.675” standoff length makes it ideal for more compact projects. The kit — which is priced at $29.99 — includes:
Scribbler S3 Robot
T
he newly released Scribbler S3 from Parallax offers a perfect place for students and teachers to begin their STEM/STEAM journey. The robust easy-to-use S3 robot is simple enough to set up in minutes, and is powerful enough to teach engaging activities throughout the school year. Programming, robotics, and even integrating math and art are all possible with the S3, which is priced at $179. The BlocklyProp online tool is the S3 robot’s primary programming environment. Its interlocking blocks with
14
SERVO 11.2016
• • • •
(4) (4) (4) (8)
Ball-bearing V-Wheels Standoffs #6 Washers 6-32 x 1/4” socket head cap screws
For further information, please contact:
ServoCity
www.servocity.com
readable text let beginners build programs in an intuitive, visually logical way. The BlocklyProp tool exposes the S3’s encoders to provide control over distance and speed for all possible types of movement. Pre-made blocks support all of the S3 robot’s sensors and motors. In addition, blocks are included for select accessories that plug into the S3’s Hacker Port. Customize the S3 by connecting a Parallax standard servo, PING))) ultrasonic distance sensor, or even an XBee RF module. Those who know the original S1 and S2 may also appreciate the S3 GUI for Windows as an easy transition for
New Products - Nov 16_Mar15 - NewProd.qxd 10/4/2016 12:30 AM Page 15
existing Scribbler curriculum. The S3 robot’s Propeller microcontroller brain may also be programmed directly in Spin language or Propeller C by advanced users. Features include: • Fully assembled with a durable shell. • Eight pre-programmed play modes let the Scribbler interact right out of the box. • Easy to program with Parallax’s free open source graphic and text based options. • Built-in sensors for line following, light seeking, object avoidance, and stall sensing. • DC motors with encoders allow for detailed scribbling, maze navigation, and distance control. • Integrated pen port fits pens up to a standard Sharpie in diameter; the S3 can scribble as it drives. • Speaker plays robot-generated musical notes and sound effects. • Hacker Port gives access to five digital I/O pins, two analog pins, 3.3V, 5V, and ground. • Silicone o-ring tires provide good traction without leaving marks. • S3 Li-Po battery and programming/charging cable included.
For further information, please contact:
Parallax
www.parallax.com
SERVO 11.2016
15
Bots in Brief - Nov 16_Bots in Brief Mar15.qxd 10/4/2016 12:14 AM Page 16
bots
IN BRIEF
NEW EMIEW DOESN’T STINK
V
isitors to Tokyo’s Haneda International Airport may find themselves receiving assistance from EMIEW: a 90 cm tall humanoid robot developed by Hitachi. Showing off its capabilities at a carefully planned demonstration, EMIEW (pronounced like the flightless bird with a similar looking name) guided a traveler to a tourist office while another EMIEW offered a downloadable digital map showing the location of the airport’s souvenir stores. The wheel-based robot switched effortlessly between English and Japanese (just like the “tourist” in the demonstration, actually), responding accurately and naturally to each inquiry. The whole process did, however, seem a little on the slow side, but since this was a trial run, response times may be speeded up before the bots roll out on a more permanent basis toward the end of the year. Hitachi has been developing EMIEW since 2005, with the Haneda version the third in the series. The latest model — which has a top speed of 3.7 mph (6 kmh) — features what Hitachi calls a “remote brain” where built-in sensors work with external monitoring technology (think overhead cameras) to give the robot all the information it needs for an appropriate response. The cloud based system also enables multiple EMIEWs to cooperate with each other in a specific space such as an airport. This is not necessarily a good thing for those who fear the robot apocalypse, but could prove useful if you’re looking for a faraway bathroom. Should a late passenger sprinting to a gate happen to accidentally knock EMIEW over, the bot can cleverly get back on its feet without any human assistance — provided, of course, its electronics weren’t mangled in the fall.
IMPRESSIVE STRIDES
C
laire Lomas, a 36 year old woman who at the time was 16 weeks pregnant, recently completed the Great North Run, the largest half marathon in the world that takes place each September in North East England. Lomas has also been paralyzed from the chest down since 2007 following a horseback riding accident. Lomas used an exoskeleton from ReWalk Robotics to help her complete the 13 mile journey over five days. She also had help from her husband, Dan, who was behind her each step of the way. Lomas walked about three miles per day, beating the heat, hills, and injuries throughout the half marathon.
16
SERVO 11.2016
Bots in Brief - Nov 16_Bots in Brief Mar15.qxd 10/4/2016 12:14 AM Page 17
bots
IN BRIEF MULTI-MOTION MINITAUR
Y
ou’ve probably seen robots that walk, roll, climb, and open doors. However, the Ghost Minitaur robot does all of these things in one package. It’s a medium-sized quadruped walker that stands well under a half meter tall. Built by Ghost Robotics, Minitaur can travel in a front-to-back orientation or at a slower side-to-side orientation in which it rolls over itself in either direction. If that’s not impressive enough, Minitaur can also open doors with a “jump and swipe” maneuver, and climb fences by carefully manipulating its powerful legs. Minitaur does all of this with just four legs that each have two motors. The mechanical portion of Minitaur seems simple at first, but a closer look shows it is extremely well designed. Each leg system is offset at five degrees and is built as 5-bar linkage assembly. With this linkage setup, inputs from two motors combine to determine the final position of the legs. This allows the legs to be positioned nearly anywhere outside the body, only being restricted by the length of the linkages and the possibility of physically hitting the robot’s chassis. Unbelievably, Minitaur was built with offthe-shelf parts, and because it uses no gearbox between the motors — which would add extra inertia, backlash, and friction — the force “felt” by the legs can more easily be sensed by the control unit and be used while moving. This feedback transparency is where the term “Ghost” comes from. Minitaur currently is operated as a remote controlled vehicle. The lower-level operations, such as how each motor needs to rotate at a certain instant and force feedback, is handled by the onboard processor: an STM32F series microcontroller that can be programmed in an Arduino environment. The control board also includes connections for a Raspberry Pi.
TRYING TO CLEAN UP
X
iaomi recently introduced its $250 Mi robot vacuum that hopes to take on the iRobot Roomba. The Mi vacuum can clean all floor types and features a Laser Distance Sensor (LDS) and Simultaneous Localization and Mapping (SLAM) to scan its surroundings 1,800 times per second in 360 degrees. It also has 12 sensors, including ultrasonic radar, cliff sensor, gyroscope and accelerometer, three processors and four CPU cores for real time mapping and positioning, and a main brush with adjustable height for uneven surfaces. The Xiaomi Mi robot vacuum features a Nidec brushless DC motor, claims to be ultra quiet, and uses a 5,200 mAh battery that promises 2.5 hours of cleaning. Like other Mi Ecosystem products, Mi Robot Vacuum pairs and integrates with the Mi Home app. It can be controlled remotely where users can power it on or off, and it also lets you set regular cleaning schedules.
SERVO 11.2016
17
Combat Zone - Nov 16_Combat Zone - Aug 15.qxd 10/3/2016 11:30 PM Page 18
Post comments on this section and find any associated files and/or downloads at the specific article link for each feature.
Witch Doctor’s Secret Recipe Revealed!
● by Kevin M. Berry
itch Doctor — the Heavyweight from Team Busted Nuts — is a BattleBots™ fan favorite. Combat Zone took the bold step of asking two of the Nuts to reveal the secret concoction that brewed up such a vicious and successful machine. Mike Gellatly and Andrea Suarez graciously answered our nosy questions, giving the public a peek into the magic bot caldron.
W
Combat Zone: Thanks for taking time out to talk to us. Our readers are
Featured This Month: 18 Witch Doctor’s Secret Recipe Revealed! by Kevin M. Berry
20 Florida BattleBots Storm Kennedy Space Center by Kevin M. Berry
21 The Evolution of Algos by Mike Jeffries
18
SERVO 11.2016
fascinated with Witch Doctor, and I know they'd appreciate any inside information, so to speak, you can give them about the bot. Did you use any new technology in the Season 2 version of Witch Doctor, or was it pretty much all proven standard combat tech? Can you tell us about them and how they performed? Witch Doctor: Our design philosophy is to keep it simple and use reliable tech. We did use a new MGM brushless weapon speed controller this
year, which was much more reliable than the version we used for Season 1. However, it did require some tuning to get it set up right. Even still, there is always room for improvement. Combat Zone: I'm sure you used some proven hardware as well. What "old reliables" did you include? Witch Doctor: Our go-to drive speed controllers have always been of the VEX/IFI offering. We have been using the Victor series (883/885) for many many years with great success in
Combat Zone - Nov 16_Combat Zone - Aug 15.qxd 10/3/2016 11:30 PM Page 19
www.servomagazine.com/index.php/magazine/article/November2016_WitchDoctors-Secret-Recipe.
various weight classes. VEX released their new BB ESC (electronic speed controller) just before the competition, which we used on our self-righting system due to its currentlimiting capability. The real advantage of the BB line is the ability to run a 48V system, which is double what the Victor's can handle. We run our drive system at 22V, so we would not have been able to take full advantage of that feature. We are planning on using them to their full potential for Season 3. Combat Zone: We know you included a self-righting mechanism this year. How does that work? Witch Doctor: The self-righting mechanism is powered by an S28-150 Mag motor mated to an Apex Dynamics planetary gearhead, with an additional chain reduction to give us the power we need to self-right (or lift an opponent if primary weapon failure occurred). It's not a particularly fast actuating system, but we wanted to ensure it had enough power to flip us over with an additional 250 lbs on top. The most unexpected failure mode occurred during our Red Devil match, in which the drive sprocket for the self-righting mechanism shattered due to shock load. Later inspection proved the sintered metal sprockets were not up to the task as even Shaman had a drive sprocket failure. Combat Zone: Can you give our readers an overview of your weapon system? Parts, configuration, ratios, etc.? How do you switch your weapon power? Witch Doctor: Our weapon system is basically the biggest brushless Outrunner we could find. The motor claims 15 kW of power output, which
Combat Zone: For our RC literate readers, can you tell us your stick and switch layout, programming, etc., on your transmitter?
seems to pack plenty of punch. The 60 lb weapon assembly is comprised of two 1.25" thick S7 tool steel discs mated to an aluminum hub which spins at just under 4,000 RPM. We used an industrial brushless speed controller for Season 2 instead of a hobby-grade controller which gave us much more control over the ESC parameters and datalogs as well, so we could troubleshoot during testing or review matches. Combat Zone: Give us some thoughts on your layout, design for redundancy, design for failure, and general design philosophy. Witch Doctor: When designing for redundancy, we double-up everywhere we can. Our drive system has four ESCs (two per motor); the wheels are all independent chain drive so if one gets ripped off or bound up, the robot will still drive. We run dual belts on our weapon assembly for the same reason. As for designing for failure, we isolate our weapon and drive systems from one another so that if the weapon goes out, it doesn't take the drive with it. For example, we have our batteries in separate compartments in case of failure, like what happened in the Red Devil fight. One of our drive packs was cut into but the other systems were still functional.
Witch Doctor: We run Spektrum DX6i transmitters for both Witch Doctor and Shaman. We have been using 2.4 GHz spread spectrum tech for years, starting back in Bots IQ after the IFI controllers were obsolete. This is reliable technology and has never given us any problems with fail safes or interference. Additionally, the DX6i allows for mixing and adjustments right on the transmitter, which is really nice. As far as transmitter layout, this year we separated the weapon system to a second transmitter. The main transmitter controls the drive on the aileron/elevator stick and the selfrighting mechanism on the rudder stick. I have always controlled drive on the right stick and weapon on the left. Some people like to split up right/left drive on each stick which does allow for more fine control, but it's not what I'm used to. Combat Zone: Any sneak peeks for our readers on what might be up in Witch Doctor's future? Building for the Season 3 we all hope will happen? Witch Doctor: We are excited to say that Witch Doctor will be entirely rebuilt for Season 3. We plan to optimize WD's weight distribution and we put some additional power into the drive system. With new types of robots at competition each year, we need to make upgrades to our armor in all configurations. Our weapon system has been pretty reliable, but there are some upgrades we want to make to it as well. SV SERVO 11.2016
19
Combat Zone - Nov 16_Combat Zone - Aug 15.qxd 10/3/2016 11:30 PM Page 20
Florida BattleBots Storm Kennedy Space Center
● by Kevin M. Berry
A story in which gearheads intersect with rocket nerds, to the benefit of both. Act One: A Happy Coincidence uring the filming of Season 2 of ABC’s BattleBots™ series this past April, some of the Florida bot crowd naturally congregated. They brought their friends, and their friends brought their friends, and soon it was realized that nine teams were based in or had members from central and south Florida. The author of this amusing little tale, along with fellow Kennedy Space Center worker, combat robot veteran, and SERVO writer, Matt Spurk had previously invited the gang from Busted Nuts Robotics (Witch Doctor and Shaman) to visit Kennedy Space Center, under the guise of sharing
D
some of their experiences with the rocket launching crowd. NASA’s Kennedy Engineering Academy, headed up by Dr. Michael Bell, had agreed to host the (one!) team, in a presentation called “Designing For Damage,” since robust design and eliminating failures is a common topic in both communities. The ever patient Dr. Bell graciously agreed to expand the event from four visitors and one bot to 25 visitors, seven BattleBots machines, and a variety of other hardware from Fleaweights to Heavyweights. In addition to the machines from the show, Matt from CE Robotics brought his Heavyweight, plus hockey bots and other Insects. Many teams took the chance to
show off smaller bots, letting the crowd know combat bots come in lots of different sizes. After a backstage tour of Kennedy Space Center, the gang set up in KSC’s largest conference facility, with an incredible view of the VAB and launch pads. Hoping for a large crowd, the room was set up for 200 people, and attendance was near that level. Team Busted Nuts led off with a great presentation on the changes to Witch Doctor since Season 1, then each team took a turn to show off their design philosophy. After a panel Q&A, an open house let visitors roam and examine each machine. Overall, it was a very successful day for all concerned. SV
All photos courtesy of Andy Sokol.
2.
3.
1. 6.
4.
5.
20
SERVO 11.2016
Combat Zone - Nov 16_Combat Zone - Aug 15.qxd 10/3/2016 11:30 PM Page 21
www.servomagazine.com/index.php/magazine/article/November2016_BattleBots-Storm-Space-Center.
8.
7.
1. Spinners don’t have to be big. Chainsaw (another Spurkbot) showed guests the small side of building. 2. Hypershock, showing hungry bot marks on the tire. (What could that vertical shaft go to?) 3. The Spurk family’s tiny lifter, Mucho Destructo sports flip-flop tires. 4. Matt Spurk’s hockey bot, High Sticking shows that wood has a place in serious bot building. 5. Busted Nuts shows off their itty bitty bot building skills. 6. The candy shell outside and soft nougat center of Team Logicom’s full body spinner, Captain Shrederator. 7. The legendary Nightmare was a big draw for visitors. 8. Team Carnage’s Ultimo Destructo rigged for flipping.
The Evolution of Algos lgos has been by far my most successful 1 lb combat robot. It was originally built in early 2012 and fought its first The original Algos design. match at Clash of the Bots 2012 on July 14th. Since then, it’s been through 77 fights, one major design revision, and a second weapon upgrade. Algos fought its last fight at Motorama 2016 back in February. With Algos retired, I have decided to release the full CAD files publicly. Those files can be downloaded at http://nearchaos Shot of .net/Algos Final.rar. Algos after
A
Algos Version 1 The core idea behind Version 1 of Algos was to have a robust chassis with a nimble drive system and a reasonable but not extremely destructive weapon. With my prior 1 lb bot, Kobalos it was able to go the distance in most fights, but without a weapon it made reliably winning fights against high quality spinners difficult. The design had a few issues, but the core components remained the same across all revisions of Algos:
being wired, showing most of the components.
Algos V1 prior to Dragon Con 2012.
● by Mike Jeffries
• Drive Motors: FingerTech Robotics 11:1 Silver Sparks • Drive Electronic Speed Controllers (ESCs): FingerTech Robotics TinyESCs • Battery: ThunderPower 3s 325 mAh 65C LiPo • Rx: Four-Channel OrangeRx • Weapon Motor: Turnigy Park 300 1,380 kV Outrunner • Weapon ESC: Plush12 brushless The only major electrical component that was dropped after Version 1 was the power switch, as FingerTech Robotics came out with their mini power switch before Version 2 was built. At the first event, I discovered that the stock Outrunner shafts were extremely prone to failure, and spent most of the event without a working weapon. For the next competition, I replaced the stock shaft with a length of garage heat-treated O1 tool steel. This worked reasonably well, but over the course of several events the weapon assembly proved to be too exposed. By the end of Motorama 2013, it was time to come up with something new. Version 1 of Algos managed a 13-5 SERVO 11.2016
21
Combat Zone - Nov 16_Combat Zone - Aug 15.qxd 10/3/2016 11:30 PM Page 22
Version 2 render with motor-in-weapon arrangement and aluminum weapon hub.
Algos V2 showing some scars along with the steel drumette and the lower top hooks.
record across four events.
Algos Version 2 A popular trend in the Insect classes has been to build the motor into the spinning weapon. For Algos Version 2, I decided to give that a try as well. Cross As part of the redesign, section view of the I also made the chassis weapon as narrow as I was able assembly while maintaining showing the shoulder roughly the same side bolt and profile. This resulted in bearings. the footprint Algos had for the rest of its 59 fights. The new weapon setup flipped the weapon motor to the opposite side of the frame rail and wrapped it in a machined aluminum hub. Attached to the hub were two waterjet cut 4130 disks that were pressed and bolted into place.
22
SERVO 11.2016
Algos V2 with the aluminum drumette.
While externally it looks mostly the same, the weapon is dramatically more durable with the new shaft.
This change resulted in a nice boost to the destructive power of the weapon while still leaving the bot very controllable in the arena. The hooks on the top of the frame rail still allowed inverted driving with no weapon contact. While the weapon worked well overall, during the second event it went to, it became clear that the aluminum hub with thin steel disks
configuration wasn’t well suited to dealing with horizontal spinning weapons. This led to the next variant of the weapon: a single piece drumette machined from a block of steel. This general shape would be the final one Algos’ weapon would take as it proved to be quite durable. The upgrade in strength showed the next weakness in the design. The hooks that were meant to allow it to drive inverted were thin enough that a good shot from a horizontal spinner would be able to fold them over into the path of the weapon. Those were lopped off of the design and a pair of shorter nubs were added that would keep all but the tooth of the drumette from touching the ground. The idea behind this was that it would allow the drumette to start spinning if it had stopped after being flipped, which made it more readily able to selfright as the drumette would kick the robot over
Combat Zone - Nov 16_Combat Zone - Aug 15.qxd 10/3/2016 11:30 PM Page 23
www.servomagazine.com/index.php/magazine/article/November2016_Evolution-of-Algos.
once it started spinning up. As with all the prior upgrades, the next weak spot made an appearance. This time, it made its way back to the weapon shaft. While it was reasonably well supported and a decently tough material, eventually a big hit or several would either bend the shaft, explode the 3 mm bearing, or cause the shaft to work its way out of position. This lead to the final design revision: an overhaul of the motorin-weapon setup after Algos managed a 20-5 record in the V2 arrangement.
Here’s the magnet ring and drumette prior to being pressed and bonded together along with the shoulder bolt used as the weapon shaft.
Algos V2.5 freshly assembled and ready for Motorama 2015.
Algos Version 2.5 The setup’s a bit rough on the stator,
The two things that but it’s still running strong. had to happen to the and the metal ring that retains them. weapon were that the shaft had to be This was pressed and glued into the actively retained and it had to be drumette, effectively turning the strong enough to resist bending even drumette into the new rotor. after the nastiest hits. After looking at At this point, Algos was in its final a few options, I settled on removing state. The drive was fast, the weapon the bearings from the stator (the part was durable and destructive, and the of the brushless motor with the chassis could handle just about copper windings) and drilling it out to anything thrown at it. accommodate a 1/4” shoulder bolt. The final revision of Algos lived up This also meant that I’d have to move to its potential, winning Motorama the bearings into the drumette itself. 2015, the Freeside Robot Street Fight, After finding suitable bearings Clash of the Bots 2015, and Dragon and taking measurments to determine Con Robot Micro Battles 2015 — all the correct offset between the new with essentially no maintenance, no bearings and the old stator, I got all issues, and a total of two losses. the critical parts ordered including a By this point, the first drumette small pile of steel shims that would was looking a bit worn out, so Algos allow me to precisely set the spacing was taken apart for a cleaning and and had a fresh drumette machined. drumette replacement. For this arrangement, the stator During the cleaning, it was clear was mostly left as delivered outside of just how hard the current setup is on the removal of the bearings and the the stator. However, it also was clear enlarged bore. For the rotor, however, that even with the stator feeling some the only part left was the magnets
Algos after Motorama 2016.
of the shock, the weapon as a whole was holding together well. With a fresh disk on and Algos reassembled, it was ready for its final run. Algos went undefeated at Robot Battles 57, Robot Battles 58, and Motorama 2016, having a combined 13-0 run across those competitions. With the win at Robot Battles 58, it had also managed to win every event it attended for a full year, and finished with seven straight event wins and an overall record of 32-2. While Algos could fight again as it sits or be fixed up a bit and look as good as new, it’s done everything I wanted it to do and I’ve learned a lot in the process. It’s had an amazing run, and there’s nothing I want to change on it. I think that means it’s time for something new. SV
SERVO 11.2016
23
Henning - Serving RaspPi 7 - Nov 16_Blank Rough SV.qxd 10/3/2016 11:36 PM Page 24
Serving Raspberry Pi #7 Berry Bot
By William Henning PHOTO 1. Meet Berry Bot.
In previous columns, I described my bot, Hobbit, and had it running around on its own, avoiding obstacles in a random walk. Hobbit could also be driven around with a PS/3 remote control. more batteries and more weight. So, first let’s improve the drive system. An improved drive system needs a more powerful motor drive, which dovetails rather nicely with talking about the popular L298N based motor drivers. For this article, I decided to give Hobbit a holiday and talk about Berry: my new 4WD Dagu red chassis based bots. Berry is more “brainy” than Hobbit, and can carry more weight. Berry currently consists of:
H
owever, we have to move beyond that, so let me 1. Dagu Magician 4WD chassis (red) introduce you to Berry Bot. 2. Raspberry Pi 3 For more complicated bots, at some point, we have to 3. RoboPi robot controller add the ability for it to navigate at least around the house. 4. L298N driver module We could use a GPS module if we were outdoors, but GPS 5. HMC5883L magnetometer module (compass) modules are fairly useless inside a house or apartment due 6. Sharp IR distance sensor to the limited resolution and — even worse — poor GPS 7. 9g servo for panning the Sharp IR sensor reception indoors. 8. Patriot Fuel+ 5,200 mAh USB power bank Inside, we can use a variety 9. 4xAA battery holder for of beacons and distance sensors motor power in order to give the robot an idea of what room it is in, and how For the time being, Berry will close it is to nearby objects. That not be provided with a camera information is greatly enhanced since vision processing is a very by adding a compass. Once we complicated topic. Plus, a camera can tell how far we are from is not necessary for initial indoor objects and what direction the location experiments. robot is facing, we can start trying to implement some mapping functionality which can later be used for indoor positioning and navigation. The Dagu Magician 4WD chassis is an inexpensive robot If we are going to investigate chassis, suitable for educational indoor navigation, it would be robots that do not need a lot of nice to give the robot some more power or precision. Elf’s and brain power and the ability to add PHOTO 2. The Magician 4WD chassis has Hobbit’s Dagu 2WD chassis is more sensors ... which leads to plenty of room.
Dagu Magician 4WD Chassis
24
SERVO 11.2016
Henning - Serving RaspPi 7 - Nov 16_Blank Rough SV.qxd 10/3/2016 11:36 PM Page 25
Post comments on this section and find any associated files and/or downloads at www.servomagazine.com/index.php/magazine/article/November2016_RaspPi-Robots-BerryBot.
even less expensive, but the 4WD chassis has roughly twice the torque, and as such, can be used for heavier more complicated robots.
Raspberry Pi 3 Model B At the risk of sounding like a zombie, all I can say at this point is brains ... I chose a Raspberry Pi 3 for Berry’s brains because: 1. 2. 3. 4. 5.
It It It It It
is inexpensive. is well supported. has onboard Wi-Fi. has onboard BlueTooth. works well with RoboPi.
PHOTO 3. Raspberry Pi 3 Model B.
Later, I plan to add the new 8M pixel Pi camera. For more information on the Raspberry Pi 3, you can check out my review at www.mikronauts.com/raspberry-pi/ raspberry-piraspberry-pi-3-model-b-review.
RoboPi Advanced Robot Controller Since Berry is supposed to be a smarter, more advanced robot than Elf or Hobbit, I added my RoboPi advanced robot controller. RoboPi has: • An eight-core RISC coprocessor running at 100 MHz. • An eight-channel 12-bit analog-to-digital converter (ADC) with three-pin sensor headers. • 24 “FlexIO” pins with servo-style headers; each individual pin can be any of these: 1. Digital input 2. Digital output 3. PWM output 4. Servo output 5. Ping/HC-SR04 distance sensor input/output
PHOTO 4. RoboPi on top of Berry Bot.
For more information about the RoboPi, go to www.mikronauts.com/raspberry-pi/robopi.
L298N Driver Board I wanted to be able to drive the four motors using only a single dual H-bridge. The L293D motor driver used on Pi Droid Alpha is not a good choice for driving two motors per channel due to its maximum drive current per channel. For those of you with Pi Droid Alphas or other L293D based motor driver boards, you can try piggy-backing a second L293D — a lot of people use that approach to double the current driving capabilities of L293D based motor driver
PHOTO 5. L298N module on Berry Bot. boards. Simply place a second L293D chip on the back of the socketed chip, and tack-solder the legs together. Your L298N board may look different than Photo 5. SERVO 11.2016
25
Henning - Serving RaspPi 7 - Nov 16_Blank Rough SV.qxd 10/4/2016 12:20 AM Page 26
EnA
Enable Motor A
Connected to RoboPi FlexIO #6
IN1 Direction control 1 for Motor A Connected to RoboPi FlexIO #12 IN2 Direction control 2 for Motor A Connected to RoboPi FlexIO #13
EnB
Enable Motor B
Connected to RoboPi FlexIO #7
IN3 Direction control 1 for Motor B Connected to RoboPi FlexIO #14 IN4 Direction control 2 for Motor B Connected to RoboPi FlexIO #15
Table 1. An L298N can be used in both four- and six-pin modes on most L298N driver boards. I always recommend you use L298N driver boards that support both four- and six-pin modes, as that provides the maximum flexibility for your robots. Some L298N modules also have optional connections for current sensing. However, even without those connectors, it is possible to use a common ACS712 module to measure the current used by each motor. Here’s is a link to a L298N datasheet: www.st.com/resource/en/ datasheet/l298.pdf. For Berry, I will be using six-pin control of the L298N driver, as it uses less power from the batteries and is more efficient than four-pin control. The six L298N inputs we need to drive are shown in Table 1. The speed of each motor (A and B) will be controlled by applying a PWM signal between 0% and 100% to the motor enable pin. You will find that the motor will not start turning until the PWM duty cycle is high enough so that it has enough
PHOTO 6. HMC5883L module on Berry Bot.
26
SERVO 11.2016
torque to move the robot’s weight. So, don’t expect to see any movement at low duty cycles. For more about L293D, L298N, four- vs. six-pin control, and some other motor driver boards, please see “Serving Raspberry Pi #3” in the March 2016 issue of SERVO Magazine. I’ll be using the same “Easy Motor” Python API I used for Hobbit on Berry.
Adding a Compass — HMC5883L Magnetometer Module
There are a LOT of compass modules on the market, at wildly varying prices. Some of the most popular modules use the Honeywell HMC5883L triple axis magnetometer. You can find the datasheet for the HMC5883L at www.farnell.com/datasheets/ 1683374.pdf. There are much more accurate tilt-compensated modules out there, but the low price of the HMC5883L modules outweighs the need for accuracy for hobby and educational robots. If we desire greater accuracy, it is possible to calibrate the sensor readings for your location, and it is also possible to add tilt compensation in the future using an inexpensive ADXL345 (or similar) module. For our initial experiments here, two degrees of accuracy will be more than sufficient.
Positioning the HMC5883L Module on Your Robot In an ideal world, we would mount our compass modules in the geometric center of our robot’s drive
PHOTO 7. HMC5883L mounted close to the center of Berry Bot.
Henning - Serving RaspPi 7 - Nov 16_Blank Rough SV.qxd 10/3/2016 11:36 PM Page 27
system. In the real world, being close is good enough. As the HMC5883L module measures extremely small variations in the local magnetic field, it should be kept as far away as is reasonable from: Magnets Motors Coils Metal plates For Berry, I mounted the HMC5883L module on a small prototyping board that had a 3 mm hole, and mounted the prototyping board about 2.5” above the robot chassis using plastic standoffs.
Correcting for Magnetic Declination You might be surprised to learn that compass needles do NOT point to “true north,” but instead point to the local “magnetic north.” There can be a significant difference between true north and magnetic north. True north is the direction along the Earth’s surface that points towards the geographic North Pole. True north is represented on maps and globes by lines of longitude. Magnetic north can be defined as pointing to where the horizontal component of the local magnetic field points. Go to www.geomag. nrcan.gc.ca/mag_fld/magdec-en.php for an excellent explanation. Fortunately, there are sites that allow you to determine the magnetic declination for your location on the surface of Earth, thus allowing you to correct for the difference between magnetic and true north. Refer to https://en. wikipedia.org/wiki/Magnetic_declination and/or www.magnetic-declination.com for more details.
Tilt Compensation
PHOTO 8. Berry Bot's eyes.
USB and 4xAA Battery Packs Berry is equipped with a Patriot Fuel+ 5,200 mAh USB battery pack, which can run the electronics for over four hours — including Wi-Fi. The motors are currently powered by four AA cells.
Until Next Time ... You can download Berry’s demo code at the article link or at www.mikronauts.com/robot-zoo/berry-4wd-pirobot. Berry can move around with the same simple motor commands as Hobbit from the June 2016 article. Heck, you could add the same joystick code if you wanted to drive Berry around! However, the real fun will begin when he can start mapping the floor in my home office. Next time, I’ll add tilt compensation code for the compass, and maybe get us started on indoor localization by getting Berry to map my office floor. SV
I will add an ADXL345 module and code to compensate for tilt in the next article in this series.
IR Distance Sensor and Nine Gram Standard Servo A Sharp IR range sensor provides us with the ability to “see” how close Berry is to the nearest object, and the nine gram servo allows us to pan the range sensor a full 180 degrees in front of the bot. (Refer to “Serving Raspberry Pi #4” in the April 2016 of SERVO Magazine for more about range sensors.)
PHOTO 9. Berry's batteries. SERVO 11.2016
27
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:44 PM Page 28
Getting Started with ROS — Arduino Interfacing for Robotics Projects
Introduction to ROS — Arduino Interface Arduino boards are becoming an essential ingredient in DIY robots and electronic gadgets. There are a lot of reasons for this, such as simplicity of programming, costeffectiveness of the board, and great community support. In my opinion, the main reason for the success of Arduinos is because of the ease of prototyping. Even though there are some ARM based boards available in the market which can perform better than the Arduino, I don’t believe they could win over hobbyists and DIYers. Let’s focus on robotics. We already know that Arduinos are being used in DIY robots, but do you think these boards can handle all the different functions in a complex robot? Let’s look at an example. Imagine we are going to build an autonomous mobile robot which can map its surroundings and navigate autonomously. Do you think the Arduino can do this job alone? No! Because the Arduino is just a microcontroller platform based on the AVR/ARM controller (running 8 MHz-84 MHz), it is basically an I/O board which can perform only a minimum amount of computation on its own. We can’t do a computer vision application using it. So, how can we use this board in a high-end robot? I would say we can use it as an I/O board basically to interface robotic sensors (such as ultrasonic sound sensors), IMUs (Inertial Measurement Units), and actuators such as DC motors, servos, etc. To perform high-end processing in robots, we may need to look at PCs with software frameworks to program robots. ROS (Robot Operating System) is a popular robotics software framework to work with complex robots like PR2, Robonaut, TurtleBot, etc. These high-end robots have tons of sensors, so processing data is a cumbersome task. ROS provides a message passing middleware (so to speak) which
28
SERVO 11.2016
By Lentin Joseph Post comments on this section and find any associated files and/or downloads at www.servomagazine.com /index.php/magazine/article/November2016_ROSArduino-Interfacing-for-Robotics-Projects.
can be use to communicate with different processes/nodes. For example, it may have a node for reading and writing to an Arduino, and a different node for getting images from a camera. Each of these nodes can communicate and exchange data with each other. Now the question is how do we interface an Arduino to ROS? How do we exchange sensor data and control messages from the Arduino to the ROS communication framework? Before discussing interfacing, it’s a good idea to go through some basic concepts of ROS. So, let’s do just that!
ROS in a Nutshell As mentioned, ROS is a meta operating system, which means it gives you functionality but needs a host OS to execute. The main features of ROS are: • Communication middleware: This middleware allows inter-process communication between ROS nodes/processes to exchange data. The communication is done by a publish/subscribe mechanism, i.e., one node is sending data and one is receiving it. The main communication paradigms in ROS are Topics, Messages, Services, and Parameters. • Tools: It has a wide variety of GUI and command line tools to visualize and debug ROS data. Some of the tools are Rviz (ROS Visualizer) and rqt. • Capabilities: In addition to the communication middleware, ROS provides a wide variety of capabilities which can be used in any robot without having deep knowledge about it. Some of the capabilities of ROS are Pose Estimation of robot, Localization, Mapping, and Navigation. • Ecosystem: There is an active worldwide community for ROS development and support.
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:44 PM Page 29
Really Getting Started Before getting started with ROS, we should understand its terminology first. Let’s have a look at the basic ROS terminologies and concepts: 1. ROS Distributions: Like Linux distributions (e.g., Ubuntu), an ROS distribution is a versioned set of ROS packages. The latest ROS distribution is Kinect Kame. Previous versions included Jade Turtle and Indigo Igloo. The purpose of the ROS distributions is to let developers work against a relatively stable codebase until they are ready to roll everything forward. If you want to explore the latest features in ROS, you can use Kinect; if you want stable packages, use ROS Indigo. 2. Supported OS: As stated previously, the ROS framework needs a host OS for its operation; one favorite OS for ROS is Ubuntu itself. The latest version of ROS is compatible with Ubuntu 16.04 LTS and 15.10. The ROS Indigo is mainly supported in Ubuntu 14.04 LTS. Check out this link for exploring various ROS distributions: http://wiki.ros.org /Distributions. 3. ROS nodes: Nodes are processes which perform some kind of computation with the help of the ROS communication framework. For example, one node can receive data from laser range finders, and one can send and receive data to an Arduino. 4. ROS topics: Topics are named buses which exchange data between ROS nodes using ROS messages. The method of sending data using topics is called publishing; receiving data using topics is called subscribing. For error free communication over ROS topics, the publisher node and subscriber node should handle the same ROS message type. 5. ROS messages: Node exchanges data in the form of messages over topics. ROS messages are data structures which can hold primitive types (e.g., integer, floating points, Boolean, etc.); arrays are also supported. We can write custom messages for our applications as well. 6. ROS parameter server: This server is a shared multivariant dictionary for mainly storing static non-binary data. Each node can store and retrieve parameters to this server at runtime. ROS parameters are globally viewable and accessible to all nodes, and it is mainly used for storing configuration parameters. This can store almost all types of primitive data types and is mainly designed for low bandwidth applications. 7. ROS services: ROS services are a kind of RPC (Remote Procedure Call) reply/request communication paradigm. Using services, a node provides a service, and the other client node can call this service. The client has to wait until the service provider node sends the result back to the client. Then, only the client can send the next request. 8. ROS client libraries: The ROS client library helps to
create an ROS node by providing a set of APIs (Application Programming Interfaces) for implementing ROS concepts such as topics, services, parameters, etc., in nodes. The programmer can simply use the client library APIs to use the ROS concepts. The main client libraries are roscpp and rospy. Programmers can use roscpp along with their C++ code also (rospy for Python programmers). Go to this link for a list of client libraries available on ROS: http://wiki.ros .org/Client%20Libraries. 9. ROS packages: The software in ROS is organized as packages. Each package may contain nodes, configuration files, third-party software, or anything which we can call as a module. The package in ROS makes the code reusable, modular, and easy to distribute. The ROS meta packages are a kind of virtual package which means not having nodes or other files except package.xml and manifest.xml. This is a reference for one or more packages which belong to a particular group. 10. ROS build system: The build system is responsible for building the target executable or library from the raw source code inside an ROS package. The build system used in new ROS distributions is catkin. Catkin uses CMake macros and Python script to do the building of source code inside a package. 11. ROS workspace: The workspace is a place where we organize the ROS packages. We can create, modify, and install an ROS package from an ROS workspace. We have to set a catkin workspace before creating a catkin based package.
How to Interface a Serial Device (like an Arduino) to ROS In most robots, the basic sensors will be interfaced to I/O boards such as an Arduino, STM32, or Tiva C Launchpad. So, how can we feed this sensor data to ROS which is running on a PC? This is the role of rosserial packages (http://wiki .ros.org/rosserial). The rosserial meta package consists of sets of packages to receive serial data from a microcontroller or any other serial device using a standard rosserial protocol. Here is how the rosserial protocol works. Rosserial is a standard protocol for communicating between ROS and a serial device. The communication is over a serial transmission line and uses serialization/deserialization techniques for transmitting ROS messages. The serial device is sending ROS messages as a packet which has a header and tail that allow multiple topics and services from a single hardware device. The packet also contains flags to synchronize the communication between the PC and device, and vice versa. Figure 1 shows the packet format using the rosserial protocol.
Figure 1. Rosserial packet structure.
SERVO 11.2016
29
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:44 PM Page 30
The first byte is called Sync Flag which is used to synchronize the communication between ROS and the device. Its value will be always 0xff. The second byte or Protocol Version/Sync Flag tells you if the ROS version we are using is before ROS Groovy or after Groovy. The value will be 0xfe after ROS Groovy and will be 0xff up until Groovy. The third and fourth bytes represent the length of the message which is on the packet, and the fifth byte is a checksum of the message length. The sixth and seventh bytes are dedicated for Topic ID. The Topic ID from 0-100 is reserved for system functions. The remaining bytes are used for serial data and its checksums. The checksums of the length of the packet and data is computed using the following equation: 255 - ( (Topic ID Low Byte + Topic ID High Byte + data byte values) % 256) The communication between the serial device and PC will start from the PC side, which will send a query packet for getting the number of topics, names, and types of topics from the Arduino/serial device side. When the Arduino gets this query packet, it will reply to the PC with a series of response packets. The response packet will consist of the following entries: uint16 topic_id string topic_name string message_type string md5sum int32 buffer_size This series of responses will be in the rosserial_msgs/ TopicInfo messages. When a response is not getting answered from the serial device, the query will resend from the PC side. The synchronization between ROS and the serial device is handled by sending timing information from the PC to the particular device.
The rosserial_client Libraries The rosserial_client libraries (http://wiki.ros.org/ rosserial_client) have a client side implementation of the rosserial protocol. The client can be an embedded microcontroller platform such as with an Arduino, ARM, or another serial device such as Xbee. It can run on any processor which has an ANSI C++ compiler and serial interfacing to a computer running ROS. There are several rosserial_client library packages out there for specific platforms. Here are some of those rosserial_client libraries: • rosserial_arduino: This package helps you build an Arduino library called ros_lib which can work as a rosserial_client library for Arduino. We can include this library for writing Arduino-ROS client nodes. This package helps us create a rosserial client on most of the Arduino platforms – especially the Uno, Mega, and Leonardo. • rosserial_embeddedlinux: This package enables us
30
SERVO 11.2016
to run rosserial_client on embedded Linux systems (like routers, etc.). • rosserial_windows: ROS is not completely ported to Windows. If we have to communicate with any Windows application, we can use this package to communicate from the Windows client to ROS. • rosserial_mbed: Most of the ARM controller based boards support mbed (hardware abstraction layer) programming, which is similar to Arduino programming. We can either program mbed boards using an online compiler, or offline using a gcc4embed (https://github .com/adamgreen/gcc4mbed) project. The offline compiler can only work with a limited number of boards, but the online compiler can use new boards which support mbed. • rosserial_tivac: The Tiva C Launchpad is another controller board from Texas Instruments which runs on 80 to 120 MHz. The latest boards are 123GXL and 129XL, and support the Arduino-like IDE (integrated development environment) called Energia (http://energia.nu). We can program Tiva C using the Arduino programming language called Wiring (http://wiring.org.co). After writing the rosserial node into a serial device, we have to run another node on the PC side to encode/decode the serial data. There are some packages for doing this process. Those are: • rosserial_python: This package is commonly used for rosserial communication. You have a Python node which can connect to the serial device and receive serial values from the device. It will decode serial packets and generate ROS topics and services which will be available on the PC side. This package is stable and recommended for PC applications. • rosserial_server: This is actually a C++ implementation of a rosserial receiver and can be used for high performance applications. The features of this node are less compared to rosserial_python. • rosserial_java: If you want to interface ROS with an Android, this is the best choice. We are going to use rosserial_python on the PC side.
Required Components These are the two hardware components we need to start with our Arduino-ROS programming: • Arduino Mega 2560 (https://www.arduino.cc/ en/Main/Arduino BoardMega2560) • USB B-type cable (https://amzn.com/ B00UNZ9KBM) To start interfacing our Arduino to ROS, the first procedure is to install ROS on the PC itself.
Installing ROS on Ubuntu 16.04 LTS For working with an Arduino, we can set up a new
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:45 PM Page 31
ROS distribution which is ROS Kinect Kame on Ubuntu 16.04 LTS. I’ll also give you the instructions to set ROS Indigo on Ubuntu 14.04 LTS. You can either install Ubuntu on a real PC or VirtualBox (if you want to work from Windows). Here are the procedures to set up Ubuntu 16.04 LTS and ROS Kinect Kame: • Download Ubuntu 16.04 LTS from http://releases.ubuntu.com/16.04/ubuntu-16.04desktop-amd64.iso; burn it to a disc or write it to a USB drive using unetbootin (https://unetboot in.github.io) to install it to a PC. You can also install Ubuntu on VirtualBox (https://www.virtual box.org/wiki/Downloads). The complete Ubuntu installation tutorials are available at www.ubuntu .com/download/desktop/install-ubuntudesktop.Note that in the VirtualBox setting, the video memory should be high, and you should install the VirtualBox Guest Add-ons after the Ubuntu installation. • Next, install ROS on Ubuntu. For detailed instructions on how to install ROS Kinect on Ubuntu 16.04 from the ROS website, go to http://wiki.ros.org/kinetic/ Installation/Ubuntu. If you are interested in ROS Indigo, please use http://wiki.ros.org/indigo/Installation/ Ubuntu instead. Also note, instead of Ubuntu 16.04, you need 14.04 LTS to install ROS Indigo. • You will need the ROS-Kinetic-Full desktop installation for this project. Once the ROS installation is complete, run the roscore command to check that everything is working fine. A screenshot of this command is shown in Figure 2.
Installing the Rosserial Interface Package on Ubuntu After setting ROS on Ubuntu, we have to install rosserial packages in ROS. Installing a package can be done in two ways: 1. Installation through apt-get which will install pre-built binaries. 2. Installation through compiling source code. The easiest way to install packages is using apt-get but in the latest ROS versions, most of the packages may not be available as binaries. In that case, we can create a ROS work space and download the source packages and install it. Here’s the procedure to build a rosserial package in ROS Kinect: 1. On your terminal, create an empty folder for the ROS workspace. You can give it any name; I am using rosserial_ws: $ mkdir -p ~/rosserial_ws/src //Creating a folder called rosserial_ws, and src folder //inside the workspace folder
Figure 2. Running roscore.
$ cd ~/rosserial_ws/src //Switch to src folder $ catkin_init_workspace //This will initialize a catkin //workspace $ git clone https://github.com/ros-drivers/rosserial //Cloning latest source code of serial package in src //folder $ cd ~/rosserial_ws //Change into workspace folder $ catkin_make //Command to build the entire //workspace 2. The catkin_make command will build all the packages inside the workspace and it generates additional folders like ‘build’ and ‘devel.’ The build folder contains build logs and the devel folder contains shell scripts and generated executables. For making this package visible to the ROS environment, you have to source one of the shell scripts in the devel. The following command will do this job: $ echo “source ~/rosserial_ws/devel/setup.bash” >> ~/.bashrc $ source ~/.bashrc
Congratulations!! You are done with the source installation of rosserial packages!! If you are trying to install using apt-get, you can use this command: $ sudo apt-get install ros-kinectic-rosserial
Note: If it fails, please switch to the source installation. If you are working with ROS-Indigo, you can directly install it using the following command: $ sudo apt-get install ros-indigo-rosserial
Setting the Arduino IDE and ROS Client Library In this section, we are going to set the Arduino IDE on Ubuntu 16.04. Arduinos can be easily programmed using their simple IDE. This IDE can be downloaded from the Arduino website and is available for popular OS platforms. SERVO 11.2016
31
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:45 PM Page 32
Figure 4. Arduino Preference. Figure 3. Arduino IDE.
Figure 5. Generating Arduino ros_lib.
Go to https://www.arduino.cc /en/Main/Software. We can either download the IDE from this website or install it via the Ubuntu software package manager. Downloading directly from the website will give you the most current version. For installing the Arduino IDE from the Ubuntu software package manager, use this command: $ sudo apt-get install arduino
Figure 6. Arduino ros_lib examples.
After installation, you can run the command arduino in your terminal, or if you are working with binaries downloaded from the website, extract the archive and you can see an executable called arduino. Simply execute it using this command: $ ./arduino
If everything works fine, the Arduino IDE will pop up and you will see the screen in Figure 3. Congratulations! You have successfully set up the Arduino IDE in Linux. Our next procedure is to set up the rosserial Arduino library.
Setting Up ros_lib in the Arduino IDE After setting up the Arduino IDE, we have to create an Arduino-ROS library for writing Arduino-ROS nodes. Here are the steps for setting it: 1. Navigate to File -> Preference in the Arduino IDE, and find the sketchbook location (Figure 4). Go to the sketchbook location and find the folder called libraries. If it
32
SERVO 11.2016
is not there, you can create a new one. This is the location where we are going to create the Arduino-ROS library. 2. To build the Arduino-ROS library, open a new terminal and run: $ roscore 3. Open a new terminal in arduino_sketchbook_folder /libraries and enter the command shown in Figure 5. This command will generate the ros_lib library which consists of embedded equivalent messages of actual ROS messages and ROS serial client APIs. Note: It may show an error during generation. Just ignore the error messages. For some ROS messages, embedded equivalent conversions may not be possible. If the ros_lib is now properly in the folder, you may get the examples of ros_lib from the following option (refer to Figure 6): File -> Examples -> ros_lib Now, we can work on simple examples using it. We can start with a Blink LED code. Using this example, we can toggle the state of the LED whenever we publish a value to a topic. Here is how we do that.
Setting the Board Name and Serial Device in the Arduino IDE You can either program Arduino in the real Ubuntu system or VirtualBox. If you are working with a PC, just plug in the Arduino device and when you plug the Arduino in Ubuntu, it will act as a serial device and the Linux kernel will load the USB to serial driver.
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:45 PM Page 33
Use a Linux terminal and execute dmesg or dmesg | grep tty. The dmesg will show the kernel logs and we can find the serial device corresponding to the Arduino. The output of dmesg & dmesg | grep tty is shown in Figure 7 and Figure 8. Figure 7. Linux kernel messages.
The device name for the Arduino is ttyACM0. It may be different for each system.
ROS Running on VirtualBox from Windows If you are working from Windows and VirtualBox, you first need to install the proper driver of the Arduino for Windows. The drivers are available in the Arduino installation folder itself. You may need to download “Arduino for Windows” to get this driver. After installing the driver, use the Windows Device Manager to check the serial port number of the Arduino. If everything is set, it should look like Figure 9. You will only see this if the Arduino drivers are properly installed. After setting the drivers, you can share this serial device in VirtualBox. Launch VirtualBox and got to Settings -> Serial Port. Share the real port in the guest OS as shown in Figure 10. Here, the actual device is COM5:. In the guest device, it is going to be COM1 which corresponds to ttyS0 in Linux.
Figure 8. Dmesg and grep messages.
compile it, and upload it to the board. Note: If you are getting a permission denied error or something similar, you can do the following fix to solve it. These commands will allow us to add a current user into a group called dialout. This group user can access a serial device without permission: $ sudo usermod -a -G dialout
To set the read/write permission to the existing serial device, use this: $ sudo chmod 666 /dev/ttyACM0 or ttyS0
Setting the Board Name and Port in the Arduino IDE Running on VirtualBox
If everything is working great, upload an Arduino-ROS client code for blinking an LED on the Arduino board. You will get it from File -> Example -> ros_lib -> Blink.
After getting the serial port number of the Arduino, we should set these parameters inside the Arduino IDE. Here is how we do that. To set the board name, go to the IDE Menu Tools >Board ->Arduino Mega 2560. Also set the port name from Tools -> Port ->ttyS0. If you are working from a PC, the port will be ttyACMO. If you working from VirtualBox, recall the port that we assigned was ttyS0. Test the connection between the Arduino and VirtualBox by burning a sample sketch called Blink:
First Project: Blink an LED /* * rosserial Subscriber Example * Blinks an LED on callback */ // Arduino – ROS headers
Figure 10. Sharing a serial port in VirtualBox.
File -> Examples -> Basics -> Blink Load the sketch,
Figure 9. Windows Device Manager.
SERVO 11.2016
33
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:45 PM Page 34
Figure 12. ROS topic list.
Figure 11. ROS-Python serial node. #include #include //Creating a Nodehandle ros::NodeHandle nh;
object
//Creating a callback for the topic toggle_led, //whenever a value come through this topic, this //callback will execute // The callback will toggle the state of LED //which is on PIN 13
In this code, we are creating a subscriber ROS node inside the Arduino, which will listen to a topic called toggle_led. Whenever a value publishes this topic, the LED will change its state. Upload this source code to the Arduino and let’s see how to publish values to this topic. First, go to a terminal and run: $ roscore
void messageCb( const std_msgs::Empty& toggle_msg){ digitalWrite(13, HIGH-digitalRead(13)); // blink the led } //Creating a subscriber with a name toggle_led, //and its callback ros::Subscriber sub(“toggle _led”, &messageCb ); //Setting PIN 13 as output and initializing ROS //node and subscriber object void setup() { pinMode(13, OUTPUT); nh.initNode(); nh.subscribe(sub); } // Spining the node each times to listen from //the topic void loop() { nh.spinOnce(); delay(1); }
Run the rosserial node on the PC side to encode/ decode Arduino messages: $ rosrun rosserial_python serial_node.py
If this command is okay, you will get a message like that shown in Figure 11. If the node is working well, enter the following command: $ rostopic list
It will list out the topics on the ROS system. If everything is correct, you may get output that looks like Figure 12. Yes! We did it! We got the topic from the Arduino-ROS client. Now, to publish a value to this topic, use this command: $ rostopic pub toggle_led std_msgs/Empty –once
Take a look at Figure 13. You can find more examples of ROS-Arduino interfaces at http://wiki.ros.org /rosserial_ arduino/Tutorials.
Interfacing an MPU9150 on an Arduino Using ROS Kinetic
Figure 13. LED toggle.
34
SERVO 11.2016
Next, we’ll discuss a more complicated example using ROS and an Arduino. In this example, we are going to interface an IMU (inertial measurement unit) called the MPU-9150 to an Arduino Mega 2560, and visualize its values on Rviz. Required components include:
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:45 PM Page 35
• • • • •
Arduino Mega 2560 USB B-type cable MPU-9150 breakout board Breakout pin headers Arduino male-to-female jumper wires
Project Concept The MPU-9150 is a popular IMU from a company called InvenSense (www.invensense.com). It has a built-in accelerometer, gyroscope, and magnetometer. It also has a motion processing unit called DMP (Digital Motion Processing) to fuse all three sensor data to get accurate orientation information. The MPU-9150 can be easily interfaced to an Arduino using the Arduino library. After retrieving the orientation information from the sensors, it will send it to ROS via the ROS-Arduino interface. The Arduino-ROS client will publish an IMU ROS message and also publish Transform (TF) information. The TF data can be directly visualized on Rviz.
Figure 14. MPU-9150 breakout board.
Soldering MPU-9150 Pin Headers When you purchase the MPU-9150, you will get its pin headers which have to be soldered to the breakout board. Figure 14 shows how the pin headers are soldered. These pins can be interfaced to an Arduino using the male-tofemale jumper wires. You should be very cautious while soldering because excessive heat can damage the main IC on the board. You should keep the pin header alignment perpendicular to the board while soldering. If the pin alignment is not proper, we can’t mount the IMU into a breadboard. After soldering, we can connect the IMU module using the M/F jumper wires. The female connector can be used to attach the IMU, and the male connector can be used for the Arduino. Figure 15 shows the circuit of the IMU to the Arduino 2560.
Figure 15. MPU-9150 Arduino interfacing circuit.
Figure 16. MPU9150 library on Arduino IDE.
Programming the Arduino To start programming with the Arduino, we first need to download the Arduino library for the MPU-9150. We can download it from https://github.com/sparkfun/MPU9150_Breakout. Copy the content of the firmware folder to the /libraries folder. Open the Arduino IDE; if everything is set, you should get what you see in Figure 16. If you get this, you can copy the ROS_IMU interfacing code to the Arduino IDE; compile and burn it to the Arduino. The complete explanation of the code is commented in the code itself. After burning the ROS_IMU code into the Arduino, start Figure 17. Running rosserial node.
SERVO 11.2016
35
Joseph - Using ROS on the Arduino - Nov 16_Blank Rough SV.qxd 10/3/2016 11:45 PM Page 36
Figure 20. Echoing TF.
Figure 18. Listing topics.
Figure 19. Echoing imu_data.
roscore on the PC side. Also, the ROS Python serial node can give you your own device name by using this command:
When you echo the topic, you may get values like those in Figure 19. You can also echo the /tf using this command:
$ rossrun rosserial_python serial_node.py /dev/ttyACM0
$ rostopic echo /tf
If everything is working fine, you will get a message like that shown in Figure 17. You can list out the topics after running the above command. You may get new topics such as /imu_data, /tf as in Figure 18. You can also inspect each topic. The imu_data can be echoed using the following command:
Figure 20 shows a typical output of the tf topic. After checking these topic values, we can display the TF data inside Rviz as you can see in Figure 21. The screenshot shows the imu_link with respect to base_link which is a static link. The IMU link is placed one unit away from base_link. You can move the IMU by using your hand to change its orientation. You can see the same orientation inside Rviz as well. Congratulatios! You are done interfacing one of the best IMUs available on the market to ROS! You can now use it for various applications such as robot control and teleoperation.
$ rostopic echo /imu_data
Conclusion
Figure 21. Visualizing TF.
36
SERVO 11.2016
That wraps up our basic tutorial session on an ROS-Arduino interface. We installed ROS and set up ROS serial packages to communicate with an Arduino. We have successfully set up the interface and then performed a basic Blink code using this interface. We also completed a complex example called ROS-IMU interfacing. SV
Gross - Robot Cartoon - Nov 16_Robot cartoon - Feb15.qxd 10/4/2016 12:32 AM Page 37
SERVO 11.2016
37
Simpson - CNC Electronics - Nov 16_Blank Rough SV.qxd 10/3/2016 11:59 PM Page 38
Building the KReduCNC
By Michael Simpson Post comments on this section and find any associated files and/or downloads at www.servomagazine.com/index. php/magazine/article/November 2016_Build-CNC-Electronics.
Electronics In this installment, I will show you how to connect the controller to your stepper motors in order to get your CNC moving for the first time. This temporary hookup will be used to tune the machine before we attach the table.
Electronic Components You will need the components shown in Figures 1, 2, and 3 to complete this installment. These consist of the following: • SainSmart three-axis controller • 12 volt/five amp power supply • Power cord
7/8” x 15-3/4”. One of the panels will need a notch cut into one end as shown in Figures 4 and 5. These are used to temporarily hold the controller board and the power supply. Later, you will install these panels inside your KReduCNC frame. Links to the various components I used will be provided on my KReduCNC support pages, as well as the drawing files for the panels.
Hardware You will also need two 1/4” thick plywood panels 7Figure 1
In addition to the drive components listed above, the following hardware fasteners will be needed for the hookup: • • • •
Six #6-32 x 1” machine screws Eight #6 washers Six #6 internal tooth lock washers 10 #6-32 hex nuts Figure 3
Figure 2
38
SERVO 11.2016
Simpson - CNC Electronics - Nov 16_Blank Rough SV.qxd 10/3/2016 11:59 PM Page 39
Figure 5 Figure 4
Figure 6 Figure 11
Figure 8
Figure 7
Figure 12
Figure 9
• Two M3-.5 x 10 mm socket head machine screws • Two #4 lock washers • 2’ of red 14 to 18 gauge wire • 2’ of black 14 to 18 gauge wire
= off; and 4 = on as in Figure 9. Set the two-position switch block to 1 = off and 2 = on as shown in Figures 9 and 10. Figure 10
Mounting the SainSmart Controller Start by placing the controller board on the plywood panel as shown in Figure 6. The board should be about an inch from the edge of the panel. The area to the right of the controller can be used to mount additional electronics if needed. With the controller in place, trace the four mounting holes with a pencil. Drill a 3/16” hole at each mark and insert a 1” #6 machine screw with washer into each hole and secure it with a #6 hex nut (Figure 7). Slip the board over the screws as shown in Figure 8. You may need to loosen the nuts a little to allow the screws to slip into the holes of the controller board. Secure the board with a #6 lock washer and hex nut. Set the four-position switch block to 1 = off; 2 = on; 3
Mounting the Power Supply To mount the power supply, start by setting the supply in place on the notched panel (Figure 11). Place it about an inch from the end and trace its outline. Flip the supply on its side with its back on the line closest to the end of the panel. Using a square, extend the holes to the edge of the supply so that you can transfer the position of the holes to the panel; refer to Figure 12. Drill a 3/16” hole at each mark in the panel, then secure with two M3-.5 x 10 mm screws, #6 washers, and #4 lock washers as in Figure 13. For the next step, you will need the three-prong power cord. Connect the three colored leads on the cord to the AC input terminals on the power supply as shown in Figure 14. Connect the green wire to GND, the white wire to N, SERVO 11.2016
39
Simpson - CNC Electronics - Nov 16_Blank Rough SV.qxd 10/3/2016 11:59 PM Page 40
Figure 13
V- (refer to Figure 16).
Hookup Before starting, I want to talk a little about how to interface the CNC to a PC. The easiest way is with a parallel port. Unfortunately, PCs with parallel ports are harder Figure 14 and harder to come by unless you build your own CNC PC. If you are using a fullFigure 16 size desktop machine with expansion ports, it’s an easy and cheap process to add a card to the computer. This option is not possible with the use of a laptop. You cannot use a USB to parallel port Figure 15 converter. USB has too much latency to control a CNC directly. In addition, the Mach3 controller software only supports the parallel port on a 32-bit version of Windows. The Mach3 parallel port driver does not work on any version of Windows 10. Okay, what do you do if you can’t use a parallel port? In this case, you have to offload the control of the CNC to a smart controller. One such controller that I have used is called the SmoothStepper. They Figure 18 will run you about $180, so a parallel port is always my first Figure 17 choice. and the black wire to L. Take the red and black hookup I’m not going to cover using the SmoothStepper, as I already have instructions on my website. I will provide a link wire and strip about 1/2” of the insulation from both ends. on my KReduCNC support pages. Connect each wire to the provided power connector There are other options, as well. I have successfully (Figure 15). It is important to take note of the orientation added an Arduino Uno to my SainSmart and then used of the red and black wires. software to drive it from a USB interface in all versions of Connect the other end of the red wire to the terminal Windows. on the power supply marked V+. Connect the other end of For this project, I will be employing Mach3 on a 32-bit the black wire to the terminal on the power supply marked Windows 7 PC, using a parallel port. The PC shown in Figure 17 is a machine I just picked A complete bill of materials, as well as additional information can be found on my website at www.kronosrobotics.com up at a local thrift store. The machine was $15; the /kreducnc. For any questions or comments, please visit the monitor was $5. I lucked out as it had 32-bit Windows 7 SERVO Magazine forums at http://forum.nutsvolts.com/ Pro already installed. All I had to do was add a mouse viewtopic.php?f=49&t=17408. and keyboard (which I purchased earlier for about $5).
40
SERVO 11.2016
Simpson - CNC Electronics - Nov 16_Blank Rough SV.qxd 10/4/2016 12:00 AM Page 41
Figure 19 Figure 20
Figure 22
Figure 23
Figure 21
The machine runs at 2 GHz with a parallel port, and works great with all my CNC machines. Start by laying out the power supply and controller panels with the rear of the CNC on one side and your PC on the other as shown in Figure 18. Take the controller power connector that you attached to the power supply earlier and plug it into the controller (shown in Figure 19). Please note the orientation of the red and black wires. If you reverse these wires, you will destroy the controller. Once you are happy with the connection, plug the power supply AC cord into the wall. The controller should light up several LEDs. Figure 24 In order to connect the Figure 25 stepper motors to the controller, attach the motor Important!!! Never disconnect the motors from the wires to the connectors that come with the controller. controller while the controller board is powered up! There are several ways to do this. You can cut the header Figure 22 shows another connecter I made. It’s about off the motor wires and connect them directly to the two feet long. Later, when the controller is mounted inside controller connector. I tend to make little connectors by the KReduCNC frame, the extension is needed so the motor soldering some leads to a four-pin header that will plug into can reach the controller. the motor connector. This makes it easy for me to move the No matter how you decide to connect the motors to controller to other CNC machines if needed. Figures 20 the controller connectors, insert each connector into the and 21 show one such connector. The advantage of the little dongle is that you can appropriate socket on the controller (Figure 23). The last part of the hookup is to connect the included reverse the motor direction by pulling out the connector, parallel cable from the controller to the PC as shown in flipping it, then plugging it back in. SERVO 11.2016
41
Simpson - CNC Electronics - Nov 16_Blank Rough SV.qxd 10/4/2016 12:00 AM Page 42
Figure 26
Figure 27
start Mach3 with the correct configuration file. Figures 24 and 25. At this point, it is probably best to remove power from the controller by unplugging the AC power from the power supply.
Starting Mach3
Software and Configuration We will be using Mach3 software to control our CNC. The software is free as long as you use less than 500 lines of Gcode. You can download a copy from www.machsupport.com/ software/mach3. The first step is to download the software and install it. If you are using a parallel port, be sure to install the parallel port driver. If you are going to use a SmoothStepper, don’t install the parallel port driver. I have created three files that will help you get your KReduCNC up and running with very little effort. They consist of the following:
Figure 28
Figure 29
• Kronosrobotics.set • KReduCNC.xml • KReduCNC.lnk These can be downloaded from the KReduCNC support pages. Place the Kronosrobotics.set and KReduCNC.xml files in your Mach3 install directory. Place the KReduCNC.lnk on your desktop, as it is the shortcut to
42
SERVO 11.2016
Figure 30
Let’s start by making sure each axis is connected properly. With your motors connected as outlined earlier, power up your controller power supply and PC. Start Mach 3 by clicking on the shortcut provided. You will be presented with the startup screen shown in Figure 26. Observe the Reset button in the lower left of the window. When first started, this button will be flashing red and green. This tells you that your machine is in reset mode. Hit the button; it should turn to a solid green as in Figure 27. Now, with the Mach 3 window in focus, hit the right arrow on your keyboard (Figure 28). Your X carriage should move to the right. If the carriage moves to the left, you will need to powerdown your controller power supply and reverse the X axis connector. Repeat the process with the Y axis by hitting the down arrow (Figure 29). The table should move towards the back. This may seem reversed at first, but it is from the perspective of the bit in reference to the table so just accept it at this point. Again, if it does not, reverse the connector. Remember to remove the power before doing so. Next,
Simpson - CNC Electronics - Nov 16_Blank Rough SV.qxd 10/4/2016 12:02 AM Page 43
The Easiest The Easiest W Way ay to Design esign Custom Custom hit the page down key shown in Figure 30. The Z carriage should move down. If it does not, reverse the connector. Again, remember to remove the power before doing so.
Front Panels Panels & Enclosures ures s
Conclusion This completes the KReduCNC electronics hookup. Your machine should now be configured and the motor directions all set up. Next month, we will start the tuning process and look at getting your table assembled. SV
You design it to your specifications using our FREE CAD software, Front Panel Designer
FREE
PCB Layout Software & PCB Schematic Software
We machine it and ship to you a professionally finished product, no minimum quantity required
3 PCBs
41
$
3 PCBs
+ shipping
61
$
3 PCBs
81
$
+ shipping
+ shipping
2-layer MiniBoard
2-layer MiniBoardPro
4-layer MiniBoardPro
(Shipped in 1 business day)
(Shipped in 2 business days)
(Shipped in 3 business days)
1
DOWNLOAD our free CAD software
2
DESIGN your 2 or 4-layer PCB
3
CHECK your design with xCHECK DRC
4
SEND us your design with just a click
5
RECEIVE top quality boards in just days
Now Offering
SMT STENCILS
ost effective prototypes C and production runs with no setup charges
P owder-coated and anodized finishes in various colors Select from aluminum, acrylic or provide your own material
Standard lead time in 5 days or express manufacturing in 3 or 1 days
– Nano Coating available–
FrontPanelExpress.com MADE IN THE USA
| www.expresspcb.com
SERVO 11.2016
43
Leeman - Multi-Rotor Hobbyist - Nov 16_Blank Rough SV.qxd 10/4/2016 12:37 AM Page 44
Training for Flight
The Multi-Rotor Hobbyist
By John Leeman Post comments on this section and find any associated files and/or downloads at www.servomagazine.com/ index.php/magazine/article/ November2016_MultiRotorHobbyistTraining-for-Flight.
Last month, we left our quad on the workbench with beeping electronic speed controllers and no idea about how the transmitter was connected. This month, we will train the flight controller to our hardware and take our quadcopter on its official maiden flight!
T
he CC3D Revolution flight controller is an amazingly powerful brain that is capable of controlling many different types of remote controlled craft. We need to train the flight software on the kind of vehicle we have, where the motors for each propeller will engage and begin spinning, the level point of the craft, and how our transmitter is connected. This is often done through a menu interface on the controller, or by just connecting things in a well-defined way. The LibrePilot ground control software (GCS) is a really versatile utility that we will use to perform all of these actions in about 45 minutes!
Software and Firmware Upgrade The first step in setting up our controller is to download the GCS. Head over to the LibrePilot website (librepilot.org) and download the version appropriate for your operating system. (See the sidebar to avoid potential confusion.) All of the screenshots I will be showing were done on a MacBook Air running OSX 10.11.3 and LibrePilot 15.09. I also have the software installed on a Microsoft Surface Pro 4 for field use. Go ahead and install the software like you would any other, and open the application. Upon launch, you will be prompted to answer if you would like to share usage information with the developers. This is a decision that will not affect the functionality of the software at all, but I generally accept it so that I can help the developers make the software better. Attach your flight controller to your computer using a
44
SERVO 11.2016
micro-USB cable. Be careful! These tiny connectors are great for their small footprint, but they are also very easy to rip right off a printed circuit board, and make for a very difficult repair. Do not force any connections or torque on the connector in any way! It is very likely that you will receive a message “GCS and firmware versions of the UAV objects set do not match which can cause configuration problems.” Simply click okay — we will be addressing that concern.
Vehicle Setup You will find yourself in the “Welcome” tab of the application (tabs are located in a strip along the bottom of the window). Click on the setup wizard; a window will pop up that will guide us through the basic vehicle configuration. The first warning is very important. Make sure there are no propellers on your aircraft! We haven’t actually put them on yet, but I know a few people surely did to see what it looks like; maybe even took photos to show at their hackerspace, etc. Do not proceed with any propellers on the vehicle. These are powerful motors and large props that would easily injure you. The next step addresses that error message we initially received. The firmware on your flight controller is probably out of date, but luckily you just need to press the upgrade button. Make sure the flight controller is only powered by the USB port at this point and is not attached to the main battery. The firmware will download to your machine, then upload to the memory on the controller (Figure 1). When you are done, there should be a confirmation message and the navigation buttons will be enabled again.
Leeman - Multi-Rotor Hobbyist - Nov 16_Blank Rough SV.qxd 10/4/2016 12:37 AM Page 45
Figure 2: If the software successfully recognizes the flight controller, it should read “USB: Revolution” and “OpenPilot Revolution” as shown.
Figure 1: Upgrading the firmware on the flight controller is a simple and essential process to get the software and controller to work together. It takes a few minutes to complete. Be sure you are powering the flight controller through the USB connection only.
In the next window, the software will try to identify the hardware you have connected. If you are playing along with the same hardware I am using, it will indicate “USB: Revolution” as the connection device and “OpenPilot Revolution” as the detected board type (Figure 2). Just click Next. The next window wants to know how the transmitter is connected to the flight controller. We used the pulse width modulated (PWM) configuration. Just select that and click Next. The other modes have unique advantages and disadvantages, but that’s another topic for another time. On the next screen, select the appropriate vehicle type (multi-rotor) and click Next. The multi-rotor configuration screen is a lot of fun to browse because it shows you just how many configurations this piece of software knows how to fly. It’s a very comprehensive list that includes configurations I didn’t ever dream anyone would support. Our copter is of the “Quadcopter X” style. Though our frame is shaped like an “H,” the motor layout and forward direction match that shown in the figure of the “X” design (Figure 3). The next screen asks about the electronic speed controllers (ESCs). Different ESCs will have different update strategies. The AfroSlim models we are using are particularly interesting because there is an entire community centered around hacking the firmware on them to improve performance and control type. If you were observant when you took them out of the package, you will have noticed that they even include the name of the hex file that is flashed on the controller on the package. That’s something you don’t see every day! I wasn’t exactly sure of the correct mode here, so I followed the recommendation to leave the default setting of “Rapid ESC” selected. Turns out that was a good suggestion. Some users choose to make their multi-rotor GPS enabled so it can fly to waypoints, station keep, etc. I do plan to do that, but I think that first it is important to get
the quad in the air and make sure we all know how to fly without something helping us fight the wind and spoiling us. For now, just leave the GPS setting disabled. The screen following this will summarize our settings; just click past it as we don’t need a connection diagram — we are all set. The next part of the setup wizard will configure the sensor zero points and ESC start points. The sensor zeroing comes first. Here, the software will determine the offsets and bias for your individual accelerometer and gyro sensors. It is important that you place the vehicle on a sturdy, flat, and level surface. I used a table, but made sure it was actually level first with a carpenter’s level. It may be time to pull out scraps of cardboard and paper to level things. When you’re ready, click the “Calculate” button. After a few seconds, the process will complete and the sensors are calibrated. Now, it’s time to set up the ESCs. You did remove the propellers, right? It’s hard to tell which direction the motors
Figure 3: Even though our airframe is shaped more like an “H,” the relative position of the motors and the forward direction match that of the “Quadcopter X” setting. The difference in geometry of our motor supports doesn’t matter.
SERVO 11.2016
45
Leeman - Multi-Rotor Hobbyist - Nov 16_Blank Rough SV.qxd 10/4/2016 12:37 AM Page 46
Figure 4: Carefully read the ESC calibration steps and then verify you have done each of the three essential steps to begin. Don’t just check the boxes! Doublecheck your work, then check the box!
are turning without propellers, so I put a flag of masking tape on each motor shaft to make it easy to see which direction the motors are spinning. Carefully read the seven step procedure that we will use to calibrate the controllers, and then check the three confirmation check boxes when you have complied (Figure 4). The next screens will guide you through finding the neutral rate for each controller. I recommend you do this for each motor individually, as they could be slightly different and it takes very little time. You will click the start button and slowly advance the slider until the motor just starts spinning. Click Stop, and then move to the next motor. While doing this, it is vital that you confirm that the motor is indeed spinning in the correct direction as shown on the diagram (pay special attention to the vehicle-forward direction so things are not backwards). If your motor is spinning in the wrong direction, pick two of the three wires going from the ESC to the motor and reverse them. Any two. I did this on the ESC end since those connections were the easiest to change. I was lucky
Figure 5: Calibrating each motor just takes a few minutes. Make sure the motors turn in the correct direction as shown in the diagram. If they turn in the wrong direction, just reverse any two of the three power wires to that motor.
46
SERVO 11.2016
and only had to change one out of four. For what it’s worth, my neutral rate time constant was around 1,117 µs (Figure 5). The control loops that determine how the vehicle will react to differences in where it is versus where we want it to be must be tuned. The tuning for every quad is different and can determine if you have a steady and slow photography platform or a hot-rod racing machine that is responsive to the slightest touch of the controls. For now, select the “Current Tuning” option. In a future article, we will discuss how to tune any drone for better performance. This will use the default values in the firmware that are perfectly adequate to get in the air. On the next screen, click Save to write the configuration we’ve just set up to the flight controller’s memory. This will take a minute or two, and then you should power cycle the flight controller.
Transmitter Setup The next step is to set up the transmitter so that the flight controller knows which inputs correspond to which channels. You can launch the transmitter setup wizard from the Welcome screen or from the prompt following saving the configuration to the flight controller. During the process of calibrating the transmitter, we will move the controls to their full extent and assign them functions. From the factory, the transmitter only has the thumb sticks enabled. Using the menu on the transmitter itself, you can enable other switches and knobs if you wish to use them. For now, we’ll stick with the basics. One of the most important settings is the arming setting for the quad. This is how you will enable and disable the motors, and is how you ensure that you don’t end up going to the hospital with propeller related injuries. When setting up the transmitter, the settings revert to always disarmed to ensure that the quad is not accidentally powered up during transmitter setup. When we are done with the calibration, we’ll re-enable this and assign our arming sequence. In the RC input setup tab, we follow the on-screen prompts, answering that our controller is an “Acro: normal transmitter for fixed-wing or quad” type and will operate in Mode 2. These settings mean that the left control stick will be throttle (up-down) and yaw (spin about the vertical axis) and the right control stick will be pitch (forward-backward) and roll (left-right) (Figure 6). This is a “standard” way to configure your transmitter, but Mode 1 is available if you are already used to flying that way. More information about Mode 1 vs. Mode 2 can be found at www.spektrumrc .com/Articles/Article.aspx?ArticleID=2105. The software will then ask you to toggle various switches. Since we didn’t configure any of the extra channels, you can just skip over them. The most important step is centering all of the controls when prompted and
Leeman - Multi-Rotor Hobbyist - Nov 16_Blank Rough SV.qxd 10/4/2016 12:37 AM Page 47
Figure 6: Our controller will run in “Mode 2” with the control stick functions shown here. You can set up the system for another mode if you prefer to fly in a different configuration.
Figure 7: If the controls on the screen move in the opposite direction than you are moving them in real life, tick the invert box for that axis. In my setup, only the pitch control had to be inverted.
then moving them to their maximum extent. This allows the software to calculate the range of inputs expected. You may notice that when you move the sticks on the controller, the sticks on the screen follow but in the wrong direction! On the next screen, we can invert the direction of any axis of control. In my case, I only had to invert the pitch axis (Figure 7). The next screen will ask you to doublecheck that all controls are moving in the correct direction. Once you verify this, the transmitter setup is complete and we can set the arming sequence. I decided to set mine to be “Yaw Right” meaning that with the throttle off, placing the right control stick to its rightmost extent will arm the vehicle. Placing it to the left will disarm the vehicle. A 30 second timeout will also disarm the vehicle (Figure 8).
Installing the Propellers Okay — it’s finally time to make the quad able to lift itself by installing the propellers. I really want to stress here that the fast spinning propellers of a model aircraft can be extremely dangerous. Never place any part of your body near the quad when it is powered and armed. Even when running at low speed, it can be difficult to see the exact arc swept out by the propeller and get too close. It’s easy to remove the propellers and put a scrap of masking tape on
Figure 8: Setting up arming is a crucial step, as you need to remember the arming sequence to get the vehicle ready to fly. The timeout is also a nice feature as it can prevent you from forgetting that the vehicle is armed if you become distracted. Always be sure the vehicle is disarmed before approaching it to disconnect the battery.
Figure 9: Find the appropriate propeller bushing and press it into the recess of the propeller. Also note which propellers are marked for left and right hand rotation.
the motor shaft if any testing or calibration is needed — it takes less time and effort than dealing with an injury. There are even labs that are studying multirotor injury. A YouTube video of a moving propeller impacting a piece of pork is a good reminder of the danger (https://youtu.be/QQoTQZcwZWE). The propeller nuts that came with the motors have a hole in the end that the shank of a hex key or small rod can be passed through to provide some leverage to tighten the prop nut. I hesitate to recommend using Loctite on these, though, as it degrades plastics and our propellers are plastic. You can find nuts with a nylon insert to lock them at the hardware store, but I have had no problems using the provided propeller nuts and simply checking them after every couple of flights (a good habit to form anyway). The propellers are shipped with a set of plastic propeller bushings that adapt the propeller to the motor shaft size. Find the appropriate bushing for your motors and remove them from the set. Press-fit them into the propeller recess and work the propellers onto the motor SERVO 11.2016
47
Leeman - Multi-Rotor Hobbyist - Nov 16_Blank Rough SV.qxd 10/4/2016 12:37 AM Page 48
OpenPilot and LibrePilot
Figure 10: Registering with the FAA and putting your registration information on the quad is required before you can legally fly outdoors. Adding additional contact information is not required, but probably increases the chances of the quad being returned should it fly away.
shafts (Figure 9). Be sure the correct propellers go on the correct motors! Most brands mark the rotation with an “R” and “L” somewhere on the casting. Secure the propellers with the prop nuts and firmly tighten.
Preparing for the Test Flight We are finally ready to fly our creation! Before your takeoff, be sure that you have registered with the Federal Aviation Administration (FAA; see the May 2016 issue of SERVO for details) and put your registration information on the quad. I used a label maker to make a weather resistant label with my registration number as well as contact information (Figure 10). This is beyond what is required, but probably increases the chances of getting your quad back if it flies off. Make sure you have fresh batteries in the transmitter and fully charge the main quad battery. The charger I chose (Turnigy Compact Charger E3) is not remarkably fast, but does the job. Again, observe the best safety practices when charging batteries by never leaving them unattended and preferably in a battery safe (such as http://amzn.com/B00T01LLP8). When everything is ready, wait for a nice calm day with no wind. Take your quad out into a wide open space with no nearby people, structures, powerlines, etc. I’ve found that using community soccer or football fields in the off season with permission works well. Place the quad on a level surface and plug in the battery. I ultimately secured my battery with a strip of Velcro™ on top of the deck to make it easy to get to for testing, and secured the deck down with some Velcro straps for good measure.
Getting in the Air Once the quad is powered up, power-on the
48
SERVO 11.2016
When researching different flight controllers and flight controller software before doing this build, I found a lot of references and even hardware stamped with the OpenPilot name. The OpenPilot website was down, though, and the forums inaccessible. I also saw references to LibrePilot that had software which looked very similar and supported the same hardware. Turns out that in June 2015, there was a rift in the OpenPilot community. Many of the core developers made a fork of the project called LibrePilot with the idea to be open to all contributors and governed by a board of members keeping a steady course for the project. The LibrePilot website and documentation are still a work in progress, but should be considered as the source for all official information and downloads of the software.
transmitter and take several steps back from the vehicle. Check that the trim settings are centered on the LCD screen. With the throttle all the way down, move the yaw stick all the way to the right. This will cause the LEDs on the top of the flight controller to change their flashing pattern. This indicates that the quad is armed. Gently advance the throttle and make sure all the motors are spinning up. We are now ready to take off! Orient yourself with the quad, facing the same right and left direction. You should be facing the rear green motor mount. Slowly push the throttle up until the airframe just begins to lift off the grass. If it is trying to drift in one direction, you can counteract with small control inputs. Continue to increase the throttle until you have successfully cleared the ground. Making continuous small adjustments, try to hover. This is a skill that will take some time to develop, but is essential to being a good pilot. You can try to go forward, backward, left, and right, but only make very small movements on your first voyage. Finally, gently reduce the throttle until the quad begins to descend. Hopefully, you will make a gentle touchdown with a minimum of side-to-side movement when you land (lateral velocity in aerospace lingo). Disarm the quad by placing the throttle at the bottom and holding the yaw stick to the left. You just completed your first flight! Learning to fly can be a difficult process, but patience and persistence are the only way to succeed. There are a plethora of videos online offering tips that are good to watch during your lunch hour. I’ve also posted a video showing the flight of the quad with no further modifications made (https://youtu.be/lYqCfuLYOS8). Once you are comfortable with basic hovering and flight, you can begin to learn how to use the yaw control, and get a feel for flying in different orientations. Just be sure to keep safety first and stay below the 400 foot operational ceiling!
Leeman - Multi-Rotor Hobbyist - Nov 16_Blank Rough SV.qxd 10/4/2016 12:38 AM Page 49
Closing Thoughts During the first few flights, I noticed a design flaw that was easily corrected. The wire landing legs we made for the quad were weak and bent easily. While this could provide some shock-absorbing capability, I didn’t want to be continually reforming the landing gear. I debated the best replacement, playing with metal and acrylic options. For now, the easiest solution to implement has been to use Wiffle balls zip tied to the motor support arms. There is a little bit of compliance in this and it is easy to repair. As an added bonus, I found a pack of Wiffle balls that contained red and white ones that can be used to help mark orientation. I also found that balancing the propellers helped reduce vibration, but is probably not strictly necessary until we try to collect video from the quad. The final product of the last few months of our labor looks pretty good (Figure 11), and is in the air with plenty of power to spare! Next month, we’ll add some telemetry
MAKE YOUR MACHINE
MOVE
Figure 11: After a few months of work, the final product looks very nice and makes a nice addition to anyone’s UAV fleet — small to large!
and GPS systems to our quad, at which point you will be capable of flight planning and logging. SV
MICRO LINEAR ACTUATORS for RC devices
Shown here with optional stand and accessories.
Shown below is an articulated humanoid robot leg, built by researchers at the Drexel Autonomous System Lab (DASL) with a Tormach PCNC 1100 milling machine. DASL researcher Roy Gross estimates that somewhere between 300 and 400 components for “HUBO+” has been machined on their PCNC 1100.
Personal CNC Mills
10mm-200mm sstroke troke supply 6v-12v power supply available force force 25kg+ available 15g-100g net weight
PCNC 1100 Series 3 starting at:
$8480 (plus shipping)
www.tormach.com/servo
www.actuonix.com SERVO 11.2016
49
Blankenship - Sensors and Programming - Nov 16_Blank Rough SV.qxd 10/4/2016 12:39 AM Page 50
Hobby Robotics It’s Really About Sensors and Programming
By John Blankenship
Hobbyists new to robotics often wonder what sensors their first robot should have, but seldom appreciate the role programming plays when turning sensor data into a robotic behavior. Simulators can make it easy to acquire this knowledge before constructing or purchasing a robot that does not meet their needs.
R
probably does not yet own a robot. obotics is a fantastic hobby as attested by the For that reason, everything will be done using number of people interested in building or buying RobotBASIC and its integrated robot simulator. The their own personal robot. Unfortunately, though, if simulator is deceptively simple and its 2D circular you attend a typical robot club meeting, you will representation of a robot might not look all that exciting find that the hobbyists new to robotics often view building until you discover its sensory capabilities. The simulation has a robot only in terms of constructing it. In reality, building a two levels of digital perimeter sensors to detect nearby robot involves so much more. obstacles and a turret-mounted If your robot is going to be MainProgram: ranging sensor to measure the more than a remote control toy, gosub DrawEnvironment distances to more remote it is going to need a variety of gosub InitRobot objects. Its simulated wheel sensors to interact with its gosub GoThroughDoor encoders can ensure that environment by recognizing end movements are accurate and various situations and DrawEnvironment: repeatable. responding with appropriate LineWidth 2 These sensory capabilities actions. Such a cause-and-effect Rectangle 200,290,350,310,black,gray will satisfice for this article, but relationship can be thought of as Rectangle 420,290,600,310,black,gray those readers wanting to expand a robotic behavior. When your Return on the principles discussed will robot can string behaviors InitRobot: love that the simulation has even together to accomplish a goal, it rLocate 230,350 more to offer. It has line begins to look intelligent ... but rInvisible GREEN detectors, a compass, battery we are getting ahead of rPen DOWN Return monitoring, a simple GPS, a ourselves. color-detecting camera, and The intent of this article is to GoThroughDoor: even a beacon detector. help those hobbyists new to gosub FindDoor Another thing to love is that robotics understand the need for gosub PassThrough Return RobotBASIC is totally free for sensors and why programming hobbyists, students, teachers, skills are essential for obtaining FindDoor: and schools. It was developed by and utilizing sensor data. rTurn 90 two retired college professors Since this article is directed rForward 155 Return whose primary goal was to primarily at newcomers to further the interest in subjects robotics, it is important that the PassThrough: such as robotics, programming, examples used be easily rTurn -90 Figure 1 duplicated, as well as modified mathematics, and engineering. rForward 100 and enhanced, by someone that You can learn more about it and Return
50
SERVO 11.2016
Blankenship - Sensors and Programming - Nov 16_Blank Rough SV.qxd 10/4/2016 12:39 AM Page 51
Post comments on this section and find any associated files and/or downloads at www.servomagazine.com /index.php/magazine/article/November2016_Hobby-Robots-Sensors-and-Programming.
download your free copy from www.RobotBASIC.org. Let’s get right to it and discover how easy it is to program your robot’s behavior using sensory information. Look at the program in Figure 1. It begins by initializing the simulated robot in an environment with a wall containing a doorway as shown in Figure 2. Finding a doorway and proceeding through it is not an uncommon behavior for a home-based robot, and it makes an excellent practical — yet not overly complicated — example for demonstrating the need for sensors and the role of programming. It is worth noting that the InitRobot routine drops a simulated pen so that the robot will leave a green trail as it moves. Notice also that the final gosub statement in the MainProgram calls a routine that uses two other routines to move the robot to the door and then through it. When the program in Figure 1 is executed, it produces the result shown in Figure 3. Notice the trail left by the robot as mentioned above. The actions performed by the program are easy to follow because BASIC syntax is very much like normal English. All of RobotBASIC’s robot-related programming statements begin with the letter r. The command rForward, for example, moves the robot forward or backwards (negative values) a specified amount. Other r commands allow you to read sensors, initialize the robot, etc. In this first program, the robot is initially facing the wall and goes to the door by just turning right 90° and moving 155 units (pixels for the simulator). To go through the door, it turns left 90° and moves forward 100 units. The values used for movements like this can be determined through experimentation. This kind of control only works if the robot has sensors called wheel encoders that accurately report how far a wheel moves. Without encoders, one wheel on any robot will always move slightly faster than the other. So, if movements are just timed, the robot’s motion will be somewhat erratic. Even if wheel encoders are used, you cannot be sure of perfect movements. Wheels might slip on a waxed floor, for
example, or from a piece of paper or other small object in the robot’s path. The RobotBASIC robot can Figure 2 simulate such problems by adding randomness to the robot’s movements and sensor readings. We can introduce a 10% error, for example, by adding the statement rSlip 10 to the end of the InitRobot subroutine. A 10% error is larger Figure 3 than we would expect for a typical robot, but using a large error helps demonstrate the principles being discussed. If you change the program to introduce an error and then run it again, it will produce an action similar to that shown in Figure 4. In this case, the movement error caused the robot to collide with the wall. Notice how RobotBASIC reports Figure 4 this error. Closing the dialog box will take you back to the editor and the offending line in the program. Since the error is random, sometimes the robot will make it through the doorway. However, even if it does, it always stops at a different place. There are other error conditions that should be considered. For example, our program currently assumes that the robot always starts in a specified position and is facing the wall in a perpendicular manner. If we modify the rLocate statement in the InitRobot routine as shown below, the robot will have up to a 10 pixel error in both its horizontal and vertical starting positions, as well as a similar error in its initial heading: rLocate 225+random(11),345+random(11),5+random(11)
Figure 5 shows the robot’s path for 10 runs of the program with these new errors. Since the robot now has relatively large errors in its original position and heading, as well as errors in its movements, the accuracy of its actions is downright horrible. Unfortunately, the results shown (as bad as they are) are not unusual for some real world robots that do not use sensors. It also demonstrates why many new robot builders become frustrated with their robot’s performance. Obviously, many of the robot’s paths would have resulted in a doorway collision. If you study the figure SERVO 11.2016
51
Blankenship - Sensors and Programming - Nov 16_Blank Rough SV.qxd 10/4/2016 12:39 AM Page 52
beginning of the doorway by carefully, it is easy to see the reason detecting when the range finder for the error. (pointing slightly forward of directly Ideally, when the robot moves left) finds an opening. This toward the doorway, it should travel measurement points slightly parallel to the wall. With the forward (85° to the left) to ensure random errors introduced, this seldom happens. It is important to Figure 5 the programming loop ends before the -90° range sensor reading sees realize that the farther the robot the opening and causes the robot moves, the more the error to think it is too far from the wall accumulates. Since the robot FindDoor: Figure 6 (which could make it turn toward moves a reasonable distance to rTurn 90 the wall, losing its parallel find the doorway, it means that dist = rRange(-90) orientation as it passes into the when the robot finally turns left // follow wall to doorway repeat doorway opening). 90° to face the opening, it is if rRange(-90)dist then rTurn -1 remember you can always increase perpendicular to the wall; that rForward 1 your understanding of the makes the robot travel through the until rRange(-85)>10+dist program by making modifications doorway at an angle. Furthermore, rForward 55 (such as changing -85 to -90) and any error in the total distance Return observing what happens. This ease traveled to find the door means of experimenting is a major the robot will not stop at the center advantage of using a simulation to of the opening, which further test ideas and develop algorithms. increases the possibility that the Replace the original FindDoor robot will collide with the door routine with the one in Figure 6, casing. Figure 7 and rerun the program. The robot These conditions can be should move similar to one of the handled in a variety of ways, paths shown in Figure 7. You can see that the depending on what sensors your robot has. For changes keep the robot parallel to the wall no example, when the robot reaches the opening, matter where it initially starts and the you could use a compass to make it turn to a orientation of its original heading. It is specific heading to face the doorway instead of important to realize that the robot’s wheel just turning 90°. Alternatively, we could use rotations still have the same inaccuracies shown sensors to make sure the robot travels parallel in Figure 5, but now the robot is constantly to the wall as it looks for the door, which then using sensory information to correct the errors makes a 90° turn more acceptable. The point is Figure 8 in its movement. there are many possible solutions to most You can also see from Figure 7 that the problems. Let’s try the latter approach and robot now avoids a collision with the door casing. make the robot move parallel with the wall. Unfortunately, the robot still has to move a decent distance In order to stay parallel with the wall, the robot should to transverse the doorway. This relatively large movement maintain its initial distance from the wall as it moves. This allows the error to accumulate, causing the robot to drift to can easily be accomplished if the robot has one or more the right or left and preventing it from arriving consistently ranging sensors. The simulator’s ranging sensor is mounted at a final destination. To correct this, we need a way to use on a rotating turret on the front edge of the robot. You can sensor readings to keep the robot moving perpendicular to obtain a distance reading to objects straight ahead with the doorway as it passes through it, but unlike before, we either rRange(0) or just rRange(). Using rRange(-90) will now have no wall for it to use as a reference. We can, look directly to the left and rRange(90) will look to the however, solve this problem using a different technique. right. Of course, you can use any numbers between -90 and The simulator has five perimeter feel sensors mounted +90 depending on the direction you wish to use for the around the front half of the robot. They scan an area as measurement. shown in Figure 8. Unlike the ranging sensor, each feel Figure 6 shows a new version of FindDoor that keeps sensor only produces a 1 or 0 to indicate if it detects an the robot parallel with the wall. After the robot turns right object or not. The data from these five sensors can be 90°, it measures the distance to the wall and stores that in obtained using the function rFeel() where each bit in the the variable dist. As it moves along the wall, the robot will returned value represents the state of one of the sensors turn left and right trying to maintain this distance. Notice (the LSB is the right-side sensor). that the repeat-until loop ends when the robot finds the
52
SERVO 11.2016
Blankenship - Sensors and Programming - Nov 16_Blank Rough SV.qxd 10/4/2016 12:39 AM Page 53
We can use the information from PassThrough: rTurn -90 these sensors to ensure the robot while (rFeel()&17)!=17 stays perpendicular to the wall as it rForward 1 approaches the doorway as shown in These examples demonstrate if rFeel()&8 then rTurn 1 the new version of the PassThrough several points. First, a simulator is an if rFeel()&2 then rTurn -1 routine shown in Figure 9. It uses a excellent way for beginners (and even wend while-wend loop to move the robot advanced users) to test ideas and Figure 9 rForward 60 forward as long as the doorway has develop algorithms for controlling a return not been reached (in this routine, robot’s behavior. Working with a the robot is deemed inside the simulator is especially valuable for doorway opening when both of the beginners because it helps them see outside feel sensors are triggered, why sensors and programming skills creating a value of 17). As the robot are necessary for building a robot. Figure 10 moves forward, if either of the 45° If you are ready to build or buy sensors are triggered (meaning it a robot, first think of what you sees the door casing on the left or right), the robot turns ultimately want it to do, and consider experimenting with a away. This action tends to force the robot to enter the simulator to help you determine what sensors your real doorway perpendicular to the wall. robot will need to accomplish your goals. In the long run, Once the robot has entered the doorway and is having this type of information can save you a lot of time, generally perpendicular to the wall, it takes only a small money, and aggravation. forward movement to reach the desired destination. Since You can download the final program discussed here this smaller movement does not allow much time for errors from the IN THE NEWS tab at www.RobotBASIC.org. to accumulate, the robot ends up in nearly the same place While you are there, don’t forget to download a copy of as indicated by the paths shown in Figure 10. RobotBASIC. SV
Final Thoughts
Motor Control • 15 Amps Per Channel • Dual Channel • Quadrature Encoders • DC Brushed Motors • USB / RC / Serial • 45 Amps Per Channel • Dual Channel • Quadrature Encoders • DC Brushed Motors • USB / RC / Serial
• 160 Amps Per Channel • Dual Channel • Quadrature Encoders • DC Brushed Motors • USB / RC / Serial
10% Off With Coupon Code: NV1
www.ionmc.com SERVO 11.2016
53
SV Webstore - Nov 16 working_SV Webstore May 16 working.qxd 10/4/2016 12:43 AM Page 54
The SERVO Webstore CD-ROM SPECIALS
11.2016 FEATURED
ROBOTICS Arduino Robot Bonanza by Gordon McComb Create high-tech walking, talking, and thinking robots. "McComb hasn’t missed a beat. It’s an absolute winner!" Breathe life into the robots of your dreams — without advanced electronics or programming skills. Arduino Robot Bonanza shows you how to build autonomous robots using ordinary tools and common parts. Learn how to wire things up, program your robot's brain, and add your own unique flair. $29.95
Robot Builder's Sourcebook Fascinated by the world of robotics but don’t know how to tap into the incredible amount of information available on the subject? Want the names, addresses, phone numbers, and web sites of companies that can supply the exact part, plan, kit, building material, programming language, operating system & computer system? Robot Buider’s Sourcebook is just what you’ve been looking for! $36.00
54
SERVO 11.2016
Making Things Move: DIY Mechanisms for Inventors, Hobbyists, and Artists by Dustyn Roberts
In Making Things Move: DIY Mechanisms for Inventors, Hobbyists, and Artists, you'll learn how to successfully build moving mechanisms through non-technical explanations, examples, and do-it-yourself projects — from kinetic art installations to creative toys to energy-harvesting devices. Photographs, illustrations, screenshots, and images of 3D models are included for each project. $29.95
Build Your Own Humanoid Robots by Karl Williams GREAT 'DROIDS, INDEED! This unique guide to sophisticated robotics projects brings humanoid robot construction home to the hobbyist. Written by a well-known figure in the robotics community, Build Your Own Humanoid Robots provides step-by-step directions for six exciting projects, each costing less than $300. Together, they form the essential ingredients for making your own humanoid robot. $24.95
Build Your Own Teams of Robots with LEGO® MINDSTORMS® NXT and Bluetooth® Plan, design, assemble, and program robot squads that communicate and cooperate with each other to accomplish together what they can’t do individually. Inside the authors show you how to construct a team capability matrix (TCM) and use the Bluetooth RoboticOriented Network (BRON) so your robot teams can share sensors, actuators, end effectors, motor power, and programs.$30.00
Robotics Demystified by Edwin Wise YOU DON'T NEED ARTIFICIAL INTELLIGENCE TO LEARN ROBOTICS! Now anyone with an interest in robotics can gain a deeper understanding — without formal training, unlimited time, or a genius IQ. In Robotics Demystified, expert robot builder and author Edwin Wise provides an effective and totally painless way to learn about the technologies used to build robots! $19.95
To Order Call 800 783-4624 or visit our webstore
SV Webstore - Nov 16 working_SV Webstore May 16 working.qxd 10/4/2016 12:43 AM Page 55
Order online www.servomagazine.com SPECIAL OFFERS
Build Your Own Quadcopter: Power Up Your Designs with the Parallax Elev-8 by Donald Norris Build a custom multirotor aircraft! Build and customize radio-controlled quadcopters that take off, land, hover, and soar. Build Your Own Quadcopter: Power Up Your Designs with the Parallax Elev-8 features step-by-step assembly plans and experiments that will have you launching fully functioning quadcopters in no time. Reg $50.00 Sale Price $39.95
The SERVO Buddy Kit
PROJECTS 3D LED Cube Kit
PS2 Servomotor Controller Kit
From the article “Build the 3D LED Matrix Cube” as seen in the August 2011 issue of Nuts & Volts Magazine. An inexpensive circuit you can build to control a servo without a microcontroller.
For more information, please check out the May 2008 issue or go to the SERVO webstore.
Includes an article reprint.
$39.55
This kit shows you how to build a really cool 3D cube with a 4 x 4 x 4 monochromatic LED matrix which has a total of 64 LEDs. The preprogrammed microcontroller that includes 29 patterns that will automatically play with a runtime of approximately 6-1/2 minutes. Colors available: Green, Red, Yellow & Blue. Jig and plastic cases also available.
This kit accompanied with your own PlayStation controller will allow you to control up to six servomotors. Includes all components and instruction manual. For more information, please see the February 2011 edition of SERVO Magazine. Assembled units available! $79.95
$57.95
SERVO 11.2016
55
Savage - Doors Part 3 - Nov 16_Blank Rough SV.qxd 10/4/2016 12:46 AM Page 56
Getting a Handle on Automatic Doors Part 3
In the two previous articles, I focused on using servos for motion, and optical limit switches and DC motors using mechanical limit switches. In this installment, I will discuss stepper motors using magnetic switches and Hall-effect sensors. You can mix and match motor types with limit switch types as your project/application dictates.
By Chris Savage
Opening Doors with Stepper Motors Stepper motors are pretty common in devices that require precision control and positioning, such as 3D printers and pick-and-place machines. Many years ago, they were even used in floppy and hard drives to position the read/write heads. There are two main types of stepper motors: unipolar and bipolar. Unipolar motors are simpler to use (we’ll be using one in our project here). Like the DC motor used in the previous article, stepper motors can’t be connected
Figure 1. Highly simplified control diagram for unipolar stepper motor.
56
SERVO 11.2016
directly to the I/O pins of a microcontroller. With a stepper motor, you still need a driver circuit. This driver circuit can be as simple as several transistors for a unipolar stepper motor. For a bipolar stepper motor, you would actually need a push-pull driver circuit since the coils actually change polarity. Interestingly, for either type of stepper motor, we can use the same driver IC we used in the previous article which was a quad half H-bridge. I’m not going to get into the details of how an Hbridge works. There are many tutorials on the Internet that can be found with a simple search. Suffice it to say that this H-bridge IC allows us to not only energize the individual phases for the unipolar stepper motor, but also to change the polarity of the phases on a bipolar stepper motor. Figure 1 shows a highly simplified control diagram for our use with the unipolar stepper motor. This circuit will allow us to energize the individual phases of the stepper motor, moving it a certain number of degrees per step. In our case, 3.6 degrees per step means that 100 steps rotate the motor one revolution. This is done with four NPN transistors by grounding each phase one at a time while the COM line is tied to the supply voltage. You could also tie the COM line to ground and sequence each phase to the supply voltage to move the stepper motor, which is what we’ll be doing in this demo. A unipolar stepper motor works by energizing the four phases in sequence, and then repeats that sequence to go in a specific direction. Since each step is a certain number of degrees, it is easy to determine how much the motor has turned. Stepping the phases in the reverse order moves the motor the opposite direction with the same number of degrees per step. So, repeatability in both directions is one
Savage - Doors Part 3 - Nov 16_Blank Rough SV.qxd 10/4/2016 12:46 AM Page 57
Post comments on this section and find any associated files and/or downloads at www.servomagazine.com/index.php/magazine/article/November2016_Automated-Doors-Robot-Control-Fundamentals.
of the positive characteristics to using a stepper motor. Four I/O pins are used to control the stepper motor; each pin is an output controlling the specific phase. For door control, we’re not as concerned with precision in the steps per se — at least in this demo. However, if your system involves a gear driven model and you want position control, these would be important properties. Figure 2 shows the wiring of the L293D on the breadboard area of the Parallax Board of Education (BOE) for use in this demo. See the full schematic for more details.
Stepper Motor Demo In the previous articles, I showed you the demos I built for the servo controlled door and DC motor controlled door. In this article, I have built an entirely new demo (Figure 3) with a unipolar stepper motor in place of the servo/DC motor, and with magnetic sensors in place of the optical sensors and custom contact switches on the previous demos. Other than those changes, the demo units are virtually the same. Remember, the limit switches are interchangeable. I could have just as easily used optical limit switches here or even mechanical. However, this article demonstrates magnetic limit switches. You may have noticed the BOE is upside down on the demo. That’s because I needed the breadboard area to be close to where the stepper motor wires came through the back due to their short length. Figure 4 shows how the wires come through behind the BOE. The stepper motor is mounted in the same position and manner as the servo and DC motor in the previous demos. Like the previous demos, I chose a mobile power pack. Figure 5 shows the back side where the power supply sits opposite the BOE. The stepper motor wires run in between through the hole shown in Figure 4. This stepper motor is a unipolar motor. However, using the wiring Figure 3. Full demo.
Figure 2. Wiring the L293D on the BOE. Figure 4. Mounting the hardware and wiring.
Schematic diagram.
SERVO 11.2016
57
Savage - Doors Part 3 - Nov 16_Blank Rough SV.qxd 10/4/2016 12:46 AM Page 58
Figure 7. Upper limit switch affixed with tape.
Figure 5. Power supply and stepper motor (back).
Figure 8. Lower limit switch affixed with tape.
Figure 6. Magnetic switches and magnet.
configuration on the L293D and the same code, you could actually run a bipolar stepper motor. The difference is the bipolar motor would not have a COM wire. If you connected the four phases in the same manner, it should work, making this circuit ideal for either type of stepper motor.
Magnetic Limit Switches Magnetic limit switches can be any type that is sensitive to magnetic fields. So, this could be a Hall-effect sensor, reed switch, or even the magnetic switches used in alarm systems (which are usually the reed switch type). The sensors I used are shown in Figure 6. Essentially, it is a normally open reed switch that closes when near a magnetic field. So, you can use them in the same manner
58
SERVO 11.2016
you would use a normally open pushbutton switch. In the schematic, each switch connects to ground and to the signal line which is pulled to Vdd via a 10K resistor. The program sees a high on the line when that sensor is not active and a low when it is. When the magnet is near the switch, it is closed. Figure 7 shows the upper limit switch being triggered by the door moving up, stopping the door at that point. Figure 8 shows the lower limit switch being triggered by the door moving down, stopping the door at that point. I used tape to affix the magnetic switches and the magnet since it allowed me to make adjustments more easily. The magnet is also taped to the bottom right edge of the door so it could be adjusted. This setup works quite nicely, however, in a more professional application I would embed the magnet in the door. I would probably use two magnets as well — one for each direction limit which would provide more control over the door travel. The switches would be mounted so they could be adjusted. You might have noticed the mounting holes allow for some adjustment in one direction.
Example Code The example code is for the BASIC Stamp 2 and can easily be ported to any other microcontroller. It defines all the I/O definitions first, as well as the constants that define
Savage - Doors Part 3 - Nov 16_Blank Rough SV.qxd 10/4/2016 12:47 AM Page 59
Parts List (1) (1) (1) (1) (1) (4) (4) (1) (1)
Board of Education Full Kit USB (#28803) Li-Ion Power Pack Full Kit (#28989) Unipolar Stepper Motor Bi-Color T1-3/4 LED (#350-00005) 220 ohm 1/4W 5% Carbon Film Resistor (#150-02210) 10K 1/4W 5% Carbon Film Resistor (#150-01030) N.O. Pushbuttons/Switches/Contacts L293D or other H-Bridge Driver IC Magnet
the active/inactive state of the switches/sensors (yes/no). During initialization, the code checks to see if the door is partially open. It does this by checking to see if both limit switch sensors read inactive (not closed). If this condition is met, the door close routine is called. Otherwise, the code enters the main loop while monitoring the pushbuttons. The open/close routines are very simple. Upon entry into the routine, the limit switch is checked. If it is active (in this case, closed), the routine exits. This is always the first thing done in the routine in case the door is already at its limit when the routine is called. We don’t want to move the door before verifying if it has reached its target position. Since we’re using a stepper motor to move the door, it must be controlled by a driver; in this case, the L293D. This driver IC will receive four-bit phase steps on the four inputs to control the motor direction. Opening or closing the door simply involves outputting the phase steps in either a forward or reverse fashion. The loop continues until the door reaches the limit switch and then exits, setting the status LED to the corresponding color for that routine: green if the door is open; red if it is closed. The stepper motor remains energized in the phase it was last in.
Caveats Stepper motors can require higher voltage and current
Notes All connections are to Board of Education (#28850) BOE powered by Li-Ion pack (#28989) Servo voltage jumper in either position Part numbers are from Parallax
Resources Parts: www.parallax.com Project Website: www.savagecircuits.com Savage///Circuits email: [email protected] Savage///Circuits YouTube Channel: www.youtube.com/savage circuits
to operate than a servo or DC motor. Most stepper motors run at 12 or 24 volts. The stepper motor used in this demo is rated at 24V, but is being run at just under 12V, reducing its effective torque. Stepper motors also require four I/O pins to operate directly, whereas the servo required one and the DC motor required two. Magnetic switches are sometimes a little finicky on where they engage. So, while the stepper motor can provide a degree of precision, the magnetic switches aren’t quite so precise in most applications. There’s also the possibility that a stray magnetic field could trip one or both switches, resulting in a false reading.
Final Thoughts While stepper motors are very common in precision mechanisms, they are not usually used in door systems. On the other hand, if you were trying to build a vent or baffle system and needed precise positioning, the stepper motor could help you achieve that. Using two buttons in the demo was done for clarity, completeness, and simplicity. The code and hardware could easily be designed to work with just one button or even none, but rather receive the command from some other part of your code or a flag variable. SV
)
For the finest in robots, parts, and services, go to www.servomagazine. com and click on Robo-Links.
SERVO 11.2016
59
Carroll - Then & Now - Nov 16_Then & Now - Sep15.qxd 10/4/2016 12:54 AM Page 60
a n d
g{xÇ Now
by Tom Carroll [email protected]
The Ideal Home Robot To try and state what the ideal home robot might be is about as useless as stating what is the best NFL team — whether that might be the Arizona Cardinals, Cleveland Browns, or one of my two favorites: the Seattle Seahawks and Green Bay Packers. Since this article is about robots for the home and not football, I want to cover some of the many designs for a home robot that have arisen over the years, and discuss just how close a particular robot design might have come to fulfilling most robot user's needs. Hopefully, I can divulge some of the best features typically desired for a home robot. The Honda Asimo humanoid robot shown in Figure 1 might be considered the best home robot by many, though the price tag is astronomical by most folk’s standards. The company does not sell them yet, anyway. However, they are rumored to cost $2,500,000, or would rent for $150,000 a month. places the tray onto the top of ou might be wondering just the dish and trash sorter. This what exactly is a home built-in robot separates the robot. Some people call them trash items to be placed into personal robots, but I view that the trash chute. The dishes are category as a robot companion sorted into plates, glasses, cups, or a robot that interacts only and silverware, and are with a human. I would like to automatically inserted into the include all robots that are dishwasher below. Jeeves has designed to be used within a already set out your two person’s home or in their yards children’s clothes for the day, in the category of home robots. and has awakened the kids and That includes personal robots, Figure 1. Honda's humanoid bipedal robot, Asimo 'serving' a is helping them get ready for human her breakfast. vacuum cleaner robots, yard the day’s soccer matches and mowing robots, and any robotic swimming lessons. potential ideal home robot (if there is device that is programmable to be During the school months, Jeeves such a thing), I would like to present a used within a person’s home or continues teaching the kids after scenario of a home and its various property. school but employs a one-on-one mythical robots. Imagine yourself I won’t include programmable waking up on a Saturday morning to approach with the same curriculum as appliances such as washing machines, used in their school. None of the the buzzing sound of your robot lawn electronic sewing machines, robots do basic household chores such mower, Sam starting its weekly duties dishwashers, or even 3D printers and as laundry washing and folding, nor of sprucing up your front and back home shop machining systems that making beds and similar tasks as the yards. have been around in our homes and visual and manipulative elements You roll over and ask your shops for years. Many of these use would require a very complex and Amazon Alexa to have your personal programmed computer-controlled expensive robot. butler robot, Jeeves come to your motions to perform a needed task. There are hundreds of different A human maid comes to the bedroom with the breakfast that you robot designs because there are just home once or twice a week for a few ordered for you and your spouse. The as many features that are on the top hours to do these chores. robot announces its arrival just as you of someone’s wish list. both finish dressing after quick showers. As you are done eating, Jeeves returns to remove the tray and dishes, Before delving into features of a Most of the above tasks can be and takes them to the kitchen and
Y
An Ideal Home Robot 60
SERVO 11.2016
Features that Make a Good Home Robot
Carroll - Then & Now - Nov 16_Then & Now - Sep15.qxd 10/4/2016 12:54 AM Page 61
Advances in robots and robotics over the years. Post comments on this article at www.servomagazine.com/index.php/magazine/article/ November2016_ThenandNow_Ideal-Home-Robot.
handled by today’s robot substituting certain materials technology. As with any and fabrication processes consumer product, there are where a lower cost method many features that a does not affect the robot’s prospective buyer will take quality or functionality. For into consideration. As this example, bending a sheet type of robot is designed for metal part on a brake might a home and not an industrial save money over machining application, cost will be a the same part on a milling greater concern, though machine. manufacturing engineers Sure, the shiny milled certainly have to look at the part looks cool, but a properly bottom line. bent sheet metal part can Figure 2. Bicentennial Man projecting his capabilities when he Functionality is important function just as well in most was delivered. in a purchaser’s mind, as is applications. reliability. Overall aesthetics or Substituting a bronze each does just one thing very well. how the robot ‘looks’ is also more sleeve bushing for a ball bearing I’m sure that most people would important for a home robot. Other assembly might save money for use be delighted to have a multi-purpose features such as ease of with a slowly rotating shaft that is home robot such as Andrew Martin programming, maintenance, and occasionally used in the robot’s shown in Figure 2, who was safety are important aspects to be operation. portrayed by the late Robin Williams in considered as well. On the other hand, don’t cut the 1999 film, Bicentennial Man with costs and use such a bushing with a some CGI and special effects tossed constantly and rapidly rotating shaft in. The NDR-114 robot from NorthAm that has a heavy load. Think before Robotics was to be a simple building. Asimo was never designed to A half dozen years ago when I household ‘appliance’ that cleaned be a cost-effective product to sell. was talking with Helen Greiner (the and waited on the family. co-founder and then President of However, a bit of damage iRobot) about their line of robots, she incurred in a jump from a window gave me a bit of background of how changed ‘Andrew’ into a sentient she and her team came to design This past June in my column, I being with a desire to be a human. what is now the Roomba home mentioned the White Box HE-RObot The long journey to become a human vacuum cleaning robot. that debuted back in 2002 (shown in took 200 years. They had first worked on a design Figure 3) that took the long defunct for a large industrial or commercial allpurpose vacuuming and floor cleaning The cost of a robot project is robot. Their designs worked, but there almost always a stumbling block for were a number of issues that the the designer. I have heard so many team wanted to incorporate that were people tell me, “I could make a not cost-effective. fantastic robot if only I had enough They realized that the robot had money.” Unfortunately, well designed to be close to perfect so that it would robots do take money to buy the not damage furniture, walls, and even parts for the fabrication process. people. That’s when they came up Tooling for advanced robot building is with the basic iRobot Roomba that also expensive, not to mention good was designed to do just one job: clean CAD and circuit design software. carpets in a person’s home. Kickstarter and other creative Their single-purpose design crowd-funding sources have helped concept certainly worked well, and many innovative people get their they have sold over 10 million projects off the ground. Roombas. Their products have Figure 3. White Box Robotics’ He-RObot You can save money by expanded into lines of other robots; version of the old Heathkit Hero 2000.
Should a Home Robot Do Just One Job?
Functionality of a Home Robot
Cost of a Home Robot
SERVO 11.2016
61
Carroll - Then & Now - Nov 16_Then & Now - Sep15.qxd 10/4/2016 12:54 AM Page 62
Figure 4. Hubotics Hubot home robot.
Heathkit Hero 2000 name for their newly-developed robot and tried to bring it to market at $5,000. Costs
Figure 5. Synpet Newton home robot.
62
SERVO 11.2016
I remember when our Robotics Society of Southern California group invited the Synpet people to our meeting for a demonstration. Newton rolled around and did his best to impress our membership, and he did. The representatives of the company were as proud as parents of a newborn baby as seen in Figure 6. Figure 6. Newton demo at RSSC meeting. Potential buyers of the Newton decided rose to almost $8,000 before the house payments were more important company went under. Clearance sales than a robot and sales fizzled. Had later sold versions as low as $995 in you bought one, you still would have 2006, but as I mentioned, you had a very expensive computer that basically had a roving PC and nothing just rolled around looking cute. else. Unfortunately, that has been the resulting type of robot product so many companies have tried to sell to the public: a popular existing type of application placed on a mobile Therein lies the caveat; the platform and called a ‘robot.’ These cautionary warning to a potential companies relyed on the uniqueness buyer of any robot. Fancy sales of their product rather than the brochures of many home robots such functionality, and the public didn’t as the ones listed above touted byte, er, bite. computer power, being able to watch Do you remember the Hubotics TV on the robot’s monitor, and the Hubot shown in Figure 4 from the ability to play video games on that 1983 timeframe? That $3,500 in ‘83 same monitor. would be almost $8,500 today, and all Other attributes such as alarm systems, the ability to store recipes on you got for your money was a small computer and monitor/TV set on a the robot’s computer, voice roving base ... plus an Atari 2600 recognition, and even facial video game. recognition were proclaimed. Oh yes, you could add obstacle I’m sure that you have already avoidance, a burglar alarm, and some leaned back in your chair and realized other ‘trinkets,’ but dedicated devices that separate and dedicated systems were far cheaper and more functional. of all the above attributes can be The unique Synpet Newton purchased at a far lower cost. You shown in Figure 5 cost about $6,985 could use your own Windows or Mac in1989, and would be over $13,500 computer. My question is, “Why put all of those ‘functions’ on a mobile today. Yes, you can currently buy a new car for that price (such as the platform and call it a robot?” Nissan Versa) and have enough It is highly doubtful that our money left over for a week’s cruise. technology will ever result in a home The Newton had a ‘powerful’ IBM XTrobot with the functionality of 286 computer, unlike the eight-bit ZAndrew from Bicentennial Man, as 80s in the Hubot. that story line took place in the year
What Tasks Could or Should a Home Robot Perform?
Carroll - Then & Now - Nov 16_Then & Now - Sep15.qxd 10/4/2016 12:55 AM Page 63
2005 — six years after the movie was made but now about 11 years ago. We certainly do not have anything even close to a bipedal humanoid with Andrew’s capabilities.
What Do YOU Want YOUR Robot to Do?
Figure 7. Ted Griebling's M&M sorting robot at SRS meeting.
The only thing that really matters in all this is what you want in a robot. I’ll begin with folks who are robot builders as opposed to those who are looking at the many personal and home robots that are available on today’s market. There certainly is nothing wrong with buying your own robot as there are many complete and quite functional versions on the market, as well as great platforms on which to add your own sensors or whatever. However, I know many people want to build their own automaton exactly how they envision it to be. Your robot can be as simple as an autonomous vacuum with just one important function, or a multi-purpose machine with many versatile capabilities. Again, it’s up to your own
Figure 8. Trinity College robot fire fighting contest maze; note the robot in the center.
wants and needs, and your design and building capabilities if you want to construct your own. Let’s discuss some simple types of robots and progress to a more complex type of home robot.
Competition Robots A popular type of robot is one designed to solve the rules of a contest. The robot can be as simple as the tiny robot in Figure 7 that was designed to sort M&Ms by color (it also was demonstrated at a Seattle Robotics meeting). Another simple type of robot is a line follower. This variety uses a simple sensor on the front that can follow the straight, right, and left curves of a black line drawn on a floor.
Different components can be included to make a line follower able to do more complex things, such as adding side sensors to the design so the robot can follow a maze. Other contests developed within robotics groups have robots locate a soda can, grasp it, and move it to a ‘target’ bin. A popular robot contest that started in Connecticut is ‘fire fighting.’ Take a look at the robot shown in Figure 8; it works its way through a maze to locate a lit candle (the fire) and extinguish it. A very popular contest that was started by the Seattle Robotics Society is RoboMagellan, where a robot uses GPS, color vision cameras, and other sensors the builder might want to add to follow a path set out by orange road cones to a final goal. The robot
Figure 9. SRS Robothon RoboMagellan contestant at Seattle Center.
Figure 10. New York Regional FIRST robot competition 2016.
SERVO 11.2016
63
Carroll - Then & Now - Nov 16_Then & Now - Sep15.qxd 10/4/2016 12:55 AM Page 64
of a wheeled creation with physical as well as conversationally interactive capabilities. Bipedal humanoids are still not safe enough around humans — especially those as large as a human being.
The Al Factor of a Home Robot
Figure 11. Maxbotix EZ proximity sensor for robots.
in Figure 9 is following an outdoor path under the Seattle Space Needle. Building these types of robots to solve the various contests is a lot of fun — from the design and construction of the robot, to the actual competition. One of the best results that comes from building a robot for a contest is the learning aspect. I first knew of Dean Kamen for his amazing medical devices and the Segway, but many students know him best for the series of robot contests that he founded (and what he is personally most proud of) called FIRST: For Inspiration and Recognition of Science and Technology. These competitions are available to students of all ages; they use LEGO kits to advanced platforms like those shown in Figure 10. These are some serious robots, and many of the kids leave high school and go into college as engineering and science majors.
Advanced Home Robots Some robot builders might strive to ‘push the envelope’ and develop a robot for home use that approximates a human being. Now, I’m not talking about a robot like a Bicentennial Man style of bipedal humanoid, but more
64
SERVO 11.2016
The ultimate goal of many advanced robot experimenters and builders is to be able to use artificial intelligence in conjunction with speech and pattern recognition to approximate a sentient robot that can interact with and respond to human commands and needs. They want their creations to be able to recognize individuals, as well as understand them and their environment. This may be stretching AI quite a bit as human beings rarely understand each other. (So, why would we expect a robot to understand us?) Humans are unpredictable, so we can never develop a program for a robot that would expect all of us to react the same way to outside stimuli, conditions, or even fellow human’s speech and commands. Many AI programs are so complex that a mainframe type of computer external to the robot is required for processing large amounts of sensor data, as well as speech and facial pattern recognition. Speaker independent speech recognition adds another complexity to the AI loop. Colloquial and muffled speech as well as other languages can potentially really confuse a robot. Toss in a home that has owners moving furniture around, and toys and similar objects lying about the floor, and your trusty home robot might just go on strike.
Sensor Requirements for a Home Robot In the beginning, I mentioned simple robots that could follow a line
using a simple sensor that had a series of phototransistors that could detect a continuous black line on the floor. In real life, very few of us would want a black line or even a line only visible to a robot (via an IR light source) in our homes. Of course, we would want a robot that could detect walls, doors, and objects. Focused IR beams that reflect off objects allowing sensors to determine the distance to that object via the return reflection’s angle are popular on robots. Ultrasonic sensors (like the one from Maxbotix in Figure 11) send out focused bursts of 40 kHz sound and measure the reflected echo as a distance object. Many mobile robots use the simple sensors mentioned above to perform a fairly accurate way of navigation around a home environment. Previous and current lower priced Roombas still use side sensors to detect walls and door openings, as well as dangerous stair edges to successfully maneuver floors, though the patterns of cleaning (in my opinion) resemble that of a sheep or cow eating grass all over a pasture. Higher-end machines such as the Neato robot cleaners have gone to LIDAR, which is a revolving light radar that can map a room within a home. The top $900 Roomba uses a VSLAM, or Visual Simultaneous Localization and Mapping camera to perform the same task and clean in neat rows.
The Effort Required for Specific Robotic Tasks There are hundreds of tasks that have to be performed around the typical home. Some are needed many times a day, whereas some may only be needed once a year or so. House painting is a task that most of us do every few years, if at all. You certainly would not design that capability into a home robot as it is a very complex task that would only be used a few times.
Carroll - Then & Now - Nov 16_Then & Now - Sep15.qxd 10/4/2016 12:55 AM Page 65
The same goes for a robot that would dig holes and plant flowers and bushes. My wife is in the local garden club and always seems to bring home new plants from nurseries or big hardware stores. (I’m the lucky hole digger.) I listed the above two tasks to illustrate the fact that some projects are simply too hard at this point for a home robot to perform. My wife suggested washing windows as a potential task for a home robot, but I am trying to visualize a robot that can reach as high as our second story outside windows, or at least climb a ladder in order to reach everything. I certainly have spent hours trying to clean all our windows but soon realize my mistakes when I see streaks when the sun comes out. Would a robot perform the task any better? Folding laundry and preparing meals like Jeeves supposedly performed in my beginning scenario would be pretty complex.
A Happy Medium in Home Robot Capabilities There has to be a mid point where we can expect a truly useful home robot that can do things in our households. Costs rise when we try to add too many capabilities, but too few and we only have a mobile rolling computer that does little more than
Figure 12. Berkely BRETT PR2 robot ties a knot.
ask if grandma has taken her morning pills. A robot that comes in from the garage and tells you, “I finished rebuilding the engine in your BMW. Should I do the brake job on the Corvette?” sounds awesome, but would obviously be a bit too complex and expensive for a home robot. (Hey, I’d take the BMW and Corvette and live with a pill-reminder robot.)
Willow Garage PR2 Performs Complex Home Tasks Back around the 2010 timeframe, UC Berkeley had received one of the Willow Garage’s PR2 robots that they later named Brett, for “Berkeley Robot for the Elimination of Tedious Tasks.” Berkeley was in the robotics spotlight for videos that showed their PR2 taking 20 to 25 minutes to fold a towel that the robot had plucked out of a basket of clean laundry.
The demonstration was not aimed at showing the robot’s manual dexterity, but to show how AI and intelligent vision systems came together to allow a robot to perform a complex task (albeit very slowly). PR2 eventually improved with practice, and was soon able to complete the folding process in under six minutes, with a few runs close to two minutes. Figure 12 shows the robot at a later time tying a bow.
Final Thoughts Since most of the topics in this column would require volumes of information to properly describe, I have only touched on some key aspects of a viable robot for a home environment. Functions will be pared down to just those that are of the greatest need in a particular home, even if that is just bringing grandma her pills. I see sensor fusion using LIDAR and intelligent cameras coupled with basic AI software and speech recognition as a way to make a more functional home robot. Higher battery power will be necessary for a full day’s activities. Costs will drop as sales figures rise. I believe a truly functional home robot will soon be a commonplace “appliance” within our homes. SV
Advertiser Index Actuonix Motion Devices ........................49 All Electronics Corp. ...................................7 BotKits ........................................................13 EarthLCD ......................................................7 ExpressPCB ................................................43 Front Panel Express ...................................43
Hitec .............................................................2 Ion Motion Control ...................................53 Maxbotix ....................................................59 Mikronauts .................................................53 NTE Parts Direct ........................................59 PanaVise .....................................................15
Pico Technology ..........................................3 Pololu ..........................................Back Cover ServoCity .............................................59, 67 Spider Hill Prop Works .............................13 The Robot MarketPlace ............................15 Tormach .....................................................49 SERVO 11.2016
65
Nov16 Xmas 2for1.indd 66
10/3/2016 8:01:01 PM
299
$
99
PART: 637179
The Mini Mantis™ 6WD rover will take your off-road robotics excursions to the next level! The bug-like chassis offers extreme A-arm style suspension and with 485 rpm Economy Gear Motors, you’ll have plenty of torque to turn the aggressive off-road tires even when up against the toughest obstacles. The boxed channel chassis provides a rigid backbone with endless mounting and customization options, making it easy to bolt Actobotics® components and electronics directly to the rover.
EXPLORE
ENGAGE
Mini Mantis Features: • 6 Wheel Drive • Extreme Suspension • High Traction Tires
EXTEND
e Mor t duc Pro ! Info AVAILABLE AT SERVOCITY.COM [email protected] • 620-221-0123
Full Page.indd 67
10/3/2016 6:32:15 PM
The new starting point for robotics
Find out more at www.pololu.com/romi Full Page.indd 68
10/3/2016 6:19:47 PM