diff options
author | daid <daid303@gmail.com> | 2016-03-22 18:29:32 +0300 |
---|---|---|
committer | daid <daid303@gmail.com> | 2016-03-22 18:29:32 +0300 |
commit | aca2c17ebaf5722137568bc8aeadd2be001a7a34 (patch) | |
tree | 0042fa69d633798200fda134d7203f69d7e5ad63 /src/timeEstimate.cpp | |
parent | 22b0d0fe6a65bb445f8ff2cf3f62a87c7db58e74 (diff) |
Allow the engine to use dynamic acceleration settings to get better time estimates.15.04.6-RC215.04.6-RC115.04.6
Diffstat (limited to 'src/timeEstimate.cpp')
-rw-r--r-- | src/timeEstimate.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/timeEstimate.cpp b/src/timeEstimate.cpp index c00b170833..6cec07a178 100644 --- a/src/timeEstimate.cpp +++ b/src/timeEstimate.cpp @@ -6,16 +6,26 @@ #define MINIMUM_PLANNER_SPEED 0.05// (mm/sec) -const double max_feedrate[TimeEstimateCalculator::NUM_AXIS] = {600, 600, 40, 25}; -const double minimumfeedrate = 0.01; -const double acceleration = 3000; -const double max_acceleration[TimeEstimateCalculator::NUM_AXIS] = {9000,9000,100,10000}; -const double max_xy_jerk = 20.0; -const double max_z_jerk = 0.4; -const double max_e_jerk = 5.0; +static double max_feedrate[TimeEstimateCalculator::NUM_AXIS] = {600, 600, 40, 25}; +static double minimumfeedrate = 0.01; +static double acceleration = 3000; +static double max_acceleration[TimeEstimateCalculator::NUM_AXIS] = {9000,9000,100,10000}; +static double max_xy_jerk = 20.0; +static double max_z_jerk = 0.4; +static double max_e_jerk = 5.0; template<typename T> const T square(const T& a) { return a * a; } +void TimeEstimateCalculator::applyAccelerationSettings(ConfigSettings& config) +{ + acceleration = float(config.acceleration) / 1000.0; + for(unsigned int n=0; n<TimeEstimateCalculator::NUM_AXIS; n++) + max_acceleration[n] = float(config.max_acceleration[n]) / 1000.0; + max_xy_jerk = float(config.max_xy_jerk) / 1000.0; + max_z_jerk = float(config.max_z_jerk) / 1000.0; + max_e_jerk = float(config.max_e_jerk) / 1000.0; +} + void TimeEstimateCalculator::setPosition(Position newPos) { currentPosition = newPos; |