Browse Source

Correction to acceleration

Scott Lahteine 6 years ago
parent
commit
689bc99402
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      Marlin/src/module/planner.cpp

+ 2
- 2
Marlin/src/module/planner.cpp View File

1294
   }
1294
   }
1295
   block->acceleration_steps_per_s2 = accel;
1295
   block->acceleration_steps_per_s2 = accel;
1296
   block->acceleration = accel / steps_per_mm;
1296
   block->acceleration = accel / steps_per_mm;
1297
-  block->acceleration_rate = (long)(accel * 16777216.0 / ((F_CPU) * 0.125)); // * 8.388608
1297
+  block->acceleration_rate = (long)(accel * (4096.0 * 4096.0 / (HAL_STEPPER_TIMER_RATE)));
1298
   #if ENABLED(LIN_ADVANCE)
1298
   #if ENABLED(LIN_ADVANCE)
1299
     if (block->use_advance_lead) {
1299
     if (block->use_advance_lead) {
1300
-      block->advance_speed = ((F_CPU) * 0.125) / (extruder_advance_K * block->e_D_ratio * block->acceleration * axis_steps_per_mm[E_AXIS_N]);
1300
+      block->advance_speed = (HAL_STEPPER_TIMER_RATE) / (extruder_advance_K * block->e_D_ratio * block->acceleration * axis_steps_per_mm[E_AXIS_N]);
1301
       #if ENABLED(LA_DEBUG)
1301
       #if ENABLED(LA_DEBUG)
1302
         if (extruder_advance_K * block->e_D_ratio * block->acceleration * 2 < block->nominal_speed * block->e_D_ratio)
1302
         if (extruder_advance_K * block->e_D_ratio * block->acceleration * 2 < block->nominal_speed * block->e_D_ratio)
1303
           SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed.");
1303
           SERIAL_ECHOLNPGM("More than 2 steps per eISR loop executed.");

Loading…
Cancel
Save