Freesteel Blog » Machining

Friday, June 17th, 2016 at 1:48 pm - - Machining 1 Comment »

What was that horrible noise coming out of the closet at DoESLiverpool for about three days?

I was attempting to machine down one of these hold-down clamps so it could fit the 70mm wide type 2 vice I’d bought recently.

My earlier attempts to clamp the vice down on two points failed when the bolts rattled loose and the whole thing started being dragged back and forth across the table by the milling cutter. I decided was going to require at least four points of attachment to work, and these neat little clamps looked just the right shape — except for the problem of being slightly too tall.

(That current configuration in the picture was an idea Andy came up with at the last minute when trying to solve this problem.)

Andy had tried to skim them down on his lathe and told me that the metal was too hard. But I was determined to prove that anything could be done if you took little enough cuts. In this case it was steps of 0.1mm per layer and 0.5mm across

At 8000rpm there were sparks. These didn’t happen at 6000rpm. I was running with a 5mm 2fluke flat bottomed tiain-coated carbide tool. Furthermore, the conventional milling sounded marginally less nasty than the climb milling passes. I’m surprised nothing broke, though I don’t have the experience to tell whether a tool has worn out or not.

The result was pretty crap. Instead of performing some clean cutting, it seems like some of the metal was simply bashed flat and pushed out to form a lip around the face.
flatcut
I didn’t know that metal would have the propensity to produce this result when undergoing milling.

It’s not a factor accounted for any software I’ve heard of.

I’ve written many algorithms that detect the horizontal flat faces of a part and create toolpaths to skim them out, but no one has ever requested a subsequent pass just below each open edge to clean off the burr left over.

Sadly, there won’t be any more machining for at least six weeks as I’ll be in a rainy campsite in Austria waiting for the chance to fly. At least this will give me lots of time to try and write some useful code when I’m not washing pans or carrying rope and other provisions for the cavers.

Friday, May 27th, 2016 at 12:07 pm - - Flightlogger

The datalogger is fitted to the right hand upright of the control frame. According to my shoddy measurements the upright is 176cm long and the basbar is 138cm long. There are two wires from the corners of the control frame to a point on the keel 151cm forward, each of length 206cm. And there are another two wires to a point on the keel 80cm backward, each of length 205cm.

This seems to add up to a vector of (69.0, 42.06344442205491, -156.2492943010685) from the top of the control frame to one corner of the base bar, which is the alignment of the datalogger and its BNO055 orientation sensor strapped to the upright.

I definitely don’t have time for a complete blog record of this, and a lot of it isn’t working, even though I’ve spent no end of time hacking on things, but if I plot the logger vectors that go backwards and perpendicular to the upright on the gps track, I get this picture:

keelorientation

For scale, the red lines are 11m long and the plot rate is 3x on the 100Hz samples, so there are 33 of those lines per 1second of motion.

It’s reasonably smooth and consistent, unlike the accelerometer values, which I think represent a lot of vibrations in the system, if the creaking wicker chair-like noise on the gopro soundtrack is anything to go by. It’s about right, if you think of the airspeed being in line with the keel of the glider (which it is probably not, because of the yawing and side-slipping in turns).

I nearly bought a sonic anemometer second hand off ebay last week, but missed it. I’ve got an alert watch on a new one and have designs on fitting one to the top of the kingpost where it is out of the way and least likely to get damaged by flying into a hedge or the ground.

Regarding the kinematics of the system, every part of the flight is the same as everything else, so I can strip out the simpler bits to see if there is a relationship. In particular, this is a plot that claims to be 10 second long sections of the flight where the bank angle is less than 3degrees.

nobanksections

This doesn’t fit too well, and I can explain it that the calibration value on the device was at 1 out of 3 for most of the flight, in spite of starting off on the ground at 3/3, so it’s telling me it got it wrong.

Anyway, it’s straight enough to move on to this complex plot of some of those flight sections:

pitchsections

Time goes from left to right of about 10 to 20 seconds. The following traces have been displaced close to the zero horizontal white line so you can see their correlations, if any. Green is pitch angle, Yellow is smoothed acceleration in forward direction (approx because it’s not aligned with gravity yet), Red is airspeed, and White is differentiation of windspeed.

