Sunday, November 15, 2009

Bayes and models.

This is me talking to the pumpkin (aka thinking aloud).

I have two models.
One is that everything is noise, and has a discrete distribution over a grid.
One is that there's a pattern and predicts the future location of an event.

Bayes says the posterior probability of the model is:
   P(M|E) = P(E|M)P(M) / P(E)
   P(E) = P(E)P(M) + P(E)P(!M)

Ahhh. I realise my mistake. P(E) is not the ideal probability of the event, but the much more restricted 'probably of event in the space the P(E|M) is measured '.

In my case, where the distance between the predicted location and a movement event is being considered, the underlying distribution is the expected distance to a movement events, independent of the model.

I.e. Have no model. Just measure the expected distance from random points to movement events to build the model. Then seperately build the same model specifically for known model conforming events. That generates P(E) and P(E|M).

Doh. For some reason that took a very long to sink in.

Thursday, July 30, 2009

HAL sucks

So you have a touchscreen, and a 'modern' X11 installation.

Your 'modern' X11 knows that actually configuring devices is something that people who live in caves do. 'Modern' X11s use HAL!

Unfortunately, the nice 'modern' X11 installation is borked. It's talking to HAL which is telling it to use inputs/event0. Which doesn't actually exist.

So the question is: How do you tell it to use /dev/inputs/event2 which is a working touchscreen?

Ahh, you might ask. What you really do is spend far too much time searching google and eventually arrive at:

<?xml version="1.0" encoding="ISO-8859-1"?>
<deviceinfo version="0.2">
  <match key="input.product" contains="Touchscreen">
    <merge key="input.x11_driver" type="string">evdev</merge>
    <merge key="input.x11_options.SwapAxes" type="string">true</merge>
    <merge key="input.x11_options.InvertX" type="string">true</merge>

Which you install in /etc/hal/fdi/policy/touchscreen.fdi

Of course. it was obvious from the very start that this was the thing to do, no? And the documentation has zero mistakes or misspellings in it. A remarkable end it achieves by being non-existant.

Sunday, July 12, 2009

Rust as far as the eye can see.

Having many adventures trying to compile a new kernel for the DevKit8000

embest haven't submitted the board support to mainline and after reverse engineering their patches, it's easy to see why!

The diff is littered with random patches to random files (that aren't used), #if 0'ed code, and cruft like:

-       debug = cfg->debug;
+       //debug = cfg->debug;
+       debug = 1;
        warn = (orig != reg);
-       if (debug || warn)
+       //if (debug || warn)
It's been about  two hours work to separate out the parts that actually do something, and port them forward to a 2.6.30 kernel.

Which brings me to a confession: I just realized it's been something like 3 years since I last ran 'make menuconfig' on a linux kernel. The rust! It burns!!

Saturday, July 11, 2009


I recently ordered a DevKit8000 development board for use in an embedded image processing project I'm looking at.

My DevKit8000 arrived yesterday. I bought the "yes, I will have fries with that" version, so it has the 7" touchscreen, more cables than you can poke a stick at, 512MB sd card, a USB hub,  and 2 power wall-wart power supplies.

Total cost was $AUD420 including DHL shipping of ~ $AUD80. The price for the board board is comparable with the BeagleBoard, but the shipping was cheaper and easier from China than it would have been from DigiKey! So I'm pretty happy with the price.

One of the power supplies has a USA plug, the other is something European.
The one with the USA plug is apparently the board power supply, the other is probably the USB hub power supply (at least, the plug doesn't fit the board).

The board itself had Windows CE loaded in NAND flash out of the box, which sent me on a 4 hour trail of destruction trying to replace it with linux. This was mostly due to me not realising that the sd-card that comes with the board is junk, and in addition to being unreliable, doesn't function at the 3.3V the OMAP processor requires for it to be booted from.

Not realising that, I thought that I must be doing something wrong (which given the .. umm.. erratic number of the board documentation wasn't unlikely) and so tried all sorts of things in an effort to re-flash the NAND X-loader, cumulating in formatting the NAND flash and rendering the board entirely unbootable. Waving aside the blue air, I finally did what I should have done to start with, and use a known-good SD card. Which instantly booted correctly, taking another 2 minutes for me to reflash the x-loader, u-boot, uImage and filesystem. *&^*&^*&^&*!!!!!!!

With the board actually booting and running linux, it was much more useful. It immediately come up on the ethernet with an ifconfig+route making it a lot faster to move images around than the sd-card sneakernet I had been using.

The CD that comes with it has a port of Android which functions rather well and was useful is checking that the touchscreen actually works.

The hardware appears to be fairly close to the beagleboard, except that it also includes an on-board ethernet, and a ZIF socket for a camera input.

There's a couple of odd things: The host USB port (as opposed to the OTG USB port) appears to be missing a chip. The pattern is there for it on the board, and all the pad have solder on them, just not chip. This is not entirely unexpected: The USB Host port isn't listed in the feature list, and the BeagleBoard people have had trouble getting it reliable.

The more concerning one is that one of the power regulators (TPS73701) has a terrible soldering job done on it. It looks like there may have been a solder mask problem and FAR too much solder paste was dumped on. The tab is swimming in solder, and leads look like they didn't quite reach temperature to fully melt the paste. This is one of a two parallel regulators, and the other one is spotless, so I'm a little puzzled as to what went wrong with this one. Both are running the same temperature so it appears they're both working, it just looks terrible.

Other than that, the rest of the board looks clean and well put together.

Now I'm off to setup a cross compiler environment!

Belated files

Very belatedly getting around to posting these.

The Eagle CAD files for the relay driver board is now posted at

Friday, April 10, 2009

Noise filter your signals!

Free advice. When there's a 200m loop of wire carrying a low voltage signal, noise filtering is a _very_ good idea.

Otherwise the doorbell may ring at 3am in the morning from induced noise...

Sunday, April 5, 2009

'Fixed' the doorbell today.

The doorbell has been a source of trouble for a while. Mostly because D is in the habit of closing every between where she is and the front door, causing it to be inaudible.

So today, I wired the doorbell between the DCD and DTR lines on the main fileserver and wrote a little C program effectively gets an interrupt when DCD changes. When triggered, this program runs wget to hit a URL on another server, that runs a cgi-bin script, that plays a .wav file through the speaker.

For some reason the name 'Reuben Garret Lucius Goldberg ' kept running through my head...

But the end result is that one can push a door near the front door, and something near the center of the house chimes, so the end goal is fully achieved!

Saturday, April 4, 2009

Clipsal C-Bus

Clipsal have decided to open the C-Bus protocol.

Speaking as someone with a C-Bus wired house (for reasons that were never terribly good), this is a very, very good thing.

It's rather unexpected, and I suspect a little late (there's considerably more competition around now), but it's going to make it much easier to do semi-decent integration.

Yay Clipsal!

Monday, March 16, 2009

Adventures in Switzerland.

Currently in Zurich.
R is here for first time, so wanted to do a little wandering around.

Had very vaguely hatched a plan to visit Pilatus, a mountain not too far from Zurich. The plan was to catch a train to Luzern, bus to the cable station, and then cable car up Pilastus.

The morning started off to plan: We managed to leave the hotel vaguely sort of on time, made our way to Zurich HB (Central train station), and found food at McDonalds. (hungry people do desperate things).

The first sign of trouble was attempting to buy a ticket to Luzern. This involved much fighting with the ticket machine. Firstly it didn't like anything. This was solved by actually pressing 'OK' on the screen before attempting to hand over money. Then it refused my visa card many times (in various orientations), then it wanted a pin (which I don't have), then rejected my EFTPOS card as unsupported (the pin for which I did know), R's visa card (it wanted a pin which he didn't know), and various other random pieces of plastic we attempted to feed it. Finally R found some cash and fed it that, which is liked, ate, and dispended tickets. Yay! For a train that was due to leave in 60 seconds. On a platform far, far away.

