The firmware problem is “almost” solved by the use af an Arduino card.


Controller language – Arduinos language, based on another opensource project Wiring, and is sort of C/C++ like.
Upload to Controller / Bootstrap – Built in
G-Code interpreter – Either I’ll write that my self or borrow from the OpenSource versions
Frontpanel(?) –  The Arduino has easy interface to communicate with the pc, so you can make a virtual frontpanel on the pc.
USB/Flash interface:  Arduino has built in USB.

The “almost” means that all the development enviroment is solved. And quite nicely, too, I must add. I still had to write the G-code reader and interpreter; routines to drive stepper motors or handle feedback counters; routines to work out and implement movement paths; and a few bells and whistles. I can download and adapt an Opensource G-Repper(?), it may need a tweak or two for my machine. I am doing my own, though.

Code Versions

I have two POC (ProofOfConcept) versions, with primary purpose to verify my principal understanding is right. This is combined with a breadboard development of the interface electronics.

The hardware the Arduino controls is (a) a simulted heater (LED) controlled by a lightsensor, (b) a DC motor with a feedback switch (each revolution) (c) the real USB communication with the pc to receive a much simplified command set.  An earlier version just had LEDs simulating the motor H-bridge control.

I then took that experience to write a proper modularized program to drive two motors and a pen control to do a simple XY plotter. The idea being that a 3Dprinter is “just” a XY plotter with a fancy pen and the occasional movement to the Z axis. Well, at least as seen from the firmware point of view.

Carefull loop constructions ensure I can receive and send serial commands (simulated asychronous), whilst keeping an eye on the motor counters. A timing debug command shows I go round the main loop at least every 80 microseconds.

On this page there are links to the actual source, of my own making. (Hmm, need to decide what copyright notice to put on there. Free to use with appropiate recognition to me.)

Code design, Comms

The communication between “my” pc interface program using the COM port (which the drivers map to the USB) going to the controller is challenging. Reading/Writing asynchronously to the Com is not easy, mostly to interface with windows API. My development enviroment is Delphi (v5).

I have found the Synaser library (only need the SynaSer serial library), which although slightly large, solves my problem at the Delphi end. The standard Hyperterminal or PuTTY program gives me the same functionality as the “serial Monitor”, but sends each typed char immediatly, no need to push a SEND button and it can send control chars, like Newline. Perfect for debugging.

I have now a simple “frontpanel” on the pc that can send a file or a screen full of commands, and receive answers from the Arduino. It is not quite asychronous or event driven, but various polling timers make it appear nearly so.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: