Merge pull request #10 from Binary-Coalescence/dev

Added a minimum wait time after stepping for the Homing routine.
This commit is contained in:
BScatterplot
2024-08-06 19:12:30 -05:00
committed by GitHub
2 changed files with 4 additions and 0 deletions

View File

@@ -253,6 +253,9 @@ asynStatus MD90Axis::home(double minVelocity, double maxVelocity, double acceler
if (!status) {
// Wait for the move to complete, then home
sleepTime = SLEEP_MARGIN * SMALL_NSTEPS * COUNTS_PER_STEP / maxVelocity;
if (sleepTime < HOME_SLEEP_MIN) {
sleepTime = HOME_SLEEP_MIN;
}
std::this_thread::sleep_for(std::chrono::seconds(sleepTime));
sprintf(pC_->outString_, "HOM");

View File

@@ -13,6 +13,7 @@ USAGE... Motor driver support for the DSM MD-90 controller.
#define NUM_MD90_PARAMS 0
#define SLEEP_MARGIN 1.2 // Extra factor to wait after stepping before homing
#define HOME_SLEEP_MIN 1 // Minimum amount of time to wait after stepping/before homing
#define SMALL_NSTEPS 5 // Number of steps to take to set direction for homing routine
#define COUNTS_PER_STEP 1000.0 // Number of encoder counts per motor step (measured by testing)