What an event! We came away exhausted but with smiles on our faces and three prizes! Here’s how we did in each event:
Skittles – 1st
The skittles challenge was one of the only ones where our innovations really paid off, our attachment worked just as we’d hoped and we got spares on every round. We even managed to get a strike on our practice go! We only had one minor issue- there was a slight issue with one of the rotor motors that meant it didn’t always spin up properly but we managed to overcome this on the day by repeatedly spinning up and slowing down until both rotors were spinning properly. The laser pointer worked great for lining up, knocking the pins down to get the spares was really satisfying, we had so much ball speed we not only knocked the spare pin over, we smashed it into the backboard! (back board added just because of our attachment : – ) We also had a very minor issue with maneuvering. We knew we would be very front heavy, but the front tyres compressed so much that the attachment hit ground, adding friction and reducing the grip the rear tyres had. Luckily Mike had time to make some nice little ptfe skids and put lead ballast in the ‘booster’ battery holder. This meant we could actually maneuver, but it was still slightly challenging to line up sometimes.
score: 8,2 9,1 9,1
Speed challenge – 1st
The time spent choosing the motors/voltage/wheel sizes really paid off here, and we got times within 0.1second of what we predicted! Unfortunately we didn’t get the sensor feedback working in time but luckily it wasn’t actually required. Four grippy wheels, tuning the motor speeds to be equal and aiming straight was all that was needed to avoid the sides. We really should have done more tuning beforehand, as we hit the sides on the first few runs whilst dialing the motor speeds in but after that it went straight as an arrow. When we did hit the sides, we just lightly glanced off or continued relatively straight whilst sliding along the sides, so the front bearing guide worked as hoped. Starting at the back of the starting box also allowed us to get some speed up before entering the timed section, saving about 0.1s (fairly significant when your overall time is 1.5s :-). The motors didn’t seem to mind being significantly overvolted for that short period, so we might actually be able to go to an even higher voltage next time, if we can find some suitable motor controllers.
times: 1.618s, 1.54s, 1.526s
Proximity – 3rd
This event was a total fluke for us! We didn’t manage to get the code for our secret (blog post to follow), super accurate sensor finished in time so we were just using a regular IR sensor as many others were. In the hour of testing we got on the day, we were getting +/- 5-10mm of noise in the stop positions, so we settled on a fairly conservative target of 13mm. When we got on the course, the judges commented that many robots using IR had really suffered, so we were then even more nervous. On our first run we got 4.5mm! That was a great, lucky start but we were worried, was that just random luck or was the wall colour or reflectivity causing the robot to stop late? If we got 4.5mm+/-5mm or more, we were quite likely to hit the wall on the next run! We decided to risk leaving the code as it was and lined up for another run. We got 4.5mm again! We’d never been that close or consistent in or practice runs. Maybe the wall reflectivity was actually doing us a big favour. We had originally been testing with a wooden wall, then switched to paper. We had found that the paper might be more consistent but it’s always hard to tell when the results are quite variable. We crossed our fingers and went for the third run: 0.5mm! What a set of results! We were more shocked then anything after the dodgy test performance. It was clearly a fluke but we were just happy we had finished without incurring a fault. We weren’t sure he we’d do in the results, as we’d heard of others getting 0.5mm results and several with consistent few ~3mm scores. In the end we got third.
scores: 4.5mm, 4.5mm, 0.5mm
Three point turn – 7th
This was another challenge where we had grand plans of clever sensors that didn’t quite pan out due to being behind with the code. Like the proximity challenge, we spent an hour on the day of the competition tuning the timing in the basic code we had. We knew the floor surface would have quite a strong effect on the turn speed, so we tested on the closest surface we could find: the textured tiled floor. It didn’t take too long to get the timings pretty close and our test results were surprisingly repeatable. Once we got on the actual playing surface of the challenge though, we quickly found we needed to change a few parameters. On the first one we over shot and drove straight off the platform after the first turn. Luckily there’s just enough time allowed to tune your code once you’ve started the challenge, so we quickly ran back, got the laptop and guessed some new numbers. On the second attempt we were much closer but again slightly went outside the playing surface on the second leg and overshot the finish at the end. Again, we tuned the numbers and went for it again. It wasn’t a perfect run but we at least got back behind the starting line. Dave proved himself as the master of guessing the magic timing numbers , every one of his guesses gave the spot on correction we needed for that element.
times: 16s, 16.04s, 14.5s
Obstacle course – 9th
We were quite hopeful of doing well in this challenge as we had speed, grip, ground clearance and a reasonable amount of driving practice under our belt. We weren’t too worried about most of the obstacles as they were less severe than the wooden obstacles we’d attempted in testing; the one unknown was the turntable, it looked like it might be tricky to line up and time the entry. We’d also noticed in some of the previous challenges that the gearbox that started clicking during testing now wasn’t reversing correctly, so the robot didn’t turn around the centre as it usually did. Rob did a good job of compensating for the dodgy gearbox, getting through the first few obstacles with no faults. The gearbox really scuppered us with turntable though, he struggled to line up and the robot didn’t accelerate straight forwards when asked to, causing us to get caught by the rotating bollards. By an unlucky design fluke, the bollards were a close fit with the gap between our wheels and we got wedged. We have nearly enough grip to climb vertical walls so we initially hoped we’d be able to climb out but we then got wedged against the wall and couldn’t move. In retrospect, we should have been clearer on the rules as none of us knew what the penalty was for getting rescued, so we took some time deliberating. If we’d known it was no penalty for a rescue, we would have moved the robot much more quickly and could have got a much faster time. The rest of the course was uneventful, although we were slightly disappointed with the run over the seesaw. In testing, we’d found the robot was fast enough to hit small wooden blocks and fly quite a distance, so we were hoping we could hit the ramp at speed and finish the course in the air. In reality, the dodgy gearbox hindered s again, and Rob couldn’t quite get it lined up as he hoped. We were still in the air over the finish line, but only because we were bouncing… Still, 1:26 with one rescue wasn’t too bad, good enough for 9th place. We shouldn’t dwell too long on the could haves and might have beens, but after looking at the video for our obstacle run, if we’d rescued the robot immediately after we got stuck, we could have finished in less than a minute with one rescue (no penalties), possibly putting us in first place.
time: 1:26 with one rescue
Pi Noon – second round
Our first round was over very quickly: Rob expertly maneuvered TTOS alongside Bedford Modern then turned in for the kill, popping the balloon in less then ten seconds! The second round didn’t go as well. Mark volunteered to drive this one (mistake?) and we hadn’t had chance to replace the dodgy gearbox (definitely a mistake), so turning was hampered. Westpark Club had the interesting idea of mounting the balloon/spike on the back of their robot, pointing forwards, making it easier for them to keep the balloon out of the way. After a short period of jostling for position, with TTOS failing to get around their side/back, the two robots came together. Westpark Club had lined up better and burst our balloon first. We were out.
Line following – not placed
Before the day we had made the mount for the line sensor and got some simple code written, but it was completely untested. As soon as we saw the course we knew it was pointless to distract ourselves with trying to get it working. The course was so narrow and twisty that we would really struggle to get around it. We had designed our sensor mount to work best on relatively fast line following courses, with no turns over 90 degrees and lots of space between turns, like the course was last year. Those courses favour a sensor that is well in front of the centre of mass. This tight course strongly favoured robots with the sensors very close to the centre of turning, allowing them to follow the very twisty bends and switch backs. So a no score on this one.
Code – 20th
Our low position in the coding probably reflects more on how little coding we’d done when we submitted it than the actual quality of the code. We’ll do better next year!
Aesthetics – 9th
Given we were one of the few entries that didn’t have a mass of wires sticking out, we were hoping to score higher in this challenge.
Build Quality – 9th
Like the aesthetics ‘challenge’, we were hoping to do fairly well here, as the core robot was solid and had some nice features. Maybe not actually having enough room for the wiring and connectors let us down, or maybe we didn’t ‘sell’ the design enough to the judges.
Blogging – 12th
Not a bad score, considering we didn’t start until pretty late in the day and some of the other blogs were excellent.
Overall – 3rd!
A fantastic result for our first time at the competition! With a bit more consistency and preparation, we’re hoping for higher next year
We knew we’d got more attachments than many of the other competitors but hadn’t considered this was an award during the run up to the event, so we were quite surprised when we were announced as the winner!
The team’s been working hard the last couple of days. Let’s compare the progress against the job list from Sunday:
Wiring in the new body:
- 12v power/motors: done (Mark + Paul)
- 5v power: done (Paul)
- Analogue signals: half done (Mark)
- Pwm signals: not started
- Lcd: done (Dave)
- Other digital I/O: not started
- Practice driving: not done
- Mount arms to the servos on the ball launcher: done (Mike)
- All the wiring (both power and signal)*: mostly done, some routing issues (Mike)
- Write some code that allows the wii mote to control the servos and the spinner motors*: not started
- Design and print a wire holder*: done (Laser cut, Paul)
- Practice driving: not done
Straight line speed test:
- Design and print the distance sensor holder / bumper: done (Mark)
- Design and print the second (boost) battery holder: not done
- Turn my pseudo code into real code: not done
Three point turn:
- Finish designing the camera/line sensor mount and print it out: done (Mark)
- Design and print the beacon: started (Mike)
- Get the basic code working*: Dave and Rob have spent two evenings finding and fixing bugs. Getting there but still lots to do
- Tune the timings*: not started
- Finish designing the line sensor mount and print it out* done: (Mark)
- Turn my pseudo code into real code*: not done
- Tune it*: not done
- Turn my pseudo code into real code*: not done
- Design and print the attachment for our probe: not done
- Tune it:not done
* = high priority
T-4 days? Agggghhhhhhh!
As part of night’s work the Ball Flinger has started to take shape….
First stage of assembly
The flywheel assembled with kevlar anti expansion strengthening.
Ball pusher servos and arms installed… now to wire it up and attach the speed controllers
Like many other teams, we’ve now appreciating how much there is left to do with only a week before the competition. On the bright side, we’re all managing to put in a bit of crucial extra time. Tonight we met at our space (I think for the first time we’ve ever hired it on a Sunday) to work on our modules:
I (Mark) was working on the wire routing, with Paul’s help:
(Our speed controllers don’t quite fit, so we lost time hacking at the prints to make room)
Dave (also with Paul’s help) was working on getting the LCD display working, so that we can easily see what menu/challenge code we’re running:
(Hopefully we can get a video of it working tomorrow, it’s looking really slick)
Rob was working on turning my terrible code into something that actually works:
Mike was working on his solid looking ball launcher for the skittles challenge:
And here’s the robot as it stands now, a nice looking but empty body shell and an overly complicated RC car:
What’s left to do? well, by challenge:
- We could enter this now but it’d be nice to have all the components in the new body shell. That needs a load of wiring doing
- Practice driving
- Mount arms to the servos on the ball launcher
- All the wiring (both power and signal)*
- Write some code that allows the wii mote to control the servos and the spinner motors*
- Design and print a wire holder*
- Practice driving
Straight line speed test:
- We could also enter this now but we really want to do it autonomously
- Design and print the distance sensor holder / bumper
- Design and print the second (boost) battery holder
- Turn my pseudo code into real code
Three point turn:
- Finish designing the camera/line sensor mount and print it out
- Design and print the beacon
- Get the basic code working*
- Tune the timings*
- Finish designing the line sensor mount and print it out*
- Turn my pseudo code into real code*
- Tune it*
- Turn my pseudo code into real code*
- Design and print the attachment for our probe
- Tune it
* = high priority
T-6 days? Agghhhh!
On the previous drivetrain blog post we’d found that cordless drill motors were excessively large and powerful for a piwars robot. We continued the drivetrain search, this time looking for smaller motors that could work in a one-per-wheel (four motors total) configuration. From last time we know that we want a total power output of around 120watts, or 30watts per motor. At this point we were hoping that we could use the small ‘1000rpm’ gearmotors we’ve used on small combat robots before.
They give our beetleweight (~1.5kg) combat robot great performance and it looks like other competitors are looking at them too. From previous testing we also knew they had a stall current of ~6A at 12V (72W input) so they look like they might work here. As before, we went to enter them into the drivetrain calculator , but found the 1000rpm motors weren’t listed in their motor database.So this time we put together our own numerical model (spreadsheet) of the torque, acceleration etc, allowing us to change the parameters and see what happens to the performance: This is something we’ve used successfully many times before, for combat robots to dragsters:
So they’re ok but it looks like they top out very quickly. The top speed is much below the 12m/s we were aiming for. What can we do about that? The usual options are: change the gear ratio (complex for us) or use larger wheels (increasing effective gearing, is more easily acheived but increases the stress on the motors). Another solution is running the motors above their rated voltage (something thats very common in combat robots). This also increases the stress on the motors(overheating). Playing with the drivetrain calc again, we found that increasing the wheel size worked up to a point (about where the motors stopped having enough torque to wheelspin), then the overall time started to increase again:
So we can get a good improvement there but its still not quite as fast as we’d hoped for (1.2s). As expected, changing the voltage also worked but running the motors at 36V is a long way from their rated voltage.
Playing with the inputs more showed a combination of increasing the voltage and the wheel size could get us pretty close to target:
Picking the 95mm, 24V design, we can see from the graph that we have more than enough torque (we’re traction limited) for most of the time and the finish speed is pretty high at ~9m/s, much more than we’ll need for the other challenges. Since the 95mm, 12V performance still looks pretty good, we now wondered if we could run at 12V for most of the challenges, just adding the extra battery pack for the speed challenge. This would reduce weight and stress on the motors when we don’t need the extra speed. As before, we quickly mocked up a drivetrain test platform to confirm the model:
Well that looks promising 🙂 The robot is about as fast as before but it’s now much easier to fit the electronics in. Reliability seems good, apart from the occasional wheel falling off… It also has a tendency to wheelie or roll over, so we’ll have to be careful for component placement to keep the centre of gravity low or limit the peak deceleration a little. Its still a little difficult to get the robot to reliably move slowly though (like we’ll need for the proximity challenge) but now the motors are smaller, we can fit smaller wheels just for that challenge, effectively changing the gear ratio and slowing the robot down:
So that’s the drive train sorted, better get the code started now 🙂
or “How I Fell in DooDoo and Came Up Smelling of Raspberries”
OK. Picture the scene. It’s late on a Friday night, and you’ve been hacking on your Pi Wars robot all evening. It’s been productive. Between you and co-roboteer, you’ve ironed out glitches in your Remote Control code, you’ve soldered up the wiring looms, and you’ve even designed and printed custom parts to mount the pi onto the baseplate you laser cut earlier. You’re robot building machines. Go you. High fives all round.
Flushed with success, you both decide to power up the pi and and take it for a spin. So, you plug in the USB cable that you wired up to that adjustable 5v regulator earlier to step down the power from the lipo battery, and… uh. I’m pretty sure the activity light doesn’t normally do *that* when it’s booting. what the..? yank the power! yank the freaking power!
Welcome To Cockupsville. Population: You
OK. wait a second. what just happened? Well, remember that 5v regulator you wired up earlier? The key word there was adjustable, Dingus. And you didn’t check it, did you? You buzzed every single other thing you soldered, but you forgot to check that the output voltage was actually, y’know, ADJUSTED to 5v. So you just sent how many volts into your Pi? 12? Excellent work. well done. Slow hand clap.
You decide to check the damage, hoping against hope that the Pi just kind of wouldn’t notice that you just rammed 12v up it’s tiny USB port and you can pretend like nothing happened. After all, no blue smoke came out, so … fine, right? Fine. Probably fine.
Except, no. Adjusting the voltage regulator to 5v (triple checked – bit late now, but whatevs) and trying to boot again does nothing. Well, not exactly *nothing*, but only some flickering of the activity light and no actual booting. Saddest of sad faces.
Alas Poor Pi
So that’s that then. You’ve fried your pi. It has gone toes up. Time to give it a viking funeral.
But. BUT. A bit of Googling seems to suggest a few things:
- There is such a thing as a polyfuse
- They can heal themselves when they’ve tripped.
- Actually flipping *HEAL THEMSELVES*
- The Pi has one on the USB power input.
So you leave it an hour and, with great hope in your dumb little heart, you plug it in.
Nothing. Just a bunch more flickering. Probing across the polyfuse seems to suggest that it’s maybe a bit better, but stil a loooong way away from being useful as part of a functioning computer. sigh.
M. Night Shyamalan style plot twist
Fast forward two weeks. You’ve nearly forgiven yourself for frying a perfectly innocent Pi. You’ve ordered a replacement and plumbed it in to your Bot, and you’re sitting at your desk idly surfing the web when you see out of the corner of your eye that poor little dead Pi, half hidden under a pile of papers. “I wonder…”, you, um, wonder.
So, you dig out a phone charger and a cable, and you plug it in. <DEITY> be praised! It’s booting. It lives! You’re like the Doctor freaking Frankenstein of consumer electronics! Except that he made a sort of patchwork quilt of chopped up people and you’ve reanimated a credit card sized computer. Same thing apart from that though. Probably.
Step aside Pi Zero, I give you Pi Zombie!
So, there you have it. You too can get away with stuffing 12v into a 5v hole, if you’re very , VERY lucky. But what have we learned? Well, we’ve learned:
- If someone gives you an adjustable voltage regulator and tells you that it’s set to 5v, don’t believe a damn word of it.
- Stick your multimeter across EVERYTHING.
- Raspberry Pis don’t like 12v up them, Corporal Jones.
- Polyfuses are an actual thing. They freaking HEAL THEMSELVES, people. Insane.
- Sometimes you can fall in the doodoo and come up smelling of Raspberries.
Since there’re multiple people all working on different elements of the hardware, we’ve found it useful to share CAD and technical drawings describing the key interfaces. For example, here’s the latest drawing should the overall layout and the key mechanical interfaces:
We saw the pictures of the tracks for the PiWars challenges and figured the best way to test our robot was to build our tracks so we checked out all the specs and figured out a cutting list . Then we had an evening of construction.
Here’s our skittles track
Three point turn track
Speed run track modelled by Mike (left) and Rob (right)
So for the skittle challenge we did some thinking and testing and figured that just “nudging” the ball in the direction of the pins wouldnt cut the mustard so to speak. We needed something a tad more energetic. Resident ingenious person Mark quickly rustled up a 3d printed contra-rotating mechanism to give the bowling ball a spot more oomph!
Here are some tests
The first couple of tests used the small ramp but the ball was getting too much air so we swapped things around for the subsequent tests.
Here is another video
Things we learned from these tests:-
- Lose the ramp. In this case getting air is not good.
- Balance is your friend. 3D hubs and spindles are not well balanced and cause huge vibration.
It is difficult to see but the rig was difficult to hang on to once the wheels got up to speed. So we went back to the drawing board and Mike took on the task of fashioning Mk2. This time we would have steel shafts and a metal chassis. First models for the Mk2
The second version tidied up a bit…
Cutting some metal
A revised hub was printed without the built in spindles to try and make it less out of balance to reduce vibration.
The Mk2 flywheel assemblies are finished and look like this.
There is still quite a lot to do to make the assembly on which the flywheels will be mounted and which will be attached to the front of our robot. Here are some views of the cad of the rest of the assembly.
Some laser cutting for the main support arms, 3d printing for the smaller arms and a bit of metal bashing for mounting brackets. Finished off with a bit of wiring. More updates as the assembly comes together.
Speed with control
The drivetrain of the robot plays a key role in many of the pi wars challenges: success in the speed challenge, line following, three point turn, proximity alert, obstacle course and pi noon all put demands on the drivetrain to do well. Some of these demands are somewhat conflicting, the proximity alert requires the drivetrain to allow very small, precise movements, the obstacle course requires great torque and off road ability, the line following and speed challenge is about acceleration and top speed whilst the three point turn needs very repeatable, controlled movements.
Starting with the speed challenge, let’s see what’s needed for the best possible performance. Ignoring aerodynamic aids to increase downforce, most grippy tyres can provide a coefficient of friction of about 1. What does this mean in practice? IIf the robot weighs 1kg (or 10N), the tyres can provide a maximum of 10N of grip before they’ll slip. From F= ma, this tells us our maximum possible acceleration would be 10m/s^2, or the robot could get 10m/s (~22mph) faster every second! So what if we accelerated that fast for the whole course? what time could we finish in? There are standard equations for constant acceleration that relate time, speed, acceleration and distance. The one we need is s=ut+1/2at^2 or the distance covered is the initial speed times time plus half the acceleration times the time squared. Re-arranging and using an initial speed of 0, we get time equals (2s/a)^0.5 or, for our 7.3m track, (2×7.3/10)^0.5 or 1.2seconds! That compares quite well to last years winning time of just over 3 seconds. What does that mean for our drive train? Well, it obviously needs to be able to provide enough torque to create 10N of traction, so for 50mm wheels that would be a total of 0.25Nm (which could be shared amongst multiple motors, e.g. 0.125Nm or ~1kg-cm each for two motors). But that’s not enough to identify suitable motors, we also need to know how fast they need to spin. From our initial figures, we know that if we accelerated at 10m/s^2 for the whole 1.2 seconds, then our finish speed would be 12m/s (~30mph!). Using our 50mm wheels again, this means we need motors that can rotate at ~3000rpm. Looking at the motors on [motor database], the low gear ratio banebots look the most suitable
But there’s more to choosing a motor than just its stall torque and no load speed. we need to know the weight, size and cost. Again the banebots look ok, all though they’re a little long, we wouldn’t be able to put them side by side and fit within the size constraints. The motor cost looks ok at £xx and the weight is xxkg, both acceptable. But we’ve overlooked something: the torque curve. Whilst the gearmotor can produce enough torque at zero speed, as the speed build the torque drops off, until the usable torque is zero at the ‘no load’ speed. So our initial acceleration would be as planned, it would soon drop off. What we actually need is a motor that outs out enough power to sustain the acceleration. With a constant torque requirement, the maximum power point occurs at the end of the run, when we’re at maximum speed. Providing a traction force of 10N at 12m/s requires a power output of Fxv=120watts, much more than the small banebots motors we selected earlier. Since the torque typically decreases linearly with speed, the peak power output of DC motors is usually at half of no load is 0.5 x max torque x 0.5 x max torque. Filtering our motor database result again with this new selection criteria, we can see that the new winners are the banebots 540 motors with low ratio 36mm gearboxes. These are much bigger than the 370 size motors (~50grams) we were looking at before, weighing 150g each, making two of them possibly weigh more than some of the competitors weigh in total.
Again, since we’re going for the ultimate solution, let’s see if we can make them work, even if they are a bit extreme. Since these motors are actually unavailable now and used to cost $43, is there a cheaper alternative we can test with? The 550 size motors are very common in RC cars, but they tend to have gearboxes with two outputs and a differential, not much use for the tank style driving we’ll be doing. Cordless drills also use that style motor, often with an integrated gearbox and bearings. It’s for this reason they’re quite common in the smaller with classes of combat robots
The only issue is their stock gearing is a little high for what we want, they tend to come with an output speed of ~500rpm for the cheap ones, or 350 and 1300rpm for the more expensive two stage gearing models.
Neither these really work for us but luckily for us the gearbox in drills tend to be two or three stage planetary gearboxes.
This actually makes it quite easy to remove a stage of gearing, making them much faster, back to our target speed of ~3000rpm. Ok, so they’re quite cheap (~£15), they’re very powerful (~100watts) and we think we can make them fit and the gearing is about right. Lets build a test chassis and see how it performs!
Here’s the first go at a layout, using two motors and belt drive. Once the bearings and wheels are accounted for, the drivetrain take up pretty much the full with allowance but they still fit.
Here’s more detail added, with a battery, speed controllers and screws added. It’s starting to look a bit difficult to package the electronics, sensors etc, with the tracks taking up so much space but let’s see if the motors are as good as the look on paper.
Here’s the first printed parts starting to be assembled.
See other blog post for details of making the tracks
And here’s some test videos:
So, as predicted, the drivetrain is large and stupidly powerful. But it looks like it’s a compromise too far: the other secondary requirements of the robot are going to suffer. The control electronics (pi, ADC etc) are going to be difficult to mount, the sensors and bolt-on modules are difficult but most importantly, it was impossible to make the small/slow/precise/repeatable movements required for the proximity and three point turn challenges. A future post will cover what we come up with.