I follow a number of FB groups and forums about 3D printing in general and the Folger 2020 i3 in particular and questions about auto level keep coming up. The 2020 i3 doesn’t ship with autolevel, but when I ordered mine I thought auto level sounded like something I’d like and Folger sold an inductive sensor for just under $4 so I tossed one in with my order.
Little did I know what I was about to get into. Let’s see if I can make this a little easier for other people than it was for me! After the break I’ll explain what autolevel is and how it works as well as share my experiences setting it up and using it.
What is autolevel?
Ok, so first off what’s commonly called auto level isn’t quite what it sounds like. It doesn’t level the bed for you automatically. Instead what it does is measure how out of level your bed is and then mathematically model it so the printer can compensate by adjusting the z axis while printing so layers stay even even if the bed isn’t 100% level. This means there’s a lot more work going on for your Z axis than normally where it only runs to shift things when you change layers. As a result I decided to upgrade my machine to use lead screws before adding auto level – but lead screws would be another topic for another post! Even with lead screws I still like to manually level my bed pretty close so the auto level only has to make minor corrections. But even with my bed as level as I can get it manually the auto level routine still does an impressive amount of correction.
So to set this up there are two things to address. First the printer needs a way to measure the bed so we’ll have to add some extra hardware. Second the printer needs to be configured to use that hardware and make the necessary calculations – so there’s a software component as well. Neither is particularly simple but there are more options for Hardware so I’ll address it first.
There are a lot of different ways to measure the bed. Despite the differences though they generally all consist of removing your Z endstop and instead creating some kind of Z probe that can take readings from different parts of the bed. One common way of doing this is with a servo and a microswitch. The necessary servos are only a few dollars and the microswitch can usually be harvested from the Z endstop. But I’m not a huge fan of this method because it’s a lot of moving parts that can wear and develop slop – too much mechanics for me. Very similar to a servo method is the bltouch sensor which was an indigogo project and is now available on ebay, it’s basically a microswitch on a solenoid that simplifies the mechanics. A big benefit of either of these two mechanical approaches is that you’re actually measuring the surface of the bed directly so changing bed surfaces won’t have an effect on your readings.
The other methods are touchless there are capacitive sensors which like the mechanical sensors measure the top surface of the print bed which is nice…but I’ve used capacitive sensors in the past and found them fiddly to deal with. Another choice is an infrared sensor such as e3d used on the bigbox, but that won’t work with a reflective print bed. The method I chose to go with is an inductive sensor.
The downside to an inductive sensor is that it’s designed to sense dense ferrous metals like cast iron and steel. It will sense aluminum but not as well or from as far of a distance. The sensor I ordered from Folger (a LJ12A3-4-Z/BX) only has a 4mm sensing distance but comes in a nice compact 12mm x 61mm threaded tube package. I found some designs on thingiverse for mounting it but wasn’t entirely happy with any of them so I combined two of them into my own design that doubled as a layer fan mount. I got this sensor working by putting a sheet of 28ga galvanized sheet metal from the local hardware store under my glass so there was something for the sensor to detect. An idea I learned about from this blog by 3DPrintMi which if I hadn’t stumbled across I probably would have gone with a servo setup instead. But with my glass being 3mm thick and the metal not being substantial enough and me running the sensor off 5v for simplicity I didn’t get the full 4mm sense distance and getting things lined up was very fiddly with no room for error. I wound up with the probe barely higher than the nozzle and if anything shifted at all found myself dragging the nozzle into the bed or printing my first layer in the air. Not optimal.
So I ordered a new sensor with a 8mm sensing range. This came in a larger 19mm package and required me to redesign my mount – the new version is still at the same thingiverse link – and while it worked at 5v it didn’t work reliably. So I had to do a bit more work. The new sensor is a LJ18A3-8-Z/BX which like my original sensor is an NPN sensor. For those of you familiar with transistors that will make sense. For the rest I’ll just say that these sensors are basically electronic switches, much like transistors, and come in both PNP and NPN versions – exactly like transistors. Basically a PNP sensor is designed to direct current to convey it’s signal while an NPN sensor is designed to sink current as it’s signal. Because of this running the NPN sensor at 12v is less risky as you’re not sending 12v to your control board. But there is still a 12v potential between the signal line and ground so for safely I still used a voltage divider made up of two resistors to lower the voltage to the 3-4v range since the arduino I use as my controller is only rated for 5v max on it’s pins.
To get the 12v I had to solder an additional header onto an unpopulated set of holes on my ramps board near the fuses. Before hooking the signal wire up to the z min position I powered things up and tested that the sensor did indeed trigger (the light on top will come on when it does) and played around to see how sensitive it was. The 8mm distance sensor running at 12v was MUCH more sensitive. I was now able to remove the galvanized steel from under my glass (which made heating the glass for ABS much easier) and the sensor would trigger directly from the copper in my heated bed – and did so higher off the glass than my original sensor, win! However I soon found that it wasn’t perfect. In fact the new sensor was so sensitive that if I probed the bed over a spot where there was a screw head under the heated bed it would read higher in that spot. To correct this I gave it something right under the glass to detect – a piece of heavy duty aluminum foil. This worked great. The aluminum foil conforms to the bottom of the glass and gives more accurate readings than my old steel sheet which had curled slightly on one edge when I cut it and caused a very slight error in probes of that side.
So with the mechanics out of the way it’s time to address software. The version of Marlin that Folger provides is horribly out of date. Another Folger owner – therippa – shared a pre-configured version of the latest official Marlin release. One notable thing about his configuration is that it moves the X endstop from the right at x-max to the left at x-min. This is important because autolevel only works reliably when you home to x/y min at the front left of your bed. It just doesn’t know how to deal with any other setup and still do the math for autolevel. I went a step further and applied therippas configuration changes to the latest RC3 pre-release of Marlin. (NOTE: my version is slightly different again in that I had already installed lead screws so my Z steps are set to 400 instead of 4000 as you would want for the 5m threaded rod these machines ship with stock.) If you’re interested in just what has to be changed to setup autolevel I’d direct you to this instructible which goes into more detail.
Alright, so you’ve got a sensor mounted, you’ve got your software updated and you’re ready to autolevel! Well, not quite. You still need to configure the probe offset which tells Marlin where the new Z probe is in relation to your nozzle. Since an inductive sensor sits higher than the nozzle your Z offset is going to be negative. X and Y should be fairly self-explanatory but Z can be pretty confusing so I’ll walk through how I go about setting it up.
First I make sure that the EEPROM and EEPROM chitchat are enabled in the configuration.h file. This makes it possible to tweak things without having to constantly reflash the arduino board.
Then I manually do a G28 command to home printer. You’l want to be ready to hit the emergency stop button or pull the power to your printer when you do this the first time. If your sensor is too high up you could wind up smashing your print head into the print bed. For this reason if no other I’d suggest leaving the manual leveling springs in place for now – with autolevel you can get rid of them for fixed spacers…but having a bed that can give is nice when you screw up.
If things are setup correctly the printer should home like normal…but instead of dropping the Z at the 0,0 point it should move the probe to the center of the bed and do the Z homing there. When it’s done the nozzle will still be some distance off the print bed.
If you think you’ve got your z offset set correctly and are feeling brave (or stupid) you can test it now by doing a ‘G1 Z0’ command which will drop the nozzle to Z0. I wouldn’t though as your offset is almost certainly not correct yet.
Instead I like to do a ‘G92 Z10’ which tells the firmware that it should consider your Z to currently be 10mm above the print bed. It’s not…we’re lying to the printer here to give ourselves room to work – so be careful it will now gladly let you slam the nozzle into the bed on purpose. What you now want to do is put a piece of ordinary printer paper under the nozzle and to slowly — SLOWLY — lower it until the nozzle just drags on the paper. As you do this keep count of how far you have to move the nozzle. You can now use that value to adjust your Z-offset. Since you started at 0 from the G28 command if it took you 2.8mm to touch the paper you’ll want to set your Z-offset to -2.8 If you have the EEPROM enabled you can do this with a ‘M851 Z-2.8’ command which I usually follow up with a ‘M500’ to save current settings to EEPROM and ‘M501’ to read them back – the last line returned will be your M851 value which should match what you entered.
Now you should be able to do another G28 and when it’s done a ‘G1 Z0’ should drop your nozzle right to where it just touches the paper. If not…issue a new M851 to set the offset slightly higher or lower and try again. Lather, rise, repeat until you’re happy with your Z0 position.
With that good you can then raise the Z a few mm so you don’t scrape anything and issue a G29 which will probe the bed and tell the firmware how out out level you are. If that works you can then add a G29 command to your starting gcode so it runs right after the G28 home command and each print will measure the bed before it starts!
There’s a lot more to it than that…but this could easily be 4 or 5 posts if I went into all the details. Instead of rehashing it all I’d direct you to the instructibe I linked earlier, this excellent video by Thomas Sanladerer, this blog by 3DPrintMI which was where I got the idea to try putting thin steel under the glass, and this blog series by ZennMaster – those were the resources that helped me the most when I was setting up my autolevel.