Problems with auto bed leveling on Wanhao i3

Okay, so for months now I've been using Marlin firmware with my i3, upgraded to the Ramps 1.4 board, and auto bed leveling works okay, but at times will fail with the correction matrix and will print high on one side and too low on the other.  Several posts I have read had said that the Repetier firmware had a much better correction matrix for auto bed leveling, so I decided to give it a try.  I've spent the last 7 hours in frustration.

First of all, when I perform a G28 Z0 command to zero my Z, it comes down on my Z probe (it is an endstop switch mounted to a removable magnetic mount, I put it on the front of the print head, then after the auto bed process is completed, I remove it), so anyway it comes down the first time on the switch, bounces up, then comes down for it's second hit on the switch, but doesn't stop, just keeps jamming down into the print bed and I have to do an emergency stop.  Yes, it is raising high enough between bounces for the switch to release, then reswitch coming down, it just won't stop.  So I ended up disabling G28 in my script.

My bigger issue is this.  When I perform the G29 command for the bed level process, it goes through with no problems, measures all three points of the bed, and displays the correction matrix.  However, after it's 3rd measurement and it raises up, the Z never comes back down.  It just hangs at like 65mm from the print bed and starts printing in mid-air.  I've tried adjusting the Z probe height and the z probe bed distance (I've spent HOURS making adjustments to them) but nothing changes, the Z just stays there and tries printing in mid-air.

Any suggestions or help would be GREATLY appreciated!!!




  • If you have disabled G28, how are you setting Z home to 0 ?

    Repetier uses G32 S2 for auto bed levelling G29 is for measuring Z height.

  • @MartinH

    Ahhhhh...... maybe that is part of my problem.  Yet, when I run G29, it goes and tests 3 points on the print bed, just like it would in auto leveling????  I'm really confused.

    Yeah, I know I have to have G28, but until I figure out why G28 Z0 keeps crashing my print head into the print bed, I just have commented out the line in my script so I could test auto level.

    When I do G28 Z0, it will come down on my Z probe, switch will activate, it bounces up to about 5mm (and I do hear the switch unclick), then it comes back down for the 2nd measurement, but then just keeps coming down and down and down until I hit the emergency stop.  Any idea why it would do this and how to correct?

  • The problem with the G28 is strange, it sounds like it is detecting the Z switch ok so it should detect it on the second hit as well.
    What version of repetier are you useing, i recomend useing the dev version as many improvment have been made in the probing section.

  • Hey MartinH,

         I've got another piece of the puzzle for you to consider.  I re-ran the G28 Z0 command, and after it had done it's first contact, then bounced back up, I slid the print bed out of the way, then manually hit the endswitch as it came down for the 2nd time, just so I could see what would happen.  Well, the Z axis came down a bit, then stopped on its own and displayed the following message:

    A fatal error on the printer side stopped the printer until the error is fixed.  Printer message:
    fatal:  Could not activate z-probe offset due to coordinate constraints - result is inprecise! Printer stopped and heaters.

         This seems odd to me because the command I issued was G28 Z0 for it to home Z, nothing to do with the Z probe, so confused as to why it would be looking for that during the Z homing??



  • Hmmm, ok

    Did you set the Z homing X Y coords in the config tool.
    What option are you useing for Z homing, ie Z up then X Y preheat Z

    could you post your config.h pls

  • Sure, give me a few to remote home and grab the file and I'll post.


  • When I paste the contents of config.h here, it won't let me post it.  Says my post is too long.

  • I created a shared folder on my Google-Drive, the config.h file is there.  Here is the link

  • Hi.
    2 things i would suggest trying.
    In config tool under mechanics/endstops, try using homing order X Y preheat then Z, this will open up some more options to set, mainly the X Y coords where Z homing will go to, set it to X100 Y100.

    Also under features/z probing, enable probe pullup resistor as you are using a NO switch as a probe.

  • Okay, tried that.  Still no joy.  So you would have a better idea as to what is happening, I took a video and have uploaded it to the shared folder.  You should be able to access it from the above link.  Not sure if this will help or not, but I'm running out of ideas and don't know why I can't get this working.  Any help would be greatly appreciated.


  • Right, i see whats happening, and to a certain extent my Z homing with a probe does the same
    It is correctly homing the probe but then it removes probe offsets and tries to move the nozzle to the probing coords and then move nozzle to Z0, here is where the problem occurs because you still have the probe-switch located below the nozzle.

    This is exactly how mine works but my probe is retracted before the nozzle is moved to Z0.

    For your setup to work, i think it may require a re write of the G28 code, not sure.

    The other option is to mount the switch onto a servo arm so it can be moved into position when needed.

  • edited March 2017
    Do you know where in the firmware the G28 code is located at so I could take a look at it?

    Not sure I understand the logic in doing Z homing, then trying to move the nozzle to 0 at the probe location??  Is that a native trait of Repetier?

    I'd really like to get this working because I have heard that the correction matrix in Repetier is better than Marlin, but I've spent a lot of time on this already, so if I can't figure it out I might have to just go back to Marlin.  :-(

    Also wondering why no one from Repetier has had anything to comment on this subject.  I see they have commented on other posts.
  • MartinH was giving good answers, so why double do it:-)

    After reading all this and some thinking I think it is clear what your problem is. You must do z max homing with your manual z probe. What is happening is that z homing works perfectly, but since you are homing that is not the end. Next step is disable z probe and go to z = 0. With z probe height 13.9mm this is 13.9mm further down which the z probe prevents as disabling it does not remove it!

    As a intermediate solution you could add a finish z probe script like beep and wait 10 seconds so you can remove it manually.
  • @Repetier

    I could understand this behavior if I was running the G32 to do the Z probe for auto bed leveling, but I haven't even gotten to that step yet.  The only command I am running is G28 Z0.  Shouldn't that just bring the Z axis down till the endswitch is activated and then zero out Z?  It seems like it is adding an extra step in the process.  If you could watch the video I uploaded to the link shared above, you will see what it is doing.


  • No, z homing is homing to z min = 0 or z max. The firmware knows it is not at 0 when probe triggers so it goes down. That is required to get to Z=0 but just not possible in your case.

     G32 would not do that and also G29 not, since these commands just measure and are not supposed to go to a z position.
  • Okay, guess that is confusing for me since I'm coming from Marlin and it doesn't do things in that manner.

    In Marlin I had entered my X-Y-Z offset from where the probe activates to where my print head actually is.  When zeroing out everything before starting the auto level process, it would 0 X, then 0 Y, then would come down and "0" Z, then would perform the bed level process, then raises Z, I would remove my probe, and then it would lower Z and begin the print.

    So what can I do to make this work on my printer?  Or is this not possible with Repetier and I would just have to go back to Marlin?  I would REALLY like to try Repetier to see if the correction matrix works better than what I've been getting.

    What are my options?

  • Calibration is a thing you do only from time to time, so you should have a normal homign procedure. In your case that would be z max homing to be used for G28.

    As replacement for G28 you can use G32 which levels bed and stores new Z position but does not go down afterwards. Problem here is that since you do not home before it (you should have no z endstop at all then) you have no valid start height makign things difficult.

    Last solution is beep and pause in deselect z probe so you can remove the magnet. Still awkward as you always need to watch and react in time.

    So I'd invest a few miniuts in adding z max probe making it all easier in the long run.
  • Gotcha.  So back to Marlin it is then.

    Guess I don't understand why this process can't be adjusted.

    If you know the offset from your probe (endswitch in my case) is say 13.9 below the nozzle, not sure why that can't be added into the calculations.  So you take 4 Zprobe measurements, the first one 0's the Z, then the other 3 are used to calculate the correction matrix, but before anything is applied, the offset is adjusted into the calculations, and this creates your new correction matrix.

    I've always ran the auto bed level before every print, I've just got it as part of my starting gcode in Cura.  It only takes a couple of minutes to do, and never knowing when something has potentially moved, its just as easy for me to do an auto bed level each time.  I always watch the first layer of print anyways to make sure I'm getting good adhesion.

Sign In or Register to comment.