Cost of building a robot for PiWars
2018-4-30
By Sumit Kumar Maitra
This maybe a controversial topic and I fully expect to get panned for it, however, I thought I should write down what I spent on my PiWars bot (First time and in the Beginners category) for two reasons:
- Improve on the costs in future (i.e. spend less money)
- Give others a heads up
Before you continue if you have reached here as a PiWars first timer and not read the PiWars Getting Started manual, I strongly recommend you do. It will give you an idea of lots of options available. This post is more about the costs associated with building a robot from my perspective only.
Back to this post, the thing to keep in mind before you shoot the messenger is, this is my first PiWars and basically my first big project, so I may not be the smartest/most economic component buyer.
That said, I must stress you can do very well in PiWars with a standard off the shelf robot chassis. So I'll start with that.
Before we start, I'll assume you have a Monitor, a wireless Keyboard (bluetooth or proprietary dongle) and a mouse.
Building a competition robot using Tiny 4WD
A year and half ago Brian Coretil wrote an excellent two part article in the MagPi (Issue 51 and Issue 52) on how to build a small robot that could arguably compete well in PiWars. This became the first kit "Tiny 4WD" his company Coretec Robotics started selling. I have built a couple of 'bootlegged' versions of this robot and they are excellent little bots.
Cost of Tiny W4D based robot
Tiny kit costs £55/- from Pimoroni and comes with laser cut acrylic chassis + camera holder + Explorer pHAT Motor Controller + Micro metal motors + Moon Buggy Wheels + nut/bolts/spacers.
You'll need to add a Pi, a battery pack and to do vision challenges a Pi Camera with cable. To do Vision challenges I recommend you get a Pi 3 B+. You'll find the Pi Zero struggling to keep up.
So cost of the bot (assuming a Pi3 and official Pi Camera and a 16Gb MicroSD Card) can be split up as follows:
Item | Qty. | Each | Total | |
---|---|---|---|---|
1. | Tiny 4WD Kit | 1 | 1 | £55.00 |
2. | RaspberryPi 3 | 1 | 1 | £32.00 |
3. | SD Card 16Gb | 1 | 1 | £ 9.00 |
4. | Pi Camera | 1 | 1 | £24.00 |
5. | 2000 mAH battery pack | 1 | 1 | ~£15.00 |
Total | ~£135.00 |
You can play around with the costs by going for an aftermarket Camera from Ebay that starts at about 6 quids.
If you have a LiPo charger you can just go with the LiPo Shim (£10.00) + (upto) 6000mAh LiIon battery (like one of these from Pimoroni) only.
Optional components
Controller/Joystick. If you had a Wii-mote, a Sony PS3/4, or XBox One controller you don't need to buy one, you can easily use one of those as your Controller. You could also use your keyboard, I've seen people use the small bluetooth enable media center keyboards for controlling the robot.
I used the Rock Candy PS3 controller clone. It uses a dongle so takes up a USB port but works fine once you have paired it.Additional Servo(s): This year you could build a passive golf grabber that is basically a U shaped clamp that guides the ball forward. However you might want to use a servo to close a 'gate' once the ball is in, so that you don't loose it till the end.
Other options
You can still use a Tiny 4WD like frame and go with other options like picking one of the following:
- Motor Controllers
- 4Tronix PiconZero It is slightly costlier than Explorer pHAT that comes with the Tiny 4WD Kit
but has beefier H Bridges that can possibly support bigger motors* It also has one Utrasonic Sensor input. The key differentiator however is it's ability to be powered independently. This allows you to separate Power to the Pi and Power to the Motors making the overall platform more stable. That said, people did wonders with the Tiny 4WD this year (Check out Mark Mellors and Neal Olemeadow's exploits).
I got this board in my goody bag and I fully intend to explore it in the near future.
*Update May 2, 2018: Brian Coreteil pointed out that both the Explorer pHATs and Picon Zero have the same H-Bridge Only difference is that PiconZero allows independent power to the motors so you can use it to drive higher voltage motors, whereas the Explorer pHAT doesn't so you are limited to 5V motors. Thanks Brian.
4Tronix PZM Pi Zero Motor Shim I found this quite accidentally but then realised Dr. Emma Norling was referring to this controller in her tweet earlier. This little board seems to be the cheapest H Bridge motor driver you can have at £ 5.00/- and seems quite capable. I might get myself a couple to try out.
PiBorg ZeroBorg This is costlier than the previous boards but has ability to control 4 motors independently. The basic kit with no addons costs 18/-. It battery controller addon it goes upto 23/-. I have used it without the Battery Controller in my bootlegged Pi and it works very nicely. However I would consider this board only if I was using Mercanum wheels or other designs that needed independent speed control of 4 motors. Most PiWars challenge don't need independent control of 4 wheels unless you have a design that enables you to strafe sideways. Apart from that it is an I2C device like the others and you can daisy chain/stack as many as you want so if you built an eight legged robot you could probably stack two of these :-) to get control of 8 motors, but then again 8 legged robots would need more than brushed DC motors to control ;-).
Cytron 10A 5-30V Dual channel DC Motor Driver from Robotshop Keith Ellis, from 2018's Pro Champion team, suggested this one on the Discord server so it is definitely worth noting. Again at 20/- it is not cheap but it can certainly drive some powerful motors. You can easily control it directly from the Pi using the GPIO Zero library.
Generic Motor drivers from Ebay This one was suggested by Brian S who was a Judge and also had an awesome Robot to show called BotMatrix. Just search of Dual H-Bridge DC Motor Controllers. Only thing about eBay is you are a bit on your own, but then again, most standard H-Bridge based controllers have very straight forward interfacing options for PWM control via the Pi. These will need to be powered separately from the Pi as well (which is a good thing).
Power options
You don't really have a lot of options for power because without steady power to the Pi and the Motors your robot won't be able to cope with the rigors of competition.- Option 1 - Have separate power for motors, supply them directly what they need via the controller boards. Depending on how efficient you controller board is you could power them with a bank of AA cells 4/5/6/10 (depending on Motor DC voltage rating). Have a dedicated LiPo with a buck/boost converter to power the Pi. Given LiPos provide 3.7 or multiples of it, you'll either need a UBEC to covert 7.4 or more down to 5V or a boost converter to up 3.7 to 5 and still provide about 2A to the Pi. Be careful with which UBEC you choose some are not recommended for use with RaspberryPi due to noisy nature of their output.
- Option 2 - Use a costly controller + power regulator board and supply it 9v-12v or whatever it needs (ZeroBorg needs Nine so 7 x AA batteries should suffice) and let it do the Buck/Boost to supply the Pi with a steady supply.
Motors
If you go looking for motors at other hobby places like ModMyPi, RobotShop or HobbyKing you will definitely see lots of options and prices. Ebay is always there and so are Chinese portals like Alibaba/Bangood etc.
That's about all the maneuverability you have with respect to components. Big chunk of your this cost is going to be Motors + Driver + Power Supply (Voltage regulator) and Power Source (Batteries). Where you source it from, could give you the cost advantage. You could probably order these from Alibaba, wait a month and have them delivered for 1/3rd the price.
But end of the day, you'll need a Pi, a Camera, a set of Motors, a Motor Controller, Voltage regulator and Power/Battery pack at the very least.
So what is the configuration of Pi-O-Steer?
I built Pi-O-Steer around the ThunderBorg kit. I was an early supporter on Kickstarter and got the kit for 150/-. However PiWars rules prohibit bots wider than 225mm in width and the MonsterBorg wheels are about 50mm each :-). You can't possibly fit the MonsterBorg motors and the wheels together into 225 mm. Eitherways, I wasn't planning to use their (rather fine Aluminum) chassis because where's the 'building' in that. Also from very early on, I wanted a bot that I could steer like a car (meaning front wheel steering), so fixed wheel positions for all 4 wheels wasn't going to work for my idea. I shall not repeat my entire journey here, you can read my PiWars tag archive for that.
I will open source my design once I have it code complete, because when we went to PiWars 2018 we were woefully underprepared mostly in Software. Once I have finished tested the software out for PiWars 2018 challenges I'll open source the chassis design. The software is already up on Github. The code is fairly noobish given I am still new to Python so don't derive best practices from it.
I have not included cost of consumables like 3D Print filament or screw drivers and other tools I bought while or before I was building the Bot and will continue to use after it's been built, I have shown them in a separate table.
So the parts-list for bot (and material used in the arena) is as follows:
(The links are not affiliate links, so click without fear of being tracked or price-jacked :-)... I am sharing my limited research and experience, I am not affiliated with any of these shops. Also the costs stated are on the day i.e. May 1, 2018. Some of the items when I purchased them were costlier. If the item is no longer available I have fallen back to my purchase cost).
** The £25.66/- spent of 4 Servos was a bit much when only one was used. But in hindsight I should have used these for the tilt motor which would have probably prevented it from failing at the competition.
As you can see, the Motors + Motor Controller + Batteries is my biggest cost. The ThunderBorg Controller board is also the voltage regulator so it saved me from buying additional circuitry for it.
Pixy Cam thats the single most costliest component is strictly optional. In future I'll try to move away from the Pixy in favour of RaspiCam+OpenCV combination.
Other long term usage items purchased for PiWars that was either not used or can be reused anytime.
If you are wondering why do I have a second Pi 3B+ (the latest model O_o) and a HyperPixel in that list, well they were not a part of the robot. They formed a self contained Wifi hot-spot that I plugged in the main arena and left it there. I was able to connect my laptop and the robot to that hot-spot and ssh into the Robot as and when required. But to be fair you never actually need a separate hot spot, you could very well use your Phone's hotspot or the Pi on the robot itself as a hotspot.
Other interesting items in the second list are the two pHATs and the Button Shim from Pimoroni. These were used to build a 'on Robot' user interface to switch the robot into various modes and the likes. However, after my 3D Printer broke on the second last day, I didn't have a place to mount this combination elegantly enough. So I abandoned the onboard UI and went with SSH and script change to switch between challenges.
Psst! An open secret...
Most of the hobby/maker shops will offer discount coupons from time to time. Keep a sharp eye out for those and you might be able to save upto 25% at a time. Best way to keep track is sign up to their newsletters. Also, if you are an Education org/charity most of the local maker shops will give you a discount. However if you go all out on Ebay and AmazonUK then all bets are off.
To summarise
The biggest investment for PiWars is not listed above, it is your time, the cost of which pales in comparison to the hardware.
However, there is a very definite material cost involved in building a robust competition Robot. I have tried to show you the mid-lower limit and the mid-upper limits :-). Hopefully you will be able to find a sweet spot for yourself. You can spend a lot more money by building custom PCBs, custom Nerf guns, even custom controller boards OR spend much lower by going with one of the smaller than Tiny 4WD kits as listed on the PiWars site.
Happy Robotting 🤖 !
Updates May 3, 2018
The post has been generally well received and I got some feedback on Twitter, so I thought I would update it.
Neal Oldmeadow on Twitter
Neal reported back saying this Tiny4WD based robot costed around £170/-. That's a validation of my Tiny4WD based estimation earlier in the article. Neal came 4th in the beginner's category.
Dr. Emma Norling and Tom Onin on Twitter
Dr. Norling and Tom (both PiWars veterans) pointed out that a lot of the cost may come out of your Maker toolkit you already have (or will go into your Maker toolbox that you will hopefully use for years in the future). Also, opposed to building your first robot from scratch, if you are a repeat participant, you can expect a lot of components from previous robot still useful.
Douglas Gore on Twitter
Doug pointed out I had not clarified the "Poster Roll" line item and arena building costs. This is true. To be well prepared, it is ideal if you prepare arenas for the automated challenges because they are well documented with exact measurements. Testing the bot in simulated conditions gives you a better chance of success on the day. Me (and Doug) both used cardboard packing boxes, black poster paper and white glue to create makeshift track for straight line speed and Somewhere over the rainbow. I didn't get time to replicate the Minimal Maze. Quite a few people built the entire rigs out of Wood and then paint. If you go down the timber and paint route that will add more to costs and effort.