Friday 6 April 2007

Bundle of nerves

The wiring is fairly straightforward. The power rails are 24/0.2 and the sensors are connected with multi-core 7/0.1 screened cable salvaged from a mouse's tail. The rest of the connections are 7/0.2. The manual for the MDM7 stepper motor controllers recommends using screened cable for the motor connections because they are switching at hundreds of kHz. I couldn't find any that would handle the current so I used twisted pairs which are the next best thing. I made these by twisting two pieces of 7/0.2 write with a drill and then put them inside plastic tubing to protect them.

I recycled a mains inlet and switch from a broken PC power supply.



I also got a 0.2 inch 2 pin connector from it for the 24V feed to my I/O board. The rest of the I/O connections are 0.1 inch headers.

Again, I had all these parts lying about for years so my wife is pleased that I am starting to use up some of the "junk". The only things I have had to buy so far are the axes, wood and three 9 way D type connectors.

Thursday 5 April 2007

Brain Box

The RepRap machine uses a network of Microchip PICs plus a comms board to control the axes and the extruder(s). The controller boards are multi-purpose so this gives a flexible scheme for experimenting and extending the machine. This topology does not make so much sense for HydraRaptor because I have invested in a set of professional quality axes which I hope to be using in a stable configuration for a long time. Using three controller boards plus a comms board to drive these is a bit over the top.

Instead I have chosen to use a demo board that I had lying around to control all three axes. This is a DEMO9S12NE64 from Freescale Semiconductor. It has an on-chip Ethernet controller and a good array of analog and digital I/O ports plus serial ports, timers, etc. It comes with a free TCP/IP stack and a CodeWarrior IDE, C compiler and debugger.



I bought this a couple of years ago from Digikey to acquaint myself with Ethernet and TCP/IP but had not really done anything with it. Strangely, although the chip has masses of I/O, only a subset of this is available at the connector and some of these lines are also connected to the on-board switches and LEDs. Annoyingly the C compiler has a 12K code limit but that should not be a problem for this project. The IDE and debugger are not the best I have used and I have seen the compiler produce some terrible code. There is no excuse for this as the instruction set of the 9S12 is fully featured and well suited to C, unlike say the PICs. Sadly most C compilers I see these days produce worse code than one I used 20 years ago.

It comes with a preloaded monitor program which allows code to be loaded into on-chip flash via a serial port and then debugged at the source or register level with breakpoints and single stepping, etc. All in all the dev kit is not too bad, certainly nicer than the Microchip stuff.

I will use Ethernet to link my machine to the PC as that gives me complete freedom where I locate it. There is enough I/O to drive an extruder as well as the axes. I may well do that initially, but eventually I will use one of its serial ports to drive a network of head controllers.

One snag of using the demo board is that it is 3.3V volt logic. My XY table uses 5V logic so I had to do some level translation and that is most of what the veroboard underneath is about. The outgoing signals to the opto inputs of the stepper controllers are driven by a 7407 open collector buffer. The proper way to handle the incoming signals would be to use a level translating buffer chip but I didn't have any to hand and I suspect they are not available in leaded packages as most 3.3V stuff is surface mount. Instead I buffered them with a 74LS244 and then used potential dividers to drop the voltage. If I had not buffered first I would have reduced the noise immunity in the long leads around the machine which would not be good. This way it is only the noise immunity across the board that is slightly compromised.

Other things on the board are the z-axis driver and a 2A switching regulator which steps down the 24V to 5V to drive the level changing logic. This is actually an L5973 evaluation board from ST. Doing this with a linear reg would waste a lot of power and need a big heat sink. The DEMO9S12NE64 comes with its own 6V mains PSU but I found it works fine fed from 5V as well.

I wired the board using the Verowire system, see en.wikipedia.org/wiki/Wiring_pencil.



This is quite a quick way to produce high density prototype boards but it is a bit fiddly and requires a lot of concentration. It is not easy to make changes afterwards either.

In summary I was able to cobble together the control system from bits I already had.

Wednesday 4 April 2007

Back on track

They say you only learn by making mistakes. Well I learned that for a structure to be stiff it has to be braced against twisting as well as bending. Wasting a whole weekend certainly hammers the point home!

My second attempt was smaller, much sturdier and a lot easier to make. I completed it in two evenings as opposed to two days and with no injuries! I made all the pieces out of 18 mm MDF sheet whereas the first attempt was a mixture of 18 mm, 12 mm and 8mm. All the pieces were rectangles so I got them cut at B&Q where I bought the wood. I used two 1200 mm by 600 mm sheets and all the cuts were free. Here is the kit of parts I came home with.



I used 12 mm beading and PVA glue again to make the joints, but this time I used more screws and no nails.



Here is the finished woodwork. No detectable movement no matter how hard I push on it.



And here it is with the axes installed. The x-axis is wired to its controller and a power supply. This is a small 24V 100W switcher made by Sanken Power Systems. I chose this from the random selection of PSUs I have collected because my z-axis stepper is 24V and the XY controller can run from anything between 24 and 60V. I don't know if I will need a 12V rail yet, I am hoping to get away without it.



Wiring and electronics next.