1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Auto Bed Leveling

Discussion in 'Mods and Upgrades' started by Peter Krska, Jan 13, 2014.

  1. Jeff Mercado

    Jeff Mercado Member

    Joined:
    Aug 12, 2013
    Messages:
    41
    Likes Received:
    32
    Since you are running Ziggy's concept here, he had posted the following earlier here:
    http://community.robo3d.com/index.php?threads/auto-bed-leveling.1590/page-2#post-36798
    Hope this helps...

    "Marlin currently does not support Z Probe designs where the Z Endstop Min is always triggered while the probe is retracted.

    This is the case with the servo/opto endstop design and the switch/solenoid design. Similar Z Probe designs could be developed using hall effect switches etc.

    The issue is that Marlin sees that the Z endstop looks like it has been triggered immediately the Z Probe is engaged. To support this type of Z Probe design I modified the code in Marlin_main.cpp as below.

    ****************

    /// Probe bed height at position (x,y), returns the measured z value
    static float probe_pt(float x, float y, float z_before) {
    // move to right place
    do_blocking_move_to(current_position[X_AXIS], current_position[Y_AXIS], z_before);
    do_blocking_move_to(x - X_PROBE_OFFSET_FROM_EXTRUDER, y - Y_PROBE_OFFSET_FROM_EXTRUDER, current_position[Z_AXIS]);

    // Robo modification
    enable_endstops(false); // line added to turn off endstops while Z Probe is being engaged

    engage_z_probe(); // Engage Z Servo endstop if available

    enable_endstops(true); // line added to reactivate the endstops after the probe is engaged.

    run_z_probe();
    float measured_z = current_position[Z_AXIS];
    retract_z_probe();

    SERIAL_PROTOCOLPGM(MSG_BED);
    SERIAL_PROTOCOLPGM(" x: ");
    SERIAL_PROTOCOL(x);

    ****************

    I presume you know how to set up the servo etc. If not, I can help with the configuration.h file."
     
    mark tomlinson likes this.
  2. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Can you post the changes you made--just a zip of the altered ones specific to this or more notes like this?
    :)

    I hope to get time to work on your probe and the software this weekend.
     
  3. Jeff Mercado

    Jeff Mercado Member

    Joined:
    Aug 12, 2013
    Messages:
    41
    Likes Received:
    32
    For my servo-less version the changes to the firmware are in 3 places:
    At the basic level there are two things that need to change from a non-auto bed leveling version of Robo3D to this mod:
    uncomment enable baby stepping in .adv, and uncomment enable_auto_bed_leveling.
    1) enable baby stepping (which I haven't used since "dialing in" my m565
    2) enable auto bed leveling
     
  4. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    So for this one the baby-stepping is not needed. Cool.
    Just need to do testing with the offset to get it right.
     
  5. Jeff Mercado

    Jeff Mercado Member

    Joined:
    Aug 12, 2013
    Messages:
    41
    Likes Received:
    32
    (See pg8 of firmaware)
    - but it requires your Zprobe offsets and your desired grid coordinates
    - The offsets differ by setup and can be measured in X/Y with the instructions I provided, and the Zprobe height can be dialed in after the instructions with a few trial and error prints... or use baby stepping as the rim is printed. The grid coordinates I recommend as a starting point are 50 and 150.

    My probe offsets are: (I recommend you follow the steps posted in my instructions .pdf earlier to measure yours- see pg 9 of the firmware file )
    #define X_PROBE_OFFSET_FROM_EXTRUDER 28 (since using same design Tom, yours should be similar)
    #define Y_PROBE_OFFSET_FROM_EXTRUDER 4 (Since using same design, again similar)
    #define Z_PROBE_OFFSET_FROM_EXTRUDER -6.7 (This is dependent on the hot end, for me a e3d)

    To define the grid ( I am using different values but this is what I recommend and will change to myself soon - see page 8 of the firmware file... mine shows 10/175):
    #define LEFT_PROBE_BED_POSITION 50
    #define RIGHT_PROBE_BED_POSITION 150
    #define BACK_PROBE_BED_POSITION 150
    #define FRONT_PROBE_BED_POSITION 50

    To define the amount the probe raises before homing and between probe points: (Mine was dragging between points but not a big deal before changing these)
    #define Z_RAISE_BEFORE_HOMING 10 // (in mm) Raise Z before homing (G28) for Probe
    Clearance.
    and also here:
    #define Z_RAISE_BETWEEN_PROBINGS 10 //How much the extruder will be raised when
    traveling from between next probing points. If yours drags the rounded hangar edge between
    probings, raise this.

    There are some firmware changes to alter the temp settings for the E3D hotend and some changes for the LCD I am using (GLCD) but these changes should be all that are needed.

    I am interested in your progress to tighten up the instructions on this section as this was the area I was the most uncomfortable with when I set mine up but in hindsight it was quite simple. Ziggy was of great help in getting this running on mine and I would like to give straight forward, simple instructions on changing the firmware. All changes required should only be in the configuration.h file only in Marlin. (save the baby stepping enabling which ziggy outlined here in configuration_adv.h: http://community.robo3d.com/index.php?threads/z-axis-marlin-baby-stepping.2755/
    For my setup(opto board) the variables min and max for the endstop are "const bool Z_MAX_ENDSTOP_INVERTING = false;" (See pg 4 of firmware)
    These changes should be outlined in the instructions with the exception of Ziggy's baby stepping.
     

    Attached Files:

  6. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    That was my assumption. I am going to just do the trial-and-error testing and leave off the baby-stepping for now.
    Thanks.
     
  7. Ziggy

    Ziggy Moderator
    Staff Member

    Joined:
    Feb 20, 2013
    Messages:
    707
    Likes Received:
    530
    For those wanting to implement a servo based Z probe there is some work being done on the latest Marlin to get this working

    https://github.com/MarlinFirmware/Marlin/issues/1701

    It turns out the problem is that a delay is needed to allow the probe to deploy before the endstop is tested. (See my GitHUB comment on 27th March) So the fix is to define a delay in configuration.h

    #define PROBE_SERVO_DEACTIVATION_DELAY 300 // the value is in milliseconds

    300 milliseconds is generally enough for most servos to finish moving
     
    Mike Kelly and mark tomlinson like this.
  8. Jeff Mercado

    Jeff Mercado Member

    Joined:
    Aug 12, 2013
    Messages:
    41
    Likes Received:
    32
    I have been printing at .2mm resolution exclusively so mine has not needed changing or twiddling since dialing it in, however if you switch between .1, .2 or .3mm in resolution I am guessing baby stepping will be a valuable addition once you play with it for a while to get that first layer just the way you want it while switching resolution.
     
  9. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    23,912
    Likes Received:
    7,338
    Good point. I will see how that affects it. I don't change resolution often, but it does happen :)
     
  10. Jeff Mercado

    Jeff Mercado Member

    Joined:
    Aug 12, 2013
    Messages:
    41
    Likes Received:
    32
    I designed a new hook which cleaned up the design. (I ensured it could be printed, but went a step further for mine. You can superglue the printed version to the base. Mine is still working flawlessly but is a rats nest so to incent me to change it out to the board version I decided to mill one out of aluminum. I guess now I need to change the firmware for the differences in measurements, adjust my grid to a little smaller - I have been putting that off, and fine tune the m565 variable in my setup commands for the new setup... but now I have a reason to change it out to a more professional version. Every print I have printed (only printing at .2mm) since the install has laid down the perfect first layer with no tweaking/babystepping...resulting in no warping... a one print success every time so far. Do I really want to change this out??? Well since I went through the hassle of doing the CNC mill toolpaths and milling it out (about 8hrs) I guess I have to! The process on the mill taught me speeds/feeds and got me down to using a 1mm end mill! Another step in my learning journey. I used JB Weld to connect the hook and the two vertical holders to the base on the aluminum version. Bitmap_in_Graphic1.JPG
     

Share This Page