Pārlūkot izejas kodu

Add Travel Acceleration and change the M204 options

Added option to set Travel Acceleration (non printing moves).
The M204 options was a non sense (S for printing moves and T for retract
moves).

It has been changed to:
P = Printing moves
R = Retract only (no X, Y, Z) moves
T = Travel (non
printing) moves

I will add this info o G-Code wiki in reprap.org. I also advise to put
this info in Marlin next version changelog.
alexborro 9 gadus atpakaļ
vecāks
revīzija
9157cbd8f3

+ 3
- 2
Marlin/Configuration.h Parādīt failu

@@ -484,8 +484,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
484 484
 #define DEFAULT_MAX_FEEDRATE          {300, 300, 5, 25}    // (mm/sec)
485 485
 #define DEFAULT_MAX_ACCELERATION      {3000,3000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
486 486
 
487
-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
488
-#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
487
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
488
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
489
+#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
489 490
 
490 491
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
491 492
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 10
- 5
Marlin/ConfigurationStore.cpp Parādīt failu

@@ -3,7 +3,7 @@
3 3
  *
4 4
  * Configuration and EEPROM storage
5 5
  *
6
- * V15 EEPROM Layout:
6
+ * V16 EEPROM Layout:
7 7
  *
8 8
  *  ver
9 9
  *  axis_steps_per_unit (x4)
@@ -11,6 +11,7 @@
11 11
  *  max_acceleration_units_per_sq_second (x4)
12 12
  *  acceleration
13 13
  *  retract_acceleration
14
+ *  travel_aceeleration
14 15
  *  minimumfeedrate
15 16
  *  mintravelfeedrate
16 17
  *  minsegmenttime
