G-code to re-level bed, in between sequential prints.

I’m using  Bed _Leveling_Method 2 at beginning of print run.

No Bed Correction Method is used. 

So the print run starts with a simple three point bed level to set a general level.

The print bed is .25” Alca 5 aluminum plate.

4 different prints are made in a sequential order, at 4 different locations of the print bed. 

Print #1 finishes, drops print head back to bed, does a purge and wipe function and then starts print #2 at a different bed location, and so forth with #3 & #4.

Problem: Temperature changes Bed level over time.

Question: What G-code can I use, to do a single probe, over a new print area, to reset bed level, at new print position?

Naturally, I would insert this G-code, three times, and after the wipe function prior to new print starting.


  • If you have define z home without special position you can run G28 Z0 and it would measure at the place where you currently are. But in general the idea is quite dangerous with a high likelihood to hit one of the printed objects sooner or later. One wrong homing position or following move would suffice.
  • Repetier said:
    If you have define z home without special position you can run G28 Z0 and it would measure at the place where you currently are. But in general the idea is quite dangerous with a high likelihood to hit one of the printed objects sooner or later. One wrong homing position or following move would suffice.

    OK. I understand and have tried G28 Z0.  


    My bed G28 Z0 is taken from the Z-min end-stop and not the Z-probe which is set on Z-max end-stop. Z-probe is ignored during G28 Z0.

    The bed drops 10 mm, then raises to Z-min end-stop.

    I have Z offset to 0 and have tuned the Z-min end-stop and Z-max/probe to within 1mm. of each other. I then use “Bed Coatings- Custom” to set my extruder height.

    Depending on temperature, the custom bed coating number is around .52 when cold and .48 when the temperature rises. (Higher number decreases head height to bed, and Lower number increases head height to bed) it is inverse from the normal logic path.


    G-code at a specific spot, using Z-probe, to reset Z0.


    Initial 3 point bed level at beginning print to set initial print #1.

    Print #1 finishes and moves head to new location to start print #2.

    Bed has heated up during this time so a new Z0 will need to be re-probed at print #2 position, to compensate for aluminum bed expansion.


    Wha G-code can reset Z0 at a specific spot, halfway through a print, using a Z-probe that is set to Z-max?

  • Z probe and z min endstop having different pins makes not much sense. They should be identical to make firmware use z probe for z homing as well. A fixed endstop with rotated bed is a no go. Your bed will stop normally at wrong height with homing. With correct setting you would not have the problem. G28 Z0 would do the trick.
    Also that one point test during homing would compensate z height measured with bed rotation assuming your 3 point probe is G32 and not G29.
  • Clarification:

    This is a commercial grade process that we have developed.

    It is a single carriage, with three print heads, that use “Ditto” printing in Repetier.

    It is our findings through many tests, that any type of active bed traming (rotation?)/bed-leveling G32, will cause one or two print heads to be correct, but the third could very easily be drove into the aluminum bed, or to high to make contact with bed.

    This is the problem with a print surface, of three heads over an expanse of 110mm to ALL be correct. G32 can’t be used.

    We first use G28, which goes to back left corner and homes all axis X,Y and Z. The Z-probe and the heads are off the print bed when this occurs. (This process is backwards from standard cartesian printers) 

    Next, a G29 command is issued for a cantilevered 3 point bed. The bed drops 10mm and probes 3 points. The heads then move to an outside parameter and does a wipe and purge, moves to print position at first layer print height and starts to print three parts in Ditto. When this is finished, print head moves to purge and wipe location, drops print head to first print layer height and moves to new location for the next set of prints. There are no collisions with parts already printed, and programmed not to interfere with those parts. This continues for a full four separate, sequential print set.

    Everything works perfect in all aspects that were described. Heat is causing the bed level to change throughout this process. The surface that makes up the first layer is the outside surface of the part, and must look good, and not missing any lines due to bed adhesion or to close, and jams extruder. 

    This is why we need to re-level before each print.


    We can re-wire Z-probe in series with Z-min endstop, but it’s activation during first layer height could pose a problem. Also, we use optical endstops and have a reducing transistor on the Z-probe that will have to be considered. There may be a signal/voltage issue.

    We are using a Rumba board.

    We are not the habit of entering miscellaneous code into the machine to see what happens. A bed to head crash costs over $200 if it even happens at -.1mm. Our calibrations will all need to be reset and tested. This is the downside of machines for manufacturing. 

  • Yes, that is what I always say. With ditto printing like Stacker does, the bed must be physically levelled.

    If I understand right the z probe is on the extruders and moving them y wise outside bed prevents hitting bed on first regular homing which leaves a gap so you will not hit the bed.

    At least with current 1.0.4dev version there is a solution (maybe also in 1.0.3 not sure when I added it).
    Assuming you make the z probe also z min endstop. You can use
      Raise Z before homing z axis
      0 = no
      1 = if z min is triggered
      2 = always
      This is for printers with z probe used as z min. For homing the probe must be
      at a minimum height for some endstop types, so raising it before will help
      to make sure this is guaranteed.
    #define ZHOME_PRE_RAISE 0
    // Distance in mm to raise if required

    With ZHOME_PRE_RAISE 2 you would then always go up 10mm before doing z probing. You would run
    G28 X0 Y0 Z0
    and you get the right height. Hopefully z probe is over bed at homed xy position or it will not work. pre raise is only when z axis is being homed (in V2 firmware I'm about to change that behaviour).

    Now after 1 row is printed you move to new Y position and run only G28 Z0 and it would adjust z accordingly.

    You would use the zprobe for everything without danger of hitting the bed during xy homing and have no need for it.

    If that is no doable solution you could write an own command that does z homing just with z probe.
Sign In or Register to comment.