Simple removable bracket (now with two different versions: V1 & V2) for attaching a microswitch to the effector plate on a Kossel printer (Anycubic Linear) for bed levelling. This is designed to fit a 7mm thick effector plate. The slot in the bracket is 7.5mm, and it can be clamped in place by fitting an M3x8 screw and M3 nut in the bracket. The bracket needs to be removed manually after levelling is completed.
It's designed to suit a 20mm wide microswitch (20mm x 10mm x 7mm / 0.78" x 0.4" x 0.3") with 2.5mm diameter mounting holes.
Here's are some videos of the V2 probe in action with two different versions of Marlin:
https://youtu.be/_jQKfFPhQAI (Marlin 1.1.5)
https://youtu.be/4mFnbtlPe-g (older version: Marlin 1.1.0-RC8)
Additional parts required:
- 1x 20mm microswitch
- 1x M3x8 screw (socket headed cap screw ideally, for use with an Allen key)
- 1x M3 nut
- 2x M2.5x15 screws
- 2x M2.5 nuts
There are two different versions: V1 and V2. The smaller V1 positions the switch near the blower fan. The larger V2 puts the switch directly beneath the nozzle. I would recommend using V2.
When V1 is mounted on the side of the effector nearest the blower fan, the offsets between the switch and hot end on the Anycubic Kossel Linear are approximately (X=-9, Y=29, Z=-2.7).
In contrast, the much larger V2 is mounted in the same position as V1 above, but has an offset of approximately (X=0, Y=0, Z=-24.1) The advantage of V2 is that it allows a much larger area of the bed to be probed within the limited printing radius available.
I wired the microswitch as NO, and connected to the Z_MIN endstop input. To make it easy to connect/disconnect, I used some 0.1" pin header and heat shrink to make a small 2-pin connector.
To get auto level probing to work in Marlin, I had to set X,Y & Z_MIN_ENDSTOP_INVERTING all true. I also had to reduce the DELTA_PROBEABLE_RADIUS to 60mm inside the DELTA_PRINTABLE_RADIUS. The X,Y & Z_PROBE_OFFSET_FROM_EXTRUDER were also set up to suit the probe position.
The original Anycubic firmware was based on Marlin 1.0.0, and at first I modified that to save/restore the nonlinear bed levelling matrix from EEPROM and to survive through G28. This makes it possible to use G29 to probe the bed, then M500 to save the matrix to EEPROM, and it gets restored on startup. Default settings can be restored with M502 then M500. Initially I created two GCode files on the SD card to run the auto-level and store to the EEPROM, so it can be done by "printing" those files from SD. However, in the more recent Marlin version linked below, there's a "Level Bed" menu option and another in option in Control Menu called "Store Memory" stores the settings to EEPROM.
It's also possible to introduce a small Z offset during G29. For example, for an additional 0.2mm clearance you can use G29 Z0.2 which adjusts the offset between the probe and the nozzle. Alternatively, in the Marlin menu you can adjust the Z probe offset slightly.
To adjust the Z offset, at one time I was using M206 (which has to be done before G28) in the Cura start G-code. For example: M206 Z-0.1 will lift the nozzle 0.1mm above the bed.
To make it use the auto-level data, add M420 S1 to the start G-code, after G28. On the latest firmware, I either use the Marlin menu, or use M851 to adjust the Z offset.
The modified Marlin firmware is here, in case it helps anyone. The individual changes to the original source code are visible in the commit log. The first link is to a fork of Marlin 1.1.0-RC8 which I've modified to suit the Anycubic Kossel Linear with a heated bed, and with modifications to store/restore the bilinear bed levelling matrix in EEPROM. I used that version successfully for many months, but I'm now using a more recent version (keep reading..)
My old tested and working 1.1.0-RC8 firmware is here:
However, I would now recommend using the newer version 1.1.5 linked further down this article.
Please bear in mind you will have to make a few changes to the configuration to suit your printer. The best way is to compare the configuration of this version against your old firmware source code (using a "diff" tool).
I've added a printer log file with an example of the bed calibration matrix for my own printer.
In general, auto-levelling is not well documented or easy to set up - make sure to read through the comments section - it has some useful clues which may help you!
I noticed a couple of issues with Marlin 1.1.0-RC8 on this printer. These are minor annoyances, and not show-stopping:
- Selecting "Stop Print" during printing may crash the head. Because I no longer trust it, my workaround is to select "Pause Print" instead, then "Auto Home" then "Stop Print". That works fine.
- For the first print after powering on, after issuing M420 S1 the print head moves really slowly towards the bed (as if calling M420 S1 causes it to ignore the feed rate setting). It resumes normal speed once it starts printing. If you print the same file again, the head moves towards the bed at full speed, so this only seems to happen on the first print.
New developments on a branch from 1.1.5:
Having frozen the 1.1.0-RC8 version above, I've created a new branch for development based on 1.1.5 here:
The new 1.1.5 branch has some major advantages:
- Support for the new Unified Bed Leveling (UBL)
- Support for G33 Delta Auto Calibration
If you upload the 1.1.5 firmware, make sure you use M502 then M500 to reset EEPROM to defaults.
After fitting the probe, you can check it is working as follows:
M119 ; this should show "z_min: open" when the probe is open
; push the switch with your finger...
M119 ; this should now show "z_min: TRIGGERED" when the probe is pushed
To configure Unified Bed Levelling you can do the following:
G28 ; home
G29 P1 ; automatically probe the bed
G29 T ; view the results
G29 S1 ; save the UBL auto level data to EEPROM
G29 F 10.0 ; set fade height for correction at 10mm
G29 A ; activate UBL auto level system
M500 ; save current setup to EEPROM
There's more information on UBL here: http://marlinfw.org/docs/features/unified_bed_leveling.html
There are LCD menu commands for UBL also (which I haven't tried yet).
Here's an example of how to use the new Delta Auto Calibration in 1.1.5. Make sure you have fitted and tested the probe first:
G33 ; perform delta auto calibration
; check the displayed results and, if they look sensible...
M500 ; save them to EEPROM
More information on Delta Auto Calibration here:
To adjust the Z offset, either use the Marlin menu option, or use M851. In my case, the probe Z offset set in firmware is normally -24.1 and, immediately before printing, I manually adjust this to something like -23.9 or -23.8 to give a bit of clearance. This has the effect of lifting the nozzle above the print surface by 0.2 or 0.3mm before printing.
I've encountered one issue with Marlin on larger prints: if you try and print outside the UBL mesh, it raises the effector on Z until it hits the end stops and has to be powered off. This seems to exist on later versions of Marlin, see the following issues:
https://github.com/MarlinFirmware/Marlin/issues/9147 https://github.com/MarlinFirmware/Marlin/issues/8723 https://github.com/MarlinFirmware/Marlin/issues/9344
Some of the later bug-fix releases may fix this, but I haven't tried them yet.