Browse Source

Merge pull request #5971 from thinkyhead/rc_fix_e_factors

Patch DISTINCT_E_FACTORS bug
Scott Lahteine 7 years ago
parent
commit
c15c65f18a
3 changed files with 13 additions and 4 deletions
  1. 1
    1
      Marlin/Conditionals_post.h
  2. 11
    2
      Marlin/planner.cpp
  3. 1
    1
      Marlin/stepper.cpp

+ 1
- 1
Marlin/Conditionals_post.h View File

@@ -184,7 +184,7 @@
184 184
    */
185 185
   #if ENABLED(ADVANCE)
186 186
     #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
187
-    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS] / (EXTRUSION_AREA))
187
+    #define STEPS_PER_CUBIC_MM_E (axis_steps_per_mm[E_AXIS_N] / (EXTRUSION_AREA))
188 188
   #endif
189 189
 
190 190
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)

+ 11
- 2
Marlin/planner.cpp View File

@@ -1062,6 +1062,9 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1062 1062
   float current_speed[NUM_AXIS], speed_factor = 1.0; // factor <1 decreases speed
1063 1063
   LOOP_XYZE(i) {
1064 1064
     const float cs = fabs(current_speed[i] = delta_mm[i] * inverse_mm_s);
1065
+    #if ENABLED(DISTINCT_E_FACTORS)
1066
+      if (i == E_AXIS) i += extruder;
1067
+    #endif
1065 1068
     if (cs > max_feedrate_mm_s[i]) NOMORE(speed_factor, max_feedrate_mm_s[i] / cs);
1066 1069
   }
1067 1070
 
@@ -1135,18 +1138,24 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
1135 1138
     // Start with print or travel acceleration
1136 1139
     accel = ceil((esteps ? acceleration : travel_acceleration) * steps_per_mm);
1137 1140
 
1141
+    #if ENABLED(DISTINCT_E_FACTORS)
1142
+      #define ACCEL_IDX extruder
1143
+    #else
1144
+      #define ACCEL_IDX 0
1145
+    #endif
1146
+
1138 1147
     // Limit acceleration per axis
1139 1148
     if (block->step_event_count <= cutoff_long) {
1140 1149
       LIMIT_ACCEL_LONG(X_AXIS,0);
1141 1150
       LIMIT_ACCEL_LONG(Y_AXIS,0);
1142 1151
       LIMIT_ACCEL_LONG(Z_AXIS,0);
1143
-      LIMIT_ACCEL_LONG(E_AXIS,extruder);
1152
+      LIMIT_ACCEL_LONG(E_AXIS,ACCEL_IDX);
1144 1153
     }
1145 1154
     else {
1146 1155
       LIMIT_ACCEL_FLOAT(X_AXIS,0);
1147 1156
       LIMIT_ACCEL_FLOAT(Y_AXIS,0);
1148 1157
       LIMIT_ACCEL_FLOAT(Z_AXIS,0);
1149
-      LIMIT_ACCEL_FLOAT(E_AXIS,extruder);
1158
+      LIMIT_ACCEL_FLOAT(E_AXIS,ACCEL_IDX);
1150 1159
     }
1151 1160
   }
1152 1161
   block->acceleration_steps_per_s2 = accel;

+ 1
- 1
Marlin/stepper.cpp View File

@@ -147,7 +147,7 @@ volatile long Stepper::endstops_trigsteps[XYZ];
147 147
       X2_STEP_WRITE(v); \
148 148
     } \
149 149
     else { \
150
-      if (current_block->active_extruder != 0) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \
150
+      if (current_block->active_extruder) X2_STEP_WRITE(v); else X_STEP_WRITE(v); \
151 151
     }
152 152
 #else
153 153
   #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)

Loading…
Cancel
Save