Welcome! Log In Create A New Profile

Advanced

Mendel90 auto level implementation

Posted by svanteg 
Mendel90 auto level implementation
May 04, 2014 11:50AM
Here is my implementation of Marlin auto levelling for the Mendel90. It consists of a new Wades block and an adjusted fan duct plus some minor circuitry for probe and servo. See video here [youtu.be] and here [youtu.be]. See STL:s below.

The probe is interfaced using the same solution as for the endstops. In wiring it I noticed that that standard wiring of the x-endstop and the extruder temp has ground and signal reversed - which is ok when the probe is not used. I routed the probe to A1 and A2 is used as the servo command signal.

Here's my current start_ABS.gcode:
M207 S1.5 F1800 		; Set retract
M208 S0.0 F1800			; Set un-retract
M209 S0 			; Use firmware retract
;M301 P23.92 I2.24 D63.89	; Set extruder PID 230 degrees
;M301 P22.19 I1.98 D62.18	; Set extruder PID 240 degrees
M301 P20.72 I1.78 D60.42	; Set extruder PID 245 degrees
M304 P200.38 I39.20 D256.09	; Set bed PID

M83 		; use relative distances for extrusion

M140 S130	; Start heating bed - no wait
G28		; home axes

G1 X-100 Y-100 Z20 F12000	; Move off of endstops
M401				; Extend probe

M190 S130	; Keep heating bed - wait until temp reached
M104 S245	; Start heating extruder - no wait

G29		; Measure bed
G1 Z5 F750	; Lift slowly to allow probe to retract before next move

G1 X0 Y98 F9000	; go to front of bed
G1 Z0.05	; use the bed to block the nozzle to prevent ooze

M109 S245	; Keep heating extruder - wait until temp reached

G92 E0    	; zero the extruder

G1 X50 E5 F200	; make a thick line to prime extruder
G10		; Retract

G1 Z0.3     	; lift before move to center

Since Marlin assumes you want to do a full reset to defaults after changing the probe Z-offset I instead opted to add a new M-code (M421 Z) to allow tuning it. Newer versions have a similar addition. As Marlin gets confused by the tripped-when-retracted probe it is necessary to start a G29 or G30 with the probe extended (M401).

Marlin_main.cpp:
#if defined(ENABLE_AUTO_BED_LEVELING) && defined(SERVO_ENDSTOPS)
    case 401:
    {
        engage_z_probe();    // Engage Z Servo endstop if available
    }
    break;

    case 402:
    {
        retract_z_probe();    // Retract Z Servo endstop if enabled
    }
    break;
    
    case 421:                 // Set zprobe Z-offset
    {
      float tmp_zoffset = 0.0;
      
      if( code_seen('Z') ) {
        tmp_zoffset = code_value();
        //if(tmp_zoffset > 0.0) tmp_zoffset = 0.0;
      }
      
      zprobe_zoffset = tmp_zoffset;
    }
    break;
#endif

ConfigurationStore.cpp:
#ifdef PIDTEMP
    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("PID settings:");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("   M301 P",Kp); 
    SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki)); 
    SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd));
    SERIAL_ECHOLN(""); 
#endif
#ifdef ENABLE_AUTO_BED_LEVELING
    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Auto level settings:");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("   M421 Z" ,zprobe_zoffset); 
    SERIAL_ECHOLN(""); 
#endif

Edited 6 time(s). Last edit at 05/05/2014 05:42PM by svanteg.
Attachments:
open | download - block.jpg (31.2 KB)
open | download - Extruder1.jpg (318.9 KB)
open | download - Extruder2.jpg (343.3 KB)
open | download - Extruder3.jpg (328.3 KB)
open | download - fan_duct_above.jpg (19.6 KB)
open | download - fan_duct_below.jpg (21.3 KB)
open | download - Wiring.jpg (307.7 KB)
Re: Mendel90 auto level implementation
May 04, 2014 12:51PM
nice work!

Post a video so we can see it in action!!
Re: Mendel90 auto level implementation
May 04, 2014 04:52PM
Here are the STL:s...

block_nut_holder - is a slimmed down alternative to the standard wing nut. Needed since the wing nut interferes with the probe rod.

fan_duct_[upper|lower] - is an adjusted fan duct with the main hole relocated to not touch the hotend plus an extension of the hole to allow the probe through.

lever - is used to reduce the weight needed to trigger the micro switch.

pcb_standoff - simple standoff for m3 which I used to fix the veroboard

slider - the slider that the probe rod extends from. An 6mm cheese head m3 is used to fix the string that is pulled by the servo.

wades_block - the modified wades_block.

Edited 1 time(s). Last edit at 05/04/2014 05:01PM by svanteg.
Attachments:
open | download - wades_block.part01.rar (500 KB)
open | download - wades_block.part02.rar (500 KB)
open | download - wades_block.part03.rar (500 KB)
open | download - wades_block.part04.rar (321.3 KB)
Re: Mendel90 auto level implementation
May 04, 2014 05:17PM
See video here: [youtu.be]. Also added starting gcode and some tweaks to Marlin.

Edited 1 time(s). Last edit at 05/04/2014 05:18PM by svanteg.
Re: Mendel90 auto level implementation
May 05, 2014 05:42PM
Added new video [youtu.be].
Re: Mendel90 auto level implementation
July 06, 2015 04:59PM
Variant of slider for 4mm rod.
Attachments:
open | download - slider_4mm_rod.stl (49.3 KB)
Sorry, only registered users may post in this forum.

Click here to login