浏览代码

Fix M114 E / R broken by `LIN_ADVANCE` (#21579)

BigTreeTech 3 年前
父节点
当前提交
37e671612e
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 15 次插入5 次删除
  1. 15
    5
      Marlin/src/module/stepper.cpp

+ 15
- 5
Marlin/src/module/stepper.cpp 查看文件

@@ -1697,12 +1697,12 @@ void Stepper::pulse_phase_isr() {
1697 1697
       #if EITHER(LIN_ADVANCE, MIXING_EXTRUDER)
1698 1698
         delta_error.e += advance_dividend.e;
1699 1699
         if (delta_error.e >= 0) {
1700
-          count_position.e += count_direction.e;
1701 1700
           #if ENABLED(LIN_ADVANCE)
1702 1701
             delta_error.e -= advance_divisor;
1703 1702
             // Don't step E here - But remember the number of steps to perform
1704 1703
             motor_direction(E_AXIS) ? --LA_steps : ++LA_steps;
1705 1704
           #else
1705
+            count_position.e += count_direction.e;
1706 1706
             step_needed.e = true;
1707 1707
           #endif
1708 1708
         }
@@ -2283,15 +2283,23 @@ uint32_t Stepper::block_phase_isr() {
2283 2283
     #if ENABLED(MIXING_EXTRUDER)
2284 2284
       // We don't know which steppers will be stepped because LA loop follows,
2285 2285
       // with potentially multiple steps. Set all.
2286
-      if (LA_steps > 0)
2286
+      if (LA_steps > 0) {
2287 2287
         MIXER_STEPPER_LOOP(j) NORM_E_DIR(j);
2288
-      else if (LA_steps < 0)
2288
+        count_direction.e = 1;
2289
+      }
2290
+      else if (LA_steps < 0) {
2289 2291
         MIXER_STEPPER_LOOP(j) REV_E_DIR(j);
2292
+        count_direction.e = -1;
2293
+      }
2290 2294
     #else
2291
-      if (LA_steps > 0)
2295
+      if (LA_steps > 0) {
2292 2296
         NORM_E_DIR(stepper_extruder);
2293
-      else if (LA_steps < 0)
2297
+        count_direction.e = 1;
2298
+      }
2299
+      else if (LA_steps < 0) {
2294 2300
         REV_E_DIR(stepper_extruder);
2301
+        count_direction.e = -1;
2302
+      }
2295 2303
     #endif
2296 2304
 
2297 2305
     DIR_WAIT_AFTER();
@@ -2312,6 +2320,8 @@ uint32_t Stepper::block_phase_isr() {
2312 2320
           AWAIT_LOW_PULSE();
2313 2321
       #endif
2314 2322
 
2323
+      count_position.e += count_direction.e;
2324
+
2315 2325
       // Set the STEP pulse ON
2316 2326
       #if ENABLED(MIXING_EXTRUDER)
2317 2327
         E_STEP_WRITE(mixer.get_next_stepper(), !INVERT_E_STEP_PIN);

正在加载...
取消
保存