|
@@ -1648,8 +1648,8 @@ bool Planner::_buffer_steps(const xyze_long_t &target
|
1648
|
1648
|
#if HAS_POSITION_FLOAT
|
1649
|
1649
|
, const xyze_pos_t &target_float
|
1650
|
1650
|
#endif
|
1651
|
|
- #if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
1652
|
|
- , const xyze_float_t &delta_mm_cart
|
|
1651
|
+ #if HAS_DIST_MM_ARG
|
|
1652
|
+ , const xyze_float_t &cart_dist_mm
|
1653
|
1653
|
#endif
|
1654
|
1654
|
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters
|
1655
|
1655
|
) {
|
|
@@ -1666,8 +1666,8 @@ bool Planner::_buffer_steps(const xyze_long_t &target
|
1666
|
1666
|
#if HAS_POSITION_FLOAT
|
1667
|
1667
|
, target_float
|
1668
|
1668
|
#endif
|
1669
|
|
- #if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
1670
|
|
- , delta_mm_cart
|
|
1669
|
+ #if HAS_DIST_MM_ARG
|
|
1670
|
+ , cart_dist_mm
|
1671
|
1671
|
#endif
|
1672
|
1672
|
, fr_mm_s, extruder, millimeters
|
1673
|
1673
|
)) {
|
|
@@ -1712,8 +1712,8 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
1712
|
1712
|
#if HAS_POSITION_FLOAT
|
1713
|
1713
|
, const xyze_pos_t &target_float
|
1714
|
1714
|
#endif
|
1715
|
|
- #if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
1716
|
|
- , const xyze_float_t &delta_mm_cart
|
|
1715
|
+ #if HAS_DIST_MM_ARG
|
|
1716
|
+ , const xyze_float_t &cart_dist_mm
|
1717
|
1717
|
#endif
|
1718
|
1718
|
, feedRate_t fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
|
1719
|
1719
|
) {
|
|
@@ -1840,51 +1840,51 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
1840
|
1840
|
* So we need to create other 2 "AXIS", named X_HEAD and Y_HEAD, meaning the real displacement of the Head.
|
1841
|
1841
|
* Having the real displacement of the head, we can calculate the total movement length and apply the desired speed.
|
1842
|
1842
|
*/
|
1843
|
|
- struct DeltaMM : abce_float_t {
|
|
1843
|
+ struct DistanceMM : abce_float_t {
|
1844
|
1844
|
#if IS_CORE
|
1845
|
1845
|
xyz_pos_t head;
|
1846
|
1846
|
#endif
|
1847
|
|
- } delta_mm;
|
|
1847
|
+ } steps_dist_mm;
|
1848
|
1848
|
#if IS_CORE
|
1849
|
1849
|
#if CORE_IS_XY
|
1850
|
|
- delta_mm.head.x = da * steps_to_mm[A_AXIS];
|
1851
|
|
- delta_mm.head.y = db * steps_to_mm[B_AXIS];
|
1852
|
|
- delta_mm.z = dc * steps_to_mm[Z_AXIS];
|
1853
|
|
- delta_mm.a = (da + db) * steps_to_mm[A_AXIS];
|
1854
|
|
- delta_mm.b = CORESIGN(da - db) * steps_to_mm[B_AXIS];
|
|
1850
|
+ steps_dist_mm.head.x = da * steps_to_mm[A_AXIS];
|
|
1851
|
+ steps_dist_mm.head.y = db * steps_to_mm[B_AXIS];
|
|
1852
|
+ steps_dist_mm.z = dc * steps_to_mm[Z_AXIS];
|
|
1853
|
+ steps_dist_mm.a = (da + db) * steps_to_mm[A_AXIS];
|
|
1854
|
+ steps_dist_mm.b = CORESIGN(da - db) * steps_to_mm[B_AXIS];
|
1855
|
1855
|
#elif CORE_IS_XZ
|
1856
|
|
- delta_mm.head.x = da * steps_to_mm[A_AXIS];
|
1857
|
|
- delta_mm.y = db * steps_to_mm[Y_AXIS];
|
1858
|
|
- delta_mm.head.z = dc * steps_to_mm[C_AXIS];
|
1859
|
|
- delta_mm.a = (da + dc) * steps_to_mm[A_AXIS];
|
1860
|
|
- delta_mm.c = CORESIGN(da - dc) * steps_to_mm[C_AXIS];
|
|
1856
|
+ steps_dist_mm.head.x = da * steps_to_mm[A_AXIS];
|
|
1857
|
+ steps_dist_mm.y = db * steps_to_mm[Y_AXIS];
|
|
1858
|
+ steps_dist_mm.head.z = dc * steps_to_mm[C_AXIS];
|
|
1859
|
+ steps_dist_mm.a = (da + dc) * steps_to_mm[A_AXIS];
|
|
1860
|
+ steps_dist_mm.c = CORESIGN(da - dc) * steps_to_mm[C_AXIS];
|
1861
|
1861
|
#elif CORE_IS_YZ
|
1862
|
|
- delta_mm.x = da * steps_to_mm[X_AXIS];
|
1863
|
|
- delta_mm.head.y = db * steps_to_mm[B_AXIS];
|
1864
|
|
- delta_mm.head.z = dc * steps_to_mm[C_AXIS];
|
1865
|
|
- delta_mm.b = (db + dc) * steps_to_mm[B_AXIS];
|
1866
|
|
- delta_mm.c = CORESIGN(db - dc) * steps_to_mm[C_AXIS];
|
|
1862
|
+ steps_dist_mm.x = da * steps_to_mm[X_AXIS];
|
|
1863
|
+ steps_dist_mm.head.y = db * steps_to_mm[B_AXIS];
|
|
1864
|
+ steps_dist_mm.head.z = dc * steps_to_mm[C_AXIS];
|
|
1865
|
+ steps_dist_mm.b = (db + dc) * steps_to_mm[B_AXIS];
|
|
1866
|
+ steps_dist_mm.c = CORESIGN(db - dc) * steps_to_mm[C_AXIS];
|
1867
|
1867
|
#endif
|
1868
|
1868
|
#else
|
1869
|
|
- delta_mm.a = da * steps_to_mm[A_AXIS];
|
1870
|
|
- delta_mm.b = db * steps_to_mm[B_AXIS];
|
1871
|
|
- delta_mm.c = dc * steps_to_mm[C_AXIS];
|
|
1869
|
+ steps_dist_mm.a = da * steps_to_mm[A_AXIS];
|
|
1870
|
+ steps_dist_mm.b = db * steps_to_mm[B_AXIS];
|
|
1871
|
+ steps_dist_mm.c = dc * steps_to_mm[C_AXIS];
|
1872
|
1872
|
#endif
|
1873
|
1873
|
|
1874
|
1874
|
#if EXTRUDERS
|
1875
|
|
- delta_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)];
|
|
1875
|
+ steps_dist_mm.e = esteps_float * steps_to_mm[E_AXIS_N(extruder)];
|
1876
|
1876
|
#else
|
1877
|
|
- delta_mm.e = 0.0f;
|
|
1877
|
+ steps_dist_mm.e = 0.0f;
|
1878
|
1878
|
#endif
|
1879
|
1879
|
|
1880
|
1880
|
#if ENABLED(LCD_SHOW_E_TOTAL)
|
1881
|
|
- e_move_accumulator += delta_mm.e;
|
|
1881
|
+ e_move_accumulator += steps_dist_mm.e;
|
1882
|
1882
|
#endif
|
1883
|
1883
|
|
1884
|
1884
|
if (block->steps.a < MIN_STEPS_PER_SEGMENT && block->steps.b < MIN_STEPS_PER_SEGMENT && block->steps.c < MIN_STEPS_PER_SEGMENT) {
|
1885
|
1885
|
block->millimeters = (0
|
1886
|
1886
|
#if EXTRUDERS
|
1887
|
|
- + ABS(delta_mm.e)
|
|
1887
|
+ + ABS(steps_dist_mm.e)
|
1888
|
1888
|
#endif
|
1889
|
1889
|
);
|
1890
|
1890
|
}
|
|
@@ -1894,13 +1894,13 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
1894
|
1894
|
else
|
1895
|
1895
|
block->millimeters = SQRT(
|
1896
|
1896
|
#if CORE_IS_XY
|
1897
|
|
- sq(delta_mm.head.x) + sq(delta_mm.head.y) + sq(delta_mm.z)
|
|
1897
|
+ sq(steps_dist_mm.head.x) + sq(steps_dist_mm.head.y) + sq(steps_dist_mm.z)
|
1898
|
1898
|
#elif CORE_IS_XZ
|
1899
|
|
- sq(delta_mm.head.x) + sq(delta_mm.y) + sq(delta_mm.head.z)
|
|
1899
|
+ sq(steps_dist_mm.head.x) + sq(steps_dist_mm.y) + sq(steps_dist_mm.head.z)
|
1900
|
1900
|
#elif CORE_IS_YZ
|
1901
|
|
- sq(delta_mm.x) + sq(delta_mm.head.y) + sq(delta_mm.head.z)
|
|
1901
|
+ sq(steps_dist_mm.x) + sq(steps_dist_mm.head.y) + sq(steps_dist_mm.head.z)
|
1902
|
1902
|
#else
|
1903
|
|
- sq(delta_mm.x) + sq(delta_mm.y) + sq(delta_mm.z)
|
|
1903
|
+ sq(steps_dist_mm.x) + sq(steps_dist_mm.y) + sq(steps_dist_mm.z)
|
1904
|
1904
|
#endif
|
1905
|
1905
|
);
|
1906
|
1906
|
|
|
@@ -2071,7 +2071,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2071
|
2071
|
|
2072
|
2072
|
#if ENABLED(FILAMENT_WIDTH_SENSOR)
|
2073
|
2073
|
if (extruder == FILAMENT_SENSOR_EXTRUDER_NUM) // Only for extruder with filament sensor
|
2074
|
|
- filwidth.advance_e(delta_mm.e);
|
|
2074
|
+ filwidth.advance_e(steps_dist_mm.e);
|
2075
|
2075
|
#endif
|
2076
|
2076
|
|
2077
|
2077
|
// Calculate and limit speed in mm/sec
|
|
@@ -2081,7 +2081,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2081
|
2081
|
|
2082
|
2082
|
// Linear axes first with less logic
|
2083
|
2083
|
LOOP_XYZ(i) {
|
2084
|
|
- current_speed[i] = delta_mm[i] * inverse_secs;
|
|
2084
|
+ current_speed[i] = steps_dist_mm[i] * inverse_secs;
|
2085
|
2085
|
const feedRate_t cs = ABS(current_speed[i]),
|
2086
|
2086
|
max_fr = settings.max_feedrate_mm_s[i];
|
2087
|
2087
|
if (cs > max_fr) NOMORE(speed_factor, max_fr / cs);
|
|
@@ -2090,7 +2090,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2090
|
2090
|
// Limit speed on extruders, if any
|
2091
|
2091
|
#if EXTRUDERS
|
2092
|
2092
|
{
|
2093
|
|
- current_speed.e = delta_mm.e * inverse_secs;
|
|
2093
|
+ current_speed.e = steps_dist_mm.e * inverse_secs;
|
2094
|
2094
|
#if BOTH(MIXING_EXTRUDER, RETRACT_SYNC_MIXING)
|
2095
|
2095
|
// Move all mixing extruders at the specified rate
|
2096
|
2096
|
if (mixer.get_current_vtool() == MIXER_AUTORETRACT_TOOL)
|
|
@@ -2308,10 +2308,10 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
|
2308
|
2308
|
static xyze_float_t prev_unit_vec;
|
2309
|
2309
|
|
2310
|
2310
|
xyze_float_t unit_vec =
|
2311
|
|
- #if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
2312
|
|
- delta_mm_cart
|
|
2311
|
+ #if HAS_DIST_MM_ARG
|
|
2312
|
+ cart_dist_mm
|
2313
|
2313
|
#else
|
2314
|
|
- { delta_mm.x, delta_mm.y, delta_mm.z, delta_mm.e }
|
|
2314
|
+ { steps_dist_mm.x, steps_dist_mm.y, steps_dist_mm.z, steps_dist_mm.e }
|
2315
|
2315
|
#endif
|
2316
|
2316
|
;
|
2317
|
2317
|
unit_vec *= inverse_millimeters;
|
|
@@ -2572,8 +2572,8 @@ void Planner::buffer_sync_block() {
|
2572
|
2572
|
* millimeters - the length of the movement, if known
|
2573
|
2573
|
*/
|
2574
|
2574
|
bool Planner::buffer_segment(const float &a, const float &b, const float &c, const float &e
|
2575
|
|
- #if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
2576
|
|
- , const xyze_float_t &delta_mm_cart
|
|
2575
|
+ #if HAS_DIST_MM_ARG
|
|
2576
|
+ , const xyze_float_t &cart_dist_mm
|
2577
|
2577
|
#endif
|
2578
|
2578
|
, const feedRate_t &fr_mm_s, const uint8_t extruder, const float &millimeters/*=0.0*/
|
2579
|
2579
|
) {
|
|
@@ -2651,8 +2651,8 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
|
2651
|
2651
|
#if HAS_POSITION_FLOAT
|
2652
|
2652
|
, target_float
|
2653
|
2653
|
#endif
|
2654
|
|
- #if IS_KINEMATIC && DISABLED(CLASSIC_JERK)
|
2655
|
|
- , delta_mm_cart
|
|
2654
|
+ #if HAS_DIST_MM_ARG
|
|
2655
|
+ , cart_dist_mm
|
2656
|
2656
|
#endif
|
2657
|
2657
|
, fr_mm_s, extruder, millimeters
|
2658
|
2658
|
)
|
|
@@ -2686,17 +2686,17 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
|
2686
|
2686
|
#if IS_KINEMATIC
|
2687
|
2687
|
|
2688
|
2688
|
#if DISABLED(CLASSIC_JERK)
|
2689
|
|
- const xyze_pos_t delta_mm_cart = {
|
|
2689
|
+ const xyze_pos_t cart_dist_mm = {
|
2690
|
2690
|
rx - position_cart.x, ry - position_cart.y,
|
2691
|
2691
|
rz - position_cart.z, e - position_cart.e
|
2692
|
2692
|
};
|
2693
|
2693
|
#else
|
2694
|
|
- const xyz_pos_t delta_mm_cart = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z };
|
|
2694
|
+ const xyz_pos_t cart_dist_mm = { rx - position_cart.x, ry - position_cart.y, rz - position_cart.z };
|
2695
|
2695
|
#endif
|
2696
|
2696
|
|
2697
|
2697
|
float mm = millimeters;
|
2698
|
2698
|
if (mm == 0.0)
|
2699
|
|
- mm = (delta_mm_cart.x != 0.0 || delta_mm_cart.y != 0.0) ? delta_mm_cart.magnitude() : ABS(delta_mm_cart.z);
|
|
2699
|
+ mm = (cart_dist_mm.x != 0.0 || cart_dist_mm.y != 0.0) ? cart_dist_mm.magnitude() : ABS(cart_dist_mm.z);
|
2700
|
2700
|
|
2701
|
2701
|
// Cartesian XYZ to kinematic ABC, stored in global 'delta'
|
2702
|
2702
|
inverse_kinematics(machine);
|
|
@@ -2712,7 +2712,7 @@ bool Planner::buffer_line(const float &rx, const float &ry, const float &rz, con
|
2712
|
2712
|
#endif
|
2713
|
2713
|
if (buffer_segment(delta.a, delta.b, delta.c, machine.e
|
2714
|
2714
|
#if DISABLED(CLASSIC_JERK)
|
2715
|
|
- , delta_mm_cart
|
|
2715
|
+ , cart_dist_mm
|
2716
|
2716
|
#endif
|
2717
|
2717
|
, feedrate, extruder, mm
|
2718
|
2718
|
)) {
|