Example #1
0
void vector_3::debug(const char title[]) {
	SERIAL_PROTOCOL(title);
	SERIAL_PROTOCOLPGM(" x: ");
	SERIAL_PROTOCOL_F(x, 6);
	SERIAL_PROTOCOLPGM(" y: ");
	SERIAL_PROTOCOL_F(y, 6);
	SERIAL_PROTOCOLPGM(" z: ");
	SERIAL_PROTOCOL_F(z, 6);
	SERIAL_EOL;
}
void matrix_3x3::debug(char* title) {
  SERIAL_PROTOCOLLN(title);
  int count = 0;
  for(int i=0; i<3; i++) {
    for(int j=0; j<3; j++) {
      SERIAL_PROTOCOL_F(matrix[count], 6);
      SERIAL_PROTOCOLPGM(" ");
      count++;
    }
    SERIAL_EOL;
  }
}
Example #3
0
void matrix_3x3::debug(const char title[]) {
  SERIAL_PROTOCOLLN(title);
  int count = 0;
  for(int i=0; i<3; i++) {
    for(int j=0; j<3; j++) {
      if (matrix[count] >= 0.0) SERIAL_PROTOCOLCHAR('+');
      SERIAL_PROTOCOL_F(matrix[count], 6);
      SERIAL_PROTOCOLCHAR(' ');
      count++;
    }
    SERIAL_EOL;
  }
}
Example #4
0
/**
 * - Move to the given XY
 * - Deploy the probe, if not already deployed
 * - Probe the bed, get the Z position
 * - Depending on the 'stow' flag
 *   - Stow the probe, or
 *   - Raise to the BETWEEN height
 * - Return the probed Z position
 */