Sprinting for the platform had us there just in time to see it leaving in the distance. A 30 minute wait...

The trip to Luzern was very pleasant. The trains are very quiet and nice, and the scenery is picturesque. Did a few sudoku puzzles which R had infected me with, and we arrived in Luzern in short order.

Wandering around looking for things bearing the name 'Pilatus' had us finding the S31 bus which ran to Pilatusmarkt. Very promising. So we walked to the 6 blocks to Pilatusplatz, found a bus stop (yay), found the S31 stopped there (yay) and it was due to arrive in 6 mins (yay).

15 mins later, it was pretty clear that the S31 wasn't. The timetable insisted that all was well, but no bus. So we decide to take the S20, change to the S21 and we'd be fine. S20 was good. Actually did arrive, did travel in the right direction. Alas, we fell to talking and missed the stop. So getting off at the next stop decide to 'just walk back. Not far really'. About 15 mins of walking led us back to the stop for the S21. Which was due to arrive in a little over an hour. argh! Ok. Another change of plan. Now we'd take the S16 which looked like it also went to Pilatusmarkt and that one was only 6 mins away.

Bus arrive. We get on bus. Bus travels about 300meters to Pilatusmarkt. We get off. Find we are at deserted shopping center. Close for the sunday. Named 'Pilatus Market'. Doh! Turns that that many random things around Luzern are named after the mountain.

Now very lost, with the next bus not due to 60 mins, we decide to walk back to where we caught the S16. The horrendously unreliable map (scale optional) claimed a nearby train station.

20 mins of walking, we are at train station. We had originally intended to catch the train back toward Luzern, but there timetable had various stations marked with a cable car symbol. How exciting! Which led to R get excited about visiting Engelberg, and maybe wandering up Titlis, a 3000m high mountain.

More tickets, more fighting with ticket machine, eventually discovered that it enjoyed amex cards. Wait for train. Train takes us along a very pretty route. Alongside a lake, wending through valleys. And then turned into a cog-train for a while! Seriously steep assent led us into some stunning scenery (sorry, no photos yet) .

Engelberg was less interesting, but they really did have a cablecar up the mountain (actually, many many cable cars up many slopes). We caught one to Gerschnialp, about 1260m above sea level. Normal hairy cable car ride put us in some fairly serious snow. With us wearing jeans and tennis shoes...

We had a really good time. Walked along a snow trail for about 20 mins a small restaurant in the middle of no-where , had a fairly ordinary lunch (which cummulated with them refusing to accept anything except Amex, where the amex could only be used for bills over 50CHF [ours was 33CHF], and we had no cash left...) we then set off to walk down the mountain.

This was hugely enjoyable. A snow trail wandered down the mountain through forests et al. Most of it was fairly well packed snow so it wasn't that bad to walk on. Most of the other people we saw were wearing snowshoes, but they clearly envied our minimalist approach to snow hiking.

