Tangerine dream

I’m waiting for a new PCB for Hermione which hopefully will sort out the I²C errors that the Garmin seems to be the source of.  That means I have 10 days to kill with nearly nothing to do except this – putting her HoG in a Pimoroni Tangerine PiBow:

Tangerine PiBow

Tangerine PiBow

The part that pleases me most is actually the RaspiCam cabling that can be folded flat, nicely fitting between the RPi and the PCB, and emerging from the case dead-center above the video connector.

Once complete and with the new PCB installed, the case can be extended to have a lid (the current PCB overruns the case by the GPIO pins), providing crash and weather protection for Hermione’s HoG* (or should that be Hermione’s HoT now?).

I’ve countersunk the M3 underside corner-holes of case level 0 so the base is flat, allowing the case to be attached to the frame with a double sided foam pad.  To ensure the RPi is held firmly within the case, it’s bolted to the underside of layer 3 with 8mm M2.5 standoffs on the top of layer 3 to connect to the PCB.  This does raise the RPi slightly higher (it’s intended to sit loosely on layer 2) and so some careful filing is needed on the underside of layer 5, both for the camera cable and the HDMI connector.  But as you can see, the result is a perfect fit.  The new PCB (also in Tangerine from Ragworm) will fit perfectly inside.

I just hope the new PCB does resolve the I²C problem so that this make-up doesn’t prove to be Hermione’s end-of-the-line.

*HoG (Heart of Gold) is the the ship from Douglas Adams’ “Hitchhikers’ Guide to the Galaxy” which contains the Infinite Improbability Drive which allowed faster-than-light travel when provided with the Brownian motion source; I consume 3 pints of tea each morning to meet her needs.

The future’s bright; the future’s orange!

Well, tangerine actually!

With the IMU FIFO code taking the pressure off critical timings for reading the IMU, a huge range of options have opened up for what to do next with the spare time the FIFO has created:

  • A simple keyboard remote control is tempting where the QC code polls stdin periodically during a hover phase and amends the flight plan dynamically; ultimately, I’d like to do this via a touch screen app on my Raspberry Pi providing joystick buttons.  However for this to work well, I really need to add further sensor input providing feedback on longer-term horizontal and vertical motion…
  • A downward facing Ultrasonic Range Finder (URF) would provide the vertical motion tracking when combined with angles from the IMU.  I’d looked at this a long time ago but it stalled as I’d read the sensors could only run at up to 100kbps I2C baudrate which would prevent use of the higher 400kbps required for reading the FIFO.  However a quick test just now shows the URF working perfectly at 400kbps.
  • A downward facing RPi camera when combined with the URF would provide horizontal motion tracking.  Again I’d written this off due to the URF, but now it’s worth progressing with.  This is the Kitty++ code I started looking at during the summer and abandoned almost immediately due both to the lack of spare time in the code, and also the need for extra CPU cores to do the camera motion processing; Chloe with her Raspberry Pi B2 and her tangerine PiBow case more than satisfy that requirement now.
  • The magnetometer / compass on the IMU can provide longer term yaw stability which currently relies on just the integrated Z-axis gyro.

I do also have barometer and GPS sensors ‘in-stock’ but their application is primarily for long distance flights over variable terrain at heights above the range of the URF.  This is well out of scope for my current aims, so for the moment then, I’ll leave the parts shelved.

I have a lot of work to do, so I’d better get on with it.


2 A+’s on the way

I’ve just ordered two A+.  Why?

A+ overview

A+ overview

Phoebe is a A

Chloe is a B+.

Both sit on top of their frames with transparent domes on top to offer crash protection against damage and flipping upside-down onto wet grass.

The A+ has shrunk sufficiently that I suspect it can sit inside the frame, between the top and bottom plates.  To me, this is the biggest advantage, although there are a few others of lesser importance to me:

  • a more efficient regulator for longer life battery power
  • the sensors are moved away from the props with expected noise reduction as a result
  • the center of gravity drops to nearer the sensors whereas previously, the sensors were actually the highest point (discounting the dome) making Phoebe and Chloe very twitchy
  • the wiring is all now all below the arms and props, putting them in a much safer position.

So for me, this is primarily a hardware layout advantage, but a significant one nonetheless.

I don’t think this will have any significant effect on the flight problems (forward drift) that I’m currently seeing, but it is a huge improvement in the hardware layout.

Drift and yet another Phoebe case revision

Once my replacement blades arrive later today, I have a bit of more structured testing to do to track down the drift – I should have done this ages ago.

The new props + motors spin quicker meaning their noise frequency is higher which means the dlpf can be raised to 20Hz, allowing more genuine data through, and thus allowing tau to drop to perhaps 0.2s.  That’s the theory.  The test is 2 simple steps:

  • disable the hv* gains (horizontal velocity PID), and ensure she takes off to the right height and drifts only according to the wind – this will confirm noise filtering is correct (take-off), and angle calculation / filtering is correct (drift accountable to only external factors)
  • re-enalbe the hv* gains, and, having gained full confidence in the dlpf and tau from above, only change the hv* gains to manage drift.

I just wish I’d bothered to put this structure on the testing previously.

Anyway, assuming all goes well (I wouldn’t put any money on it), then I’ve a rebuild coming up to lower P’s centre of gravity by moving the Raspberry Pi to her underside again simply sticking it to her base plate with super-sticky double sided tape.  That shift in weight will increase her innate stability, and also will reduce the height of the sensors, perhaps isolating them from the blades that currently they are almost horizontal with.

