Operate in Native Machine Space

This commit is contained in:
Scott Lahteine
2017-11-02 23:59:42 -05:00
parent 31f112cf58
commit f8393a0908
36 changed files with 449 additions and 489 deletions

View File

@ -1679,7 +1679,7 @@ void kill_screen(const char* lcd_msg) {
*/
static int8_t bed_corner;
void _lcd_goto_next_corner() {
line_to_z(LOGICAL_Z_POSITION(4.0));
line_to_z(4.0);
switch (bed_corner) {
case 0:
current_position[X_AXIS] = X_MIN_BED + 10;
@ -1696,7 +1696,7 @@ void kill_screen(const char* lcd_msg) {
break;
}
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[X_AXIS]), active_extruder);
line_to_z(LOGICAL_Z_POSITION(0.0));
line_to_z(0.0);
if (++bed_corner > 3) bed_corner = 0;
}
@ -1742,7 +1742,7 @@ void kill_screen(const char* lcd_msg) {
//
void _lcd_after_probing() {
#if MANUAL_PROBE_HEIGHT > 0
line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
line_to_z(Z_MIN_POS + MANUAL_PROBE_HEIGHT);
#endif
// Display "Done" screen and wait for moves to complete
#if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
@ -1757,13 +1757,13 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(MESH_BED_LEVELING)
// Utility to go to the next mesh point
inline void _manual_probe_goto_xy(float x, float y) {
inline void _manual_probe_goto_xy(const float &rx, const float &ry) {
#if MANUAL_PROBE_HEIGHT > 0
const float prev_z = current_position[Z_AXIS];
line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
line_to_z(Z_MIN_POS + MANUAL_PROBE_HEIGHT);
#endif
current_position[X_AXIS] = LOGICAL_X_POSITION(x);
current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
current_position[X_AXIS] = rx;
current_position[Y_AXIS] = ry;
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
#if MANUAL_PROBE_HEIGHT > 0
line_to_z(prev_z);
@ -1893,10 +1893,7 @@ void kill_screen(const char* lcd_msg) {
mbl.zigzag(manual_probe_index, px, py);
// Controls the loop until the move is done
_manual_probe_goto_xy(
LOGICAL_X_POSITION(mbl.index_to_xpos[px]),
LOGICAL_Y_POSITION(mbl.index_to_ypos[py])
);
_manual_probe_goto_xy(mbl.index_to_xpos[px], mbl.index_to_ypos[py]);
// After the blocking function returns, change menus
lcd_goto_screen(_lcd_level_bed_get_z);
@ -2377,8 +2374,8 @@ void kill_screen(const char* lcd_msg) {
* UBL LCD Map Movement
*/
void ubl_map_move_to_xy() {
current_position[X_AXIS] = LOGICAL_X_POSITION(pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]));
current_position[Y_AXIS] = LOGICAL_Y_POSITION(pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]));
current_position[X_AXIS] = pgm_read_float(&ubl._mesh_index_to_xpos[x_plot]);
current_position[Y_AXIS] = pgm_read_float(&ubl._mesh_index_to_ypos[y_plot]);
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
}
@ -2712,17 +2709,17 @@ void kill_screen(const char* lcd_msg) {
lcd_goto_screen(_lcd_calibrate_homing);
}
void _man_probe_pt(const float &lx, const float &ly) {
void _man_probe_pt(const float &rx, const float &ry) {
#if HAS_LEVELING
reset_bed_level(); // After calibration bed-level data is no longer valid
#endif
float z_dest = LOGICAL_Z_POSITION((Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5);
float z_dest = (Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5;
line_to_z(z_dest);
current_position[X_AXIS] = LOGICAL_X_POSITION(lx);
current_position[Y_AXIS] = LOGICAL_Y_POSITION(ly);
current_position[X_AXIS] = rx;
current_position[Y_AXIS] = ry;
line_to_current_z();
z_dest = LOGICAL_Z_POSITION(Z_CLEARANCE_BETWEEN_PROBES);
z_dest = Z_CLEARANCE_BETWEEN_PROBES;
line_to_z(z_dest);
lcd_synchronize();
@ -2730,8 +2727,8 @@ void kill_screen(const char* lcd_msg) {
lcd_goto_screen(lcd_move_z);
}
float lcd_probe_pt(const float &lx, const float &ly) {
_man_probe_pt(lx, ly);
float lcd_probe_pt(const float &rx, const float &ry) {
_man_probe_pt(rx, ry);
KEEPALIVE_STATE(PAUSED_FOR_USER);
defer_return_to_status = true;
wait_for_user = true;