About 1/2 we down, we found a ski-jump! A truly terrifying affair. Seeing them on television can't convey just how insane they are. Standing at (well, near) the lip of the jump, you can't actually see any of the slope below, just the flat field far below. Actually: far, far, far below. I was having trouble with the heights just standing near the edge of the jump. I can't imagine just how certifiable you'd have to be to actually go down it on skis. Simply amazing.

It took a bit over an hour to walk down the mountain. Followed by a sprint to catch the train back to Luzern (more stunning scenery), and then the train back to Zurich, and then another train back to Stadelhofen.

Hugely enjoyable day; Now very, very tired. Goodnight.

PS: No, never did find out what happened to the S31 bus.

Sunday, March 1, 2009

Puzzle Piece

Just spent a few enjoyable hours making this exercise. "How DID the nut get on there?".

It's puzzle piece to which the photo doesn't do full justice. There's a no visible joins in the threaded piece: It looks seamless.

It's a nice exercise in lathe work with a number of tricky bits. The facing needs to be very good, threading interior sections is a generally a bitch to do, especially in stainless steel. And then finishing it all to the mirror polish (which you can somewhat see in the high fidelity reflection at the end).

I'm quite pleased with it because I pretty much got it right first time, it turned out well, and the polish came up far better than I was expecting. I keep underestimating how far the buffing wheel will cut.

Friday, February 13, 2009

Audio over HDMI

Noted here mostly so I can find it later.

I have a Gigabyte motherboard, the GA-G33M-S2H, that I use for a HTPC (home theater pc). It lives under the couch, driving the LCD TV, diskless, quiet, and is generally pretty happy.

I bought it principally because it has on-board video that does HDMI with an intel chipset. The intel graphics chips are pretty well documented and Intel fund development of linux drivers so it was a fairly easy choice at the time.

When I first turned it on about a year ago, the video of HDMI turned up right away. Very easy. 1080P @ 50Hz is very nice.

Alas, the audio didn't work. At the time, there were bugs in the ALSA drivers that prevented the properly detecting the (seperate ATI) chip that handles audio encoding for the HDMI data stream. After mucking around with it for too long, I gave up and ran a DVI cable and an audio cable to the TV instead. Which had it's own mucking around to get 1080P working on a single DVI channel...

Coming back to the present, I had occasion to revisit my MythTV setup, due to the "urgent need" to repaint the wall. This mean the TV cable down briefly, and stirred me to investigate if the audio HDMI is fixed.

Yay! It is, as of ALSA 1.0.17. Which is in Fedora 9 which I upgraded to a while back, so the kernel already knew about the HDMI audio and was ready to use it. Sweeet.

But. There's always a but. Pulseaudio, the apparent audio hub of choice didn't know about it. After poking, peering and prying at the config, it was clear that HAL did know about it, but pulseaudio refused to use more than the first device on any given soundcard.

As the HDMI appears on this motherboard as hw:0,3 (3rd device on card 0), pulseaudio via HAL refused to have any truck with it. This turns out to be a known, very long standing bug in pulseaudio.

My hack solution: Boot the HAL module in pulseaudio out the door, and just hardcode the detection for the device. Which said that it worked, but didn't produce any sound. After even more trawling, it turns out that I needed to unmute the "IEC958" in the ALSA mixer.

And now it all works! HDMI, 1080P and audio over a single cable.

Saturday, February 7, 2009

Tapping ACME nut.


The short story is: I re-tapped the acetal nut for the X axis to an ACME thread.

The longer story involves much pain. :-)

To re-tap the nut to ACME thread involved making an ACME tap. (off-the-shelf ACME taps cost ~ $400 which is a bit much for a one-off). Making an ACME tap seemed very simple: Just cut a piece of thread rod, grind a taper onto it, and then grind an edge. No worries, right?

So being a doofus, I actually did grind the taper, but in a way that involves destroying my finger tips along the way. I made a simple jig with bearings that allow me to rotate the rod against the grinder. The idea was to let the rod spin against the grinder, ensuring that it would be ground evenly and giving an accurate taper.

In practise, the rod spun much too fast, and in reaching out to slow the spinning rod, I found out that rolled ACME thread has fine burs along the thread edges. Some of them relatively large. As I can measure by the many fine cuts in my finger tips....

I started grinding an edge on the rod as well, but I really need a diamond cup grinder to do the postive rake. After mulling it over, I slapped myself upside the head, and just milled the edge onto it. The ACME rod I have isn't ground, nor hardened, so milling it is fine. I just used a carbide boring tool to cut the postive rake.

Once I'd actually managed to wake to using the mill, it all went fairly fast; Just cut the edge, polish it up a bit with the diamond lap, then bung it on the lathe and it's done.

Well, almost. The amount of plastic being removed is fairly large and the taper on the acme isn't as shallow as it should be, so machine tapping it mostly out. I used lathe power to get the tap started, but then using a spanner to turn the nut by hand to cut the thread.

The end result is fairly good. It's a relatively loose fit, so I'll need to add an anti-backlash nut at some point, but the tap itself worked well.

Thursday, February 5, 2009

Bearing mounts

