Fixed move from panel for delta bot #557
This commit is contained in:
parent
1561c6df51
commit
55c287a69e
|
@ -163,6 +163,7 @@ void ClearToSend();
|
|||
void get_coordinates();
|
||||
#ifdef DELTA
|
||||
void calculate_delta(float cartesian[3]);
|
||||
extern float delta[3];
|
||||
#endif
|
||||
void prepare_move();
|
||||
void kill();
|
||||
|
|
|
@ -198,14 +198,15 @@ int EtoPPressure=0;
|
|||
bool powersupply = true;
|
||||
#endif
|
||||
|
||||
#ifdef DELTA
|
||||
float delta[3] = {0.0, 0.0, 0.0};
|
||||
#endif
|
||||
|
||||
//===========================================================================
|
||||
//=============================private variables=============================
|
||||
//===========================================================================
|
||||
const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
|
||||
static float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0};
|
||||
#ifdef DELTA
|
||||
static float delta[3] = {0.0, 0.0, 0.0};
|
||||
#endif
|
||||
static float offset[3] = {0.0, 0.0, 0.0};
|
||||
static bool home_all_axis = true;
|
||||
static float feedrate = 1500.0, next_feedrate, saved_feedrate;
|
||||
|
|
|
@ -374,7 +374,12 @@ static void lcd_move_x()
|
|||
if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
|
||||
current_position[X_AXIS] = X_MAX_POS;
|
||||
encoderPosition = 0;
|
||||
#ifdef DELTA
|
||||
calculate_delta(current_position);
|
||||
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
|
||||
#else
|
||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
|
||||
#endif
|
||||
lcdDrawUpdate = 1;
|
||||
}
|
||||
if (lcdDrawUpdate)
|
||||
|
@ -398,7 +403,12 @@ static void lcd_move_y()
|
|||
if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
|
||||
current_position[Y_AXIS] = Y_MAX_POS;
|
||||
encoderPosition = 0;
|
||||
#ifdef DELTA
|
||||
calculate_delta(current_position);
|
||||
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
|
||||
#else
|
||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 600, active_extruder);
|
||||
#endif
|
||||
lcdDrawUpdate = 1;
|
||||
}
|
||||
if (lcdDrawUpdate)
|
||||
|
@ -422,7 +432,12 @@ static void lcd_move_z()
|
|||
if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
|
||||
current_position[Z_AXIS] = Z_MAX_POS;
|
||||
encoderPosition = 0;
|
||||
#ifdef DELTA
|
||||
calculate_delta(current_position);
|
||||
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
|
||||
#else
|
||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], homing_feedrate[Z_AXIS]/60, active_extruder);
|
||||
#endif
|
||||
lcdDrawUpdate = 1;
|
||||
}
|
||||
if (lcdDrawUpdate)
|
||||
|
@ -442,7 +457,12 @@ static void lcd_move_e()
|
|||
{
|
||||
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
|
||||
encoderPosition = 0;
|
||||
#ifdef DELTA
|
||||
calculate_delta(current_position);
|
||||
plan_buffer_line(delta[X_AXIS], delta[Y_AXIS], delta[Z_AXIS], current_position[E_AXIS], 20, active_extruder);
|
||||
#else
|
||||
plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS], 20, active_extruder);
|
||||
#endif
|
||||
lcdDrawUpdate = 1;
|
||||
}
|
||||
if (lcdDrawUpdate)
|
||||
|
|
Loading…
Reference in a new issue