Welcome! Log In Create A New Profile

Advanced

help, scrip to add m03 comand when A axis is mooving, it is possible?

Posted by carlosescuela 
help, scrip to add m03 comand when A axis is mooving, it is possible?
November 04, 2015 04:07PM
Greetings everyone, I'm making a printer without extruder, so I do not need A movements, I will use a solenoid valve activated under M03 command on lines where there is "A", and m05 to turn off the valve on lines where there is no"A"
i am using mach3 and C10 - BI-DIRECTIONAL PARALLEL PORT INTERFACE CARD [cnc4pc.com]
Is there any script or way to modify the post-processor to add M-codes on specific lines?
for example, the code below is a code to print two lines ( mach3/linuxCNC porst processor) i need to add m03, m04 codes where:

G1 Z0.400 F7800.000 m05 (valve is OFF)
G1 X6.250 Y35.000 F7800.000 m05 (valve is OFF)
G1 X6.250 Y15.000 A0.80826 F1800.000 m03 ( valve is ON)
G1 X3.750 Y35.000 F7800.000 m05 (valve is OFF)
G1 X3.750 Y15.000 A1.61653 F1800.000 m03 ( valve is ON)

any suggestions on how to achieve remmplazar Aaxis by m03 and m05 to open and close the valve?
beforehand, I am grateful
Re: help, scrip to add m03 comand when A axis is mooving, it is possible?
November 05, 2015 07:34AM
The extrusion parameter is usually E rather than A. Your modification seems a pretty simple thing to accomplish with a post-processing application. You could write it in any language or script you are familiar with. Open Slic3r file for input, your desired custom file name for output. Read the input file one line at a time, check for E parameter on a G1 command, if it's present strip it and output the m05 "on" command followed by the stripped G1 command, if not present output the m05 "off" command followed by the G1 command.

Dave
Re: help, scrip to add m03 comand when A axis is mooving, it is possible?
November 05, 2015 08:17AM
Dave

ok, i am no familiarized with scripts, can you suggest any post-processing application?
i am using mach3/linuxCNC as G-code flavour
Re: help, scrip to add m03 comand when A axis is mooving, it is possible?
November 06, 2015 06:46AM
Quote
carlosescuela
Dave

ok, i am no familiarized with scripts, can you suggest any post-processing application?
i am using mach3/linuxCNC as G-code flavour

Personally I would not embed the post-processor, but just write a quick command line program in Basic to act on the output file that Slic3r produces and maybe call that from a .cmd batch file so I can drag & drop the file into it easily, - just about any language could be used for such simple ASCII file manipulation. I think the language used by Slic3r for embedded post-processing is Python, but I have no experience of writing embedded stuff for Slic3r. You could probably even do it in a text editor that has the facility to use macros. If you have absolutely no programming skills at all you'll probably need to find someone who can write such an application for you - it shouldn't take more than an hour to write & debug.

Dave
Re: help, scrip to add m03 comand when A axis is mooving, it is possible?
November 06, 2015 07:51AM
Use AWK, every version of UNIX has it!


Bob Morrison
Wörth am Rhein, Germany
"Luke, use the source!"
BLOG - PHOTOS - Thingiverse
Sorry, only registered users may post in this forum.

Click here to login