Last night I made the two new bearing mounts. These are brackets that hold the angular contact bearings for the ACME rod. The task was to bore a 16mm hole for the rod, and then a blind 30mm hole for the bearing. The 16mm through hole had no real accuracy considerations, but the 30mm needed to be 29.99mm so as to ensure that the 30.00mm bearing were a press fit.

I had originally planned to do this using the boring bar, but on reflection realized that that would make it difficult to do the accurate flat base required to support the bearing.

So I got out the rotary table. Now normally the rotary table is a pain in the butt to use. Partly because it's difficult to clamp things on my relatively small table, but mostly because I'm terribly slow at indicating the part to be aligned with the table center. I'm just awful; it normally takes me more than an hour to get terrible accuracy. And thus I avoid it like the plague.

My brain wave was to use the lathe to made a trivial jig; The table has a 17.50mm hole in the center, and my part already had a milled 16mm hole in the center. So I made a piece of delrin (plastic) that was just a short section of 17.5mm dia, stepping down to 16mm dia.

A few taps with the mallet inserted it into the table, and then the blanks were a press fit onto the 16mm section. Instant alignment. Yay!

Even better, this made clamping much easier as I just needed to clamp at one point. Much win all around.

Actually milling the blind 30mm hole was then pretty simple. Just offset a 12mm end mill 8.950mm from the center, mill 5mm into the blank, and run the table around a full 360 degrees. Easy.

The slow bit was getting the hole to be a solid press fit for the bearings, and 29.950mm is much too small. So I increased the hole size in 10 micron increment thru to 29.990. At which point the bearings went in with about 200 newtons of force. Perfect!

I think this is some of the more accurate milling I've done. I'm pretty happy with how it turned out.

Sunday, February 1, 2009

Bearing jig

Dichro milled this up from a scrap piece of aluminium bar. 10x50mm flat bar, drilled with 16mm hole, then added 4 x 7mm holes on a 25x25mm square. M6 bolts, some washers, some skate bearing.


Worked extremely well. Should have done it sooner :)

Maching ACME threaded rod

ACME threaded rod, cut to 1150mm long, first end machined.

The 0.5 inch ACME was turned down to 10mm to match the inner diameter of the bearing. It was then threaded to M10 for ~ 30mm to allow for the lock nuts to go on, and then turned down to 4.75mm for the last 10mm to match the coupling for the motor shaft.

The metal was a serious pain to machine. Owing to the length (> 1 meter) I was running the lathe at fairly low speed. The steel work hardened VERY easily, and it's very flexible steel. This meant that it was just as easily bent away from the lathe cutting tool as cut. And it was threaded to boot, which mean highly variable loads on the initial cuts...

I ended up using the live center to attempt to hold it in place which improved matters a little, but not much.

Eventually, I used a handful of skate bearing to make up a jig to support the other end, which let me run the lathe much faster, which made the whole thing easier to do. I was initially turning it at 220 rpm with HSS cutting tool. Running it at ~ 480 rpm was dramatically easier.

The threading was done with a 60degree lathe tool, mounted upside down, with the lathe running backwards. I threaded it in until it "looked done", and then cleaned up by running an M10 x 1.5 die over it. Worked very nicely as I didn't need to try to fight workhardening steel with the die getting an initial thread.

Now to make the bearing brackets...

Saturday, January 31, 2009

ACME threaded rod.

I bought it from

Bomond Trading Co Pty Ltd
49 Orchard Rd, Brookvale, NSW 2100
p: (02) 99391344

1/2 inch (12.7mm) ACME threaded rod (aka leadscrew), 10 tpi (10 turns per inch). This is rolled rather than ground so it's less accurate.

The chap at Bomond was very helpful; I phone up on thursday, he said it was a speciality item, but he could get next day. I went this on saturday (this morning), and picked it up. The length of leadscrew and a handful of M10 nuts was under $AUD100 so I was pretty happy. It was the closet place in Sydney I could find to supply it. There's a number of other places I'd found, but they were a long drive away.

The only fly in the ointment was that I was expecting it to be a 3 meter length, but it was actually 12 foot. For some mad reason I'd heard "12 foot" and mentally translated that to "about 3 meters". Of course, it's actually about 3.7 meters, which is longer than will fit in the car.

Bomond didn't have cutting facilities, but I was on my way to Edcon Steel to pick up some aluminium flat bar, so I just left it poking out of the boot of the car a bit while I drove around the corner and asked the chap at Edcon to snip 1150mm off one end for me. Nice and easy.

Wednesday, January 28, 2009

Stepper motors

The stepper motors I have are Linengineering 4118S-62-07 motors. They were a surplus item, so unfortunately the datasheet doesn't seem to be a very common.

My motors are rated for 2.5A per phase, and a resistance of ~1 ohm is cited in a catalogue with a ~3.6Kg-cm torque.

Looking at and extrapolating a bit, my motor would be something like the 4118S-04V, or having approx the same torque the 4118S-04P does, just at twice the rpm.

So when I'm running my mill at 2000mm/sec on a 1.25mm pitch, that's about 26 revs/sec. Which would be something like 1600g-cm of torque from my wild guessing and eyeballing the graph. Which, frankly, isn't too bad at all at all!

If I get this ACME at 10tpi (or 2.54mm pitch), I should be able to run a similar speed, but at 13 revs/sec and ~ 2200g-cm of torque. When is very reasonable indeed. Ok, I'm sold.

Now I'm off to buy some 3 meters of ACME threaded rod.

