From bcb11ae5a79c3d84bd85ebc0ec21e6bb936e1ac9 Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Wed, 24 Apr 2013 18:52:24 +0000 Subject: [PATCH] Added asyn motor driver support for actual raw velocity (RVEL field). --- motorApp/MotorSrc/drvMotorAsyn.c | 5 +++-- motorApp/MotorSrc/motor_interface.h | 1 + motorApp/MotorSrc/motordrvCom.h | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/motorApp/MotorSrc/drvMotorAsyn.c b/motorApp/MotorSrc/drvMotorAsyn.c index 7a21029d..f75e72ab 100644 --- a/motorApp/MotorSrc/drvMotorAsyn.c +++ b/motorApp/MotorSrc/drvMotorAsyn.c @@ -88,6 +88,7 @@ typedef enum { motorLowLimit = motorAxisLowLimit, motorSetClosedLoop = motorAxisClosedLoop, motorEncoderPosition = motorAxisEncoderPosn, + motorActualVel = motorAxisActualVel, motorDeferMoves = motorAxisDeferMoves, motorMoveToHome = motorAxisMoveToHome, /* Status bits split out */ @@ -861,10 +862,10 @@ static void intCallback(void *axisPvt, unsigned int nChanged, (*pPvt->drvset->getDouble)(pAxis->axis, changed[i], &(pAxis->status.encoderPosition)); } - /* if (changed[i] == motorVelocity) { + if (changed[i] == motorAxisActualVel) { (*pPvt->drvset->getDouble)(pAxis->axis, changed[i], &(pAxis->status.velocity)); - }*/ + } } /* Pass float64 interrupts */ diff --git a/motorApp/MotorSrc/motor_interface.h b/motorApp/MotorSrc/motor_interface.h index 79601aae..ff1692ec 100644 --- a/motorApp/MotorSrc/motor_interface.h +++ b/motorApp/MotorSrc/motor_interface.h @@ -311,6 +311,7 @@ typedef enum motorAxisDGain, /**< (double) The differential gain term for PID control in controller dependent units */ motorAxisClosedLoop, /**< (int) Enables closed loop in the controller if non-zero */ motorAxisEncoderPosn, /**< (double, r/o) Current encoder position */ + motorAxisActualVel, /**< (double, r/o) Current actual velocity */ motorAxisDirection, /**< (int, r/o) last motion direction 0=Negative, 1=Positive */ motorAxisDone, /**< (int, r/o) a motion is complete */ motorAxisHighHardLimit, /**< (int, r/o) plus limit switch has been hit */ diff --git a/motorApp/MotorSrc/motordrvCom.h b/motorApp/MotorSrc/motordrvCom.h index 82b7953f..c29c73a7 100644 --- a/motorApp/MotorSrc/motordrvCom.h +++ b/motorApp/MotorSrc/motordrvCom.h @@ -158,7 +158,7 @@ struct mess_info int encoder_present; /* one YES/NO for each axis */ epicsInt32 position; /* one pos for each axis */ epicsInt32 encoder_position; /* one pos for each axis */ - epicsInt32 velocity; /* Raw velocity readback(not implemented) */ + epicsInt32 velocity; /* Raw velocity readback */ int no_motion_count; epicsTime status_delay; /* Insure 10ms delay between motion/velocity * commands and status query. */