diff options
author | David Crocker <dcrocker@eschertech.com> | 2021-07-24 15:42:27 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2021-07-24 15:42:27 +0300 |
commit | a1c2af661f19f248c70e9716f6142c597deb5ca0 (patch) | |
tree | 561667b7e45c532d400c09d7c1656338617afd90 /src/Movement | |
parent | 992684e22ded508c7e11ba777a50ec447d3737c9 (diff) |
Fixes for change to time units
Diffstat (limited to 'src/Movement')
-rw-r--r-- | src/Movement/DriveMovement.h | 12 | ||||
-rw-r--r-- | src/Movement/Move.cpp | 2 |
2 files changed, 9 insertions, 5 deletions
diff --git a/src/Movement/DriveMovement.h b/src/Movement/DriveMovement.h index 5d16e16a..21e1d421 100644 --- a/src/Movement/DriveMovement.h +++ b/src/Movement/DriveMovement.h @@ -100,8 +100,14 @@ private: uint32_t stepInterval; // how many clocks between steps float distanceSoFar; +#if DM_USE_FPU float timeSoFar; float pA, pB, pC; +#else + uint32_t iTimeSoFar; + int64_t ipA; + int32_t ipB, ipC; +#endif // Parameters unique to a style of move (Cartesian, delta or extruder). Currently, extruders and Cartesian moves use the same parameters. union @@ -109,11 +115,11 @@ private: struct DeltaParameters // Parameters for delta movement { // The following don't depend on how the move is executed, so they could be set up in Init() if we use fixed acceleration/deceleration -#if DM_USE_FPU float fTwoA; float fTwoB; - float fDSquaredMinusAsquaredMinusBsquaredTimesSsquared; float h0MinusZ0; // the height subtended by the rod at the start of the move +#if DM_USE_FPU + float fDSquaredMinusAsquaredMinusBsquaredTimesSsquared; float fHmz0s; // the starting height less the starting Z height, multiplied by the Z movement fraction (can go negative) float fMinusAaPlusBbTimesS; float reverseStartDistance; // the overall move distance at which movement reversal occurs @@ -133,8 +139,6 @@ private: } cart; } mp; - static constexpr uint32_t NoStepTime = 0xFFFFFFFF; // value to indicate that no further steps are needed when calculating the next step time - #if !DM_USE_FPU static constexpr uint32_t K1 = 1024; // a power of 2 used to multiply the value mmPerStepTimesCdivtopSpeed to reduce rounding errors static constexpr uint32_t K2 = 512; // a power of 2 used in delta calculations to reduce rounding errors (but too large makes things worse) diff --git a/src/Movement/Move.cpp b/src/Movement/Move.cpp index bff92a17..08c8761f 100644 --- a/src/Movement/Move.cpp +++ b/src/Movement/Move.cpp @@ -167,7 +167,7 @@ Move::Move() noexcept #if SUPPORT_ASYNC_MOVES heightController(nullptr), #endif - maxPrintingAcceleration(10000.0), maxTravelAcceleration(10000.0), + maxPrintingAcceleration(ConvertAcceleration(DefaultPrintingAcceleration)), maxTravelAcceleration(ConvertAcceleration(DefaultTravelAcceleration)), jerkPolicy(0), numCalibratedFactors(0) { |