Tuesday, January 27, 2009

Simple image to g-code converter

I did a tiny little bit of tidy up and uploaded my trivial C program to

The program simply translates images to G-code. It does nothing else. It assumes that you're capable of editing the resulting G-code to make it usable on your machine, and that you can add minor things to the g-code like feed rates et al.

It's pretty raw. It assumes many things, including that you have a ballnose cutter and that the input is always correctly formatted PGM.

The line I used to generate the (upside down) image from the pic above is:

cat ../IMG_545.JPG | jpegtopnm | ppmtopgm |
./imagecarve --scale=0.25 --toolsize=3.2 --stepover=1.5 > out.g

followed by hand editing of the resulting 'out.g' file to set a feed rate.

Monday, January 26, 2009

Yay! First cut!

After a lot of preperation the mini-mill is cutting foam again! Pic shows a little test cut from semi hand-rolled G-code. It was done with a 3.2mm ball-nose endmill, using a 2mm stepover and running at ~ 400mm/minute feed rate.

Frankly, the biggest thing it showed was that I feel the need for speed! It could easily have cut at > 1000mm/minute given the fairly shallow cuts being taken. My steppers are pretty tiny, and the threaded rod I'm using is only a 1.25mm pitch so it's spinning pretty fast to reach the 600mm/min rapids it's currently doing. I think I see a purchase of some ACME threaded rod in my future... Which will mean re-doing all the delrin nuts again, dammit.

Currently debating if I should buy 1/2inch or 5/8th inch rod (~12mm and ~16mm respectively). The 12mm is 2.54mm pitch, and the 16mm is 4.3mm pitch, so the 5/8th is capable of much higher speeds, at the cost of some accuracy and backlash. Still very undecided on this.

I say 'semi hand-rolled' G-code as it involved initially a significant chunk of perl, and eventually a chunk of C code that properly compensated for the cutter size. At the moment, it will take a PGM image and convert it into G-code, treating the grey levels as a high map. It's did a semi-reasonable job of carving a picture of K into foam; albeit with some oddities given the simple lightlevel->height conversion. Took nearly an hour to carve a 120mm x 80mm image tho. I am seriously feeling the need for speed!

Sunday, January 25, 2009

Getting slower better at milling.

I'm slowly getting better at maching parts. The photo is a trival couple of spacers; Just some aluminium box, cut and faced to the same length.

I cut them on the bandsaw, squared one end of each on the mill, turned them over, stood them on equal bars and then run a face cutter over the pair.

Pretty trivial machining, but it still involved 3 tools. The nice bit that I'm happy about is that it only took me about 5 to 10 minutes. I'm very slowly getting more experienced and quicker.

This morning I was making more delrin nuts (for the mini-mill) and had both the lathe and knee-mill running at the same time. The lathe was on auto-feed facing and then parting delrin, while the mill was on power-feed facing the aluminium bracket. Less standing around waiting while the machines take fine cuts. Not entirely sure it was a good idea, but it did make things go faster.

The PCBs for the relay board finally arrived from BatchPCB. (Well, I should say I finally got them; Turns out they were sitting the mailroom at work waiting for me to pick them up for about 2 weeks. Oops)

Pic is a raw board on the right, and a fully assembled board on the left. The board went together fairly easily.

I tried to use the SMD oven for the first time in anger, and was mildly annoyed to find that it doesn't quite reach the melting point of the lead-free solder I'm now using. Dammit. I need to get a toaster oven or similar.

So I just hot-air soldered all the SMD components, and then hand-soldered all the through hole components. A lot of soldering! Took most of an hour to solder it. ( Some 123 thru-hole solder points).

Interestingly, I managed to get a dry-solder on one of the SMD components. I suspect I managed to just not put enough solder paste on it, but it's a first for me. I fixed it by hand-soldering; Good thing it was an enormous 0.8mm pitch component.

Board is now plugged into an ATNGW100 and it looks like it's working well. I can read temperature from a DS18B20+ that's attached to one of the 1-wire interfaces, and the board hasn't caught fire. Yay!!

When I get time later today I'll do the spot of programming to talk to the GPIO pins and start testing the relay drivers, RS422, and SPI interfaces.

Eye-Fi, grumble, grumble.

The Eye-Fi card simply stopped working a few days ago.

