Distance / Direction PIDs

I’ve added the distance + direction (DD) PIDs: the targets come from the integrated velocity flight plan, the inputs come from the acceleration integrated twice and fused with LEDDAR height for the Z axis.  The outputs feed the existing velocity PIDs’ targets with a max speed of 0.5m/s set for safety reasons during the initial testing.

First few test flights were a super-sky-soarer (3m off the ground in less than a second before I could react to kill!); a couple of careless bugs fixed (and a rebuilt chassis – falling from 3m leads to a harder impact than the lower PCB can cope with even with the super shock-resistant Tarot legs installed).

It’s still a β version with more tuning – I suspect removing the PID I-gain from the velocity PIDs.  However, in principle, it’s working, and so I’ve updated GitHub.  By default the DD processing is commented out – look around line number 2319.  Simply uncomment them to convert the velocity PID targets from the flight plan to the DD PID output.


Having spent ages finding these brilliant flexible landing legs for Phoebe and Chloe from Tarot…



…I now need to get rid of Phoebe’s because they obscure the camera’s view of the ground, and therefore the red dots.

The legs were there to protect the expensive props from direct impact with the ground on landing, and they’ve served that purpose well.  So here’s what she looks like now resting on her ‘hands’ at the end of the arms.

Phoebe, legless again

Phoebe, legless again

The first test was a ground facing video just to see if that code still works – it’s possibly a couple of years since I last shot a video from the on board camera.  Turns out it doesn’t any more, but only a minor problem I think – the video didn’t stop running when the flight did due to changes when all the code got turned into classes.  I’ll sort that out now and try again tomorrow; if it works, I’ll post the video of the lawn during take-off, hover and landing.

Zoe the Zero – 5 – Hardware

There’s now a two week wait before further progress can be made on Zoe the Zero.  The PCBs are in production, and the frame is on its way from China.  It’s not the frame I was intending to use as that one is unlikely to be available until the new year.  But some ebay hunting turned up a fab frame from Tarot, the guys who I got Phoebe’ and Chloe’s fab legs from.  Click the pic to see more, but be patient – the Tarot site is very, very slow.

Tarot TL280C

Tarot TL280C

No-fly zone

Back garden

Back garden

Phoebe and Chloe have lost their test flight area to the kids’ stuff, in particular the paddling pool – Phoebe and the pool are already not on the best of terms due to a little disagreement last autumn.  Oh, and if you look hard, there’s a laundry line out for the summer too!

The park is just too far away for a quick 5 minutes of testing, so it’s the front drive – a mixed blessing: the flying space is larger and completely clear of hard objects except, that is, for the gravel. That means landing legs are mandatory to reduce the chance of props meeting gravel. I already have legs on order for Phoebe (and in fact a set arrived today but short of some critical parts); Chloe already has legs, so until Phoebe’s new legs arrive, Chloe will be flying again. Her HoG is already loaded up with the latest code, and the weather next week is looking good as far as wind and rain is concerned.  She always behaves better than Phoebe, so I’m intrigued to see what effect the latest code changes have on her flights.

Incy wincy spider…



I’m putting these modified DJI F450 Flamewheel legs (leftovers from Phoebe) to the test. On Phoebe, they were the cause of a lot of damage because they were attached to the underside of her ‘body’; she often tripped over her own legs on landing, and smashed her props into the ground.  So I replaced the legs with the gold foam dome and the legs got shelved.

But in their reincarnated version, they are mounted out on the arms, primarily to protect the ‘wrists’ of the arms from bending if they hit the ground. These arms are lovely bits of machined aluminium, but there is a weak-spot at the wrist where the arm’s cross-section like this Π changes to this .  I’ve got a stack of arms with bent wrists due to landing on them.

If today’s weather clears enough for a quick test flight, I’ll try them out to see if they can sustain landings from the much heavier HoG, and if so, they’ll become a permanent installation.


