Marlin-RC_Deltaprintr/Marlin/stepper.cpp
/**
 * Get an axis position according to stepper position(s)
 * For CORE machines apply translation from ABC to XYZ.
 */
Get an axis position according to stepper position(s)
For CORE machines apply translation from ABC to XYZ.
Get an axis position according to stepper position ( s ) For CORE machines apply translation from ABC to XYZ .
float st_get_axis_position_mm(AxisEnum axis) {
  float axis_steps;
  #if ENABLED(COREXY) | ENABLED(COREXZ)
    if (axis == X_AXIS || axis == CORE_AXIS_2) {
      CRITICAL_SECTION_START;
      long pos1 = count_position[A_AXIS],
           pos2 = count_position[CORE_AXIS_2];
      CRITICAL_SECTION_END;
      axis_steps = (pos1 + ((axis == X_AXIS) ? pos2 : -pos2)) / 2.0f;
    }
    else
      axis_steps = st_get_position(axis);
  #else
    axis_steps = st_get_position(axis);
  #endif
  return axis_steps / axis_steps_per_unit[axis];
}
float st_get_axis_position_mm ( AxisEnum axis ) { float axis_steps ; #if ENABLED ( COREXY ) | ENABLED ( COREXZ ) if ( axis == X_AXIS || axis == CORE_AXIS_2 ) { CRITICAL_SECTION_START ; long pos1 = count_position [ A_AXIS ] , pos2 = count_position [ CORE_AXIS_2 ] ; CRITICAL_SECTION_END ; axis_steps = ( pos1 + ( ( axis == X_AXIS ) ? pos2 : - pos2 ) ) / 2.0f ; } else axis_steps = st_get_position ( axis ) ; #else axis_steps = st_get_position ( axis ) ; #endif return axis_steps / axis_steps_per_unit [ axis ] ; }
Get an axis position according to stepper position(s)
 For CORE machines apply translation from ABC to XYZ.
Get an axis position according to stepper position ( s ) For CORE machines apply translation from ABC to XYZ .
// ((a1+a2)+(a1-a2))/2 -> (a1+a2+a1-a2)/2 -> (a1+a1)/2 -> a1 // ((a1+a2)-(a1-a2))/2 -> (a1+a2-a1+a2)/2 -> (a2+a2)/2 -> a2