Skip to content

Commit 314ef89

Browse files
committed
asynMotor: Introduce motorActVelocity
commit 11229ed, Fixed RVEL bug, made a change to be able to set the .RVEL field in the motorRecord from a model 3 driver. However, this mixes motorVelocity_, which is a setpoint changed with every movement, with an actual value, which changes while the motor is moving. And goes to 0.0 when the motor has stopped. Or stays at 0.0 when the motor refuse to start. This may be caused by an interlock, limit switch, power off or others. In short: Introduce a new asynParameter to store the value. Compatiblity considarations: Since the .RVEL field has never been working for an asynMotor, we don't expect any. If needed, code can be adopted at compile time, with something like this: #ifdef motorActVelocityString setDoubleParam(pC_->motorActVelocity_, st_axis_status.fActVelocity); #endif
1 parent 32fe1b1 commit 314ef89

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

motorApp/MotorSrc/asynMotorAxis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ asynStatus asynMotorAxis::setDoubleParam(int function, double value)
288288
statusChanged_ = 1;
289289
status_.encoderPosition = value;
290290
}
291-
} else if (function == pC_->motorVelocity_) {
291+
} else if (function == pC_->motorActVelocity_) {
292292
if (value != status_.velocity) {
293293
statusChanged_ = 1;
294294
status_.velocity = value;

motorApp/MotorSrc/asynMotorController.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ asynMotorController::asynMotorController(const char *portName, int numAxes, int
6060
createParam(motorHomeString, asynParamFloat64, &motorHome_);
6161
createParam(motorStopString, asynParamInt32, &motorStop_);
6262
createParam(motorVelocityString, asynParamFloat64, &motorVelocity_);
63+
createParam(motorActVelocityString, asynParamFloat64, &motorActVelocity_);
6364
createParam(motorVelBaseString, asynParamFloat64, &motorVelBase_);
6465
createParam(motorAccelString, asynParamFloat64, &motorAccel_);
6566
createParam(motorPositionString, asynParamFloat64, &motorPosition_);

motorApp/MotorSrc/asynMotorController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define motorMoveVelString "MOTOR_MOVE_VEL"
2525
#define motorHomeString "MOTOR_HOME"
2626
#define motorStopString "MOTOR_STOP_AXIS"
27+
#define motorActVelocityString "MOTOR_ACT_VELOCITY"
2728
#define motorVelocityString "MOTOR_VELOCITY"
2829
#define motorVelBaseString "MOTOR_VEL_BASE"
2930
#define motorAccelString "MOTOR_ACCEL"
@@ -207,6 +208,7 @@ class epicsShareClass asynMotorController : public asynPortDriver {
207208
int motorHome_;
208209
int motorStop_;
209210
int motorVelocity_;
211+
int motorActVelocity_;
210212
int motorVelBase_;
211213
int motorAccel_;
212214
int motorPosition_;

0 commit comments

Comments
 (0)