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
    */
184
    */
185
   #if ENABLED(ADVANCE)
185
   #if ENABLED(ADVANCE)
186
     #define EXTRUSION_AREA (0.25 * (D_FILAMENT) * (D_FILAMENT) * M_PI)
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
   #endif
188
   #endif
189
 
189
 
190
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)
190
   #if ENABLED(ULTIPANEL) && DISABLED(ELB_FULL_GRAPHIC_CONTROLLER)

+ 11
- 2
Marlin/planner.cpp View File

1062
   float current_speed[NUM_AXIS], speed_factor = 1.0; // factor <1 decreases speed
1062
   float current_speed[NUM_AXIS], speed_factor = 1.0; // factor <1 decreases speed
1063
   LOOP_XYZE(i) {
1063
   LOOP_XYZE(i) {
1064
     const float cs = fabs(current_speed[i] = delta_mm[i] * inverse_mm_s);
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
     if (cs > max_feedrate_mm_s[i]) NOMORE(speed_factor, max_feedrate_mm_s[i] / cs);
1068
     if (cs > max_feedrate_mm_s[i]) NOMORE(speed_factor, max_feedrate_mm_s[i] / cs);
1066
   }
1069
   }
1067
 
1070
 
1135
     // Start with print or travel acceleration
1138
     // Start with print or travel acceleration
1136
     accel = ceil((esteps ? acceleration : travel_acceleration) * steps_per_mm);
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
     // Limit acceleration per axis
1147
     // Limit acceleration per axis
1139
     if (block->step_event_count <= cutoff_long) {
1148
     if (block->step_event_count <= cutoff_long) {
1140
       LIMIT_ACCEL_LONG(X_AXIS,0);
1149
       LIMIT_ACCEL_LONG(X_AXIS,0);
1141
       LIMIT_ACCEL_LONG(Y_AXIS,0);
1150
       LIMIT_ACCEL_LONG(Y_AXIS,0);
1142
       LIMIT_ACCEL_LONG(Z_AXIS,0);
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
     else {
1154
     else {
1146
       LIMIT_ACCEL_FLOAT(X_AXIS,0);
1155
       LIMIT_ACCEL_FLOAT(X_AXIS,0);
1147
       LIMIT_ACCEL_FLOAT(Y_AXIS,0);
1156
       LIMIT_ACCEL_FLOAT(Y_AXIS,0);
1148
       LIMIT_ACCEL_FLOAT(Z_AXIS,0);
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
   block->acceleration_steps_per_s2 = accel;
1161
   block->acceleration_steps_per_s2 = accel;

+ 1
- 1
Marlin/stepper.cpp View File

147
       X2_STEP_WRITE(v); \
147
       X2_STEP_WRITE(v); \
148
     } \
148
     } \
149
     else { \
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
 #else
152
 #else
153
   #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)
153
   #define X_APPLY_DIR(v,Q) X_DIR_WRITE(v)

Loading…
Cancel
Save