Wednesday, 3 February 2010

Hot Arduino

It was too hot this evening to tinker in the garage, so time for some theory. At Arduino.cc I tried to figure out how suitable an Atmel microcontroller would be to control stepper motors. Arduino has a stepper motor library, but at first glance it looks rather primitive and introductory. For example, it pauses while it takes a step on one stepper, so controlling 3 (or 4) at the same time won't work. Key to this is a nice interrupt-driven routine to manage it all.


Too Hot for me.

Back in the stone age (7 to 10 years ago), I once had a go at driving 3 battery power drills using an old Atmel chip. My welding, ahem, soldering is visible below. I feel too shy to expose the underside, but you get my drift.

Cro-Magnon, or, The Missing Link:
 Atmel AVR, 3 relays, 1 power mosfet, 200g solder.

Evidently, the Arduino would make a nicer board and for under $50 from eBay for the Mega version, I can't compete.

As it seems, the Arduino language is a wrapper around a C++ compiler which allows asm inlines, so I should be safe regardless how close I want to get to the core. Some more reading and pondering required.

Driving the steppers will be a project of its own. CAM applications create G-Code that traditionally seems to be fed into a program, eg, Mach3, on an old PC. It passes signals through an obsolete parallel port to a driver board that connects to the steppers.

Me not like it. I want to use my main PC (Windows 7) or my old laptop, and an Arduino board as the controller. This will require some interesting microcontroller coding and I don't know yet if Mach3 or other software can be customised to go via USB, not a parallel port. Writing the software myself would be fun, though.

2 comments:

Anonymous said...

Have you looked at the RAMPS board for the Arduino Mega? With Teacup or Splinter firmware, will accept G-code over USB. Arduino does timing and step pulses etc

Thomas said...

Hi. Well, I've seen the RAMPS setup before, but ended up with the Gecko drivers. Another alternative I am playing with is an ARM STM32 microcontroller. They're not expensive either, have more processing power, but are harder to program than an Arduino - until you get used to them.