Arduino Project

This was supposed to be my Christmas project, but I got bored, and it turned out to be easier than I expected, so I finished well before Christmas.

It’s my first attempt at doing something with an arduino. It measures the temperature of the fridge and freezer. It uses a two line LCD for display, and two one-wire sensors for the measurements. Both devices have libraries and example code which I filched, which is why the programming was so easy (and is On github if anybody is interested)

I suppose the next job is to make a case for it. I don’t have a 3D printer or any way of working with plastic, so it’s going to have to be wood. Hmmm. I wonder if I could make something steampunk looking from wood and brass….

Crafts

plaques I’ve always felt rather envious of those people who are good at crafts. I can’t draw, I can’t paint, I have no idea how to sew, and I’m not even particularly good at taking photographs.

But over the past few months I have discovered that one thing I am pretty good at is programming a CNC machine, and learning to work with wood in general.

Lines and Arcs

When I started reading up on G-Code I noticed that, as well as straight lines, it could also define arcs and circles. I also noticed that the G-Code produced by Easel only contained short line segment, and no arcs at all.

My assumption was that this was an arbitrary limitation of Easel, and I wondered if there was any way to fix this.

I found a very clever python script called g1tog23.py written by Frank, which takes a G-Code file containing line segments, and where appropriate converts lots of contiguous line segments into an arc or circle. I tried this on a test design of five interlinked circles. It seemed to work, so I then tried sending it to the X-Carve.

The first problem was that the python script had inserted lots of A0.0000 commands. I couldn’t find this command on my g-code cheat sheet, so I have no idea what it’s supposed to do. Neither did the g-code interpreter on the X-Carve, which rejected it as an ‘Unknown Command’. So I simply stripped them out.

The next problem was that instead of drawing arcs, the X-Carve was drawing straight lines from the start and end position of the arcs. This was unhelpful.

Reading up some more on g-code, I learned about G64. This command is used to specify how accuratly arcs should be drawn. Without it, when you ask the interpreter to draw an arc, it draws a straight line and says “that’s close enough”. G64 is used to say “That’s not good enough, I want no more than n units of deviation from the arc”.

The interpreter does not support the G64 command.

But it does support G61! G61 means “No compromises! I want my arcs as accurataly as possible”. So once I manually issued that command before running the g-code, I got beautiful arcs and circles.

I discovered later that it’s actually quite common for G64 not to be supported, especially on single board computers, because the calculations involved are to intensive. It’s more common for the g-code generator itself to do the calculations to convert from arcs to line segments. That is clearly the reason why Easel is producing the g-code that it is.

It was disappointing that the result took just as long as carving without arcs. Disappointing, but obvious in hindsight. The bottleneck isn’t sending commands, or interpreting them, but doing the physical carving.

But using this script does mean that the size of the g-code file is drastically reduced, typically by about half. It could be worth using just for that reason.

And at least I’ve learned a lot more about g-code.

 

Universal G-Code Sender

Easel worked pretty well with our new X-Carve, but it only runs on OS X or Windows, not on Linux. We didn’t want to keep our nice Mac laptop in the workshop, and I don’t have anything running Windows, so I looked around for a Linux solution.

I found the Universal G-Code Sender. This is a simple (ish) Open Source program written in Java that supports, amongst other things, Linux, and will send G-Code commands to the X-Carve.

Easel has the option to export G-Code to a file instead of sending directly to the X-Carve.

So our workflow is now:

  • Design using Easel on the desktop Mac in the office
  • Export G-Code
  • Load G-Code into UGS running on a cheap Linux box in the workshop
  • Use UGS to send the code to the X-Carve.

There were a few minor problems to overcome. The G-Code that Easel generates does not include a “Set Home” command, nor does it start the spindle. It also generates absolute rather than relative paths. These problems were easy to solve by manually sending the relevant G-Code commands with UGS before loading and sending the G-Code file to the X-Carve.

The commands are:

G10 L20 P0 X0 Y0 Z0        to set the home position

