Welcome! Log In Create A New Profile

Advanced

Bespoke gcode

Posted by CliveB 
Bespoke gcode
September 28, 2019 05:55AM
I am creating a bespoke printer and need to create a custom gcode routine to create a print pattern, based upon passed parameters.
There are reasons why this cannot be done in the slicer.
I have created a routine gcode_G900() and added it to the despatch table

In this routine, I have a loop which creates other gcodes on the fly and then executes them.
I thought it easier in the short term, although more long winded, to created gcodes and use already tested routines.
I initially thought that I could enqueue them, but have failed there, so I stepped down into the code .
Although an experienced Arduino coder, I am still learning my way around the Marlin code so would welcome any help/suggestion/criticism of this code snippet.

The routine contains

set_bed_levelling_enabled(FALSE);

while (test condition){

create gode on the fly for the next x,y and z coordinates, creates the E value and insert them into string cmd

printer.parse(cmd);
gcode_get_destination();
prepare_move_to_destination();
idle();
}

Thanks in advance
Clive
Sorry, only registered users may post in this forum.

Click here to login