From 6a362c03a97cbc6a1ca8d1ac4ad66d6146f1fc70 Mon Sep 17 00:00:00 2001 From: Jim Morris Date: Wed, 22 Feb 2017 13:26:37 -0800 Subject: [PATCH] Revert "Fix edge case where accleration is too high for stepticker" This reverts commit 3d2dd8f9485ed642f8809e678366b242aa1fd7df. --- src/modules/robot/Planner.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/modules/robot/Planner.cpp b/src/modules/robot/Planner.cpp index 01359d2f..5292f7ab 100644 --- a/src/modules/robot/Planner.cpp +++ b/src/modules/robot/Planner.cpp @@ -22,7 +22,6 @@ using namespace std; #include "checksumm.h" #include "Robot.h" #include "ConfigValue.h" -#include #include #include @@ -107,27 +106,18 @@ bool Planner::append_block( ActuatorCoordinates &actuator_pos, uint8_t n_motors, } } + block->acceleration = acceleration; // save in block + // Max number of steps, for all axes auto mi = std::max_element(block->steps.begin(), block->steps.end()); block->steps_event_count = *mi; - block->millimeters = distance; - - // check that acceleration/sec does not exceed step frequency - float acceleration_per_second = (acceleration * block->steps_event_count) / block->millimeters; - if(acceleration_per_second > THEKERNEL->step_ticker->get_frequency()) { - // we need to reduce acceleration to keep it under this frequency - acceleration= floorf((block->millimeters * THEKERNEL->step_ticker->get_frequency()) / block->steps_event_count); - } - block->acceleration = acceleration; // save in block + block->millimeters = distance; // Calculate speed in mm/sec for each axis. No divide by zero due to previous checks. if( distance > 0.0F ) { block->nominal_speed = rate_mm_s; // (mm/s) Always > 0 block->nominal_rate = block->steps_event_count * rate_mm_s / distance; // (step/s) Always > 0 - // must be >= 1.0 step/sec otherwise timing is off - if(block->nominal_rate < 1.0F) block->nominal_rate= 1.0F; - } else { block->nominal_speed = 0.0F; block->nominal_rate = 0; -- 2.20.1