Anyway, here’s the new case:

Phoebe's new case - underside

Phoebe’s new case – underside


Phoebe's new case - topside

Phoebe’s new case – topside

It fits a stripped down model A, with AV and audio connectors removed, and GPIO pins replaces with a low profile, soldered IDC connector.  The bolts are countersunk at the top, and the bottom plate is tapped with an M3 thread meaning no nuts are needed.  As a result, nothing protrudes from the case.  The design is a variant on the open source PiBow model B case design – I’ll publish my variant on GitHub once it’s installed and working.

As always, the high quality laser cutting was provided by Phenoptix for a ridiculously good price.

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.

Raspberry Pi and PiBow on a diet

As the first phase of the drone project nears an end, I’m looking at some non-technical fine tuning; specifically, can I make the RPi and it’s PiBow like custom case any smaller and lighter?

First step is was to flatten the RPi Model A – the drone has no need of audio output nor analogue video, so both of those are gone.  Also the GPIO pins have been replaced by a crimp connector directly soldered to the board.   Now the tallest thing on the board is the cylindrical electrolytic capacitor near the micro-USB power plug.

Lighter, thinner Raspberry Pi

Diet Raspberry Pi – losing weight and getting thinner

Next step is to start from the Model B PiBow case design, and take out two of the rows, and modify several of the others to close the holes for audio, video and ethernet, move the GPIO cable hole lower, and redesign the camera CSI cable outlet.  As a first step I needed to test the fit of the skinny RPi model A in the standard PiBow model B case:

Model B weightloss

Planning surgery for weight loss on the Model B PiBow

In addition, I found this super micro-SD to SD adapter which meant I could close the SD hole on the case reducing the risk of the SD card being damaged or falling out during a flight – a low risk, yes, but me and Murphy’s law are long standing acquaintances!

I picked up a second hand, unused copy of Adobe Illustrator CS2 for £40 off ebay (the current one is many hundreds).  So I made the tweaks mentioned above to the standard PiBow using it, and got it cut by http://www.cut-tec.co.uk/.

Here’s the end result: a model A height card, but minimal holes in the lid, bolts in the corners, micro-SD card locked in, audio and video holes shut, and GPIO and camera cables fed neatly out the sides.  I’m well chuffed.  I’m only going to fit it though once quadcopter is stable!

Custom model A case

Custom model A case


I received my final version of my tweaked PiBow back from PeopleKraft yesterday and it’s perfect. I’d wholehearted recommend using their services if you have your own Laser Cutting project – whether it’s a revised PiBow or anything else.

PiBow revision

My PiBow revision 2

They’re a two person business; John manages the design and cutting, and his wife manages the finances.

John uses Adobe Illustrator designs to setup the laser cutter. They have a full Adobe suite if you would like them to do the design work, or alternatively, Adobe offer a 30 day free trial of Illustrator. That’s what I used as I already had the PiBow design as it’s available on public license.

For modifying the PiBow base design, the AI 30-day trial was perfect for me; draft 1 was ready after about a week. I got the first cut back within a couple of weeks (John’s wife had pneumonia which set back their normal turnaround). That showed me a couple of changes needed to accommodate the IDC connector to replace the GPIO pins, and my measurements were slightly out on the draft. I turned those around in a few more days, and John turned those updates around within a week. And the second revision is perfect, so I’ve ordered a few more for safe-keeping!

P.S. There are two mods to this Model A + Case I’ve made: I’ve drilled countersunk holes on the bottom plate of the case, and used countersunk 3mm nylon bolts from ebay, so the base is as flat as a pancake; I’ve also applies heatinks from ModMyPi as these RPi’s are for use in my Drone. The current revision of the drone code never sleeps; that’s giving smoother responses, but at the expense of power consumption – hence the transition to model A and the heatsinks.

What do you get when you cross a Raspberry Pi, a PiBow and a Steamroller?

In preparation for getting a camera board to sling under my drone, I’m in the process of tweaking a RaspberryPi Model A, and designing my own variant of the PiBow case to match – although in doing so, I’ve found much broader use…

For the RPi changes, I’ve removed the A/V socket, and replaced the GPIO pins with an IDT connector so I can lose a couple of layers in the Model B PiBow. That’s now complete – removing the A/V connector wasn’t too bad, but removing the GPIO pins was a right PITA – more on that in another post. Here’s the end result.

For the PiBow, I wanted a cross between the Model B and Model A PiBows: thinner like the model A, but with bolts in the corner like the model B so it could be a direct but thinner replacement for the Model B Ninja PiBows I’m using at the mo on the drone and its RC. Primarily this is to reduce the weight, centre of gravity, profile and power consumption of both.

In the end, I had to compromise, and took 2 layers out of the model B, and sealed up the A/V socket, and opened up the GPIO hole to allow the larger GPIO connectors. I got a local laser cutter company to produce this from my Pibow001-AB3. Here’s what it looks like….

PiBow A + PiBow B

PiBow A + PiBow B cross

Note the addition of the IDC connector isn’t mandatory – there are 90 degree sets of pins available, and they were my first choice, but for the connectors on the ribbon cable, the 90 degree pins weren’t quite long enough.  They would still take the single wire pin connectors though if that’s what you’re after.