Browse Source

Rename some planner acceleration vars

- `per_sq_second` => `per_s2`
- `per_sqr_second` => `per_s2`
- `axis_steps_per_sqr_second` => `max_acceleration_steps_per_s2`
Scott Lahteine 8 years ago
parent
commit
cb4704e07a
5 changed files with 23 additions and 23 deletions
  1. 2
    2
      Marlin/Marlin_main.cpp
  2. 8
    8
      Marlin/configuration_store.cpp
  3. 7
    7
      Marlin/planner.cpp
  4. 2
    2
      Marlin/planner.h
  5. 4
    4
      Marlin/ultralcd.cpp

+ 2
- 2
Marlin/Marlin_main.cpp View File

@@ -5150,7 +5150,7 @@ inline void gcode_M92() {
5150 5150
           float factor = planner.axis_steps_per_unit[i] / value; // increase e constants if M92 E14 is given for netfab.
5151 5151
           planner.max_e_jerk *= factor;
5152 5152
           planner.max_feedrate[i] *= factor;
5153
-          planner.axis_steps_per_sqr_second[i] *= factor;
5153
+          planner.max_acceleration_steps_per_s2[i] *= factor;
5154 5154
         }
5155 5155
         planner.axis_steps_per_unit[i] = value;
5156 5156
       }
