Merge pull request #3991 from thinkyhead/rc_axis_units
Rename some vars to clarify their relationship to acceleration
This commit is contained in:
		@@ -155,7 +155,7 @@
 | 
			
		||||
 * M84  - Disable steppers until next move,
 | 
			
		||||
 *        or use S<seconds> to specify an inactivity timeout, after which the steppers will be disabled.  S0 to disable the timeout.
 | 
			
		||||
 * M85  - Set inactivity shutdown timer with parameter S<seconds>. To disable set zero (default)
 | 
			
		||||
 * M92  - Set planner.axis_steps_per_unit - same syntax as G92
 | 
			
		||||
 * M92  - Set planner.axis_steps_per_mm - same syntax as G92
 | 
			
		||||
 * M104 - Set extruder target temp
 | 
			
		||||
 * M105 - Read current temp
 | 
			
		||||
 * M106 - Fan on
 | 
			
		||||
@@ -1683,7 +1683,7 @@ static void setup_for_endstop_move() {
 | 
			
		||||
       * is not where we said to go.
 | 
			
		||||
       */
 | 
			
		||||
      long stop_steps = stepper.position(Z_AXIS);
 | 
			
		||||
      float mm = start_z - float(start_steps - stop_steps) / planner.axis_steps_per_unit[Z_AXIS];
 | 
			
		||||
      float mm = start_z - float(start_steps - stop_steps) / planner.axis_steps_per_mm[Z_AXIS];
 | 
			
		||||
      current_position[Z_AXIS] = mm;
 | 
			
		||||
 | 
			
		||||
      #if ENABLED(DEBUG_LEVELING_FEATURE)
 | 
			
		||||
@@ -5155,15 +5155,15 @@ inline void gcode_M92() {
 | 
			
		||||
      if (i == E_AXIS) {
 | 
			
		||||
        float value = code_value_per_axis_unit(i);
 | 
			
		||||
        if (value < 20.0) {
 | 
			
		||||
          float factor = planner.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
 | 
			
		||||
          float factor = planner.axis_steps_per_mm[i] / value; // increase e constants if M92 E14 is given for netfab.
 | 
			
		||||
          planner.max_e_jerk *= factor;
 | 
			
		||||
          planner.max_feedrate[i] *= factor;
 | 
			
		||||
          planner.axis_steps_per_sqr_second[i] *= factor;
 | 
			
		||||
          planner.max_acceleration_steps_per_s2[i] *= factor;
 | 
			
		||||
        }
 | 
			
		||||
        planner.axis_steps_per_unit[i] = value;
 | 
			
		||||
        planner.axis_steps_per_mm[i] = value;
 | 
			
		||||
      }
 | 
			
		||||
      else {
 | 
			
		||||
        planner.axis_steps_per_unit[i] = code_value_per_axis_unit(i);
 | 
			
		||||
        planner.axis_steps_per_mm[i] = code_value_per_axis_unit(i);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
@@ -5198,9 +5198,9 @@ static void report_current_position() {
 | 
			
		||||
    SERIAL_EOL;
 | 
			
		||||
 | 
			
		||||
    SERIAL_PROTOCOLPGM("SCARA step Cal - Theta:");
 | 
			
		||||
    SERIAL_PROTOCOL(delta[X_AXIS] / 90 * planner.axis_steps_per_unit[X_AXIS]);
 | 
			
		||||
    SERIAL_PROTOCOL(delta[X_AXIS] / 90 * planner.axis_steps_per_mm[X_AXIS]);
 | 
			
		||||
    SERIAL_PROTOCOLPGM("   Psi+Theta:");
 | 
			
		||||
    SERIAL_PROTOCOL((delta[Y_AXIS] - delta[X_AXIS]) / 90 * planner.axis_steps_per_unit[Y_AXIS]);
 | 
			
		||||
    SERIAL_PROTOCOL((delta[Y_AXIS] - delta[X_AXIS]) / 90 * planner.axis_steps_per_mm[Y_AXIS]);
 | 
			
		||||
    SERIAL_EOL; SERIAL_EOL;
 | 
			
		||||
  #endif
 | 
			
		||||
}
 | 
			
		||||
@@ -5345,7 +5345,7 @@ inline void gcode_M200() {
 | 
			
		||||
inline void gcode_M201() {
 | 
			
		||||
  for (int8_t i = 0; i < NUM_AXIS; i++) {
 | 
			
		||||
    if (code_seen(axis_codes[i])) {
 | 
			
		||||
      planner.max_acceleration_units_per_sq_second[i] = code_value_axis_units(i);
 | 
			
		||||
      planner.max_acceleration_mm_per_s2[i] = code_value_axis_units(i);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
  // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
 | 
			
		||||
@@ -5355,7 +5355,7 @@ inline void gcode_M201() {
 | 
			
		||||
#if 0 // Not used for Sprinter/grbl gen6
 | 
			
		||||
  inline void gcode_M202() {
 | 
			
		||||
    for (int8_t i = 0; i < NUM_AXIS; i++) {
 | 
			
		||||
      if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_unit[i];
 | 
			
		||||
      if (code_seen(axis_codes[i])) axis_travel_steps_per_sqr_second[i] = code_value_axis_units(i) * planner.axis_steps_per_mm[i];
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
#endif
 | 
			
		||||
@@ -8226,8 +8226,8 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
 | 
			
		||||
        }
 | 
			
		||||
        float oldepos = current_position[E_AXIS], oldedes = destination[E_AXIS];
 | 
			
		||||
        planner.buffer_line(destination[X_AXIS], destination[Y_AXIS], destination[Z_AXIS],
 | 
			
		||||
                         destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS],
 | 
			
		||||
                         (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_unit[E_AXIS], active_extruder);
 | 
			
		||||
                         destination[E_AXIS] + (EXTRUDER_RUNOUT_EXTRUDE) * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS],
 | 
			
		||||
                         (EXTRUDER_RUNOUT_SPEED) / 60. * (EXTRUDER_RUNOUT_ESTEPS) / planner.axis_steps_per_mm[E_AXIS], active_extruder);
 | 
			
		||||
      current_position[E_AXIS] = oldepos;
 | 
			
		||||
      destination[E_AXIS] = oldedes;
 | 
			
		||||
      planner.set_e_position_mm(oldepos);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user