My Repstrap Build

Tommelise Repstrap to Reprap then fabber or cnc?

This was in response to Zach Hoeken on the RepRap forum.

http://forums.reprap.org/read.php?13,5128

To make the gui in Processing, I used someone elses library (SpringGUI by Philipp Seifried) which then of course I had to learn how he did what. Kind of tedious, after using an ide that did all that for you, but just a lot of cut and paste mostly. In processing (Slice_Dice_xml_reader), the file called Setup has all that in it.

I’m using some code Dr.Higgs wrote in vb that takes an stl file and slices it to make layer paths which are just xyz coordinates stored in an xml file. I have Processing read the file and store all the xyz values in arrays then convert them to steps put them in a string ending in a line feed and shoot it off to the Arduino. CNC uses a 255 char max length packet so I picked that and added a * followed by a kinda sorta crc and end the packet with a linefeed.  I plan to rewrite it all to use it for cnc later.

The timing of the xyz steppers was using millisecond timing but after looking at you code I thought I’d change it to Microseconds which is what I’m working on as we speak.

The code for the Arduino is pretty simple. It continuously listens for serial comms and reads the temp. (when I have an extruder. remmed out now)  The arduino reads chars till it sees the linefeed and then parses the string. It gets xyz steps, extruder on/off, heater on/off pwm%, and feedrate(cnc uses 1 to 22. I can only get to 8 in/min). When it finishes drawing a line it sends an ACK back to Processing for the next line.

I make all three steppers step in different directions at differing speeds by using Breshenham line drawing like they do with plotters. It’s really linear interpolation. In the Arudino code (xyz_gcode_interpreter) look at the linear_interpolation file. If you send step info for all three motors it will choose the largest number of steps to move and calculate how often to move the other two so that they all get finished at the same time. With reprap I send z steps separate from xy since it will only change between layers.

I’ll use a second Arduino, when I need one, but will have the first one be the master and control the second which will control the extruders, heaters, and fans. I’ll use software serial to talk to it on two pins not dedicated to serial (like 0 and 1).