What I would hope for is a delayed correlation between pitch (green) and airspeed (red). If you push the nose up and hold it there, the glider will slow down, and then fly at a slower speed. If you pull the bar in and hold it there, the glider will speed up and then fly at a constant higher speed. But of course you’re moving the bar all the time. But you can almost convince yourself of the response; the green line goes down, and the windspeed then starts to rise, and vice versa.

This should be built this into a kinematic model of control and response. It would actually also align with the barometric reading, where the sink rate goes up with a higher speed, so it’s quite 2 dimensional in the vertical plane, with energy equations.

The other correlation should be between the forward acceleration and the derivative of the airspeed. Both the airspeed signals and the acceleration signals are quite full of noise, so they needed to be smoothed (I think I’ve done this incompetently here, but that’s for another fortnight of coding).

Here you would expect a direct correlation in still air, because if the accelerometer says I am accelerating at 1metre per second per second, then over the course of 2 seconds my absolute velocity will increase by 2 metres per second. And, if the air is still, then my measured air speed should also increase by 2 metres per second.

So these two ought to be scaled the same. Except the smoothing flattens out all the humps and troughs, so you really can’t tell what the absolute value of anything is from this anymore.

Some of the bumps seem to line up, but this is not adequate for a kinematic model.

The numbers get hairier and hairier as I try to approach something useful. And that useful thing would be to separate the absolute motion into that which is due to my control and the flight characteristics of the glider, and that which is due to the underlying wind speed and direction.

Accordingly, I should be doing lots of boring flights in completely still air at the start of the day with a working logger where everything is calibrated, rather than having lots of fun in thermic air. This is a job to do in Austria where the hills are high and I should have hours and hours in the campsite not coding on other things.

This work just takes so much time and has hit so many technical failures already that I doubt it could be done by someone who is answerable to a boss.

Wednesday, May 25th, 2016 at 1:05 pm - - Machining 1 Comment »

You know those clamps for the vice I was so pleased about fitting?

Well, they slipped out while milling metal due to all the vibrations during helixing.
loosevice

This just after I’d spent all afternoon compensating for the rotational position of the vice to withing 0.04mm across 50mm of its width by probing a piece of metal in the jaws wrapped in a piece of wax paper to electrically isolate it from the vice.

Bog! That’s ruined my day.

And the weekend is going to be rubbish, waiting in a tiny cold tent in Yorkshire for the fog to clear.

Thursday, May 12th, 2016 at 5:04 pm - - Machining

I have actually been doing some machining at long last, having purchased a 130-040-01900 Precision Tool Vice Type 2 – 70mm wide vice, which feels reassuringly solid, square and metal for the entirely reasonable price of £56 — given that this is about what I’ll need to pay for a single tapered cutter when I get onto that project.

clampthinning
First problem was that the hold down clamps were a bit too wide to fit into the groove comfortably, so I milled them down by about 1.5mm. There had been a worry that these would be hardened steel, so I tested one by cutting a groove into it with a hacksaw. Of course the clamps are going to be soft steel. If it was hard metal it would be liable to make horrible marks in your work-piece.

looseclamp
Then I tried squaring off a bit of model board. This is what happens when you forget to tighten up the vice and the cutter lifts and ploughs through it before tossing it off the table.

A bit more practice, some work on toolpaths, more tools, the procurement of some pieces of metal, and I’ll be ready for business. Just in time for the holidays.

Monday, May 9th, 2016 at 4:49 pm - - Flightlogger

I made an interesting mistake during my flight over Merthyr which began in very rough air. My radio was charged and working, which meant I had an external source of misinformation to confuse me, that I did not have on my excellent flight from Builth Wells three days before.

One of the things I thought I overheard was that the thermals were tracking southeast in spite of the wind on the hill coming from due west. This suspect information lodged into my brain, so that when I finally got a good thermal I began tracking to the SE instead of due East with the wind, and fell out of it, and landed an embarrassing 5km away to the SE on a smooth bit of grassland feeling rather unhappy with myself.

Still, nothing important broken, except my ego. The data came out good, with the following temperature track vs altitude, where horizontal lines are degC from 0, vertical lines are 100m (topping at 1200m on the right), and green data points are during the climb, with red for the descent.

merthyralttmp