M3 S12915                              to start the spindle

 

X-Carve

So, we took delivery of an X-Carve a couple of weeks ago, and since then I’ve been learning all about CNC machines, g-code, CAM/CAD packages, USG and GRBL. It’s been a fairly steep learning curve.

It arrived in kit form while I was away for the weekend, but by the time I got home, Jenny had already put it together and got it working, leaving me to play with software.

The software that comes with it, and is recommended and supported, it Easel. It’s a fairly straightforward browser-based program that is pretty intuitive, and does everything. It lets you do the design (CAD), specify bit size, depth of cut, speed of cutting, and so on (CAM), and then generates g-code and sends it to the X-Carve. It’s not bad, and it works. For fairly simple designs.

It runs on Windows and OS X. Linux is not supported.

IMG_0077The first thing I tried to create, after the demo and test designs, was a big circular sign. In hindsight, this was clearly running before I could walk. Still, it worked pretty well. I used MDF for the first attempt, because that was all I had available. Lessons learnt: don’t try detailed carving with MDF, it doesn’t work. But as a proof of concept it was a success.

I tried the same design on hard plywood, and the results were better with clearer and crisper edges. The design could still do with some tweaking, but Easel and the X-Carve worked well, if slowly. The design covered about 600 x 600 mm and took around 18 hours.

The next problem I hit was file size and Linux compatibility. But that’s for another post….

Bees

 We are on the local beekeeping association list for people to contact if they have a swarm in their garden and want somebody to come and collect it. So far we have collected at least five swarms in the past two months! Yesterday, as well as collecting a swarm from a nearby village, we found this in our own garden.

That’s it. We are now full up. We have no spare hives left to house any more bees.

Hopefully we should have a really good crop of honey this year 🙂

 

First Meeting

I attended my first Parish Council meeting as a councillor last week.

The agenda was, I suspect, pretty standard. We discussed a couple of planning application, some highways matters, and the state of the children’s play area.

Next time could be more interesting. There are consultations on street lighting and possible boundary changes. Both of these things involve a lot of paperwork to read through 🙁

I have managed to upload the minutes to my unofficial Woodditton website, on the extremely remote chance that anybody else is interested in reading them.

 

Elections

Well, that’s over for another five years. I can’t pretend that the results weren’t very disappointing, especially where I live in Woodditton.

In the general election the Liberal Democrat candidate who has lived in the area for decades lost to a Conservative candidate who lives in London and knows nothing about us.

In the local elections I stood for the district council for my area, and lost to a conservative candidate who live about 15 miles away in Soham.

I think that one thing that these results show, as well as the results across the country, is that the vast majority of people don’t vote for candidates who will best represent them, they vote purely along party lines, in most cases not even knowing who they are voting for.

In other news, I did win the parish council elections, and am now a member of Woodditton Parish Council. That’s going to be interesting…

Python

I’ve spent the last ten years writing mostly in Perl, but I’ve just recently started using Python (yes, I’m late, I know)

I like it. So far at least, it seems cleaner and neater than Perl, easier to read, and there seems to be at least as many libraries available as there are for Perl.

Installing WordPress

Well, that was more effort than I expected.

At first, it seemed to go well. The installation went very smoothly and very quickly, and I had a multi site WordPress using subdomains up and running in no time.

Then I tried to use it.

The first problem was when I tried to write a post, and discovered that the text colour was set to white text on a white background. Some googling and some poking around with the Safari debugger showed me how to fix that by hacking the editor.min.css file.

The next problem was trying to change the header image. When I uploaded a file it went to one directory. When I tried to use a file it looked in a different directory. So uploading an image “worked”, but I wasn’t able to use it.

I finally fixed that problem with a lot of experimentation and some clever symbolic links.

It seems to be working now (so far at least). But dammit – I thought WordPress was solid, reliable, tried-and-tested software? Why does it seem so buggy? And how on earth do non-programmer who don’t know how to hack css and create symbolic links manage to use it?