Math and Variables in gcode
-
im sorry if this has been asked before but I am playing around with the idea of making a printer that has 3 z motors that can automatically mechanically level the bed. This will likely involve probing three locations on the bed and storing the distance traveled at each position in a variable then rotating each motor by a certain value. calculating that value will at least require multiplication and will probably require all three . can this be done with a macro or will it require customizing the firmware or is there some other method like a c++ standalone function that could rewrite the macro since it is just a text file? thanks and sorry again if this has been asked before.
-
What you're talking about already exists as automatic bed leveling with independent lead screw motors using the G32 bed probing command.
https://duet3d.dozuki.com/Wiki/Setting_up_automatic_probing_of_the_print_bed
-
Here is the doc how to configure indepent Z motors:
https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_ -
For the life of me I couldn't find it.
https://duet3d.dozuki.com/Wiki/Bed_levelling_using_multiple_independent_Z_motors
-
oh awesome. Thank you very much!
I guess the main and more general question is still unanswered but I assume you cannot store variables and do math within a macro?
-
Not currently.