Sunday, November 8th, 2015 at 6:05 pm - - Machining 1 Comment »

Occasionally hope triumphs over experience and I expose myself to another face-punch, like the one I got this morning when I learned that the triangular machine tool development had been rejected for the Innovation Vouchers Round 13.


This is lowest, most easy grant money to go for — according to everyone. You don’t even see the £5000 when you win it because it’s only paid to fit and proper people such as patent attorneys and college professors. If you can’t win one of these then you’re such a loser you don’t need to waste everyone’s time applying for anything more substantial. And boy have I wasted people’s time (including my own) in the past over other rejected projects.

Innovate UK (formally Technology Strategy Board) has only one job, which is to distribute £400million per year on the basis that:

“We work to:

* determine which science and technology developments will drive future economic growth
* meet UK innovators with great ideas in the fields we’re focused on
* fund the strongest opportunities
* connect innovators with the right partners they need to succeed
* help our innovators launch, build and grow successful businesses

You’ll note that this list does not include or imply that:

Our ambition is to acquire the most beautifully crafted set of grant applications in the world to provide a lining to the filing cabinets in our office.

You’d think it’d be obvious that a written application merely needs to meet a certain standard of expressiveness to merit being judged entirely on its content. It either passes that standard or it doesn’t, and I won’t be told that I failed because I simply didn’t sweat enough over the 1000 characters alloted on the form.

Nevertheless, here’s the case I wrote down for obtaining an innovation voucher which I intended on spending at the AMRC:

We have a CNC milling machine based on a triangular geometry that is capable of cutting steel and can be built from parts a tenth of the price of a conventional machine with the same capabilities. Several full scale prototypes have been built and have proven capable. Unfortunately neither of the inventors are trained mechanical engineers and we require expert advice on the design as well as an independent assessment of its potential.

Luckily, in these enlightened days, InnovateUK actually publishes where the grants are going, so I don’t have to file FOI requests as I once used to. The 60 winners of the previous Round 12 have been disclosed.

Here’s one of them, which is presumably intending to drive future feline growth:

To Design and build a fully automated Cat feeder that can support up to eight cats for up to 4 days or the length of a bank holiday weekend.

The feeder will also make use of modern connectivity technologies so as not to break the link between owner and cats but also allow additional functional options such as play and monitoring.

The Modular design will allow for customization for owners offering greater flexibility and increasing the consumer market this product is aimed for.

Here’s another:

New trendy Fashion line for everyone. Pick’n’Mix your t-shirt to make it suitable for you

And another:

Honesty Foods develops a liquid tea bag which contains sufficient protein and fibre to take the edge off your appetite and therefore help reduce snacking.

And another:

With the support of Innovate UK, CookieSmart is developing an exciting new Internet of Things (IoT) application for kids!

And another:

PitchForMe plans to build a platform which gives insight into the real person prior to meeting, from which employers can make informed hiring decisions. An employer would be able to fully understand a candidate’s qualities. Through a cloud based dashboard solution they will be able to find people who have aligned values and truly fit their company. Also included would be personality traits, video pitching, and work histories. Personality profiling would be available which determines strengths, how an employee works within a team, and areas for development.

I’m not making these up. This one is pretty timely:

The external expert will be able to help in defining the technological feasibility if(sic) developing a Human presence detector and linking it to an app that will alert the drive/logistics provider to the presence of human entity located within the trailer of the HGV.

This one is plainly the text of a job ad, and not an answer to a question posed in the application form. Yet somehow it got accepted:

We are looking for a talented and experienced hybrid mobile app developer (minimum 5 years experience) who has a passion for innovation, to join our team on a 3 month contract. You will be providing guidance, advice and technical leadership on a senior level to launch the re-build of our existing iOS app. Your superior technical skills will contribute to the future of the company and to the success of Must. The successful candidate will have extensive previous experience working with PhoneGap or Ionic. The successful candidate will also have experience in the build and deployment of a medium to large scale application capable of horizontal scaling. Candidates must already have the right to work in the UK without sponsorship.

Perhaps machine tools are just too passe and boring. Well, how about this:

An expert external CNC programmer will be able to create a programme for us to use on the machine. We are hoping to develop a programme that will enable us to create different extending tables of bespoke sizes just by inputting the dimensions for each table. This will enable us to create tables of an extremely high quality with precise dimensions.

Sure, it’s a great thing to do, but is it innovative?

If schools were places of learning, then this one should easily be within the capabilities of a school kid as part of an end of year project. I don’t see anyone putting such resources and needs together.

None of this makes me feel any better. In fact it makes me feel worse. Once again I’m a failure. Go suck on it.