Potentially this means in such a strong thermal the temperature was one degC higher than the surrounding air, with brief drops in the readings in the moments where I fell out of the thermal. The climb rate up to 1000m was between 2 and 4m/s, but above that it became less than 1m/s — coinciding with period the temperature differential had decreased.

The thermal temperature is going to be all mixed up with rising air and surrounding air as I go in and out of the core, but it seems to have a pretty constant trend. The non-thermal air (encountered when I utterly lost the thermal) seems to be completely constant between 1000m and 1100m, which would account for the decline in thermal strength (according to theory) and at 1050m only differed by 0.3degrees.

Unfortunately, with only one thermal in the flight to derive the data from, the pattern is not definite. I think I should do something more serious with the temperature sensor, like fit a cowl over it to protect it from sunlight while directing the full flow of the wind across the device. It cannot take more than seconds to equalize. I ought to revisit my vacuum cleaner and hairdrier experiments.
(more…)

Thursday, May 5th, 2016 at 4:29 pm - - Flightlogger

I must have changed cards for one in an old camera or something, because the data files went bad on the hang glider logger.

What started out as an effort to plot a timeline of the holes in my data has turned into a simple SD card write benchmarking experiment which allows me to see the slippage.

The code sort of goes like this:

int multiple = 200; 
long biggaptime = multiple*2; 
long sumnormaltimes = 0; 
long nnormaltimes = 0; 
long flushmultiple = 1000; 
void loop()
{
    // wait for the next 200microsecond moment
    long mstamp; 
    long mstampnext = ((int)(mstampprev/multiple + 1))*multiple; 
    do {
        mstamp = micros(); 
    } while (mstamp <= mstampnext); 
    
    // output the microsecond value in 8 hex characters
    for (int i = 32-4; i >= 0; i -= 4)
        sdfile.write(hexchar((mstamp>>i)&0x0f)); 

    // if that write took longer than expected, record how long
    long mwritetime = micros() - mstamp; 
    if (mwritetime > biggaptime) {
        if (ngapsline < ngapslineP) {
            PRINT(" ", mwritetime, ".", nbytessincegap); 
        }
        nbytessincegap = 0; 
        ngapsline++; 

    // otherwise keep track of the average time
    } else {
        sumnormaltimes += mwritetime; 
        nnormaltimes++; 
    }
    nbytessincegap += 8; 
    
    // flush at a defined multiple of looks
    n++; 
    if ((n % flushmultiple) == 0) {
        sumnormaltimes = 0; 
        nnormaltimes = 0; 
        long mstamppreflush = micros(); 
        sdfile.flush(); 
        long mstampflushtime = micros() - mstamppreflush; 
        P(" F", mstampflushtime); 
    }
    mstampprev = mstamp; 
}

This produces output like this:

1085.0 17500.320 2926.512 2906.512 2912.512 3574.512 2925.512 2914.512 2912.512… (33.89)
10000 215737 F7575 994.320 407194.192 4632.512 2915.512 2943.512 2920.512… (33.89)
15000 407211 F7601 1104.384 3279.128 4400.512 205153.512 2916.512 2920.512… (33.82)
20000 207194 F7576 1018.448 3255.64 4535.512 2915.512 2916.512 204380.512… (33.80)

One can interpret it as taking on average 34microseconds per 8 byte write block, with a pause of 3milliseconds after every 512 bytes, and then an enormous 205millisecond pause after every 8*512=4096 bytes. The call to flush() takes 7.6milliseconds.

We can plot the timeline of writes with this function:

ftext = open(“SPEED.TXT”).read()
ts = [ int(ftext[i:i+8], 16) for i in range(0, len(ftext), 8) ]
t0 = ts[-20000]
sendactivity(points=[((t-t0)*1e-6, y) for t in ts[-20000:]])

to get the green series of points labelled 1 in the diagram below (where the yellow vertical lines represent one second increments):
badsdcards
(more…)

Thursday, April 28th, 2016 at 12:04 am - - Flightlogger, Hang-glide

Well, the hang-gliding has been quite lovely. But the logger appears shot to pieces.
cloud
I still don’t know what I am doing when I get to cloud-base, which is probably why I plummeted out of the sky shortly after this picture was taken.