float probe_pt(const float &lx, const float &ly, const bool stow, const uint8_t verbose_level, const bool printable/*=true*/) {
  #if ENABLED(DEBUG_LEVELING_FEATURE)
    if (DEBUGGING(LEVELING)) {
      SERIAL_ECHOPAIR(">>> probe_pt(", lx);
      SERIAL_ECHOPAIR(", ", ly);
      SERIAL_ECHOPAIR(", ", stow ? "" : "no ");
      SERIAL_ECHOLNPGM("stow)");
      DEBUG_POS("", current_position);
    }
  #endif

  const float nx = lx - (X_PROBE_OFFSET_FROM_EXTRUDER), ny = ly - (Y_PROBE_OFFSET_FROM_EXTRUDER);

  if (printable
    ? !position_is_reachable_xy(nx, ny)
    : !position_is_reachable_by_probe_xy(lx, ly)
  ) return NAN;


  const float old_feedrate_mm_s = feedrate_mm_s;

  #if ENABLED(DELTA)
    if (current_position[Z_AXIS] > delta_clip_start_height)
      do_blocking_move_to_z(delta_clip_start_height);
  #endif

  #if HAS_SOFTWARE_ENDSTOPS
    // Store the status of the soft endstops and disable if we're probing a non-printable location
    static bool enable_soft_endstops = soft_endstops_enabled;
    if (!printable) soft_endstops_enabled = false;
  #endif

  feedrate_mm_s = XY_PROBE_FEEDRATE_MM_S;

  // Move the probe to the given XY
  do_blocking_move_to_xy(nx, ny);

  float measured_z = NAN;
  if (!DEPLOY_PROBE()) {
    measured_z = run_z_probe(printable);

    if (!stow)
      do_blocking_move_to_z(current_position[Z_AXIS] + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
    else
      if (STOW_PROBE()) measured_z = NAN;
  }

  #if HAS_SOFTWARE_ENDSTOPS
    // Restore the soft endstop status
    soft_endstops_enabled = enable_soft_endstops;
  #endif

  if (verbose_level > 2) {
    SERIAL_PROTOCOLPGM("Bed X: ");
    SERIAL_PROTOCOL_F(lx, 3);
    SERIAL_PROTOCOLPGM(" Y: ");
    SERIAL_PROTOCOL_F(ly, 3);
    SERIAL_PROTOCOLPGM(" Z: ");
    SERIAL_PROTOCOL_F(measured_z, 3);
    SERIAL_EOL();
  }

  #if ENABLED(DEBUG_LEVELING_FEATURE)
    if (DEBUGGING(LEVELING)) SERIAL_ECHOLNPGM("<<< probe_pt");
  #endif

  feedrate_mm_s = old_feedrate_mm_s;

  if (isnan(measured_z)) {
    LCD_MESSAGEPGM(MSG_ERR_PROBING_FAILED);
    SERIAL_ERROR_START();
    SERIAL_ERRORLNPGM(MSG_ERR_PROBING_FAILED);
  }

  return measured_z;
}
Example #5
0
  void unified_bed_leveling::display_map(const int map_type) {
    constexpr uint8_t spaces = 8 * (GRID_MAX_POINTS_X - 2);

    SERIAL_PROTOCOLPGM("\nBed Topography Report");
    if (map_type == 0) {
      SERIAL_PROTOCOLPGM(":\n\n");
      serial_echo_xy(0, GRID_MAX_POINTS_Y - 1);
      SERIAL_ECHO_SP(spaces + 3);
      serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1);
      SERIAL_EOL();
      serial_echo_xy(MESH_MIN_X, MESH_MAX_Y);
      SERIAL_ECHO_SP(spaces);
      serial_echo_xy(MESH_MAX_X, MESH_MAX_Y);
      SERIAL_EOL();
    }
    else {
      SERIAL_PROTOCOLPGM(" for ");
      serialprintPGM(map_type == 1 ? PSTR("CSV:\n\n") : PSTR("LCD:\n\n"));
    }

    const float current_xi = get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0),
                current_yi = get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);

    for (int8_t j = GRID_MAX_POINTS_Y - 1; j >= 0; j--) {
      for (uint8_t i = 0; i < GRID_MAX_POINTS_X; i++) {
        const bool is_current = i == current_xi && j == current_yi;

        // is the nozzle here? then mark the number
        if (map_type == 0) SERIAL_CHAR(is_current ? '[' : ' ');

        const float f = z_values[i][j];
        if (isnan(f)) {
          serialprintPGM(map_type == 0 ? PSTR("    .   ") : PSTR("NAN"));
        }
        else if (map_type <= 1) {
          // if we don't do this, the columns won't line up nicely
          if (map_type == 0 && f >= 0.0) SERIAL_CHAR(' ');
          SERIAL_PROTOCOL_F(f, 3);
        }
        idle();
        if (map_type == 1 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(',');

        #if TX_BUFFER_SIZE > 0
          MYSERIAL.flushTX();
        #endif
        safe_delay(15);
        if (map_type == 0) {
          SERIAL_CHAR(is_current ? ']' : ' ');
          SERIAL_CHAR(' ');
        }
      }
      SERIAL_EOL();
      if (j && map_type == 0) { // we want the (0,0) up tight against the block of numbers
        SERIAL_CHAR(' ');
        SERIAL_EOL();
      }
    }

    if (map_type == 0) {
      serial_echo_xy(MESH_MIN_X, MESH_MIN_Y);
      SERIAL_ECHO_SP(spaces + 4);
      serial_echo_xy(MESH_MAX_X, MESH_MIN_Y);
      SERIAL_EOL();
      serial_echo_xy(0, 0);
      SERIAL_ECHO_SP(spaces + 5);
      serial_echo_xy(GRID_MAX_POINTS_X - 1, 0);
      SERIAL_EOL();
    }
  }
