Skip to content

Commit bff6b18

Browse files
motorappmotorapp
authored andcommitted
Fixed motor wont move initially after IOC start when part of CSAxis
1 parent 11db4ec commit bff6b18

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

3-4/GalilSup/src/GalilCSAxis.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,12 @@ asynStatus GalilCSAxis::setDefaults(void)
150150
setDoubleParam(pC_->motorEncoderPosition_, encoder_position_);
151151
//Pass default direction value to motorRecord
152152
setIntegerParam(pC_->motorStatusDirection_, direction_);
153+
//Used to stop all motors in this CSAxis in Sync start only mode
153154
//Dont stop the CSAxis now
154155
stop_csaxis_ = false;
155-
//Used to stop all motors in this CSAxis
156-
stop_issued_ = false;
156+
//Used to track whether stop request issued to all motors in this CSAxis
157+
//Default is stop request already issued
158+
stop_issued_ = true;
157159
//Axis not ready until necessary motor record fields have been pushed into driver
158160
//So we use "use encoder if present" UEIP field to set axisReady_ to true
159161
lastaxisReady_ = axisReady_ = false;
@@ -1019,6 +1021,7 @@ asynStatus GalilCSAxis::packReadbackArgs(char *axes, double mrargs[])
10191021
for (i = 0; axes[i] != '\0'; i++)
10201022
{
10211023
//Get the readbacks for the axis
1024+
//These can be real, or other CSAxis
10221025
status |= pC_->getDoubleParam(axes[i] - AASCII, pC_->motorEncoderPosition_, &epos);
10231026
status |= pC_->getDoubleParam(axes[i] - AASCII, pC_->motorPosition_, &mpos);
10241027
//Retrieve needed motor record fields
@@ -1415,8 +1418,11 @@ asynStatus GalilCSAxis::poller(void)
14151418
pAxis = pC_->getAxis(revaxes_[i] - AASCII);
14161419
//Process or skip
14171420
if (!pAxis) continue;
1418-
//stop the motor
1419-
pAxis->pollRequest_.send((void*)&MOTOR_STOP, sizeof(int));
1421+
//Set axis stop code
1422+
sc = pAxis->stop_code_;
1423+
//stop the motor if it's not stopping already
1424+
if (!pAxis->done_ && sc != MOTOR_STOP_FWD && sc != MOTOR_STOP_REV && sc != MOTOR_STOP_STOP)
1425+
pAxis->pollRequest_.send((void*)&MOTOR_STOP, sizeof(int));
14201426
}
14211427
//Flag stop has been issued
14221428
stop_issued_ = true;

3-4/GalilSup/src/GalilController.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,8 @@
245245
// Fixed issue with motorUpdateStatus_ when using motor record set field
246246
// Fixed issue with CSAxis jog function in sync start and stop mode
247247
// Improved CSAxis limit handling
248+
// 17/04/17 M.Clift
249+
// Fixed motor wont move initially after IOC start when part of CSAxis
248250

249251
#include <stdio.h>
250252
#include <math.h>

0 commit comments

Comments
 (0)