Cotswold Raspberry Jam

So there I was this morning on the bus heading to Cheltenham to co-host the Cotswold Raspberry Jam, gazing at the beautiful Cotswold countryside, and my mind began to wander – well actually it was unleashed from the constraints of dealing with details it couldn’t fix while on a bus.  And out came a better idea about where to go for the next step to autonomy.

What’s been bugging me is the difference between magnetic and GPS North.  The ‘bus’ solution is to ignore magnetic north completely.  The compass still has a role to play maintaining zero yaw throughout a long flight, but it plays no part in the direction of flight – in fact, this is mandatory for the rest of the plan to work.

Instead, the autopilot translates between GPS north, south, east and west coordinate system and Hermione’s forward, backwards, right and left coordinate.  The autopilot only speaks to Hermione in her own coordinates when telling her where to go.  The autopilot learns Hermione’s coordinate system at the start of each flight by asking her to fly forwards a meter or so, and comparing that to the GPS vector change it gets.  This rough translation is refined continuously throughout the flight.  Hermione can start a flight pointing in any direction compared to the target GPS point, and the autopilot will get her to fly towards the GPS target regardless of the way she’s pointing.

Sadly now, I’m back from today’s Jam, and the details confront me once more, but the bus ride did yield a great view of where to go next.

P.S. As always, the jam was great; over 100 parents and kids, lots of cool things for them to see and do, including a visit this time by 2 members of local BBC micro:bit clubs.  Next one is 30th September.


Just using spare time to put together a tutorial for the Autumn Cotswold Raspberry Jam.

import RPi.GPIO as GPIO
import time

RED_LED = 35




# All the LEDs are turned on every 1/100 of a second or 0.01s.
pulse_period = 0.01

# This is how much of the pulse period each LED stays turned on.
# After that, it gets turned off again.
red_fraction = 0.002
red_on = red_fraction

blue_fraction = 0.003
blue_on = blue_fraction

green_fraction = 0.005
green_on = green_fraction

# Remember the time this all started so we can work out how long
# we've been going since we started. 
start_time = time.time()

    while True:
        clock_time = (time.time() - start_time) % pulse_period

        #========================== RED =======================#

        if clock_time < red_on * pulse_period: GPIO.output(RED_LED, GPIO.HIGH) else: GPIO.output(RED_LED, GPIO.LOW) red_on += red_fraction if red_on > 1 or red_on < 0:
            red_fraction = -red_fraction
            red_on += red_fraction

        #========================= GREEN ======================#

        if clock_time < green_on * pulse_period: GPIO.output(GREEN_LED, GPIO.HIGH) else: GPIO.output(GREEN_LED, GPIO.LOW) green_on += green_fraction if green_on > 1 or green_on < 0:
            green_fraction = -green_fraction
            green_on += green_fraction

        #========================= BLUE =======================#

        if clock_time < blue_on * pulse_period: GPIO.output(BLUE_LED, GPIO.HIGH) else: GPIO.output(BLUE_LED, GPIO.LOW) blue_on += blue_fraction if blue_on > 1 or blue_on < 0:
            blue_fraction = -blue_fraction
            blue_on += blue_fraction

except KeyboardInterrupt as e:



No-fly drones


Zoe is going to the Cotswold Jam next Saturday, and then is definitely being retired.  Her Pi0W is just not fast enough to process 680 x 680 pixel ground facing video frames required to fly on gravel / grass.  On the plus side, she’s going to be asset stripped for bigger things.


Hermione broke her arm a while back, and the replacement has just been installed, but the weather is still too blustery.  She broke her arm in a free-fall landing; one of her CF legs took the bulk of the force, but punched a hole in her CF armpit.  As a result, in addition to the new arm, I’ve also got a new pelvis from for her legs which is thinner, lighter and prevents the legs from damaging the arms.  Also, because they are thinner, there’s space for larger props; When the need arises, I may well upgrade from the current T-motor 1240 CF props with the larger T-motor 1344s which are still within scope of her T-motor U3 motors.