Example #6
0
void Config_PrintSettings()
{  // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown
    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Steps per unit:");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M92 X",axis_steps_per_unit[0]);
    SERIAL_ECHOPAIR(" Y",axis_steps_per_unit[1]);
    SERIAL_ECHOPAIR(" Z",axis_steps_per_unit[2]);
    SERIAL_ECHOPAIR(" E",axis_steps_per_unit[3]);
    SERIAL_ECHOLN("");
      
    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
    SERIAL_ECHOPAIR(" Y",max_feedrate[1] ); 
    SERIAL_ECHOPAIR(" Z", max_feedrate[2] ); 
    SERIAL_ECHOPAIR(" E", max_feedrate[3]);
    SERIAL_ECHOLN("");

    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M201 X" ,max_acceleration_units_per_sq_second[0] ); 
    SERIAL_ECHOPAIR(" Y" , max_acceleration_units_per_sq_second[1] ); 
    SERIAL_ECHOPAIR(" Z" ,max_acceleration_units_per_sq_second[2] );
    SERIAL_ECHOPAIR(" E" ,max_acceleration_units_per_sq_second[3]);
    SERIAL_ECHOLN("");
    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M204 S",acceleration ); 
    SERIAL_ECHOPAIR(" T" ,retract_acceleration);
    SERIAL_ECHOLN("");

    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M205 S",minimumfeedrate ); 
    SERIAL_ECHOPAIR(" T" ,mintravelfeedrate ); 
    SERIAL_ECHOPAIR(" B" ,minsegmenttime ); 
    SERIAL_ECHOPAIR(" X" ,max_xy_jerk ); 
    SERIAL_ECHOPAIR(" Z" ,max_z_jerk);
    SERIAL_ECHOPAIR(" E" ,max_e_jerk);
    SERIAL_ECHOLN(""); 

    SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Home offset (mm):");
    SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M206 X",add_homeing[0] );
    SERIAL_ECHOPAIR(" Y" ,add_homeing[1] );
    SERIAL_ECHOPAIR(" Z" ,add_homeing[2] );
    SERIAL_ECHOLN("");
    #ifdef DELTA
      SERIAL_ECHO_START;
      SERIAL_ECHOLNPGM("Delta Geometry adjustment:");
      SERIAL_ECHO_START;
      SERIAL_ECHO("  M666 A");
      SERIAL_PROTOCOL_F(tower_adj[0],3);
      SERIAL_ECHO(" B");
      SERIAL_PROTOCOL_F(tower_adj[1],3);
      SERIAL_ECHO(" C");
      SERIAL_PROTOCOL_F(tower_adj[2],3);
      SERIAL_ECHO(" I");
      SERIAL_PROTOCOL_F(tower_adj[3],3);
      SERIAL_ECHO(" J");
      SERIAL_PROTOCOL_F(tower_adj[4],3);
      SERIAL_ECHO(" K");
      SERIAL_PROTOCOL_F(tower_adj[5],3);
      SERIAL_ECHO(" U");
      SERIAL_PROTOCOL_F(diagrod_adj[0],3);
      SERIAL_ECHO(" V");
      SERIAL_PROTOCOL_F(diagrod_adj[1],3);
      SERIAL_ECHO(" W");
      SERIAL_PROTOCOL_F(diagrod_adj[2],3);
      SERIAL_ECHOPAIR(" R" ,delta_radius);
      SERIAL_ECHOPAIR(" D" ,delta_diagonal_rod);
      SERIAL_ECHOPAIR(" H" ,max_pos[2]);
      SERIAL_ECHOLN("");
      SERIAL_ECHO_START;
      SERIAL_ECHOLNPGM("Endstop Offsets:");
      SERIAL_ECHO_START;
      SERIAL_ECHOPAIR("  M666 X" ,endstop_adj[0]);
      SERIAL_ECHOPAIR(" Y" ,endstop_adj[1]);
      SERIAL_ECHOPAIR(" Z" ,endstop_adj[2]);
      SERIAL_ECHOLN("");
      SERIAL_ECHO_START;
      SERIAL_ECHOLNPGM("Z-Probe Offset:");
      SERIAL_ECHO_START;
      SERIAL_ECHOPAIR("  M666 P X" ,z_probe_offset[0]);
      SERIAL_ECHOPAIR(" Y" ,z_probe_offset[1]);
      SERIAL_ECHOPAIR(" Z" ,z_probe_offset[2]);
      SERIAL_ECHOLN("");
    #endif
 #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
} 
Example #7
0
void Config_PrintSettings()
{  // Always have this function, even with EEPROM_SETTINGS disabled, the current values will be shown

    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("FABtotum TOTUMDUINO");
    SERIAL_ECHOPAIR(" Batch Number: ", (unsigned long)fab_batch_number);
    SERIAL_ECHOLN("");

    SERIAL_ECHOLNPGM("FABlin");
    SERIAL_ECHOLNPGM(" Version: " STRING_BUILD_VERSION);
    SERIAL_ECHOPAIR(" Baudrate: ", (unsigned long)BAUDRATE);
    SERIAL_ECHOLN("");

    SERIAL_ECHOLNPGM("Steps per unit:");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M92 X",axis_steps_per_unit[0]);
    SERIAL_ECHOPAIR_P(PMSG_WS_Y,axis_steps_per_unit[1]);
    SERIAL_ECHOPAIR_P(PMSG_WS_Z,axis_steps_per_unit[2]);
    SERIAL_ECHOPAIR_P(PMSG_WS_E,axis_steps_per_unit[3]);
    SERIAL_ECHOLN("");

    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M203 X",max_feedrate[0]);
    SERIAL_ECHOPAIR_P(PMSG_WS_Y,max_feedrate[1] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Z, max_feedrate[2] );
    SERIAL_ECHOPAIR_P(PMSG_WS_E, max_feedrate[3]);
    SERIAL_ECHOLN("");

    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M201 X" ,max_acceleration_units_per_sq_second[0] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Y , max_acceleration_units_per_sq_second[1] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Z ,max_acceleration_units_per_sq_second[2] );
    SERIAL_ECHOPAIR_P(PMSG_WS_E ,max_acceleration_units_per_sq_second[3]);
    SERIAL_ECHOLN("");
    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M204 S",acceleration );
    SERIAL_ECHOPAIR_P(PMSG_WS_T, retract_acceleration);
    SERIAL_ECHOLN("");

    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s),  Z=maximum Z jerk (mm/s),  E=maximum E jerk (mm/s)");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M205 S",minimumfeedrate );
    SERIAL_ECHOPAIR_P(PMSG_WS_T, mintravelfeedrate );
    SERIAL_ECHOPAIR(" B" ,minsegmenttime );
    SERIAL_ECHOPAIR_P(PMSG_WS_X, max_xy_jerk );
    SERIAL_ECHOPAIR_P(PMSG_WS_Z, max_z_jerk);
    SERIAL_ECHOPAIR_P(PMSG_WS_E, max_e_jerk);
    SERIAL_ECHOLN("");

    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Home offset (mm):");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M206 X",add_homeing[0] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Y, add_homeing[1] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Z, add_homeing[2] );
    SERIAL_ECHOLN("");
