Welcome! Log In Create A New Profile


Z-offset: M206 and G10 don't seem to work

Posted by ashleywebster 
Z-offset: M206 and G10 don't seem to work
September 16, 2014 03:00AM
I have been looking for a better way to tweak the z offset. I use different build plates for different materials or bottom surface finishes, sometimes glass with blue tape, sometimes plain glass, sometimes garolite, and each has a different thickness which means a different z0 position. So far I have been setting z offset in the slicer. This works most of the time but falls short in two regards. 1) The slicer only applies the offset to the tool path it creates but not to the start up code. For the glass plates this is not a problem since they are all very close in thickness but when using garolite, the nozzle would hit the plate during the unattended warm up routine. 2) The gcode files are less reusable since each one it tied to a particular z-offset.

Ideally, I would like the ability to set the offset at run time: choose a plate, load the gcode file, punch in the current offset, and go. M206 and/or G10 look like they should do this but neither seem to work. I have tried M206 Z150, M206 Z-150, and the same for G10, expecting that one of these, followed by G1 Z0 would park the tool head a short distance down from the end stop but it always goes to the usual spot defined in the firmware. Are these codes not implemented in Nophead's version of Marlin or am I misunderstanding how they work?

Another alternative is to use G92. I could calibrate the position that the tool head should be in at z0 for each build plate, send it there during the start up routine (e.g. G1 z0.5), and then issue G92 to set that as the new 0 point. But that procedure would need to be placed in the start up code and I haven't really achieved the goal of making the gcode more reusable.

Any help or other ideas would be much appreciated.

Re: Z-offset: M206 and G10 don't seem to work
September 16, 2014 05:18AM
G10 is not implemented but M206 is. It offsets the homing position if you set it before homing, but for some reason only when the value passed to G28 is non zero.

So on my machine G28 Z0 homes to 202.61. So does G28 Z202.61 but if I set M206 Z-1 then G28 Z202.61 sets home as 201.61. That means it will be 1mm too high at Z=0.

It doesn't seem very useful as you don't want to embed the home position in your G code. I think later versions of Marlin handle it differently so it always offsets the home position irrespective of whether you pass 0 to G28.

All in all I hate messing about with random number G code commands and find it much easier to set these things in firmware where it is clearly named. So if I change my bed or the filament diameter I reload the firmware.

Re: Z-offset: M206 and G10 don't seem to work
September 16, 2014 01:30PM
Kudos for figuring that little quirk out. I might never have thought to try entering a non zero value when homing. And although it's a tad awkward, it is helpful since it gives me a command that I can manually input at the start of each print job. I just have to update my start code from G28 to G28 Z. Then before I hit print, I send M206 Z and it should be ready to go. The values won't be random, I will calibrate the correct offset for each build plate and have that printed on a reference sheet on the work bench. I may end up coming around to your way of doing it but I'll give this a try for a few weeks.

Many thanks,
Re: Z-offset: M206 and G10 don't seem to work
September 18, 2014 06:59AM
The inability to adjust the distance between bed and homing position without reuploading the firmware annoyed me too. I now have the M206 setting Z offsets nicely, as an additive offset to what has been configured in the firmware as the total Z length. I haven't noticed the G28 problem that nophead mentions (my start gcode just uses G28 without any args).

E.g. M206 Z-0.2 reduces the apparent length of the Z axis by 0.2mm. The M206 offsets can be saved to EEPROM too, so you only need to change them if there is some change in your printer hardware.

However, in the version of marlin I use, I had to patch it so that the M206 command behaved the way we want with software endstops and Z homing to MAX. See this commit:

Essentially the normal behaviour of M206 is to shift both the min and max positions (rather than changing the length of the axis), which is fine if you're homing to MIN, but if you're homing to MAX like we do on the Mendel90, you actually want the offset to adjust the length of the axis.

(If you are interested, my Mendel90 branch is here, although the configuration is set up for my machine running a RUMBA with a couple of adjustments for blown pins, last synced with the main Marlin about a month ago)

Edited 1 time(s). Last edit at 09/18/2014 06:59AM by Lenbok.
Sorry, only registered users may post in this forum.

Click here to login