I’m reaching the stage where I think Phoebe is just about all she can be.  I need to get a video to prove it, but her recent flights have been (mostly) safe and consistent.

And I’m already planning what short term upgrades I’ll do next.

  • reinstating her legs – the dome ball on the underside has saved me a fortune in broken legs and propellers due to aborted flights, but now her behaviour has improved significantly she can have her legs back – I actually like the soft sponge dome but it stops me from…
  • putting her WiFi antenna back between her legs to get better reception – currently she’s on a nano dongle and I only get about 5m coverage
  • customizing the RPi.GPIO.wait_for_event() code for performance reasons.  This will allow me to wait on the MPU6050 data ready interrupt and hopefully improve the code response to availability of fresh sensor data even if only marginally
  • moving to a model A+ when available due to it’s more efficient power usage, and layout which allows…
  • fitting a custom PCB akin to a breadboard attached directly to the GPIO pins and the standoff holes.  This will reduce weight and lower the MPU6050 nearer Phoebe’s center of gravity which in turn means that rotation doesn’t trigger the accelerometer, and hence greater accuracy.

None of these are radical changes and they are already in progress.  I’m hoping I can complete then before early September so I can show her off at the next CamJam.


Limb breakages everywhere

I’ve been fitting Phoebe’s new motors and blades.  In doing so, I spotted that one of the arms was broken at the bottom – well hidden inside the central platforms.  And on replacing that, I’ve found out 3 of her four new legs were broken too!  I had spares kicking around so no further cost, but it could explain some of the problems I’ve been having getting  consistent gravity calibration recently, although I don’t think it would wholly explain the flight problems as once she’s airborne, the broken part of the arm is non-structural.

Another lesson though, crash damage can be very hard to see yet structural significant, so arms and legs need careful examination post crash – I’ll add that to my list of checking battery and Raspberry Pi slippage!

Fingers crossed, that’s now all the hardware problems found and fixed, and I can get back to flight testing again!

Testing times

Alas another Phoebe rebuild – fairly significant changes this time, but not really driven by damage, more by hardware improvements.

Phoebe's new outfit

Phoebe’s new outfit

She had a couple of test flights the other day – the first was perfect: take-off from a non-horizontal surface (the lawn), hover and land back at the same point.  The weather was cold and damp, but no breeze.

I upped the flight time to get a video; except this time, she started to drift (still no wind, so no good reason for the drift).  A quick check of flight stats suggested her sensors thought she was tilting at about 4 degrees when she wasn’t, and they were adjusting for that leading to the drift.

A quick investigation showed the breadboard on which the sensors sit had started to come unstuck peeling up at one corner – hence the false angle and drift.  I suspect the cold & damp caused the breadboard to flex and it’s adhesive to come unstuck – that’s certainly how it looked.

In addition, her legs had also started to loosen up again – even though she’d only had good landings  – the trouble I suspect is the legs are rigid, so even soft landings have a hard impact on the legs.

And that finally pushed me to knick some of the bits from Phoenix and instead use them on Phoebe as well as getting some new bits:

  • a new case cut by Phenoptix with a platform for new breadboards supported by noise dampening standoffs
  • new legs – flexible ones from DJI specifically for the F450 which are clearly designed for absorbing impacts
  • new antenna, since the old antenna platform went with the old legs
  • a protective dome over the Raspberry Pi and breadboard – hopefully just for the rain, rather than any head-banging!

As a result of these last tests, my confidence in the software is increasing with each flight; on the downside, the hardware is bothering me more.  Fingers crossed, this iteration will solve the worst problems.

On one final sad note: Phoebe is once more good to fly, but in getting there, she stole a lot of Phoenix’ outfit, leaving Phoenix short of the glamour required for her to walk to red carpet any time soon.

Don’t forget the nut-lock