@@ -5337,7 +5337,7 @@ inline void gcode_M200() {
5337 5337
 inline void gcode_M201() {
5338 5338
   for (int8_t i = 0; i < NUM_AXIS; i++) {
5339 5339
     if (code_seen(axis_codes[i])) {
5340
-      planner.max_acceleration_units_per_sq_second[i] = code_value_axis_units(i);
5340
+      planner.max_acceleration_mm_per_s2[i] = code_value_axis_units(i);
5341 5341
     }
5342 5342
   }
5343 5343
   // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)

+ 8
- 8
Marlin/configuration_store.cpp View File

@@ -45,7 +45,7 @@
45 45
  *
46 46
  *  104  M92 XYZE  planner.axis_steps_per_unit (float x4)
47 47
  *  120  M203 XYZE planner.max_feedrate (float x4)
48
- *  136  M201 XYZE planner.max_acceleration_units_per_sq_second (uint32_t x4)
48
+ *  136  M201 XYZE planner.max_acceleration_mm_per_s2 (uint32_t x4)
49 49
  *  152  M204 P    planner.acceleration (float)
50 50
  *  156  M204 R    planner.retract_acceleration (float)
51 51
  *  160  M204 T    planner.travel_acceleration (float)
@@ -175,7 +175,7 @@ void Config_StoreSettings()  {
175 175
   EEPROM_WRITE_VAR(i, ver); // invalidate data first
176 176
   EEPROM_WRITE_VAR(i, planner.axis_steps_per_unit);
177 177
   EEPROM_WRITE_VAR(i, planner.max_feedrate);
178
-  EEPROM_WRITE_VAR(i, planner.max_acceleration_units_per_sq_second);
178
+  EEPROM_WRITE_VAR(i, planner.max_acceleration_mm_per_s2);
179 179
   EEPROM_WRITE_VAR(i, planner.acceleration);
180 180
   EEPROM_WRITE_VAR(i, planner.retract_acceleration);
181 181
   EEPROM_WRITE_VAR(i, planner.travel_acceleration);
@@ -355,7 +355,7 @@ void Config_RetrieveSettings() {
355 355
     // version number match
356 356
     EEPROM_READ_VAR(i, planner.axis_steps_per_unit);
357 357
     EEPROM_READ_VAR(i, planner.max_feedrate);
358
-    EEPROM_READ_VAR(i, planner.max_acceleration_units_per_sq_second);
358
+    EEPROM_READ_VAR(i, planner.max_acceleration_mm_per_s2);
359 359
 
360 360
     // steps per sq second need to be updated to agree with the units per sq second (as they are what is used in the planner)
361 361
     planner.reset_acceleration_rates();
@@ -529,7 +529,7 @@ void Config_ResetDefault() {
529 529
   for (uint8_t i = 0; i < NUM_AXIS; i++) {
530 530
     planner.axis_steps_per_unit[i] = tmp1[i];
531 531
     planner.max_feedrate[i] = tmp2[i];
532
-    planner.max_acceleration_units_per_sq_second[i] = tmp3[i];
532
+    planner.max_acceleration_mm_per_s2[i] = tmp3[i];
533 533
     #if ENABLED(SCARA)
534 534
       if (i < COUNT(axis_scaling))
535 535
         axis_scaling[i] = 1;
@@ -687,10 +687,10 @@ void Config_PrintSettings(bool forReplay) {
687 687
     SERIAL_ECHOLNPGM("Maximum Acceleration (mm/s2):");
688 688
     CONFIG_ECHO_START;
689 689
   }
690
-  SERIAL_ECHOPAIR("  M201 X", planner.max_acceleration_units_per_sq_second[X_AXIS]);
691
-  SERIAL_ECHOPAIR(" Y", planner.max_acceleration_units_per_sq_second[Y_AXIS]);
692
-  SERIAL_ECHOPAIR(" Z", planner.max_acceleration_units_per_sq_second[Z_AXIS]);
693
-  SERIAL_ECHOPAIR(" E", planner.max_acceleration_units_per_sq_second[E_AXIS]);
690
+  SERIAL_ECHOPAIR("  M201 X", planner.max_acceleration_mm_per_s2[X_AXIS]);
691
+  SERIAL_ECHOPAIR(" Y", planner.max_acceleration_mm_per_s2[Y_AXIS]);
692
+  SERIAL_ECHOPAIR(" Z", planner.max_acceleration_mm_per_s2[Z_AXIS]);
693
+  SERIAL_ECHOPAIR(" E", planner.max_acceleration_mm_per_s2[E_AXIS]);
694 694
   SERIAL_EOL;
695 695
   CONFIG_ECHO_START;
696 696
   if (!forReplay) {

+ 7
- 7
Marlin/planner.cpp View File

@@ -82,8 +82,8 @@ volatile uint8_t Planner::block_buffer_tail = 0;
82 82
 
83 83
 float Planner::max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
84 84
 float Planner::axis_steps_per_unit[NUM_AXIS];
85
-unsigned long Planner::axis_steps_per_sqr_second[NUM_AXIS];
86
-unsigned long Planner::max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
85
+unsigned long Planner::max_acceleration_steps_per_s2[NUM_AXIS];
86
+unsigned long Planner::max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
87 87
 
88 88
 millis_t Planner::min_segment_time;
89 89
 float Planner::min_feedrate;
@@ -946,10 +946,10 @@ void Planner::check_axes_activity() {
946 946
   }
947 947
   // Limit acceleration per axis
948 948
   unsigned long acc_st = block->acceleration_st,
949
-                xsteps = axis_steps_per_sqr_second[X_AXIS],
950
-                ysteps = axis_steps_per_sqr_second[Y_AXIS],
951
-                zsteps = axis_steps_per_sqr_second[Z_AXIS],
952
-                esteps = axis_steps_per_sqr_second[E_AXIS],
949
+                xsteps = max_acceleration_steps_per_s2[X_AXIS],
950
+                ysteps = max_acceleration_steps_per_s2[Y_AXIS],
951
+                zsteps = max_acceleration_steps_per_s2[Z_AXIS],
952
+                esteps = max_acceleration_steps_per_s2[E_AXIS],
953 953
                 allsteps = block->step_event_count;
954 954
   if (xsteps < (acc_st * bsx) / allsteps) acc_st = (xsteps * allsteps) / bsx;
955 955
   if (ysteps < (acc_st * bsy) / allsteps) acc_st = (ysteps * allsteps) / bsy;
@@ -1148,7 +1148,7 @@ void Planner::set_e_position_mm(const float& e) {
1148 1148
 // Recalculate the steps/s^2 acceleration rates, based on the mm/s^2
1149 1149
 void Planner::reset_acceleration_rates() {
1150 1150
   for (int i = 0; i < NUM_AXIS; i++)
1151
-    axis_steps_per_sqr_second[i] = max_acceleration_units_per_sq_second[i] * axis_steps_per_unit[i];
1151
+    max_acceleration_steps_per_s2[i] = max_acceleration_mm_per_s2[i] * axis_steps_per_unit[i];
1152 1152
 }
1153 1153
 
1154 1154
 #if ENABLED(AUTOTEMP)

+ 2
- 2
Marlin/planner.h View File

@@ -114,8 +114,8 @@ class Planner {
114 114
 
115 115
     static float max_feedrate[NUM_AXIS]; // Max speeds in mm per minute
116 116
     static float axis_steps_per_unit[NUM_AXIS];
117
-    static unsigned long axis_steps_per_sqr_second[NUM_AXIS];
118
-    static unsigned long max_acceleration_units_per_sq_second[NUM_AXIS]; // Use M201 to override by software
117
+    static unsigned long max_acceleration_steps_per_s2[NUM_AXIS];
118
+    static unsigned long max_acceleration_mm_per_s2[NUM_AXIS]; // Use M201 to override by software
119 119
 
120 120
     static millis_t min_segment_time;
121 121
     static float min_feedrate;

+ 4
- 4
Marlin/ultralcd.cpp View File

@@ -1686,10 +1686,10 @@ static void lcd_control_motion_menu() {
1686 1686
   MENU_ITEM_EDIT(float3, MSG_VMAX MSG_E, &planner.max_feedrate[E_AXIS], 1, 999);
1687 1687
   MENU_ITEM_EDIT(float3, MSG_VMIN, &planner.min_feedrate, 0, 999);
1688 1688
   MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &planner.min_travel_feedrate, 0, 999);
1689
-  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, _reset_acceleration_rates);
1690
-  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, _reset_acceleration_rates);
1691
-  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, _reset_acceleration_rates);
1692
-  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, _reset_acceleration_rates);
1689
+  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &planner.max_acceleration_mm_per_s2[X_AXIS], 100, 99000, _reset_acceleration_rates);
1690
+  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &planner.max_acceleration_mm_per_s2[Y_AXIS], 100, 99000, _reset_acceleration_rates);
1691
+  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &planner.max_acceleration_mm_per_s2[Z_AXIS], 10, 99000, _reset_acceleration_rates);
1692
+  MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &planner.max_acceleration_mm_per_s2[E_AXIS], 100, 99000, _reset_acceleration_rates);
1693 1693
   MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &planner.retract_acceleration, 100, 99000);
1694 1694
   MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &planner.travel_acceleration, 100, 99000);
1695 1695
   MENU_ITEM_EDIT(float52, MSG_XSTEPS, &planner.axis_steps_per_unit[X_AXIS], 5, 9999);

Loading…
Cancel
Save