From b5dcc7bdf1b5cd1e7948a6b2e1431a43ff79f820 Mon Sep 17 00:00:00 2001 From: smathis Date: Thu, 12 Feb 2026 12:04:20 +0100 Subject: [PATCH] Fixed scaling of the written motorVelocity value --- src/masterMacsAxis.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index a2d9a85..0b08621 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -510,9 +510,6 @@ asynStatus masterMacsAxis::doPoll(bool *moving) { setAxisParamChecked(this, motorEncoderPosition, currentPosition); if (pMasterMacsA_->lastMoveCommand == velocityMode && !speedEqualZero()) { - - // TODO: Not sure whether the RVEL field of the motor record does not - // work - has to be clarified double actualVelocity = 0.0; rwStatus = pC_->read(axisNo_, 14, response); @@ -525,8 +522,10 @@ asynStatus masterMacsAxis::doPoll(bool *moving) { __PRETTY_FUNCTION__, __LINE__); } - // Write the actual velocity to the paramLib (TODO: does it though?) - setAxisParamChecked(this, motorVelocity, actualVelocity); + // Writes the actual speed in steps per second to the paramLib. This + // value is then returned by the RVEL field of the motor record. + setAxisParamChecked(this, motorVelocity, + actualVelocity / motorRecResolution); // Motor is moving in velocity mode *moving = true;