@@ -104,7 +105,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size) {
104 105
 // wrong data being written to the variables.
105 106
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
106 107
 
107
-#define EEPROM_VERSION "V15"
108
+#define EEPROM_VERSION "V16"
108 109
 
109 110
 #ifdef EEPROM_SETTINGS
110 111
 
@@ -118,6 +119,7 @@ void Config_StoreSettings()  {
118 119
   EEPROM_WRITE_VAR(i, max_acceleration_units_per_sq_second);
119 120
   EEPROM_WRITE_VAR(i, acceleration);
120 121
   EEPROM_WRITE_VAR(i, retract_acceleration);
122
+  EEPROM_WRITE_VAR(i, travel_acceleration);
121 123
   EEPROM_WRITE_VAR(i, minimumfeedrate);
122 124
   EEPROM_WRITE_VAR(i, mintravelfeedrate);
123 125
   EEPROM_WRITE_VAR(i, minsegmenttime);
@@ -253,6 +255,7 @@ void Config_RetrieveSettings() {
253 255
 
254 256
     EEPROM_READ_VAR(i, acceleration);
255 257
     EEPROM_READ_VAR(i, retract_acceleration);
258
+    EEPROM_READ_VAR(i, travel_acceleration);
256 259
     EEPROM_READ_VAR(i, minimumfeedrate);
257 260
     EEPROM_READ_VAR(i, mintravelfeedrate);
258 261
     EEPROM_READ_VAR(i, minsegmenttime);
@@ -380,6 +383,7 @@ void Config_ResetDefault() {
380 383
 
381 384
   acceleration = DEFAULT_ACCELERATION;
382 385
   retract_acceleration = DEFAULT_RETRACT_ACCELERATION;
386
+  travel_acceleration = DEFAULT_TRAVEL_ACCELERATION;
383 387
   minimumfeedrate = DEFAULT_MINIMUMFEEDRATE;
384 388
   minsegmenttime = DEFAULT_MINSEGMENTTIME;
385 389
   mintravelfeedrate = DEFAULT_MINTRAVELFEEDRATE;
@@ -516,11 +520,12 @@ void Config_PrintSettings(bool forReplay) {
516 520
   SERIAL_EOL;
517 521
   SERIAL_ECHO_START;
518 522
   if (!forReplay) {
519
-    SERIAL_ECHOLNPGM("Acceleration: S=acceleration, T=retract acceleration");
523
+    SERIAL_ECHOLNPGM("Accelerations: P=printing, R=retract and T=travel");
520 524
     SERIAL_ECHO_START;
521 525
   }
522
-  SERIAL_ECHOPAIR("  M204 S", acceleration );
523
-  SERIAL_ECHOPAIR(" T", retract_acceleration);
526
+  SERIAL_ECHOPAIR("  M204 P", acceleration );
527
+  SERIAL_ECHOPAIR(" R", retract_acceleration);
528
+  SERIAL_ECHOPAIR(" T", travel_acceleration);
524 529
   SERIAL_EOL;
525 530
 
526 531
   SERIAL_ECHO_START;

+ 23
- 5
Marlin/Marlin_main.cpp Parādīt failu

@@ -3263,16 +3263,34 @@ inline void gcode_M203() {
3263 3263
 }
3264 3264
 
3265 3265
 /**
3266
- * M204: Set Default Acceleration and/or Default Filament Acceleration in mm/sec^2 (M204 S3000 T7000)
3266
+ * M204: Set Accelerations in mm/sec^2 (M204 P1200 R3000 T3000)
3267 3267
  *
3268
- *    S = normal moves
3269
- *    T = filament only moves
3268
+ *    P = Printing moves
3269
+ *    R = Retract only (no X, Y, Z) moves
3270
+ *    T = Travel (non printing) moves
3270 3271
  *
3271 3272
  *  Also sets minimum segment time in ms (B20000) to prevent buffer under-runs and M20 minimum feedrate
3272 3273
  */
3273 3274
 inline void gcode_M204() {
3274
-  if (code_seen('S')) acceleration = code_value();
3275
-  if (code_seen('T')) retract_acceleration = code_value();
3275
+  if (code_seen('P'))
3276
+  {
3277
+    acceleration = code_value();
3278
+    SERIAL_ECHOPAIR("Setting Printing Acceleration: ", acceleration );
3279
+    SERIAL_EOL;
3280
+  }
3281
+  if (code_seen('R'))
3282
+  {
3283
+    retract_acceleration = code_value();
3284
+    SERIAL_ECHOPAIR("Setting Retract Acceleration: ", retract_acceleration );
3285
+    SERIAL_EOL;
3286
+  }
3287
+  if (code_seen('T'))
3288
+  {
3289
+    travel_acceleration = code_value();
3290
+    SERIAL_ECHOPAIR("Setting Travel Acceleration: ", travel_acceleration );
3291
+    SERIAL_EOL;
3292
+  }
3293
+  
3276 3294
 }
3277 3295
 
3278 3296
 /**

+ 5
- 2
Marlin/example_configurations/Hephestos/Configuration.h Parādīt failu

@@ -500,8 +500,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
500 500
 #define DEFAULT_MAX_FEEDRATE          {250, 250, 3.3, 25}    // (mm/sec)
501 501
 #define DEFAULT_MAX_ACCELERATION      {3000,3000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
502 502
 
503
-#define DEFAULT_ACCELERATION          1000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
504
-#define DEFAULT_RETRACT_ACCELERATION  1000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
503
+#define DEFAULT_ACCELERATION          1000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
504
+#define DEFAULT_RETRACT_ACCELERATION  1000   // E acceleration in mm/s^2 for retracts
505
+#define DEFAULT_TRAVEL_ACCELERATION   1000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
506
+
507
+
505 508
 
506 509
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
507 510
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 4
- 2
Marlin/example_configurations/K8200/Configuration.h Parādīt failu

@@ -505,8 +505,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
505 505
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 500}    // (mm/sec)
506 506
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
507 507
 
508
-#define DEFAULT_ACCELERATION          1000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
509
-#define DEFAULT_RETRACT_ACCELERATION  1000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
508
+#define DEFAULT_ACCELERATION          1000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
509
+#define DEFAULT_RETRACT_ACCELERATION  1000   // E acceleration in mm/s^2 for retracts
510
+#define DEFAULT_TRAVEL_ACCELERATION   1000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
511
+
510 512
 
511 513
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
512 514
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 5
- 2
Marlin/example_configurations/SCARA/Configuration.h Parādīt failu

@@ -530,8 +530,11 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
530 530
 #define DEFAULT_MAX_FEEDRATE          {300, 300, 30, 25}    // (mm/sec)
531 531
 #define DEFAULT_MAX_ACCELERATION      {300,300,20,1000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
532 532
 
533
-#define DEFAULT_ACCELERATION          400    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
534
-#define DEFAULT_RETRACT_ACCELERATION  2000  // X, Y, Z and E max acceleration in mm/s^2 for retracts
533
+#define DEFAULT_ACCELERATION          400    // X, Y, Z and E acceleration in mm/s^2 for printing moves
534
+#define DEFAULT_RETRACT_ACCELERATION  2000   // E acceleration in mm/s^2 for retracts
535
+#define DEFAULT_TRAVEL_ACCELERATION   400    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
536
+
537
+
535 538
 
536 539
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
537 540
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 3
- 2
Marlin/example_configurations/WITBOX/Configuration.h Parādīt failu

@@ -499,8 +499,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
499 499
 #define DEFAULT_MAX_FEEDRATE          {350, 350, 7.2, 80}    // (mm/sec)
500 500
 #define DEFAULT_MAX_ACCELERATION      {1000,1000,10,1000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
501 501
 
502
-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
503
-#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
502
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
503
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
504
+#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
504 505
 
505 506
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
506 507
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 4
- 2
Marlin/example_configurations/delta/Configuration.h Parādīt failu

@@ -440,8 +440,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
440 440
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 500, 25}    // (mm/sec)
441 441
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,9000,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
442 442
 
443
-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
444
-#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
443
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
444
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
445
+#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
446
+
445 447
 
446 448
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
447 449
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 3
- 2
Marlin/example_configurations/makibox/Configuration.h Parādīt failu

@@ -497,8 +497,9 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
497 497
 #define DEFAULT_MAX_FEEDRATE          {60, 60, 20, 45}         // (mm/sec)    
498 498
 #define DEFAULT_MAX_ACCELERATION      {2000,2000,30,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for skeinforge 40+, for older versions raise them a lot.
499 499
 
500
-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
501
-#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
500
+#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
501
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
502
+#define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
502 503
 
503 504
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
504 505
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 4
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration.h Parādīt failu

@@ -503,8 +503,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of
503 503
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
504 504
 
505 505
 /* MICHEL: This has an impact on the "ripples" in print walls */
506
-#define DEFAULT_ACCELERATION          500    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
507
-#define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts
506
+#define DEFAULT_ACCELERATION          500    // X, Y, Z and E acceleration in mm/s^2 for printing moves
507
+#define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
508
+#define DEFAULT_TRAVEL_ACCELERATION   500    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves
509
+
508 510
 
509 511
 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
510 512
 // The offset has to be X=0, Y=0 for the extruder 0 hotend (default extruder).

+ 3
- 0
Marlin/language_en.h Parādīt failu

@@ -233,6 +233,9 @@
233 233
 #ifndef MSG_A_RETRACT
234 234
 #define MSG_A_RETRACT                       "A-retract"
235 235
 #endif
236
+#ifndef MSG_A_TRAVEL
237
+#define MSG_A_TRAVEL                        "A-travel"
238
+#endif
236 239
 #ifndef MSG_XSTEPS
237 240
 #define MSG_XSTEPS                          "Xsteps/mm"
238 241
 #endif

+ 6
- 1
Marlin/planner.cpp Parādīt failu

@@ -67,8 +67,9 @@ float max_feedrate[NUM_AXIS]; // set the max speeds
67 67
 float axis_steps_per_unit[NUM_AXIS];
68 68
 unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
69 69
 float minimumfeedrate;
70
-float acceleration;         // Normal acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
70
+float acceleration;         // Normal acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all printing moves. M204 SXXXX
71 71
 float retract_acceleration; //  mm/s^2   filament pull-pack and push-forward  while standing still in the other axis M204 TXXXX
72
+float travel_acceleration;  // Travel acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
72 73
 float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
73 74
 float max_z_jerk;
74 75
 float max_e_jerk;
@@ -907,6 +908,10 @@ Having the real displacement of the head, we can calculate the total movement le
907 908
   {
908 909
     block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
909 910
   }
911
+  else if(block->steps_e == 0)
912
+  {
913
+    block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
914
+  }
910 915
   else
911 916
   {
912 917
     block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2

+ 1
- 0
Marlin/planner.h Parādīt failu

@@ -112,6 +112,7 @@ extern unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201
112 112
 extern float minimumfeedrate;
113 113
 extern float acceleration;         // Normal acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all moves. M204 SXXXX
114 114
 extern float retract_acceleration; //  mm/s^2   filament pull-pack and push-forward  while standing still in the other axis M204 TXXXX
115
+extern float travel_acceleration;  // Travel acceleration mm/s^2  THIS IS THE DEFAULT ACCELERATION for all NON printing moves. M204 MXXXX
115 116
 extern float max_xy_jerk; //speed than can be stopped at once, if i understand correctly.
116 117
 extern float max_z_jerk;
117 118
 extern float max_e_jerk;

+ 1
- 0
Marlin/ultralcd.cpp Parādīt failu

@@ -903,6 +903,7 @@ static void lcd_control_motion_menu() {
903 903
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 100, 99000, reset_acceleration_rates);
904 904
   MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, reset_acceleration_rates);
905 905
   MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &retract_acceleration, 100, 99000);
906
+  MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &travel_acceleration, 100, 99000);
906 907
   MENU_ITEM_EDIT(float52, MSG_XSTEPS, &axis_steps_per_unit[X_AXIS], 5, 9999);
907 908
   MENU_ITEM_EDIT(float52, MSG_YSTEPS, &axis_steps_per_unit[Y_AXIS], 5, 9999);
908 909
   MENU_ITEM_EDIT(float51, MSG_ZSTEPS, &axis_steps_per_unit[Z_AXIS], 5, 9999);

Notiek ielāde…
Atcelt
Saglabāt