After trying the usual sorts of things (power cycle, power cycle again in a fit of sheer optimism, opwer cycle with it next to the access point, tcpdump on the network looking for it's MAC address) it was clear that things had gone badly wrong.

10:38:04.919893 00:18:56:10:1d:b6 > Broadcast, 802.3, length 60: LLC, dsap Null (0x00) Individual, ssap Null (0x00) Response, ctrl 0xaf: Unnumbered, xid, Flags [Response], length 46: 01 00
10:38:09.174952 00:18:56:10:1d:b6 > Broadcast, 802.3, length 60: LLC, dsap Null (0x00) Individual, ssap Null (0x00) Response, ctrl 0xaf: Unnumbered, xid, Flags [Response], length 46: 01 00
10:38:13.444594 00:18:56:10:1d:b6 > Broadcast, 802.3, length 60: LLC, dsap Null (0x00) Individual, ssap Null (0x00) Response, ctrl 0xaf: Unnumbered, xid, Flags [Response], length 46: 01 00
10:38:17.707051 00:18:56:10:1d:b6 > Broadcast, 802.3, length 60: LLC, dsap Null (0x00) Individual, ssap Null (0x00) Response, ctrl 0xaf: Unnumbered, xid, Flags [Response], length 46: 01 00

It was basically just broadcasting an invalid ethernet frame over and over again. Curses. Looks like it had corrupted its configuration.

After laboriously re-installing the windows software, it wanted a firmware update (2.0396 -> 2.0400 ) which I did. Pulling the log from the card showed things like..

[111:32] Disconnected from WLAN (reason = 4).
[111:32] Connection dropped (previous state is 2)

looping. Yuck. No idea what causes it to corrupt it's settings. It's "fixed" now in the sense that it's uploading images again, but I'm a little perturbed. (Luckily the firmware update didn't break the perl server).

I need to find out why Dave Hansens linux utility doesn't work and fix it. It's very annoying having to fire up a windows instance all the time.

Saturday, January 24, 2009

Bracket to suit.

This is the bracket that goes with the acetal nut. It's just a piece of 50mm x 50mm x 10mm aluminum, squared up on the mill, slotted with a 6mm end-mill, drilled in the center with same, increased out to 16mm with a 16mm roughing endmill, and then bored out to ~21mm with the boring tool.

The finished piece. I just love the finish the boring tool puts on holes. The final pass was cutting ~0.1mm deep, feeding at about 0.03mm per turn, so it was taking a pretty fine cut indeed. The result is this mirror smooth finish. Total overkill for this piece, but I take any opportunity to practise. The results I'm getting these days are far improved over the mess I made with it when I first got it.

Acetal nut fitted to bracket. The bolts are just my usual M6 stainless steel. There's about 5mm of adjustment available in both the X and Y directions.

The driving side. The nut isn't actually totally flat on this side. It turns out the parting tool I used to cut it off the bar isn't totally straight, so there's ~0.07mm of curvature across the nut. Which turned out to be fine as it's the otherside that fits to the bracket, but it's still annoying. Will have to get out the dial indicator and straighten the parting tool at some point; Come to think of it, I'd better do it soon before I forget and attempt to use a bent parting tool to part steel....

This bracket is fitted to the table mill and working very well. Much better than the old nut. Unsuprisingly, having the threaded hole accurate makes a big difference to the effort required to drive it. The tiny steppers I have easily drive it at better than 1200 rpm now.

Tuesday, January 20, 2009

My blogging process.

I'm not 100% happy with this, but it's still the least effort I know of.

I take photos with the Canon 20D, which then uses an eye-fi to upload to the server. The script on the server auto-sorts into directories by month.

I then use picassa on the linux desktop to pick out suitable photos, occasionally cropping particularly dud ones that I still want. After getting a few useful pics, I click on 'Blog this', and then 'Save as draft'. (As the picassa blog editor is awful).

Then I got to, click on 'Edit posts', select the draft and add text. Then publish if all goes well.

Things that suck:

1. Picassa on linux frequently forgets to scan the directories regularly. I need to go to the Folder manager, change nothing, click OK, and then it finally scans the directory and picks up the new images.

2. Picassa won't 'Blog this' with more than 4 pics. Sometimes this is a pain.

3. There's no easy way to add captions to pictures that show up in the blog post. Picassa lets you set captions on pictures, but promptly discards them when you ask it to generate HTML. I kinda get the impression that 'Blog this' was a kinda half-arsed feature.

4. The Blogger editor is pretty flakey. Then editing posts that have images floated right, it's easy to get into a state when it simply won't add text at the top of the post. Increasingly, I just edit the HTML as it's easier than fighting the editor.

5. The whole process is still a large work burden than I'd like. My mental barriers to regularly updating the blog are high enough without fighting tools as well.

What do other people use?

TechCrunch tablet lappad

Looks like someone is finally building my ideal tablet.

Reasonable price point, nice and simple, good sized screen, runs linux: What's not to like?

I'm still hunting something like this as a better interface for the home automation system.

Sunday, January 18, 2009

Finishing flanged nut


This is just finishing off the delrin nut for the table mill. After turning the blank on the lathe, I finished it off on the mill. This was basically just cut the top and bottom off to reduce the height to 30mm, then mill the slots either side (which will be used for position adjustment).

Acetal is seriously nice to work with. It cuts very cool (no lubricant or cooling required!), and the surface finish is just fantastic.

The only (very minor) downside is that it compresses slightly under load, so I needed to do a few passes on the slots to get them the right side.

Easy machine, relatively cheap (cost me ~$50AUD for a 1000m x 50mm rod), nice finish, tough. What's not to like!? :)

Acetal on the lathe

I started turning up the flanged nut for the X axis on the table mill. The current nut is made of UHMWPE (aka a piece of plastic cutting board), but it was made on a drill press, and it's accuracy is low enough that it binds fairly easily.

The new nut is made of Delrin (aka Acetal). This is my first time maching acetal and overall it was very pleasant. The only negative is that is grabs very easily. I got a little carried away and the autofeed was a little fast, and thus the piece of 50mm rod made contact with the ceiling. Oops.

Taking slightly lighter cut made everything good. The plastic machines to a very nice finish, and appears to hold it's shape very well. I just faced the rod, did a skim cut to true it, narrowed one section and then cut it off with a parting tool. Very easy!

I'll definitely be using this more.

The other thing I did was something I've been been meaning to do for a while. After tapping a thread into a hole, there's frequently small shards of metal et al which are difficult to remove. Just running a bolt into the hole tends to mash the splinters into the thread making a bit of a mess.

So took a normal M6 bolt, and used the ginder to put a groove up the side of it (cutting across the threads). Screwing this into the hole nicely removes the splinters of metal (they collect in the groove). This is akin to just running the tap in, but the bolt is a looser fit, and doesn't risk further cutting of the thread. Worked better than I expected.

Saturday, January 17, 2009

Home Switches


Today I added home switches to the table mill.

The microswitches were just ones I had lying around that were a suitable size. It didn't take long to discover that they mounted via a pair of 2mm holes. Unfortunately, I didn't have any M2 bolts around.

So with desperation driving necessity, I found a length of thick wire (actually ~ 1.9mm music wire) and used the drill to run it through an M2 die. This nicely gave me a length of M2 threaded rod.

In the spirit of hackery, I then drilled a pair of 1.5mm holes into the aluminium bracket, and use the drill to drive the threaded rod into the holes. The music wire being much harder than the aluminium, it just tapped a thread into the al bracket. Ta-dah! Easy mounting for the micro-switches. A very small bad of CA glue to stop things vibrating free and it's all done.

I'm still using MACH3 to drive the mill at the moment (haven't yet installed EMC2) but it's still neat to click on 'Ref All Home', and watch the mill drive the Z, Y and X axis to the home switches, stop, and reverse slowly until it comes off the switch.

I think tomorrow I'll be in shape to do the initial cuts on the upgraded mill.

Thursday, January 15, 2009


The range of the Eye-fi card is pretty ordinary indeed.

It can do 2 meters of air.
It can do 5 meters of air.
It can't do 10 meters of air + 2 glass windows.
It can't do 5 meters and a brick wall.

Am mildly disappointed. The last thing left to try is bump up the access-point power from 40mW to 250mW. This doesn't help if it's a transmit problem on the eye-fi card, but hey! it's about 50/50 right? right? :)

Wednesday, January 14, 2009

Actual progress


I basically finished re-assembling the table mill. Starting to look like it can actually cut something!

The table went on very easily. There's a lot of socket screws involved, so I took an old allen key and cut the tail off with the grinder. (With a stupid moment along the way; I had assumed the key would be case hardened as it's a cheap key, so I ground off the surface and then put it against the metal bandsaw. Mistake. Now I think I need to fit a new blade to the bandsaw. Doh! Not a total disaster as the blade was pretty close to the end anyway but still annoying)

