Open fake-name opened 2 years ago
The described behaviour only occurs with abs_move()
. If you don't like its behaviour, use move()
instead of abs_move()
. then, mode can be set with absolute()
and relative()
as you mentioned. One could argue that rel_move()
should be implemented for symmetry with abs_move()
.
I like the idea of being able to set the default mode to absolute during instantiation of the G class. If I am not mistaken, that will be added in https://github.com/jminardi/mecode/pull/75
I get that,
The main issue I have here is the ridiculous, continuous
G91 ;relative
G90 ;absolute
output.
I'm using calls to abs_move()
because I'm exclusively doing absolute moves, and having the calls explicitly include abs
makes the intension clearer.
Effectively, G91
should only be emitted before a G0
that uses absolute coordinates where the machine is in relative mode, and G90
should only be emitted if the machine is in absolute mode, and a G0
is emitted that needs to use relative motion. This does mean the G
object needs to track some additional state, unfortunately.
My g-code files are 60% G90/G91 without changes that implement the above.
I'm doing some gcode generation that uses entirely absolute moves.
Every single move winds up surrounded by a G90/G91 pair:
Looking at the code, this seems to be because nothing can ever set the gcode writer to absolute mode other then an explicit call to
absolute()
.It seems to me that if you call an absolute move call, it should set the state to absolute and leave it there, until any call to a relative motion function.