As soon as I took off, the barometer stopped communicating most of its data.
badbaro
This is the device I lavished so much time on isolating it from the rest of the electrical circuit and arranging for it to bitbash the information back through an interrupt pin.

It could be some timing issue, or whatnot. No way to debug it. Luckily I got myself a Bluefly vario which does the same thing of reading a MS5611 barometer on a tight 50Hz loop and transmitting it back to the main board. In the Bluefly’s case it’s for the purpose of running a Kobo/XCsoar system. I’ve just given up on the one I built as it’s too inferior to simply running XCSoar on the phone where I’ve got colour and more or less know how to use it.

Luckily the Bluefly also sports a GPS and works through a serial port, so I’ve yanked off the Adafruit GPS breakout board and bodged the wires to insert the Bluefly in its place.
bfbodge
Then there was a small matter coding it up using a complex state machine to program the GPS module through the Bluefly pic processor to get it to read at 10 times a second.

But then the BNO055 orientation sensor played up and decides to shutdown at unexplained moments for unexplained periods of time.
badorient
The white vertical lines are 10 minute intervals, and there is a green dot for every successful orientation reading, with y-value proportional to the time since the previous reading, so I’m getting gaps in the data of half an hour in flight.

I’ve produced a reset timer to try and start it off again if no data comes through for 20 seconds.

Anyways, here is one of those nerve-wracking close encounters with the ground during the flight.
(more…)

Monday, April 18th, 2016 at 4:43 pm - - Machining

This has taken a lot of effort fighting through the device trees on the Beaglebone to make it access the PWM and Quadrature encoder services at the same time, which is the minimum required to effect a stimulus response observation from a DC servo motor powered by an H-bridge.

What happens when you apply a fixed voltage to the DC motor for an eighth of a second, then reverse the voltage for another eighth of a second, and then set the voltage to zero (and try it for many different voltages and directions):

Here’s the graph of motor positions (in Y) over time (in X) for 20 different trials:

motortrialgraphs
(more…)

Tuesday, April 5th, 2016 at 1:04 pm - - Flightlogger

On this second day of heavy rain in the Pyrenees I think I might have the time to catch up some ancient history from all of last week. We waited five hours on El Bosque for the wind to come right, and were then rewarded with this flight with vultures.
bosquevultures
These birds came much closer than they ever showed up in the pictures. They fly with hunched shoulders.

Unfortunately the GPS for that flight is inexplicably jagged, so here’s a flight above Teba from a day later where the data is cleaner.

teba1

gpstrackteba

The yellow cube is 1000m on each side for scale from a flight that took off at the point on the frontmost vertical cube edge

gpstracktebazoomed
Here’s a zoomed in section of the left most section of the path, shown looking down, with 100m XY axes in yellow. The track comes in from the bottom right goes to the top left (against the wind direction), then turns left to make four anticlockwise loops that drift back with the wind
(more…)

Tuesday, March 29th, 2016 at 9:28 am - - Flightlogger, Hang-glide

It happened towards the end of the flight before last when my wings became my own, and I just wasn’t thinking about it any more. I stopped having those intervals where I lose concentration and fall out of the sky because there was no concentration to lose. It was all about the feeling.

teba1
Above the town of Teba watching the cars scooting along the grid of streets like busy beetles in a rotten log

teba2
Low on same rocky hill just after take-off where I struggled to survive for some minutes before I found a bubble of rising air

If you need to learn hang-glide, there’s a English school down here called Lejair where you could get it all done in two weeks (instead of the average two years of weekends back in England) because the weather is better and they use tow trucks with gliders tethered above a trailer so you can learn how to fly it without having to run up and down the hill and learn how to steer in short difficult bursts. (If you have to ask why you need to learn hang-gliding, then you don’t need to.)

birdscage
We were woken by all this nice birdsound. Then we spotted that it was from three tiny birdcages in the courtyard below and it seemed so cruel. Why can’t they use little speakers tuned to a radio channel that broadcasts live birdsound?

Got to go now. We’ve not had an off-day where I can devote 10 straight hours to coding the datalogger analysis or write any of it up. I have two interesting results to report. One being the delay on the GPS, and the second being the clean mathematical relationship between the turning circle and bank angle as measure.