The resulting hardened hex bar fits into the cordless drill and making doing and undoing socket screws very fast and easy.

I still need to finish aligning the table (need to get the electronics back together for that). I also finished all the plywood sections for the dust box.

Next step is to cut to the perspex lid and side for it, and hinge them on. Cutting the perspex will be .. interesting. It's only 3mm thick, but I need to make a greater than 1.5 meter long cut.

I'm planning on using the circular saw for it. I'll need to ensure that the perspex is clamped well on both side of the cut. Not going to be easy as I'm running a cut up the middle of a 2.4 meter long sheet. I suspect it will be a matter of reducing the depth on the circular saw to a minimum, using backing plywood, and lots and lots of weight. Not sure how else I can usefully clamp it.

Tuesday, January 13, 2009

Plastic fantastic

More toys arrived yesterday. This is 2 x 1000mm x 50mm Delrin rod. A fairly tough plastic, dimensionally pretty stable, and very, very easy to machine.

I bought it originally to make anti-backlash nuts, but I suspect it'll find up getting used for a fair few more things than that..

I'm planning to fire up the lathe this evening and turn a couple of nuts for the mini table mill, just to get some experience with the material.

Small progress

The original task to 'just remove a bit of lash' from the table mill has grown. A little. Just slightly.

So after adding the extra linear bearing, and noticing that the table structs needed fixing, which resulted in noticing that the drill holes in the original brackets weren't accurately aligned and basically tearing down the full X axis to do these things, I was on track to re-assemble.

Except that the side project of enclosing the mill (to contain dust and reduce noise) reared it's head and pointed out that it's much easier to add that while the mill is mostly disassembled.

Which led to noticing that the enclosure would shade the ethernet and power points on that side of the bench. So off to add extension leads to all power points and longer ethernet cables to ensure I wouldn't need to regularly get to them. Which led to relocating the PC to free up the desk space. And moving the monitor/keyboard. Which led to re-doing the power cabling to tidy it up a bit.

And so this evening I finally put two sides of the enclosure is on. I just used some angle aluminium to make brackets, and screwed the plywood on. Yay! Progress!

Except that in doing that and moving the X carriage around, I noticed that the nut wasn't quite aligned with the threaded rod...

On the bright side, it was an opportunity to use one of the most brutal tools I own: A 26mm , high helix milling bit. When you want to make a big hole in a hurry, and you're not too fussed about the accuracy, that's the way to do it!

A 26mm hole in 12mm aluminium, 8 seconds. Done! Sometimes, using a bigger hammer is just plain fun.

Monday, January 12, 2009

Timing belts

Another step toward finishing the CNC of the big mill arrived today. These are timing belts and pulleys. The largest one is ~300mm in diameter. I'll use this to run the Z-axis (aka the knee) on the mill, and the smaller ones to run a 2:1 reduction for the X and Y axis.