#ifdef DELTA
    //SERIAL_ECHO_START;
    SERIAL_ECHOLNPGM("Endstop adjustement (mm):");
    //SERIAL_ECHO_START;
    SERIAL_ECHOPAIR("  M666 X",endstop_adj[0] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Y, endstop_adj[1] );
    SERIAL_ECHOPAIR_P(PMSG_WS_Z, endstop_adj[2] );
	SERIAL_ECHOLN("");
	//SERIAL_ECHO_START;
	SERIAL_ECHOLNPGM("Delta settings: L=delta_diagonal_rod, R=delta_radius, S=delta_segments_per_second");
	//SERIAL_ECHO_START;
	SERIAL_ECHOPAIR("  M665 L",delta_diagonal_rod );
	SERIAL_ECHOPAIR(" R" ,delta_radius );
	SERIAL_ECHOPAIR(" S" ,delta_segments_per_second );
	SERIAL_ECHOLN("");
#endif

#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

    //SERIAL_ECHO_START;
    SERIAL_ECHOPGM("Servo Endstop settings:");
    SERIAL_PROTOCOL(" R: ");
    SERIAL_PROTOCOL(servo_endstop_angles[5]);
    SERIAL_PROTOCOL(" E: ");
    SERIAL_PROTOCOL(servo_endstop_angles[4]);
    SERIAL_PROTOCOLLN("");

    //SERIAL_ECHO_START;
    SERIAL_ECHOPGM("Z Probe Length: ");
    SERIAL_PROTOCOL_F(-zprobe_zoffset,2);
    SERIAL_PROTOCOLLN("");

    SERIAL_ECHOLNPGM("Installed head ID:");
    SERIAL_ECHOPAIR(" M793 S", (unsigned long)installed_head_id);
    SERIAL_ECHOLN("");
}