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:



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.

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


Cotswold Jam tutorial kits vs. Dyson

I’ve just quit smoking saving myself £300 a month, and I was going to treat myself to a new vacuum cleaner as a reward – I have an older version of the same and it’s fab but this one is even fabber.

But I’ve also started putting together a new python + electronics tutorial for the next Cotswold Jam at the end of April, both setting up my own prototype, and collecting components for 24 kits to be given away to tutorial participants.  Sadly, this has taken a significant proportion of my Dyson money, but I think the result of my prototype looks pretty cool, literally:

Door alarm system

Door alarm system

Big thanks to Pimoroni for the custom Snowflake white version of their limited edition PiBow B+/B2 Coupe Midnight Black, the discount on the 25 mini-PCBs for the kits – you’re stars!

The give away kits will have smaller breadboards instead of the cakeboard shown above, but they’ll all come with the doors with neodymium magnets as the door knobs, reed switch, buzzer, on-off switch and wires.