You actually clicked the link?….
You sick puppy.
(Oh, and my chosen method was GIMP)
Can’t believe it’s been almost a year…
Can’t believe it’s Pi Wars in 3 weeks…..
Can’t believe how much I still have left to do…….
Life is rather full on right now. And so is preparation for Pi Wars 2018. A completely new job and change of direction, a move to a new city and about 6 weeks of travelling all in the last year has meant that preparations for Pi Wars have taken longer than hoped (when do they ever not!) I was equally pleased and somewhat mortified to have been selected to compete again this time round, competition for a place was fierce, with 76 teams eventually lucky enough to make the start line.
After last year’s fairly disastrous outing, managing to compete in only 3 events, I wanted to start early and eradicate the source of my frustrations – power issues and controller issues. I also wanted to address the problems with the ultra-cool but ultra-slidey mecanum wheels. And the motor controller issues. And the sensor issues. And the wiring issues. Ummmm.
So, whilst it may look fairly similar, X-Bot has indeed undergone a significant transformation in terms of what’s under the hood. Pretty much *everything* has either been replaced, rewired or removed! This is hopefully going to be obvious not only in terms of reliability but also controllability.
Ok…. so last’s year’s wiring ‘loom’ was more of a wiring nest – as several folks kindly pointed out (I’m looking at you, Brian)….
I wanted to clean up the power supply and all of the wiring and start again from scratch. I looked at Li-Po but the investment cost to get started was fairly eye- watering. I also wanted to ditch the 5v buck converter I’d been using as I am suspicious of the reliability of these devices to say the least (see earlier blog post for full details) I’ve successfully used the ‘powerbank’ type USB battery packs to run Pi projects (including my first Pi Wars bot) and never had an issue so, in this case, the mantra became stick with what you know.
Horrible buck converter, horrible wobbly wiring!….
The transformation process begins….. (That’s just a little bit neater!)
I genuinely couldn’t believe the amount of wiring I was actually able to remove and still have a fully functioning bot when it was all put back together. I’ve now repeatedly tested this new setup and had literally zero power issues or reboots etc. I am using the ZeroBorg controller to power the four motors (which have also been upgraded) and a Rock Candy controller to replace the PS3 one from last year – another source of potential issues gone!
I’ve also mounted a Pi camera for the autonomous challenges, currently on a temporary lego / blutac mount until I can get time to design and 3D print a proper one. With upgraded motors, cleaned up wiring, reliable power supply and controller I am hopeful that the renewed and revamped X-Bot will at least be reliable enough to compete on the day.
Behold… the scrubbed up X-Bot.
Let’s get grippy….
One of the other things sorely lacking on the original X-Bot was a degree of controllability. Whilst the mecanum wheels are incredibly effective in terms of movement, they actually had very little grip which meant manual challenges were… challenging, and autonomous tasks were made significantly harder.
The original rollers. After hours of trials with different coverings, these proved the most long lasting and effective – wrapped in self-amalgamating plumber’s tape..
I have a confession. My new role at the Open University comes with distinct perks. One of these is access to the awesomely equipped ‘fab lab’ with a range of mouth-watering maker / engineering kit. One particular delight is an industrial strength 3D that can print in a range of materials. At the same time :-O
I will be forever indebted to Kevin, the chap who runs the lab, as he printed some uber-grippy new rollers for me. They have a solid ABS core and a rubber ‘tyre’ surround. They have a load more traction than the previous rollers which really aids both manual and autonomous driving.
Such grip. Many rollers….
Introducing…. X-Bot 360!
One of the other things previously missing was something that I am sorely lacking myself, a sense of direction (just ask my wife – she has literally stopped me walking off a cliff whilst reading a map, boldly declaring that this was, of course, the correct way back to car.) To that end I looked into the scarily mathematical world of the IMU. These incredibly tiny devices combine magnetometer, gyroscope and accelerometer into one board. Combining the outputs of these three readings, and using some incredibly complex mathematics and things called ‘kalman filters’, these boards can give a bot a guide to where it’s pointing with some degree of accuracy. I’d done some experimenting a while ago with a board called a BerryIMU but had not had a lot of success getting reliable readings from it. Whether this was me or the supplied Python library, I am still not sure. I then found the superbly geekily titled BNO055 from the ever reliable Adafruit (but seriously – who uses ‘o’s and ‘0’s in the same product ID?!)
Do you know the way to Pi Wars? – this little thing does!
It’s taken a fair while and a lot of tweaking to tune the motors to start and stop effectively in time with the readings from the IMU, something that’s critical for exact 90 and 180 degree turns. I’m really pleased with the results thus far, thankfully as the board was probably one of the most expensive individual parts at around £35.00
One the main structure of the bot was complete, I started planning the add-ons for the new challenges and also getting OpenCV installed for the Rainbow challenge – but that, as they say, is another story.
Next time – new challenges… new add-ons.. and *$%&*#ing OpenCV!
Well, six months after the fact, I believe I may have located the source of the pretty disastrous issues I had at the last Pi Wars. I actually managed to complete just three of the seven events so it was all a bit heartbreaking tbh.
I had severe issues using a PS3 controller and I fully believed that to be the issue and therefore have looked at moving away from this to another controller type for next time round. The Rock Candy PS3 controllers come highly recommended by Brian Corteil (aka @CannonFodder) who has used them to great effect, in fact winning – twice!
So, you may have seen FRED-209, my new Pi powered Nerf Tank. This uses same ZeroBorg motor controller and I had it linked to an original PS3 controller. I’ve tested extensively in the week and then this Saturday I took it to Cotswold Jam and bam… the controller fails. Niet… Zip… Diddly. Can’t get it to connect, then if it does it drops after a few seconds.
This is *identical* to the behaviour X-Bot exhibited at Pi Wars. So much discussion ensues as to the cause. I know of several other folks who also had issues with these controllers last time round. However, Brian C. lent me a Rock Candy one to test and this also showed exact same behaviour. The RC ones are 2.4ghz and the PS3 ones are Bluetooth so still wasn’t sure if it was radio interference of some kind. Another good guess was noisy DC motors causing problems.
But… I think we have a winner. This DC-DC converter board is a damn liar…
I recently recommended this type of thing having seen similar at Pi Wars last time. I now conclusively retract that recommendation! I used a similar board last time , without a read out, and I believe this suffers from the same issue.
Note the difference in alleged and actual voltage….
This difference is not enough to shut the Pi down, but it is enough to mean power hungry peripherals, say a bluetooth dongle for example, are just enough to make the power dip enough that the USB experiences issues and that kills the controller.
If this were the only problem then simply setting it higher to start off with would solve the problem. We did crank it up to 5.18v on the multimeter which may be getting a little hot for the Pi, but it then ran flawlessly for the rest of the day at Cotswold Jam with loads of people giving FRED-209 a good hammering.
I do though believe there is good reason to suspect that the setting on the board drifts over time. Whether this is vibration from the pot moving the micro screw that you use to set the output voltage or something else, it does seem to change. This is regardless of the state of the batteries being used.
So, I am now hunting for a DC-DC board that sticks out a guaranteed 5v that can be relied one. Core Robotics have one in the pipeline but it’s not available yet. I’d be interested to hear from other teams who used these or similar boards or PS3 controllers last time and also experienced issues.
Until next time….
This one’s been a while in the making, I’ve had a whole summer of fun putting it together. Tbh I can’t remember what first inspired the idea for this. I’ve been wondering about Nerf guns for a while (another amazing thing that wasn’t around when I was a youngster) My main thought was ‘can you use a servo to trigger it?’
Turns out you can
Flushed with initial success, things got out of hand remarkably quickly….
Whilst a fun idea, it obviously wasn’t going to fly that way so I decided I’d see if I could design a ‘Nerf Tank’ from the ground up. I’ve use the ZeroBorg controller again from Pi Borg and a PS3 controller (despite one dying on me at PiWars!) I chose this as the base as I have working controller code and I wanted to focus on the actual 3D design and build this time so I could complete in time for the next Cotswold Raspberry Jam.
The Nerf in the pic above is the Elite Stryfe, about £15 from various places. Or – your local car booty for a whole lot less! ..
I pretty rapidly disassembled it to get a good understanding of the innards. Turns out it’s two flywheels that actual push the dart out and a fairly simple push mechanism to give it a shove. Hmmm… two motors – and a servo. This could work!
I then got OpenSCAD out again, still my favourite 3D design tool, I love its overall simplicity and the fact you can do fairly complex shapes in just a few lines of code (without having to learn what a zillion buttons do) I drew out a basic design for the chassis and I made larger versions of the same motor mounts I made for the PiWars bot.
This is the original chassis I designed, combined with the gorgeous chunky wheels I found on eBay. Sadly the motors turned out not to have enough grunt to move the thing so a rapid and somewhat disappointing switch was made to the Rover 5 chassis you can see in the final version (which was also an eBay find) Also in the below picture is the design for the tilt mechanism which would eventually be controlled by two of the shoulder buttons on the PS3 controller.
Here’s the completed barrel and mechanism box, you can see the servo mounted underneath which attaches to a nice simple pusher. Printing the lid was fairly tricky as it and the box are the largest single pieces I’ve printed at 24cm long. The lid also required a lot of support material which was a bit of a bugger to remove cleanly as it covered such a large surface area.
And flinger bit….
I had to tweak a couple of dimensions on the box to make sure everything lined up nicely but it went together really quite quickly in the end.
You’ll notice this version is black. And really quite poorly printed. After two crappy results I finally worked out something pretty important. Cheap PLA isn’t worth the saving. I spent many hours trying to work out why the results were so poor when previously the printer had been excellent. Turns out it wasn’t calibration, or heat settings, or bed temperature – just naff filament. It works ok on smaller items but the moment you try and print something larger you’ll run into all sorts of problems with warping, lifting and delamination.
I therefore binned the black, and splashed out on some shiny orange (flouro red was the as described colour but hmm…) I also had to redesign the bottom plate to fit onto the Rover 5 chassis. It doesn’t look as good as it did on the chunky wheels but hey, it works.
I’m planing to take this to Cotswold Jam so thought it may be a good idea to give the kids something to aim at (apart from each other!) So – evil alien hordes it is. I’ve also rigged up a Pimoroni Blinkt, the lovely little 8 LED board. This works as a visual countdown, starting with all green LEDs and then one going from green to red every 15 seconds. The plan is to mark out an arena and then the player has two minutes to knock down as many targets as possible and then return to base before time runs out.
Doing a little target practice with the finished build…
(Apologies for rough quality of video – it was downsampled during upload to youtube for some reason.)
I’ll put the STL files for the chassis and the Nerf cannon on Thingiverse when I get some time later this week, I’ll also upload the controller code to GitHub.
I’ve got some future plans for this chap too. Adding a camera and web interface controller seems like the logical next step – and guaranteed to cause remote mayhem! Further to that, I’ve started experimenting recently with OpenCV so am very interested in adding a level of autonomy / target detection. Hopefully FRED-209 will be slightly better behaved than his namesake!
Thanks for reading – pop along to Cotswold Jam on 23rd September if you want to have a play – there’ll be prizes for the highest scores!
Until next time…..
While I’ve had the last few months to freak out about having no motors and therefore essentially no bot, I’ve had plenty of time to try and distract myself and design and build a range of add ons to cope with some fairly stiff challenges in this year’s competition.
I built a 4-way sensor rig from standard ultrasonic sensors. The wiring is pretty um… intense, but it does work and reads distance in all directions. I’ll be using this for the straight line speed test and the maze.
The wiring maze begins…..
All wired up….
I’ve also got a mount for the line sensors sorted and the code working nicely for that (fingers crossed this works on the day!). I’ve also got a simple holder for the golf challenge, although I suspect there may be far sneakier / trickier hazards than this will cope with! :/ The one on the left is the clamp for Pi Noon… Looking forward to that one.
Skittles was great fun last year, and my ‘ball cannon’ worked well enough, sadly my driving let me down and I knocked the ball away from the bot and fluffed a shot. The ‘collect the ball’ component of the challenge has forced me to come up with something to avoid this completely this time round.
The simple arm / servo arrangement should prevent the ball rolling away, and the spring in the tube has enough kick to give the ball a good whack!
Armed and (slightly) dangerous…
I’ve got the bot driving properly and the mecanum wheels are performing really well – such a relief at this point. I’m now (slowly) working on the autonomous challenges and rapidly running out of time. Going to be a frantic dash to the finish line. I reckon I’ll get there
I’ve got a bot that can compete and even with all the difficulties I faced, I’ve learnt so much again through the the build and it’s been really fantastic to be involved in Pi Wars again. I love the social camaraderie, particularly on Twitter. Very much looking forward to seeing old faces and new next weekend.
I’ll be there for both days, do come and say hello. I’ll be the one with the panicked look cos his bot just * shot out the door / took out a small child / knee-capped Eben Upton (*delete as applicable)
See you all next weekend!
It never rains…..
I have not as yet managed to assemble a complete set of four matching motors in the six months I’ve been in preparation for this competition. Unreal.
And, with 10 days to go, I managed to strip two of the gear boxes on the motors I have. I took them apart and discovered that the gears in my ‘metal gear motors’ were in fact… plastic. Seriously? – After how long it took me to find them?
Something’s definitely not right…
Ok… DefCon 1 level panic time. Some great suggestions on Twitter (thanks folks!) and some fleabay scouring actually brought these beauties to my attention thankfully pretty quickly…
Not cheap, but sooooo pleased I found these, 24hrs ago I was pretty much dead in the water.
These motors are 12v and I have been running at 9v. I’ve stepped it up to 10.5v which is the maximum voltage the Zeroborg controller I am using can handle. They are nice and torque-y and are rated at 500rpm, I reckon I am getting 430rpm (ish) at the voltage I am using.
Although I built the motor mounts to be removable it still required a complete strip down of the chassis to remove and replace all four motors (again).
I’ve 3D printed a fake AA battery and run a wire through it so I can use an 8 cell holder with only 7 cells in it to give me the required 10.5v
Works a treat!…
I’ve also removed and replaced the rollers for the ninetiteenth time. This time to add some thread lock. The wheels do put some fairly significant forces through the rollers and they’ve had a tendancy to spit bolts on the odd occasion so I took the opportunity to tighten everything up.
Anyhoo. Another 48hrs flies by, and I have rarely been so grateful to be back where I was two days ago. Onwards – I still have a ridiculous amount to do. At least now I have four matching motors!
I’ll hopefully get time for one more post where I’ll do a quick overview of my wild and frankly heath-robinsonian attachments for some of the challenges.
As I’ve previously mentioned my last Pi Wars bot was rudimentary to say the least. This time I wanted something that would push my skills further and also result in a better designed / built bot. There’s nothing like jumping in at the deep end so when I got my hands on the 3D printer last year, I had an idea. A mad, stupid, almost impossibly, ridiculously complex idea but hey – this is Pi Wars, right? I’ve kept this largely under my hat during the development of these as I honestly wasn’t sure I could get them to work…
So, I saw PiBorg and their mecanum wheeled robot at a couple of events and pretty much fell in love. This combined with witnessing the performance of the omni-directional bots last time was enough to convince me to attempt to do something similar. I looked around and found prices for mecanum wheels to be more than a little eye-watering and therefore decided to see if I could 3D print some. It became pretty clear, pretty quickly, to be honest that the full design is waaaaay beyond my capabilities so I adapted an original set I found on Thingiverse which were just so freakin’ cool.
The first frame appears on the printer…..
They were designed for Lego motors originally so I adapted the hubs to work with Pololu 4mm hubs and gear motors. I also reconfigured the roller attachment to work with M3 bolts, rather than Lego axles.
Roller up…. Roller up.
Each frame takes around 7hrs to print at 0.2mm resolution – fortunately all four printed first time with no errors.
And now the fun really begins…. 4 Wheels. 8 rollers per wheel, 2 bolts per roller.
I’d originally intended to print in NinjaFlex – a really cool rubbery 3D printing filament but sadly it turned out my printer couldn’t use this so I had to get creative.
Printing the basic rollers….
(Each roller takes 19 minutes to print)
I can print in PLA or ABS, both of which are basically solid plastic and therefore completely unsuitable to be used as rollers as they have no grip at all. So – a covering was required. To quote myself and many other Pi Wars contestants – ‘How hard can that be?’
As it turns out, very. Annoyingly, swearingly difficult actually. I have now tried and tested seven types of covering. That’s all 32 rollers removed, coated, replaced, tested. Often twice – just to be certain.
Hanging ’em out to dry….
The list of what didn’t work includes…
It can be seen from the above that coating and grippiness wasn’t an issue, durability was. So, as I was about to throw in the towel, Mark from Astro Designs came up with idea number seven…
7. Self Amalgamating Tape – aka plumbers tape.
And….. we have a winner!
Here’re are the rollers wrapped with tape and ready for testing. It had become a proper love hate relationship with these damn wheels by this point in the process.
Thankfully, I think we’re looking good. Whilst the bot is ridiculously ‘slidey’ the wheels do actually work.
I conservatively estimate I have spent 100+ hours on the wheels alone so I am thrilled that I have a bot with ‘proper’ mecanum wheels. Whether this offers any advantage in the competition remains to be seen!
The tape offers enough grip to get the bot to move and it’s durable enough not to tear straight off. It’s a complete riot to try and drive the thing however. It may yet be christened ‘Uncontrollabot’ !
It has of course made autonomous driving and the associated challenges much, much harder than they may well have been. But hey, we’ll cross that bridge when we get to it.
In about two weeks time :-O
Until next time….
Just a quick update this time. Got a lot on at the moment!
If you were around for the last Pi Wars you may remember I fried a Pi for the first time ever whilst mucking about with relays for the skittle ball release mechanism. It was sad. We had a minute’s silence. RIP RPi.
Weeeeell, it would appear I doggone went and did it again. Nooooooo!! This time it was whilst trying to hook up the Adafruit servo board (which I’ve used successfully several times in the past.)
There was smoke this time too. Proper thick, acrid, really not good smoke type of smoke. Rapidly followed by lots of frantic wire pulling.
Was undoubtedly a classic ID10T error. A quick aide memoir for myself and others:
9v > 5v > 3v3
This is important. It goes wrong quickly if you mix them up. Very quickly.
I was in all honesty surprised when the Pi actually booted up again. Sadly though, a quick check of the i2c deelybob (that’s a technical term I think) revealed that all was not well…
I’m not sure therefore if it’s the i2c driver on the Pi that’s gone, or whether its the servo board. In reality, I’ve not had time to check, I swapped out the Pi for a fresh one and have limited myself to using the hardware PWM on GPIO 18 of the Pi. I’m only running one servo that holds an arm to hold the ball in place (hopefully) for the golf and skittles events.
I had another moment earlier this week when, on reviewing the challenges on the piwars.org site that I realised that there had been a small, but rather flippin important change to the skittles challenge – someone put a turn in the course! I’d not seen the important ‘competitors must collect the ball and then…’ bit. The wonderful @GeekyTim ‘fessed up on Twitter when challenged and admitted that it was indeed he who had added a little something extra. This should make it a lot more interesting and requires some thought in actually controlling the ball to even get it as far as going in the direction of the skittles.
I’ve still got a long way to go, have been manically designing and printing a wild and wacky range of attachments to serve in the array of challenges. More of these next time. The bot is being assembled and reassembled repeatedly as I test, fit and retest different configurations. I’ve got most of the manual challenges sorted now and am working on the challenges that require some form of autonomy. I *may* have made these an awful lot more difficult than they reasonably should be due to a critical design decision I took very early on in the process. I’ll let you know.
So – onward and PiWar’d. Ermm…. did I say there’s only two weeks to go? Gotta dash – I’ll catch up with you all later.
Until next time… (more…)
Finally feels like things are starting to come together. Literally. Since my last bot was made from two cobbled together project boxes, any amount of design is going to be a step forward. I’ve continued to experiment with OpenScad and am really loving it. There’s a really good cheat sheet here that gives you pretty much everything to design anything of any shape. It’s really a very powerful FREE tool and tbh makes much more sense to me than the AutoCad type programs. I’d also previously tried SketchUp and found it to be the same type of thing with a million incomprehensible buttons and a very steep learning curve. For my purposes OpenScad suits perfectly.
So, I’d made the motor mounts (for non-existent motors at the time) and wanted to build a fairly simple chassis to mount it all on. To the 3D printer, Batman! I put together a very basic shape, with holes for the motor mounts, and then, in trying to make it look at least a little less basic, began experimenting with chopping bits out of it. This can bo done really easily with the difference() function in OpenScad that takes one shape away from another.
I then saw fairly quickly where I wanted to go with this and….
Behold – X-Bot is born!
I am printing in PLA with 20% fill, which gives plenty of rigidity without taking a age to print anything. Got to admit that having the 3D printer is an absolute gem. Being able to conceive an idea, design it and hold it in your hand a very short time later is still pretty science fiction to me!
The motor mounts went on really nicely. I’m really pleased with these considering my motors were held on with hot glue last time!
And once all four were mounted…
I started to lay out the electronics to get an idea for the spacing etc…
I also attached the wheels for the first time – Yay! For the first time it actually looks recognisably like a Pi Wars bot.
Was also REALLY pleased to see my calculations were indeed correct and it does fit on an A4 sheet of paper – phew.
So, the basic chassis and control mechanisms are complete. I *still* have motor nightmares to confront. The seller who owes me a back order is yet to come up with the goods so I may yet have to find another plan.
I’m going to focus on the manual challenges next as planning / coding for the autonomous challenges is a non-starter with un-matched motors. I’ve got an idea for the golf challenge and am going to rework last year’s skittles cannon so hopefully can sort those two fairly quickly. I’m designing swap-able mods for each of the challenges, I spent too long having to reconfigure the bot during the day last time so want to avoid this as much as possible.
Can’t believe there is sooooo little time left!
Next time – Weapons of Mass Distraction.
We do this because we love it.
We do this because we love it.
We do this because we love it.
(Keep repeating the mantra)
It’s not that bad, but some parts of the process can make you swear a little. Additionally, it’s 48hrs to the Pi Party, I’ve got loads of prep left to do – and have had lovely tonsillitis for 3 days. Seriously hoping the antibiotics kick in soon!
So – four motors right, just four little motors. No problems. So, I started ordering motors back in November and after two hopeless ebay sellers took TEN WEEKS to fail to deliver anything to me at all I was getting a little sweaty by the time the new year crawled round. So, third time’s a charm (as the saying goes) and I found another supplier who actually delivered the goods in about a week.
Last year’s motors at the front – new ones behind. Ooooh – look at the shiny shiny!
I was sooooo happy to get my hands on these then a few things started to dawn on me. The motors are 12v. I am using a ZeroBorg from PiBorg, the very neat little 4-channel controller they first launched as a Kickstarter campaign. Turns out the ZeroBorg can only take a maximum of 10.4v, so I am actually running it at 9v. Bang goes 25% of the power going to the motors immediately.
In addition to this, the motors are rated as ‘300rpm’ (when running at 12v) So I expected around 200-225rpm at 9v. This I would have been happy with. The motors I used last year were 130rpm but really torque-y. These new ones actually turned out to run SLOWER?!! Whoever gave these their speed rating needs a good talking to IMHO!
Back to square one.
Another year, another supplier (Ireland this time)….
‘Hi, you have 300rpm, 6v motors?’
‘And they’re definitely 300rpm?’
‘And they’re definitely 6v?’
‘Oh, definitely sir’
Fantastic. So, I order and a week goes by. I am juuuust getting antsy when a parcel lands on my door step.
Containing three motors.
And a note ‘Sorry – we’ve only got 3 of those atm, we’ll send you the other on back order when we get it – possibly by March.’
Are. You. Kidding me.
(Oh – it’s now March, and I am still waiting.)
So, I find my FIFTH supplier, in the US this time, who has the exact same motors that I have three of, but at a premium price plus US / UK shipping costs. I therefore spent a lot more than I should to get a matching forth motor. In fairness to the seller, he shipped immediately and it arrived within a week.
And guess what? – The SAME motor, from the SAME manufacturer, with the SAME label actually has a 6mm shaft not a 4mm as the others do. And it runs significantly slower than the other three. Utterly frustrating, but can’t really blame the seller for that one, although QC at this particular manufacturer obviously leaves a lot to be desired!
So, with 6 weeks to the competition, I am yet to find a fully matching set of motors. I have compensated in the code to allow for this, but it does mean slowing the other three down to match which isn’t really great – I certainly won’t be winning any speed runs I feel!
One a positive note, I’ve designed my own motor mounts for standard 25mm gearmotors, I’ll put these on Thingiverse so they’re available. Very pleased with the way they turned out…
I’ve also got the Pi Zero / ZeroBorg wired up and have started tweaking the code. I’ve also got a PS3 controller set up for manual challenges. This is a significant step up in usability and complexity from last time round. Think I’m also going to need a lot more driving practice!
Next time…. Get it together, man. – Time to get chassis-tastic and try and actually build a bot!