Now that I have wallowed long enough in this particular punch in the face, you don’t need to know how much of this blogpost has already been deleted. It’s pretty lucky I don’t have any rent to pay except to the hackspace, or I’d be homeless at this rate.

Friday, October 30th, 2015 at 7:34 pm - - Machining

As you can see, I got lent a G320 servo drive to play with.


This time I put it into a slightly more sophisticated test regime than with my leadshine driver experiments involving sending 8 step pulses 1800 duration (except the first one which was 600ms duration) [in purple], then giving it 12 forward pulses from the encoder with duration 360ms followed by 4 backward pulses from the encoder of 1800ms to simulate an overshoot [in cyan]. The PWM voltage out is in yellow.

You can see opposing denser and weaker voltage layers in opposition as the driver delivers more of 24V+ and less of 24V- in equal measure in response to the inputs.


Wednesday, October 28th, 2015 at 11:08 am - - Machining

The first BeagleBoneBlack in the picture was already bust when I gave it to Tom. He broke his own one when wiring it to the triangle milling machine during replacement of its desk-top PC LinuxCNC controller system. Then, with nothing better to do, we got to work on those Leadshine DB810A servo drives and broke the Z-axis one when we wired an oscilliscope across the plus and minus motor power poles. These are temperamental devices that spend a lot of time flipping back to the error state with the red LED so we weren’t 100% sure it was broken until we did the same job to the ‘Y’-axis driver.


And that’s how we reduced three hand-held oblong items of electronic gadgetry to three lifeless plastic bricks in one day.

We took all three drivers out of the box and put them on the bench with a 24 volt power supply to verify that the remaining ‘X’-axis one was working differently on account of the fact that we hadn’t broken it yet.

Friday, October 23rd, 2015 at 4:20 pm - - Machining

A day of pain on the proxxon mini machine produced this terrible result:

In the evening I was able to work with the big machine in the closet while another meeting was going on in the Dinky main room. My got it’s such a pleasure to use. And so quiet, without these buzzing stepper motors and noisy spindles. Here’s the raw code that made the toolpaths.

I’ve been pushing so hard on this I’ve not updated anything else. Back on weekend of 10th October I had a couple of flights off Mam Tor.
I stayed the night with Becka in the TSG hut and flew with 25 other hang-gliders on Sunday. No crashes happened and I didn’t talk to many of them in the field on packing up. It’s not like being with cavers. There’s not so much use we can be to each other, other than getting in one another’s way.

And finally I spent most of the fortnight cycling down to the allotment after receiving an official warning that we’ve not been weeding it enough. This takes me past the new Kings Leadership Academy which is not in Warrington, but on the site of the out of date website of University Academy Liverpool as you can see from the signage facts on the ground:


This is just half measures. They should go for the full Bill & Ted experience and use the original sayings:

Be Excellent to Each Another

Party on, Dudes

These, in fact, have a lot more meaning and application, in the way that “Excellence is a habit” is self-centred and ultimately empty.

On the other hand “Be excellent to each other” is the motto of Noisebridge hacker space founded by Mitch Altman who explained that this is their one and only rule. It’s something that has meaning, you can act on it, and hold yourself up to it.

Furthermore, “Party on, Dudes” does make clear that we are here having a party. Life is a party. There’s enough food and toys in the room with sociable people and we’re all here to share and enjoy it. And we intend to continue this party on. Nothing could be clearer than that.

It would be nice if the students got it together to sort out that sign, and the other one, which says: “Making Great Leaders”, because someone’s got to do the goddamn work at some point, and it would be nice if such people were valued instead of ground into the ground by all these self-appointed “leaders”.

You could start with the pathologies of meaningless mottos and the deterioration in direction outlined by a interviewee on This Is Hell who began:

I recently spent a semester teaching writing at an elite liberal-arts college. At strategic points around the campus, in shades of yellow and green, banners displayed the following pair of texts. The first was attributed to the college’s founder, which dates it to the 1920s. The second was extracted from the latest version of the institution’s mission statement:

The paramount obligation of a college is to develop in its students the ability to think clearly and independently, and the ability to live confidently, courageously, and hopefully.


Let us take a moment to compare these texts. The first thing to observe about the older one is that it is a sentence. It expresses an idea by placing concepts in relation to one another within the kind of structure that we call a syntax. It is, moreover, highly wrought: a parallel structure underscored by repetition, five adverbs balanced two against three…

The second text is not a sentence. It is four words floating in space, unconnected to one another or to any other concept. Four words — four slogans, really — whose meaning and function are left undefined, open to whatever interpretation the reader cares to project on them.

