Added a minimum wait time after stepping for the Homing routine. Otherwise, you sometimes had to send the Home command twice. (Unsure of the reason.)

This commit is contained in:
2024-08-06 18:59:10 -05:00
committed by BScatterplot
parent c6edb953a5
commit 760716f342
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) { if (!status) {
// Wait for the move to complete, then home // Wait for the move to complete, then home
sleepTime = SLEEP_MARGIN * SMALL_NSTEPS * COUNTS_PER_STEP / maxVelocity; 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)); std::this_thread::sleep_for(std::chrono::seconds(sleepTime));
sprintf(pC_->outString_, "HOM"); 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 NUM_MD90_PARAMS 0
#define SLEEP_MARGIN 1.2 // Extra factor to wait after stepping before homing #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 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) #define COUNTS_PER_STEP 1000.0 // Number of encoder counts per motor step (measured by testing)