Chloe is back, and is Zoe’s asset stripper, primarily her Garmin LiDAR-Lite V3.  C’s only using an A+ and I don’t expect her to be any better than Zoe as a result; however, very speculatively, the only missing gap in the RPi clan is an A3.  That’s what she’s waiting for.  She’s build only from left-overs / spares / shelved pieces except for her new CF arms, again from – isn’t she pretty?

Chloe reborn

Chloe reborn

A3 speculation

Here’s my best guess / hope of an A3 spec, based realistically on the middle ground between a B3 and Pi0W:

  • single USB A port as per A+ to avoid power drain of ethernet / USB port chipset
  • built in WiFi as per B3* and Pi0W, freeing up the USB port for GPS
  • 4 core processor – ideally, the B2 version rather than B3, again for power consumption reasons.

No-fly Zones

The few times I’ve flown my Mavic, it’s always warned me I live in a class C ICAO airspace designation zone.  It doesn’t surprise me really with RAFs Fairford, Brize Norton, and Royal Wooten Basset all within easy cycling distance.  The Fairford Royal International Air Tattoo normally has squadrons of classic Spitfires, Hurricanes and Lancaster Bombers plus the Red Arrows flying over our back garden on my daughter’s Birthday weekend.  A couple of years back, Air Force One flew within a stone’s throw / spitting distance of our house.  I’m sure I saw ex-POTUS Barack Obama through the window eating his breakfast!  Should the POTUS Trump ever fly by, I’ll be sure to test the metaphorical distance literally.

* Ideally, the new A3 should also include a U.FL connector for a WiFi antenna allowing extended range, ideally switched between the inbuilt and external based upon the presence of an external antenna.  Worst case, I’ll add this myself.

Vanity is…

me trying to convince the audience (there were more than it looks like) how video macro-blocks could be used for lateral motion tracking (and more speculatively, vertical and rotational too).

Me and my Vanity

Me and my Vanity

There are lots more photos of yesterday’s Cotswold Raspberry Jam that aren’t soiled by my presence on facebook – check ’em out at (or even better, join) the Cotswold Jam group or follow us on Twitter.

The next Cotswold Jam with be on 26th November from 1 – 4 at the University of Gloucestershire, Park Campus, Cheltenham.

Hermione development calendar



  • New legs (awaiting arrival)
  • New PX4FLOW 1.3.1 (awaiting arrival of a slow boat from China)
  • New PCBs – X8 compatible but testing first in quad mode



  • URF (and perhaps LEDDAR) height fused with double integrated accelerometer Z axis for qdz_input distance PID
  • PX4FLOW x and y velocities fused with single integrated accelerometer X, Z axes for qvx_input, qvy_input velocity PIDs
  • ignore the PX4FLOW gyro – stick with the MPU9250
  • ignore the PX4FLOW timings – stick to the MPU9250 sampling clock for integration etc
  • working compass
  • look after the kids during their summer holidays


  • get X8 motors and ESC but hold off installation depending on progress of above.



  • GPS via USB (or 2 port hub if A3 wire built in WiFi has not been announced by then)
  • external antenna for A3 if arrived
  • test flight to GPS defined target at fixed speed / height
  • Cotswold Jam 24th September 1pm – 4pm



  • A3 (speculative arrival)



  • Remove LEDDAR and instead use UART for Scanse Sweep
  • test obstacle avoidance on a GPS target flight

Cotswold Jam – date change – now 2nd July

Due to a double booking at the University of Gloucestershire, we’ve had to move the Cotswold Jam out by a week to Saturday 2nd July.  Current tickets remain valid, but if you can’t attend, please e-mail admin at so that we can free your tickets up for others and return any voluntary donation you gave.

Thanks, and hope to see you there.

Cotswold Raspberry Jam

Cotswold Raspberry Jam