Think of it as an intelligence test. Nail up a bunch of ridiculous signs around the school building and if nobody pulls them down (metaphorically and/or physically) then that school’s education has failed.

For more, there’s on-going entertainment at the FOI Website for the LDL report.

Wednesday, October 21st, 2015 at 9:09 am - - Machining

I’ve been going hammer-and-tongs at this code for almost two weeks now. To prove it’s real, here it is. No one is ever going to lock this algorithm away again. This time it’s a public good.


Back in the 1990s I implemented M. Held’s algorithm twice as it was written up, first in his PhD thesis, and later in a CAD paper. He later developed a third implementation, which I didn’t implement.

This version is a totally different approach and has the potential for being fully robust no matter what.


The plan right now is to get only this particular input shape working properly — and I can spot a few bugs still there, damn! — so that I can make a toolpath to cut a stamp, which involves area clearing, chamfering and V-groove cutting. It’s got to push through.



That’s better.

Notwithstanding a lot of technical debt I should deal with while the code is fresh on my mind, this is ready to turn into some toolpaths. Unfortunately the big machine tool in the closet is unavailable due to meetings in the spare room, so I’ll be using the mini Proxxon tool to prove this algorithm.

And while I’m packaging this up into a fit state to be presented, I need to remind myself exactly why I’ve been suckered by the Not-Invented-Here force-field and avoided using the relevant CGAL package that’s freely available and fully optimized.

For the sake of reclaiming my time I have to find a way that this code exceeds it. But it won’t be in terms of speed and efficiency, that’s for sure.

Wednesday, October 7th, 2015 at 7:52 pm - - Machining

A speculative challenge of machining some leather stamping tools out of brass has led me to do more work on my voronoi experiment hacked as part of my barmesh model.

To make a brass tool requires some area clearing, chamfering and then v-grooving the details.

Like most coders, I do suffer from Not-Invented-Here Syndrome, but at least I did look at OpenVoronoi last year.

I’ve also had a try out of jscut (an in-browser CAM system) which has a V-engrave feature that is not quite right for this application. Nevertheless, the C++ voronoi code underlying this (which I should study at some point) is here and it’s then compiled into Javascript that runs in the browser using Emscripten. Emscripten is a technology that changes everything about where you expect code to be applied.

The stuff I’m doing is quite buggy, but I can at least see a way for it to handle pure arcs in the contours coming in. Most 2D contour voronoi implementations give up once they can do polygons, because it just gets too complicated to be worth it. But this algorithm works by sampling on a regular grid and shouldn’t suffer from complexity that comes in.

The thin cyan lines is the 5-sided polygon with one concave vertex. The yellow lines is the voronoi diagram, and I’ve plotted the nodes of the mesh in different colours depending on its voronoi polygon.

Here is a sparser mesh to show that I am able to subdivide the cells (white line segments) to get to the details. (Something looks wrong at node (2,3).)

Monday, October 5th, 2015 at 7:18 pm - - Kayak Dive

Not much bloggable recently. Some well-formed untested ideas on matters of servo motor control, and lots of bad psychology. Two discoveries of note that’ll take up a lot of time are jscut for CAM and chilipeppr for CNC downloads, both of which run in the browser. I have an interest in this approach, but now that I’ve found some people who are doing it effectively, it will save me a lot of time.

Meantime, here’s a couple of bad pictures from a cheeky kayak dive in the docks during Becka’s Thursday night canoe polo session (aka murderball).

Getting ready to go down:

One of the scary eels that made me shriek when it appeared in the dark.

Eels look and move a lot like snakes. We’ve got an instinctive fear when we encounter them in their own environment. It was interesting how they could swim backwards just as easily as forwards.

Wednesday, September 16th, 2015 at 7:40 pm - - Flightlogger

Following on from last week’s episode and the Emil’s sterling work reverse engineering the HC-SR04 echo location board, JD tapped in to a couple of pins on the surface mounted microcontroller so we could get the echo signal directly.


I’ll try to report this as straightforwardly as possible without too many diversions about how we worked it all out.

With two HC-SR04s facing one another, and as per the datasheet, the scope tracing is as follows:
Cyan is the trigger to device A, Magenta is the 40kHz 8-cycle wave generated by device A (delayed to allow the MAX232A chip to charge up), Yellow is its corresponding echo pin which is programmed to go high once the 8 cycle signal goes out, and Blue is the received signal in device B. [The corresponding wave generated by device B is received at the same time by device A which is programmed to take its the echo pin (yellow) low.]

