Welcome! Log In Create A New Profile

Advanced

Marlin does not support auto bed levelling for Delta printers?

Posted by Stephanel 
Marlin does not support auto bed levelling for Delta printers?
February 10, 2015 05:15PM
Hi,

I have built a delta printer and want to enable auto bed levelling. However, although I have enabled the servo motor configuration and the motor itself seems to function, it will not deploy when I start the auto bed levelling procedure (G30).

When I use G28, the servo motor deploys the probe, and retracts it almost immediately. This is because in the code, the following is written:

// Marlin_main.cpp line 803
static void homeaxis(int axis) {
#define HOMEAXIS_DO(LETTER) \
  ((LETTER##_MIN_PIN > -1 && LETTER##_HOME_DIR==-1) || (LETTER##_MAX_PIN > -1 && LETTER##_HOME_DIR==1))

  if (axis==X_AXIS ? HOMEAXIS_DO(X) :
      axis==Y_AXIS ? HOMEAXIS_DO(Y) :
      axis==Z_AXIS ? HOMEAXIS_DO(Z) :
      0) {
    int axis_home_dir = home_dir(axis);
#ifdef DUAL_X_CARRIAGE
    if (axis == X_AXIS)
      axis_home_dir = x_home_dir(active_extruder);
#endif

    // Engage Servo endstop if enabled
    #ifdef SERVO_ENDSTOPS
      if (servo_endstops[axis] > -1) {
        servos[servo_endstops[axis]].write(servo_endstop_angles[axis * 2]);
      }
    #endif

Sadly, it appears that the code G30 does not have such deployment built in. Is this an omission or is auto bed levelling simply not yet included in the Marlin firmware for Delta Printers?

Thanks!
Re: Marlin does not support auto bed levelling for Delta printers?
February 10, 2015 05:29PM
I now updated my firmware to include the deployment of the end stop to allow for auto bed levelling. I'd rather not have changed the firmware, but I think it really doesn't work without.

I changed the following

Marlin_main.cpp line 908
void deploy_z_probe() {
  feedrate = homing_feedrate[X_AXIS];
  destination[X_AXIS] = z_probe_deploy_start_location[X_AXIS];
  destination[Y_AXIS] = z_probe_deploy_start_location[Y_AXIS];
  destination[Z_AXIS] = z_probe_deploy_start_location[Z_AXIS];
  prepare_move_raw();

  feedrate = homing_feedrate[X_AXIS]/10;
  destination[X_AXIS] = z_probe_deploy_end_location[X_AXIS];
  destination[Y_AXIS] = z_probe_deploy_end_location[Y_AXIS];
  destination[Z_AXIS] = z_probe_deploy_end_location[Z_AXIS];
  prepare_move_raw();

  feedrate = homing_feedrate[X_AXIS];
  destination[X_AXIS] = z_probe_deploy_start_location[X_AXIS];
  destination[Y_AXIS] = z_probe_deploy_start_location[Y_AXIS];
  destination[Z_AXIS] = z_probe_deploy_start_location[Z_AXIS];
  prepare_move_raw();
  st_synchronize();

    // EDIT: ADDED THE FOLLOWING
    // Engage Servo endstop if enabled
    #ifdef SERVO_ENDSTOPS
      if (servo_endstops[Z_AXIS] > -1) {
        servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2]);
      }
    #endif
    // END EDIT
}

Marlin_main.cpp line 937
void retract_z_probe() {
    // EDIT: ADDED THE FOLLOWING
    // Engage Servo endstop if enabled
    #ifdef SERVO_ENDSTOPS
      if (servo_endstops[Z_AXIS] > -1) {
        servos[servo_endstops[Z_AXIS]].write(servo_endstop_angles[Z_AXIS * 2 + 1]);
      }
    #endif
    // END EDIT

  feedrate = homing_feedrate[X_AXIS];
  destination[Z_AXIS] = 50;
  prepare_move_raw();

  destination[X_AXIS] = z_probe_retract_start_location[X_AXIS];
  destination[Y_AXIS] = z_probe_retract_start_location[Y_AXIS];
  destination[Z_AXIS] = z_probe_retract_start_location[Z_AXIS];
  prepare_move();
  prepare_move_raw();

  // Move the nozzle below the print surface to push the probe up.
  feedrate = homing_feedrate[Z_AXIS]/10;
  destination[X_AXIS] = z_probe_retract_end_location[X_AXIS];
  destination[Y_AXIS] = z_probe_retract_end_location[Y_AXIS];
  destination[Z_AXIS] = z_probe_retract_end_location[Z_AXIS];
  prepare_move_raw();

  feedrate = homing_feedrate[Z_AXIS];
  destination[X_AXIS] = z_probe_retract_start_location[X_AXIS];
  destination[Y_AXIS] = z_probe_retract_start_location[Y_AXIS];
  destination[Z_AXIS] = z_probe_retract_start_location[Z_AXIS];
  prepare_move_raw();
  st_synchronize();
}

As I still do not have a suitable mount point for my auto bed levelling device, I am not able to test it in real life. However, now the end stop is extended when the probing starts, and retracts after it has ended. That at least seams to be correct behaviour.

I hope this makes sense, and that it is the correct way of changing this.

Thanks!
Re: Marlin does not support auto bed levelling for Delta printers?
February 17, 2015 12:50PM
Not sure why the z-probe would extend for a G28, though I am using FSR. However, I thought there were g-code commands for extending and retracting the z-probe so that you wouldn't need to modify the code yourself. Simply create a script in your printer software to deploy the probe, calibrate the bed, and then retract the probe.

Alternatively, isn't there z-probe settings in the configuration.h file?
Sorry, only registered users may post in this forum.

Click here to login