My piPad is finished and WAPping nicely with Phoebe.

piPad and Phoebe WAPping

piPad and Phoebe WAPping

piPad and Florence

piPad and Florence

Loving the raspberry coloured keys. ¬†One last problem: I can’t find Florence’ colon* ūüėČ ¬†It does make editing in vim quite hard.

A few notes:

  • powered by a 5V 2.1 LiPo battery bank
  • video cards and RPi independently powered by the bank via a USB cable splitter – powering the Pi via the video cards GPIO’s or Vout USB A socket leads to reduced voltage for the Pi (rainbow square in top right of the screen is the ‘underpowered’ warning
  • florence is a good as she can be but she lacks the finer touches shown on other linux implementations – I presume due to GPU capability for rendering opaqueness / transparency – the default Raspiand distribution upgrade from Wheezy (version 0.5.1-1) to Jessie (version 0.6.2-2) will hopefully help when that happens.
  • florence also doesn’t not have access to a font with the right symbolic characters so her special keys are blank – not the end of the world, just less pretty
  • Once she’s scaled to a size suitable for the 7″ DSI Raspberry Pi screen, I needed to use a stylus even though I have tiny fingers.

She’s met her requirement to control Phoebe in flights so I can follow my purity desire and use the piPad instead of my iPad to control Phoebe’s flights. ¬†That’s how I’ll be doing it at the next Cotswold Jam.

*No seriously, can you see a colon on the keyboard? It sometimes appears with a set of keystokes I’ve not yet tracked down, but mostly it just vanishes down a black hole.

P.S. Found it – right-shift + ‘;’ what made it hard for me was that neither left-shift nor caps-lock revealed the colon, only right-shift does it.

Oh, feck!

Something has gone horribly wrong with Zo√ę. ¬†I can only get one run from her; a second time results in completely duff sensor readings. ¬†A power-reboot allows one more run and then the same happens again. ¬†Any level of the code dating back months shows the same problem. ¬†That suggests sensor damage. ¬†She did take a major crash on her last flight with unknown cause – perhaps that was symptomic of the sensor damage or perhaps the cause?

So it’s RIP Zo√ę, Chlo√ę and Phoebe for now as I’m out of MPU-6050’s.

Annoying because I’d just recalibrated yesterday, and wanted to test it in today’s good weather along with a set of changed butterworth filter configuration.

On the plus side, it’s now full speed ahead for HoG – first stop is to get some paper so I can print out the MPU-9250 specs and update the code.

Code updated on GitHub

The latest code is up on GitHub, but be aware that because the code is mostly the same for Chlöe and Phoebe, the code checks which of Phoebe or Chlöe are running it so that the right per-platform pieces are used. If the host is not Phoebe or Chlöe. it aborts.

For you to run it, you’ll need to add your own Raspberry Pi hostname to the list of permitted pilots, and

Search for “i_am_phoebe” in the code to see what I mean.

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.

Bid farewell to Phoebe?

Phoebe died this morning.  Her body is good, but her soul is gone.  The cause is not entirely clear, but during a test, she crashed, and the impact pulled out her Adafruit Cobbler from the sensor / PWM breadboard meaning her power was killed abruptly.  Her SD card was damaged and would not reformat.  I suspect the battery slid, hitting the GPIO ribbon cable tugging the Cobbler out.

I do have an image backup of her, but I need to get a new mini-SD card.

Or I could have Phoenix rise from Phoebe’s metaphorical flames and pick up where Phoebe died. ¬†Phoenix is Phoebe’s big sister with a bigger, stronger, carbon fiber arms and legs, top quality ESCs and top of the range motors and blades, and she was supposed to take over from Phoebe when Phoebe’s testing was done.

Looking at the costs of a replacement card though, I think Phoebe shall be brought back from the dead, and I’ll leave Phoenix for another time – but having mentioned her, I will show her to you once she’s all dressed up and ready to go.

All I could do was watch in horror…

All I could do is watch in horror! from Andy Baker on Vimeo.

Net result, 3 broken blades (one in a previous flight and two in this).

Prior to that, I’d had several good flights, but somehow taking video and a good flying were out of sync. ¬†Even in the one above, I’d turned off the “3rd person” video by accident as I saw the crash approaching, so only Phoebe’s point of view remains.

The drift into the railings is the breeze’ fault – in the hour I was testing, it went from still to a few miles an hour coming from behind Phoebe – hence the crash into the railings – completely the opposite directions to where she normally drifts. ¬†She is clearly very wind-sensitive, and that definitely raises the game on sorting out the lateral drift code to compensate. ¬†At the same time, it does suggest that if I am extremely careful to make sure the take-off happens with the motor tips as horizontal as possible, there is a good chance of no drift and a vertical takeoff – and that raises the option of moving the testing into the garage during winter. ¬†Still scares me a bit though!

One thing that struck me (metaphorically, thank heavens), is that a vast amount of power is used for each flight.  First flight on a full battery levelled at 5 feet, next at 4 and the next at 3.  So I recharged the battery for the next flight, which is the one on video.

I have one set of blades left, but have just purchased some more – the current ones at 11 x 5 (11 inches total blade length x 0.5 inches pitch); the new ones are 10 x 4.5 – I’m hoping this will reduce the friction imposed on the blades and hence the power they take from the battery. ¬†The flip side is they’ll need to spin faster to take off, so I’ll need to do some more minor tinkering on take-off. ¬†They should work fine though as it’s this style blade that comes in the DJI F450 that was my starting point for this project.

Where next?

Phoebe has pretty much answered the question: she took off from as good an approximation of a horizontal surface as I could come up with, and yet, once airborne, she drifted backwards. This is the polar-opposite of being able to control her flight in a desired direction; if I can stop this drift for a vertical take-off, then I can apply the opposite logic to apply drift for horizontal movement.

First step as always is to have a nosey through Phoebe’s stats from the flight, in particular the x-axis accelerometer output (plus integral for speed), and engage the outer horizontal-speed PIDs to produce the targets for the inner angular PID (which actually drives lateral speed); the unwarranted horizontal movement is stopped by a managed tilt upwards the same direction (i.e. a backwards drift will be stopped by raising Phoebe’s rear blades, and tilting down her forward ones).

But before I get too engrossed, I think Phoebe and I are due some free-play time together!

One last thing – some stats from a separate flight that day showing two things:

First how much effort is required to maintain stable yaw – about 17% more power is applied to the CW blades than to the ACW blades – that surprised me given that in theory at least, the motors and blades are nigh on identical, and the body is well balanced. ¬†I’ll have to have a think:

YAW stats

YAW stats

Secondly, a plot of acceleration, speed, and height, all derived from the accelerometer; I’m particularly impressed with the speed and height results, particularly as they are just integrated from the acceleration, and the fact that as the applied power drops, you can see the controlled drop in height as expected. ¬†Bodes well for a more automated takeoff. ¬†Units on the left at meters per second per second, meters per second or meters for acceleration, speed and height respectively. ¬†Units on the right are the motor power between 0 and 1000 (PWM pulse width in microseconds)

Vertical Height, Speed and Acceleration

Vertical Height, Speed and Acceleration


Phoebe, yaw free, fly free!

Phoebe, yaw free, fly free! from Andy Baker on Vimeo.

Smooth takeoff, yaw free flight (PID tuning worked), drifting backwards due to not quite vertical takeoff, bouncy landing, all videoed by Phoebe’s own PiCam! I’m bloomin’ delighted!

Yeah, so there’s plenty of work left to do, but for now, I’m going to enjoy the moment knowing I can now trust her for more exciting test flights!

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.