Like most solutions, they come with a problem. The holes are just guide holes, I'll need to bore them out to size. That's easy. The hard bit is cutting a keyway in each one. I don't have a keyway broach, and don't feel like spending ~ $200 just for this. I'll probably try and grind out out of a bit of high speed steel. We'll see how well that works....

I'm making slow progress on putting the table for the table router back together, but I've gotten mildly distracted by cleaning up the workshop.

The need to put a dust case around the table router has stirred up areas of the workbench that haven't been touched in months. So now I'm moving the PC under the bench, re-running the ethernet and power cables, tidying up and putting away, and generally making ~ 2 meters of bench space useable again. The long slow cycle continues!

Sunday, January 11, 2009

Tedious machining

Sorry, more machining. I'm still on my quest to rebuild/improve the mini table router.

The previous table supports were hacked together from a bunch of aluminium box, drilled and bolted at one end. It wasn't fastened at the other end, and the structs were overlength (I had never cut them to the right size). The ho

Today I drilled and tapped holes into both end brackets for the table support structs to bolt onto. This was drilling 14 holes, each 5 mm diameter, 35 mm deep, and then tapping said holes. Suprisingly, the bulk of the time went into drilling the holes. I suspect all my 5mm drill bits are getting blunt (I use 6mm bolts almost everywhere) so it may be time to invest in a drill sharpening tool. It took almost half an hour to drill the 14 holes. Part of the time was fiddly adjustment (release table clamps, wind table to x+70mm, fiddle back and forth until it was exact on the DRO, clamp table) but it just wasn't cutting very fast either. I get bored and wound up using the quill auto-feed and auto-stop to do the bulk of them.

The tapping by comparison went very fast. I love the VFD I fitted to the mill. It's just so nice to dial up 40 rpm, and let the tap just thread straight in. I press reverse when it's in far enough, and the VFS nicely slows the mill to a stop, and then winds it up into reverse. Makes tapping (at least in Al) very quick.

I followed this lot of tediousness by milling slots into the ends of all the table structs too. 28 slots (12mm slots on top, 6mm slots on bottom). Man, I'm glad I don't do this for a living.

Saturday, January 10, 2009


I had noticed earlier that there was a little too much slop in the mini table router. The Y-axis was rotating, being insufficiently restrained by the Z-axis carriage.

So this afternoon I got around to doing something about it (or maybe it was just an excuse for some boring action.. :)

I decided to add another pair of linear bearings to the top of the Z carriage so that a moment about the Y-axis would be carried by the bearings on the same rail instead of working to seperate the rails. This should (with a little pre-load) be much stiffer.

And while I had the boring set out, I enlarged the motor mount opening. The top photo is the boring bar in action, on autofeed. I love the finish it leaves! This is using a carbine tipped bar in aluminium which isn't ideal, but it was the bar I had to hand.

Nest was making a bracket for the linear bearings. This is a simple piece with 2 x 22mm holes for the linear bearings, and 2 x 7mm holes for attaching it (and 1 x 6mm holes in the center for the threaded rod to pass through). The digital readout on the mill makes this a piece of cake: Just touch off the piece to find the corner, set it to (0,0) on the DRO, then just drill 6mm pilot holes for the 2 x 22mm, enlarge to 16mm using a roughing mill bit, then use the boring bar to enlarge 1mm at a time to 21.8mm, then enlarge 0.0.05mm at a time to get to 21.99 which leaves the linear bearings a press fit.

Last photo in the new bracket installed. It's the top bracket on the Z carriage (the carriage on the vertical rails). There's a little preload from the Y rails, so it's now nice and stiff. Well, not up to cutting metal stiff, but it should now be adequate for wood and plexiglass. (I'd previously just used it for XPP foam and wax).

Friday, January 9, 2009

Modifying ACME nut on mill.

Taking another step toward converting my mill to CNC control, I decided this to take a closer look at the nut on the X axis with a view to seeing how easy it would be to replace/augment. (The idea being to remove backlash out of the system).

This is a little trickier than it would normally be because my mill has an X-Y digital readout, with the optical encoders bolted to the mill. These needed to be removed as the table was being moved beyond the normal limits to expose the nut.

Being an idiot, I look at the end with the power feed and said "Hmm. Looks complicated, let's leave that alone".

So I started with this end. After about 30 minutes of mucking around, it become abundantly clear that this was the end with the thrust bearings; I.e. the complex end. The end that's relatively high precision. And with the benefit of hindsight, it was obvious that the power feed would be fitted to the end that's easiest to fit to. Doh.

So back to the powerfeed end, it disassembled much more easily. This is after removing the retaining nut, handle, and feed cog. Nice simple mechanism.

The power feed just sits on roller bearing (no thrust bearing required) and so is very easy to remove after clearing the keyway.

And there's the acme nut. Piece of cake. Interestingly, it turns out there's two of them (another on the other side), so removing the backlash looks very easy. Just mill some slots in the nut, and turn it to adjust the degree of slop.

Nut removed.

Preparing to mill the nut. It's just centered and clamped onto a small rotary table. I'm using a 4 flute 6mm bit. The slots will be 7mm wide, but I didn't have a 7mm to hand, and I can just cut one side of the slot at a time.

All done. The slots I left slightly under size to improve the centering. It was the work of moments to reassembled everything and measure the nut backlash. (Well, many, many moments. About an hour actually).