Browse Source

Fixed move from panel for delta bot #557

pull/1/head
Nicolas Rossi 11 years ago
parent
commit
55c287a69e
  1. 1
      Marlin/Marlin.h
  2. 7
      Marlin/Marlin_main.cpp
  3. 20
      Marlin/ultralcd.cpp

1
Marlin/Marlin.h

@ -163,6 +163,7 @@ void ClearToSend();
void get_coordinates(); void get_coordinates();
#ifdef DELTA #ifdef DELTA
void calculate_delta(float cartesian[3]); void calculate_delta(float cartesian[3]);
extern float delta[3];
#endif #endif
void prepare_move(); void prepare_move();
void kill(); void kill();

7
Marlin/Marlin_main.cpp

@ -198,14 +198,15 @@ int EtoPPressure=0;
bool powersupply = true; bool powersupply = true;
#endif #endif
#ifdef DELTA
float delta[3] = {0.0, 0.0, 0.0};
#endif
//=========================================================================== //===========================================================================
//=============================private variables============================= //=============================private variables=============================
//=========================================================================== //===========================================================================
const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'}; const char axis_codes[NUM_AXIS] = {'X', 'Y', 'Z', 'E'};
static float destination[NUM_AXIS] = { 0.0, 0.0, 0.0, 0.0}; 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 float offset[3] = {0.0, 0.0, 0.0};
static bool home_all_axis = true; static bool home_all_axis = true;
static float feedrate = 1500.0, next_feedrate, saved_feedrate; static float feedrate = 1500.0, next_feedrate, saved_feedrate;

20
Marlin/ultralcd.cpp

@ -374,7 +374,12 @@ static void lcd_move_x()
if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS) if (max_software_endstops && current_position[X_AXIS] > X_MAX_POS)
current_position[X_AXIS] = X_MAX_POS; current_position[X_AXIS] = X_MAX_POS;
encoderPosition = 0; 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); 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; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) if (lcdDrawUpdate)
@ -398,7 +403,12 @@ static void lcd_move_y()
if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS) if (max_software_endstops && current_position[Y_AXIS] > Y_MAX_POS)
current_position[Y_AXIS] = Y_MAX_POS; current_position[Y_AXIS] = Y_MAX_POS;
encoderPosition = 0; 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); 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; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) if (lcdDrawUpdate)
@ -422,7 +432,12 @@ static void lcd_move_z()
if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS) if (max_software_endstops && current_position[Z_AXIS] > Z_MAX_POS)
current_position[Z_AXIS] = Z_MAX_POS; current_position[Z_AXIS] = Z_MAX_POS;
encoderPosition = 0; 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); 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; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) if (lcdDrawUpdate)
@ -442,7 +457,12 @@ static void lcd_move_e()
{ {
current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale; current_position[E_AXIS] += float((int)encoderPosition) * move_menu_scale;
encoderPosition = 0; 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); 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; lcdDrawUpdate = 1;
} }
if (lcdDrawUpdate) if (lcdDrawUpdate)

Loading…
Cancel
Save