Zoomed in on the initial cycle to see there are 8 and that their wavelength is four to a vertical division, or about 25microseconds each, corresponding to 40kHz. The transducers probably resonate at this frequency (to give a better energy to sound conversion) which is why so many more waves are received than sent out.

This is the received signal, overlaying the half-second of samples (about 10 because I’m repeating the loop with a delay of 50milliseconds) proving that it’s pretty stable.

By zooming in on a single wavelength and averaging over the previous 64 we can make it dance with the application of the fan

Device B (the receiver) is the one by the oscilloscope. By directing the fan along the sound vector we’re able to blow back the sound signal by approximately half a wavelength or about 12microseconds.

I’ve spent hours playing with this setup, but it’s only going to be any good if we can read the values using a microcontroller, like an Arduino.

Tuesday, September 8th, 2015 at 4:08 pm - - Flightlogger

The amazingly cheap HC-SR04 ultrasonic sensor works pretty well for what it does, which is measuring distances by echo location, but I wanted to use it for measuring air velocity as my mechanical anemometer is unreliable and of no use for getting the direction.

The sonic anemometer uses the theory that you can measure the time it takes for sound to travel through the air (about 2938.6microseconds to travel one metre) and the delay it would experience if the air was also traveling against the direction of the sound waves (about 8.6 additional microseconds for each metre per second in velocity). These values should be no problem for an Arduino running at 16MHz frequency to detect.

The basic interface code to run the HC-SR04 is as follows:

float speedofsoundmps = 340.29; // metres-per-second
digitalWrite(triggerpin, LOW);  
digitalWrite(triggerpin, HIGH);
digitalWrite(triggerpin, LOW);
long timemicros = pulseIn(echopin, HIGH);
System.out.print("Distance (cm) = ");
                       // factor 2 because distance
                       // is there and back

The basic code for pulseIn() counts processor cycles for the duration of the voltage being HIGH.

Here’s my experimental setup using two such devices, one sending and the other receiving (though you do need to trigger both in order to arm the receiver). Note the desktop fan to generate the wind.

And these are the experimental results plotted over five minutes, making a reading 20 times a second for ten minutes.
The average time of 1545.7microseconds equates to 52cms, which is an under-reading as the actual distance is 60cm, but we’ll ignore that for now.

If we turn the fan on we get an average reading of 1551.7micoseconds with a higher standard deviation of 13.4 (not surprising as the fan air is chopped and turbulent) which is an average difference of 6microseconds amounting to a wind speed of about 2 metres per second, agreeing approximately with the figure from my mechanical anemometer.

I’m not interested in tracking down the source of the error or calibrating this setup while the readings themselves are so darn noisy and in excess of the signal I am attempting to detect.

What is the source of the noise?

Monday, September 7th, 2015 at 10:55 am - - Kayak Dive

Home at last. Lots of stuff to do, so here’s just the bare facts of the trip to the north part of Ireland with our kayaks, as well as a 4-day booking with aquaholics where the weather blew northerly gales the whole time, which denied access to the famous north face of Rathlin Island and the basking sharks were a no-show.

Date Site Place type depth (m) time (mins)
2015-08-28 Mulroy Bay Downings Kayak 15 19
2015-08-28 Mulroy Bay Downings Kayak 17 35
2015-08-29 Melmore Head Downings Kayak 20 45
2015-08-30 Gloster Rock Malin Beg Kayak 20 12
2015-08-30 Shark Rock Malin Beg Kayak 20 30
2015-08-31 2nd Pinnacle Slieve League Kayak 18 12
2015-08-31 Big Cave Slieve League Kayak 9 15
2015-08-31 Carrigan Head Slieve League Kayak 20 23
2015-09-01 Portnagh Rock St Johns Point Shore 26 52
2015-09-01 Skuddagh Rock St Johns Point Shore 17 48
2015-09-02 Black rocks Rahlin Island Boat 31 36
2015-09-02 HMS Drake Rahlin Island Boat 18 46
2015-09-03 Black rocks Rahlin Island Boat 31 38
2015-09-03 Scallop bed Rahlin Island Boat 21 48
2015-09-04 SS Lough Garry Rahlin Island Boat 30 29
2015-09-04 Harbour wreck Ballycastle Boat 19 37
2015-09-05 SS Lough Garry Rahlin Island Boat 29 29
2015-09-05 Black rocks Rahlin Island Boat 29 36
2015-09-06 Lees Inner Wreck Strangford Lough Kayak 11 24
2015-09-06 Lees Outer Wreck Strangford Lough Kayak 12 29

Kayak diving wins again!

The most notable sighting of wildlife was this unexplained swimming snail above the kelp at the start of yet another black rocks dive (where we failed to find the right bit as usual).