Thing-O-Matic: Uncommanded Z Motion After Homing

After printing the Barbie Pistol, I discovered that moving the Z stage to anything less than the absolute maximum was a Bad Idea, so I changed end.gcode to simply home the Z axis to the top. That worked fine in RepG 24, but after printing a few things with RepG 25, I discovered that the Z axis now has uncommanded motion after that homing step: a G0 F4000 X0 causes the Z stage to drop by anywhere from a few millimeters to half the total travel.

Of course, the uncommanded Z motion depends on something imponderable, but it’s consistent for any given setup. This chunk of G-Code causes about 10 mm of downward Z motion:

G21        (set units to mm)
G90        (set positioning to absolute)
(- coarse home axes -)
G162 Z F1000    (home Z to get nozzle out of danger zone)
G161 Y F4000    (retract Y to get X out of front opening)
G161 X F4000    (now safe to home X)
M132 X Y Z A B    (fetch home offsets from EEPROM)
G0 F4000 X0 Y0 Z30        (pause at center to build confidence)
(- draw square)
G0 F4000 X-45 Y-45 Z10    (to front left corner)
G1 Y45 F4000
G1 X45
G1 Y-45
G1 X-45                    (return to front left)
(- move to eject position)
G162 Z F1500    (home Z to get nozzle away from object)
(G0 F4000 Z113) (this would work fine)
G0 F4000 X0        (center X axis)
G0 F4000 Y40    (move Y stage forward)

There’s a RepG ticket for that.

As nearly as I can tell, homing an axis trashes its coordinate value, so the only thing you can do next is set the axis coordinate value with G92 or M132. Given that those values are now stored in EEPROM, maybe it’s be a good idea to simply use them, without requiring another command after each homing command?

You’d want home offset values for both the maximum and minimum limits, to accommodate printers with limits on both ends of the axis, rather than the single offset now stored. The two homing commands (G161 and G162) could pick the appropriate offset, if a valid one was stored, and leave the coordinate unchanged (but not trashed!) otherwise.

There’s a RepG ticket for that.

One thought on “Thing-O-Matic: Uncommanded Z Motion After Homing

Comments are closed.