mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-04 21:55:40 -05:00
Merge pull request #10 from Binary-Coalescence/dev
Added a minimum wait time after stepping for the Homing routine.
This commit is contained in:
@@ -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");
|
||||
|
@@ -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)
|
||||
|
||||
|
Reference in New Issue
Block a user