mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-04 21:55:40 -05:00
Merge pull request #5 from Binary-Coalescence/Speed-conversion-update
Fixed speed conversions
This commit is contained in:
@@ -185,7 +185,7 @@ asynStatus MD90Axis::sendAccelAndVelocity(double acceleration, double velocity)
|
|||||||
// Velocity provided in steps/sec
|
// Velocity provided in steps/sec
|
||||||
// Our unit step size of the encoder is 10 nm, but the motor moves in steps approx. 5 micrometers.
|
// Our unit step size of the encoder is 10 nm, but the motor moves in steps approx. 5 micrometers.
|
||||||
// Motor controller accepts step frequency in Hz.
|
// Motor controller accepts step frequency in Hz.
|
||||||
freq = NINT(fabs(velocity / 500.));
|
freq = NINT(fabs(velocity / COUNTS_PER_STEP));
|
||||||
sprintf(pC_->outString_, "SSF %d", freq);
|
sprintf(pC_->outString_, "SSF %d", freq);
|
||||||
status = pC_->writeReadController();
|
status = pC_->writeReadController();
|
||||||
if (!status) {
|
if (!status) {
|
||||||
@@ -446,7 +446,7 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
if (comStatus) goto skip;
|
if (comStatus) goto skip;
|
||||||
// The response string is of the form "0: Current step frequency: 100"
|
// The response string is of the form "0: Current step frequency: 100"
|
||||||
sscanf(pC_->inString_, "%d: %[^:]: %d", &replyStatus, replyString, &replyValue);
|
sscanf(pC_->inString_, "%d: %[^:]: %d", &replyStatus, replyString, &replyValue);
|
||||||
velocity = replyValue * 500.0;
|
velocity = replyValue * COUNTS_PER_STEP;
|
||||||
setDoubleParam(pC_->motorVelocity_, velocity);
|
setDoubleParam(pC_->motorVelocity_, velocity);
|
||||||
|
|
||||||
// Read the current motor integral gain (range 1-1000)
|
// Read the current motor integral gain (range 1-1000)
|
||||||
|
@@ -2,9 +2,6 @@
|
|||||||
FILENAME... MD90Driver.h
|
FILENAME... MD90Driver.h
|
||||||
USAGE... Motor driver support for the DSM MD-90 controller.
|
USAGE... Motor driver support for the DSM MD-90 controller.
|
||||||
|
|
||||||
Mark Rivers
|
|
||||||
March 1, 2012
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "asynMotorController.h"
|
#include "asynMotorController.h"
|
||||||
@@ -15,6 +12,8 @@ March 1, 2012
|
|||||||
// No controller-specific parameters yet
|
// No controller-specific parameters yet
|
||||||
#define NUM_MD90_PARAMS 0
|
#define NUM_MD90_PARAMS 0
|
||||||
|
|
||||||
|
#define COUNTS_PER_STEP 1000.0 //Number of encoder counts per motor step (measured by testing)
|
||||||
|
|
||||||
class epicsShareClass MD90Axis : public asynMotorAxis
|
class epicsShareClass MD90Axis : public asynMotorAxis
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
Reference in New Issue
Block a user