Welcome! Log In Create A New Profile

Advanced

G90 tramples M83 - firmware bug?

Posted by KP 
KP
G90 tramples M83 - firmware bug?
March 10, 2014 03:37PM
I was attempting to implement Z lift in a Cura plugin by doing a relative G1 Zxx then returning to absolute coords. It transpires that an M83 is required post G90. Is this correct behaviour?

I contend not, G90/G91 is abs/rel coords. I do not consider extrusion distance to be a coordinate.


KeV.
Re: G90 tramples M83 - firmware bug?
March 10, 2014 05:43PM
Hi KeV,

Looking at the wiki page on gcodes, G90 and G91 unfortunately don't specify parameters, [reprap.org] , and just say Example: G90

"All coordinates from now on are absolute relative to the origin of the machine. (This is the RepRap default.) "
[edit : if they DID then you'd be able to say something like G91 Z;G1 Z0.2;...;G1 Z-0.2;G90 Z /edit]

It's a semantic problem (and I don't mean to trivialise it by saying "semantic", I mean that the meaning isn't well defined) - I agree partly with what you say, and I'd view the use of "coordinate" in this context to mean a co-ordinate in cartesian space, however, extrusion does have a distance and direction too (though not orthogonal with cartesian axes) and could qualify still as a coordinate. Since they also include M82/M83 specifically for the extruder, you could validly take the stance that extrusion movement shouldn't be covered by G90/G91 - as an aside M82/M83 don't have parameters on the wiki page, so presumably all extruders should behave in the same way (which is reasonable). One thing that would suggest it's OK is that in the generality of CNC, it seems that G90 and G91 cover all axes (including rotary axes), and perhaps that's why the (reprap-specific) M82/M83 were introduced to specifically alter the extruder - it's not explicit on the wiki, but it could be that M82/M83 were intended to be used the way you've ended up using them...

In the firmware, RRP clearly differentiate between "drives" which include all extruder motors, and "axes" which include only the axis motors, however, they lump the responses of both types of motor together for the response to G90 and G91:


    case 90: // Absolute coordinates
      drivesRelative = false;
      axesRelative = false;
      break;
      
    case 91: // Relative coordinates
      drivesRelative = true; // Non-axis movements (i.e. extruders)
      axesRelative = true;   // Axis movements (i.e. X, Y and Z)
      break;


and of course only pass on the M82/M83 to "drives":
 case 82:
    	for(int8_t extruder = AXES; extruder < DRIVES; extruder++)
    		lastPos[extruder - AXES] = 0.0;
    	drivesRelative = false;
    	break;

    case 83:
    	for(int8_t extruder = AXES; extruder < DRIVES; extruder++)
    		lastPos[extruder - AXES] = 0.0;
    	drivesRelative = true;

    	break;

So I'd say it isn't a bug, just a case of trying to cover all bases - the workaround you hit should be fine, but it might be worth petitioning for clearer definition of G91/G91 too (though how you do that I don't know - is there a central committee for these things anyone?)

Ray

Edited 1 time(s). Last edit at 03/10/2014 06:15PM by rayhicks.
Sorry, only registered users may post in this forum.

Click here to login