Browse Source

`acceleration_st` => `acceleration_steps_per_s2`

Scott Lahteine 9 years ago
parent
commit
3b08eb1eeb
2 changed files with 8 additions and 8 deletions
  1. 7
    7
      Marlin/planner.cpp
  2. 1
    1
      Marlin/planner.h

+ 7
- 7
Marlin/planner.cpp View File

@@ -155,7 +155,7 @@ void Planner::calculate_trapezoid_for_block(block_t* block, float entry_factor,
155 155
   NOLESS(initial_rate, 120);
156 156
   NOLESS(final_rate, 120);
157 157
 
158
-  long accel = block->acceleration_st;
158
+  long accel = block->acceleration_steps_per_s2;
159 159
   int32_t accelerate_steps = ceil(estimate_acceleration_distance(initial_rate, block->nominal_rate, accel));
160 160
   int32_t decelerate_steps = floor(estimate_acceleration_distance(block->nominal_rate, final_rate, -accel));
161 161
 
@@ -936,27 +936,27 @@ void Planner::check_axes_activity() {
936 936
   float steps_per_mm = block->step_event_count / block->millimeters;
937 937
   long bsx = block->steps[X_AXIS], bsy = block->steps[Y_AXIS], bsz = block->steps[Z_AXIS], bse = block->steps[E_AXIS];
938 938
   if (bsx == 0 && bsy == 0 && bsz == 0) {
939
-    block->acceleration_st = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
939
+    block->acceleration_steps_per_s2 = ceil(retract_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
940 940
   }
941 941
   else if (bse == 0) {
942
-    block->acceleration_st = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
942
+    block->acceleration_steps_per_s2 = ceil(travel_acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
943 943
   }
944 944
   else {
945
-    block->acceleration_st = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
945
+    block->acceleration_steps_per_s2 = ceil(acceleration * steps_per_mm); // convert to: acceleration steps/sec^2
946 946
   }
947 947
   // Limit acceleration per axis
948
-  unsigned long acc_st = block->acceleration_st,
949 948
                 xsteps = max_acceleration_steps_per_s2[X_AXIS],
950 949
                 ysteps = max_acceleration_steps_per_s2[Y_AXIS],
951 950
                 zsteps = max_acceleration_steps_per_s2[Z_AXIS],
952 951
                 esteps = max_acceleration_steps_per_s2[E_AXIS],
952
+  unsigned long acc_st = block->acceleration_steps_per_s2,
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;
956 956
   if (zsteps < (acc_st * bsz) / allsteps) acc_st = (zsteps * allsteps) / bsz;
957 957
   if (esteps < (acc_st * bse) / allsteps) acc_st = (esteps * allsteps) / bse;
958 958
 
959
-  block->acceleration_st = acc_st;
959
+  block->acceleration_steps_per_s2 = acc_st;
960 960
   block->acceleration = acc_st / steps_per_mm;
961 961
   block->acceleration_rate = (long)(acc_st * 16777216.0 / (F_CPU / 8.0));
962 962
 
@@ -1057,7 +1057,7 @@ void Planner::check_axes_activity() {
1057 1057
       block->advance = 0;
1058 1058
     }
1059 1059
     else {
1060
-      long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_st);
1060
+      long acc_dist = estimate_acceleration_distance(0, block->nominal_rate, block->acceleration_steps_per_s2);
1061 1061
       float advance = ((STEPS_PER_CUBIC_MM_E) * (EXTRUDER_ADVANCE_K)) * (cse * cse * (EXTRUSION_AREA) * (EXTRUSION_AREA)) * 256;
1062 1062
       block->advance = advance;
1063 1063
       block->advance_rate = acc_dist ? advance / (float)acc_dist : 0;

+ 1
- 1
Marlin/planner.h View File

@@ -84,7 +84,7 @@ typedef struct {
84 84
   unsigned long nominal_rate;                        // The nominal step rate for this block in step_events/sec
85 85
   unsigned long initial_rate;                        // The jerk-adjusted step rate at start of block
86 86
   unsigned long final_rate;                          // The minimal rate at exit
87
-  unsigned long acceleration_st;                     // acceleration steps/sec^2
87
+  unsigned long acceleration_steps_per_s2;           // acceleration steps/sec^2
88 88
 
89 89
   #if FAN_COUNT > 0
90 90
     unsigned long fan_speed[FAN_COUNT];

Loading…
Cancel
Save