Welcome! Log In Create A New Profile


EMC based reprap working and printing but I need programming help!

Posted by andy hall 
EMC based reprap working and printing but I need programming help!
November 30, 2008 12:52PM

I have spent a while now setting up an EMC based repstrap and have now got it working and it is now producing reasonable quality prints.
See attached photograph of Nopheads heart shaped box printed in HDPE with no rework just as it came from the machine.

I cannot programme the M1XX codes in EMC so I have to take the skeinforge g code output and then edit and replace swapping M101 for M8, m103 for M9 and deleting all M105 m104 lines (I could not make EMC recognise spindle start and stop for some reason so I use the coolant flood)). This is all a bit of a pain but is doable.

If someone could do the programming or explain how in simple non geek language I would be very grateful.Perhaps as an incentive I could make some parts for you on my lathe -heater barrels, extruder screws or perhaps in a few weeks time when I have fine tuned it some more print out some parts!

While I was waiting for the prints today I set up a blog to record what I have done at emcreprap.blogspot.com/


Re: EMC based reprap working and printing but I need programming help!
December 05, 2008 08:09AM
You don't say what platform you are using, but I'm going to guess some flavour of Linux for EMC.

The following command will do what you are after, (fileIn and fileOut will need replacing with real file names)
sed -e 's/^[mM]101/M8/' -e 's/^[mM]103/M9/' -e 's/^[mM]104.*$//' -e 's/^[mM]105.*$//' -e '/^$/ d' fileIn > fileOut
If you need to convert other commands just add an extra, (XXX is the command to replace, MYYY is the replacement command):
-e '/^[mM]XXX/MYYY/'
or to remove a type of command add, (XXX is the number of the command to remove):
-e '/^[mM]XXX.$//'
The final -e block removes blank lines created where m104 and m105 commands were.

Rather than having to copy and paste it repeatedly, the code below when pasted into a shell window, running bash, will create a program called convert.sh

As a final note you will have to type /path/convert.sh, being in the same directory as the program doesn't remove this criteria but you can use the shortened path ./convert.sh

cat < convert.sh
if [ \$# -ne 2 ]; then
	echo 1>&2 Usage: \$0 \ \ \$
	exit 127
/bin/sed -e 's/^[mM]101/M8/' -e 's/^[mM]103/M9/' -e 's/^[mM]104.*$//' -e 's/^[mM]105.*$//' -e '/^$/ d' \$1 > \$2
chmod a+x convert.sh

Sorry, only registered users may post in this forum.

Click here to login