Browse Source

Merge pull request #3751 from AnHardt/fix-arcs

Idle during long arcs
pull/1/head
Scott Lahteine 9 years ago
parent
commit
6903eb1c5b
  1. 1
      Marlin/Configuration_adv.h
  2. 16
      Marlin/Marlin_main.cpp
  3. 1
      Marlin/example_configurations/Felix/Configuration_adv.h
  4. 1
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  5. 1
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  6. 1
      Marlin/example_configurations/K8200/Configuration_adv.h
  7. 1
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  8. 1
      Marlin/example_configurations/SCARA/Configuration_adv.h
  9. 1
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  10. 1
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  11. 1
      Marlin/example_configurations/delta/biv2.5/Configuration_adv.h
  12. 1
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  13. 1
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  14. 1
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  15. 1
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  16. 1
      Marlin/example_configurations/makibox/Configuration_adv.h
  17. 1
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

1
Marlin/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

16
Marlin/Marlin_main.cpp

@ -506,7 +506,9 @@ void stop();
void get_available_commands();
void process_next_command();
#if ENABLED(ARC_SUPPORT)
void plan_arc(float target[NUM_AXIS], float* offset, uint8_t clockwise);
#endif
void serial_echopair_P(const char* s_P, int v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
void serial_echopair_P(const char* s_P, long v) { serialprintPGM(s_P); SERIAL_ECHO(v); }
@ -2461,6 +2463,7 @@ inline void gcode_G0_G1() {
* G2: Clockwise Arc
* G3: Counterclockwise Arc
*/
#if ENABLED(ARC_SUPPORT)
inline void gcode_G2_G3(bool clockwise) {
if (IsRunning()) {
@ -2487,6 +2490,7 @@ inline void gcode_G2_G3(bool clockwise) {
refresh_cmd_timeout();
}
}
#endif
/**
* G4: Dwell S<seconds> or P<milliseconds>
@ -6484,7 +6488,7 @@ void process_next_command() {
break;
// G2, G3
#if DISABLED(SCARA)
#if ENABLED(ARC_SUPPORT) && DISABLED(SCARA)
case 2: // G2 - CW ARC
case 3: // G3 - CCW ARC
gcode_G2_G3(codenum == 2);
@ -7423,6 +7427,7 @@ void prepare_move() {
set_current_to_destination();
}
#if ENABLED(ARC_SUPPORT)
/**
* Plan an arc in 2 dimensions
*
@ -7509,8 +7514,16 @@ void plan_arc(
float feed_rate = feedrate * feedrate_multiplier / 60 / 100.0;
millis_t previous_ms = millis();
for (i = 1; i < segments; i++) { // Iterate (segments-1) times
millis_t now = millis();
if (now - previous_ms > 200UL) {
previous_ms = now;
idle();
}
if (++count < N_ARC_CORRECTION) {
// Apply vector rotation matrix to previous r_X / 1
r_new_Y = r_X * sin_T + r_Y * cos_T;
@ -7564,6 +7577,7 @@ void plan_arc(
// in any intermediate location.
set_current_to_destination();
}
#endif
#if HAS_CONTROLLERFAN

1
Marlin/example_configurations/Felix/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/Hephestos/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/Hephestos_2/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/K8200/Configuration_adv.h

@ -461,6 +461,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/RigidBot/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/SCARA/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/TAZ4/Configuration_adv.h

@ -463,6 +463,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/WITBOX/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h

@ -457,6 +457,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/delta/generic/Configuration_adv.h

@ -457,6 +457,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h

@ -456,6 +456,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h

@ -461,6 +461,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h

@ -457,6 +457,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/makibox/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

1
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h

@ -455,6 +455,7 @@
// @section extras
// Arc interpretation settings:
#define ARC_SUPPORT // Disabling this saves ~2660bytes
#define MM_PER_ARC_SEGMENT 1
#define N_ARC_CORRECTION 25

Loading…
Cancel
Save