Wednesday, 29 June 2011

In motion

After trying cables, first building it like a draftsmans drawing board (the criss-cross at the back design), and then more linearly with two loops, first with kevlar thread, then with cotton, I tried tracks (which you can see pictured). Two more failed attempts later, I finally gave up trying to get rid of the backlash in the Lego machine.
It's never going to be a full scale machining CNC made out of the parts I have, but, I can make one that has limited backlash by using the linear actuators that came with my digger (set 8294).

Now, with these actuators, I can't move the table as far, but it does have very limited backlash.

Also, now I have done this, why didn't I know about THESE!?

Anyway, here is a video of it in motion. About time I hear you say. Well, the next step is no longer Lego. I've got annoyed with the limitations and I went and ordered some bits. Next update will reveal more, but just one clue...

Thursday, 23 June 2011

Software updates

No pictures in this one as my only real changes have been software ones.

I started by adding more and more functions to the python file I'm using to command the CNC pen machine, but after a while I realised that the control software I'd written was really bad, and the backlash was really really bad. I hunted for an algorithm to control the motors better than they had been, and after many dead ends, found a video referencing PID control which then lead me straight to the wikipedia article...

So, I planned to implement this algorithm in my arduino, only to find someone had already done it... so, I dropped it in, and after only about an hour of tinkering, managed to get it to control all three axes with much greater accuracy and speed than I had managed with my home grown pile of ifs. Excellent, now I had a machine that was quicker and more accurate at it's own motor control.

Backlash is still a major issue, and because of the speed of the new system (the new code makes it quicker) the bendyness is more of an issue too. I set to figuring out a final solution to this problem last night, looking over my collection of lego and trying to find something that looked like it might keep backlash at a minimum, but even though I prototyped a few designs, they all had problems. Some were just clumsy, some where not large enough to provide enough motion, some where just as sloppy as the gears I'm currently using, and one turned out to be impossible.

However, there is still one technique that I haven't tried that might solve it, and that is using cables. I haven't got any real cables, but lego beams with cotton thread as my pulley and belt system might turn out to be good enough. I'll see how it goes, and use the left over pieces to reinforce the Z-axis (which has been the source of the problem with respect to bendyness)

Monday, 13 June 2011

Python Powered

The H-Bridges arrived and I almost missed my dinner due to trying to wire them up with my solderless prototyping board. After the initial frenzy I realised that to do anything real with this stuff I'm going to have to make it work without sticking wires into arduinos and actuall make a half shield for it....

That done (and that was a lot of work as I have virtually no experience in doing that amount of soldering on a small board) I took out the drill style head and replaced it with a pen grip. Thought that it might be better to start with. Anyway, after some initial playing around (and realising that when you code a controller to take int based positions and ignore any decimal
points it thinks that your small numbers are really really large) I got it to draw a circle, and a square from python (via the serial library that comes with python), and even hand-held it through drawing an 'F'.
The tolerances for lego are terrible due to the flexibility of the plastic, but it does perform the same operation over and over with little reproduction error. The square was run three times in total and doesn't look like it's been "widened" by going over a number of times.
The F shows why it's not great though, the top bar is almost diagonal, even though the motors were told to go straight, that's all due to the bendyness of the structure holding the Z axis.

Sunday, 5 June 2011

More power

I managed to get some time to work on the machine. After a little trouble trying to get all the NXT servo motors built into the frame without interfering with each other it now has powered axes.

It took a while figuring out how to get the encoder working reliably on the arduino, and because of the amount of encoder signal lines (6 in all), I had to switch over to using the arduino mega. Even that is at it's limit for hardware interrupts. After making that work, writing the code was quite simple.

It kinda works. I've tested it on the logic voltages to see if I can get it to work at all, and even though the low voltage means very little force in the motors, it was enough to prove it moved about and always came back to it's zero point. Now I've got to wait until my motor driver ICs arrive (going with L293D as it has some existing tutorials for usage) before starting to write more utility style functions for it including things like "find home" and making it keep the motors synchronised when they're travelling.

Thursday, 2 June 2011

All moved in. So, of course it's building time.

We settled in quickly and now we all live together in London. It's been hard up until now and nothing shows that I'm happy more than being productive.

Other than lots of coding bringing up my old engine inside Ubuntu, I've also started work on a Lego CNC. Initial pics show slow daily progress, but I hope to have something that can cut cheese or toast by the time the weekend is over. I hope so anyway.