When I bought a complete set of new legs to replace the ones whose landing skids had been bent by a crash (OTT as it turned out, as I swapped to using 8mm carbon fibre tubes from ebay), it turned out the design has changed subtly for the better: the previous model used a commbination of bolt/washer/leg or body/washer/split-washer/nut or inter-leg strut.  This made sure nothing shook loose, but all those washers were a faff, and I think were part of the reason when I could never get all 4 legs to touch a flat surface.

The new version removed all the washers, and used lock nuts for the body-to-leg bolts; the leg-to-struts bolts had nothing.  The use of lock-nuts is great – the increased strength and stability of the body was clear.  But the cross-leg joists now had nothing to stop their bolts wiggling loose.  I realized that but assumed it must be OK.

But after a couple more trampoline and lawn (!) test flights today, I could feel the frame was wobbling a bit.  Nothing dangerous, but it proved that nut-lock is needed for the bolts connecting the legs to the cross-struts.  Makes sense really given that every bolt on the body has nut-lock to stop it shaking apart.

P.S. Today’s flights were all about yaw tuning which I failed completely to improve.  I think I’ll spend the rest of the day looking for better yaw tuning gains on-line.  On the plus side, I took the drone out of the trampoline, and it flew nicely, except she drifted towards me in the 10mph ‘breeze’ that was blowing!  Luckily I do have an abort signal handler built into the code, so no damage was done to either of us.

P.P.S. She needs a name now she’s alive; I’m thinking of Phoebe (“Fee Bee”) just because I like it, but I’m open to suggestions.

Rebuilding the ballerina’s legs

my new legs for the quad arrive today from quadframe.com to replace the ballerina’s twisted ankle that the last spiralling crash caused.  They don’t come with building instructions as (to quote the site) “Assembly guide: not needed IMHO :)”.  However, when I built my first set, it took several minors tweaks to get the holes that attach them to the DJI F450 frame aligned, and only 3 of the legs touched the ground – somewhere during the build, I’d added some distortion to the frame – certainly it was no fault of the legs themselves.

So even though I only needed the new landing skids to replace the bent ones from the last crash, I decided to build the complete set of new legs and put together some concise instructions how to build these legs onto your DJI F450 frame, and have all 4 feet touch the ground.

New legs

New legs



  • First loosely attach the leg plates together using just the the smaller aluminium tubes (leave off the aluminium brackets which join the legs to the frame – we’ll deal with those later) – each join should be bolt, [optional side plate], leg plate, aluminium tube.
  • Once you have these put together loosely, find a guaranteed very flat surface such as a kitchen work-top, and stand the legs on that
  • Now tighten up the bolts gently, carefully and bit by bit, starting from the 4 nearest the feet and working up to the platform, ensuring that all four legs remain in touch with your flat surface throughout
  • Next add the brackets which connects the legs to the frame – the order here is bolt, brackets, side plate, leg plate, washer, nut – this way the DJI F450 holes align with the frame holes
  • Once you’ve done this, now insert the rubber washers into the feet holes (don’t ask me how, I just swear at them until they go in) and slide in the landing skids – I’ve bought some 8mm carbon tubing from ebay cut to 25cm to replace the standard aluminium ones so my ballerina won’t twist her ankles again during one of my (normally) dramatic test flight landings
  • Now add the end-caps to these skids, and ensure all four end caps touch your flat surface – if not, some gentle twisting of the whole frame can resolve this at this stage.
  • Now double check everything is tight.
  • Only now are the legs are solid and standing on four feet can you add the platform with the cable ties; I have the breadboard velcro’d onto this platform – the heads of the cable ties must be underneath the platform or there won’t be space for the breadboard – tighten each of the cable ties bit by bit so the platform stands evenly on the top of the aluminium struts.
  • Once you’re happy, then snip the excess from the 8 cable ties
  • Finally, with the legs and platform tightly assembled, put the quad on top and bolt the two together using judgement to ensure they were aligned correctly – you’ll need some M3 screws bolts and washers that do not come with the frame nor leg kits.