Freesteel Blog » Uncategorized

Friday, March 3rd, 2017 at 11:04 am - - Flightlogger, Hang-glide, Uncategorized

To be clear, I haven’t got mathematical proofs here (I don’t have the time), but the experimental evidence is quick to get.

Take the differential barometer sensor (used to measure airspeed) of the hang-glider flight logger. The Arduino code which updates the reading every 200ms looks like this:

long lastpx4timestamp; 
void Flylogger::FetchPX4pitot()
{
    long mstamp = millis(); 
    if (mstamp >= lastpx4timestamp + 200) {
        px4pitot->readpitot(); 
        sdlogger->logpitot(px4timestampset, px4pitot-rawpressure, px4pitot->rawtemp); 
        lastpx4timestamp = mstamp; 
    }
}

Why did I choose 200 milliseconds? It sounded like a good number to read it at. This is a quick way to program it to be a regular reading.

A better way is to actually synchronize it with the clock divided rather than simply add 200ms to the next time, like so:

int mstampdivider = 20; 
int prevmstampdivided = 0; 
void loop()
{
    long mstampdivided = millis()/mstampdivider; 
    if (mstampdivided != prevmstampdivided) {
        prevmstampdivided = mstampdivided; 
        P(micros());  P(" ");  P(singlereading());  P("\n"); 
    }
}

Now that code reads at 20ms rather than 200ms, but it prints a load of output which I can cut and paste into a file and read into pandas, like so:

rows = [ (int(s[0]), int(s[1]))  for s in (ln.split()  for ln in open("../logfiles/dmprapidtest.txt").readlines())  if len(s) == 2]
k = pandas.DataFrame.from_records(rows, columns=["t", "d"])

And then we can plot the autocorrelation (the covariance) with itself shifted in time, like so:

d = k.d   # just the measurement Series
dm = d.mean()
ss = [((d - dm)*(d.shift(i) - dm)).mean()  for i in range(400)]

autocov1

Let’s zoom in on the first 50 covariances:
(more…)

Tuesday, September 13th, 2016 at 8:25 am - - Uncategorized

Sensible Code

It’s at the Sensible Code Company whose webpage URL is actually sensiblecode.io, even though it’s not in the Indian Ocean.

Company was formerly called Scraperwiki of scraperwiki.com

Nobody ever called my coding Sensible. Things have obviously got to change.

Wednesday, July 13th, 2016 at 8:54 am - - Cave, Uncategorized

The weather turned caving, so I went underground two times. The first was to the shallow Balconyhohle (60m entrance pitch, then run around horizontal passages). There is a snow slope going up towards the surface that Andrew had a poke up.
balconsnow

Then someone showed me a demo of virtual reality using WebGL on a smartphone in a webpage, and I spent a couple of days coding the obvious idea I’d had years ago of putting all the cave data into a 3D model, using the GPS position and screen orientation to project it so that your phone acts like some kind of X-ray vision through the ground.

ssgroundview2

We used this to find a corresponding hole above the ground, which had a snow slope in it going down. It was a known hole in the database (identified by the metal tag drilled into the rock beside it) but with no record of exploration. Andrew looked at it the next day and couldn’t get down through. Later on he went underground again with a shovel and dug upwards as far as he could reach, but it still remained plugged.

Maybe if we rigged up some kind of a shelter over the hole to stop more snow falling into it, it could melt out in a few years. Something like some metal bars and planks of wood higher up to keep the new snow from getting out of reach of the sun so that the spring meltwater pours down and erodes away a bit of the snow plug each year.

Then, because I didn’t want to do much caving, I decided to go on the deep underground camping trip, which was far, far too deep with a lot of nasty scary rope rigging on the way down and up that kept me in a state of terror for hours on end. This is not as illogical as it sounds. Caving is horrible, and it takes many days for the memory of how horrible it is to wear off (like the memory of a very painful hang-over) before I am prepared to do it again. But once I’m down there I haven’t got a lot of choice.

Becka took her phone down to the camp (at -600m in Kraken chamber) and it took considerably better pictures than the fuzzy gopro I had.
camptent
There was a cross-over with the previous camping group, which is why there’s so many people in this image.

wookonkraken
This is one of them starting up the big loose pitch out of the chamber, which begins with a 60m freehang, and then lots of rebelays on a blank rock above a soily bouldery slope that you keep kicking stuff down from. As a consequence only one person can be on the rope at a time and it takes ages.

bigtunnel
The passages were enormous and we explored and surveyed about a kilometer of cave.

helicmud
There were some surprising formations, including this pickled gherkin sized helictite with a drip on the end that never quite fell from it, because the mud was untouched below it.

When we three finished our two days and one night stint, the next team came down and met us at the tent while we were stoking up on food for the horrendous climb out (lots of pathetic whimpering from me) and overdosing on our salt quota (according to the packet, the instant risotto meal for two I ate contained 11g of salt). Somehow on our ascent one of us pulled the rope up after us and accidentally hooked it over an isolated rock ledge well out of reach, which meant that this team were trapped underground until the full-expedition rescue was called out owing to them being overdue.

griefcloud
Luckily, Becka and me were miles away in Griefenburg by this time, with her on her new road bike, and me playing in the low clouds. The sad thing was my favourite pizza joint in town had closed since last summer, and the restaurant we went to instead was a bit crap.

Back at the expo the next day, Becka went straight up the hill while I attempted to get in another flight. It didn’t go too well, and I nearly crashed off the ramp, probably because I’d kept the nose too high without a headwind to guide with wing position. I barely got away with it and haven’t dared look at the photos yet. Not good memories to leave this place with.

I calmed my nerves for a couple of days by coding the groundwindow application and getting to know something about writing GLSL shader technology. It’s pretty stunning, and it makes the phone quite hot from all the computational power.

Wednesday, March 23rd, 2016 at 12:01 pm - - Uncategorized

Funny story. My mum the author has published a Gothic novel.

A Man of Genius

Here’s the book launch at Daunt Books:
janbook1
I only recently got my copy as I had to buy it on the open market so that it made a difference to the sales. I’ve just lent the unabridged Audio CD to a friend who recognized the reader as being famous (Miriam Margolyes), which I didn’t.

I considered, but rejected, the idea of playing it on the drive down to Spain with three other hang-gliders in the car, so I’m lugging the hard back in my baggage.

Monday, July 21st, 2014 at 9:23 pm - - Uncategorized

The internal downpipes from the roof in our house have caused dampness and other problems for over a year. I finally found out why after I noticed it was leaking six hours after it had stopped raining.

First I chiselled a hole through the floor and discovered a void underneath where we thought there was bedrock. No wonder it’s so cold in this house all the time. It’s now a long term project to entirely remove the floor and insulate it.
OLYMPUS DIGITAL CAMERA

(more…)