Merge branch 'dev'

This commit is contained in:
2024-05-24 16:18:07 -05:00
3 changed files with 47 additions and 11 deletions

View File

@@ -174,10 +174,12 @@ asynStatus MD90Axis::move(double position, int relative, double minVelocity, dou
status = sendAccelAndVelocity(acceleration, maxVelocity);
// Position specified in encoder steps (10 nm), but motor move commands are in nanometers
position = position * 10;
if (relative) {
sprintf(pC_->outString_, "#%02dI%+d", axisNo_, NINT(position));
sprintf(pC_->outString_, "CRM %d", NINT(position));
} else {
sprintf(pC_->outString_, "#%02dG%+d", axisNo_, NINT(position));
sprintf(pC_->outString_, "CLM %d", NINT(position));
}
status = pC_->writeReadController();
return status;
@@ -190,11 +192,7 @@ asynStatus MD90Axis::home(double minVelocity, double maxVelocity, double acceler
status = sendAccelAndVelocity(acceleration, maxVelocity);
if (forwards) {
sprintf(pC_->outString_, "#%02dH+", axisNo_);
} else {
sprintf(pC_->outString_, "#%02dH-", axisNo_);
}
sprintf(pC_->outString_, "HOM");
status = pC_->writeReadController();
return status;
}
@@ -271,7 +269,7 @@ asynStatus MD90Axis::poll(bool *moving)
// TODO: Will need to add some more error handling for the motor return codes.
// Read the current motor position
// Read the current motor position in encoder steps (10 nm)
sprintf(pC_->outString_, "GEC");
comStatus = pC_->writeReadController();
if (comStatus) goto skip;
@@ -298,20 +296,31 @@ asynStatus MD90Axis::poll(bool *moving)
case 3: // Move stopped
break;
case 4: // Homing error
setIntegerParam(pC_->motorStatusProblem_, 1);
break;
case 5: // Stance error
setIntegerParam(pC_->motorStatusProblem_, 1);
break;
case 6: // Stance complete
break;
case 7: // Open loop move error
setIntegerParam(pC_->motorStatusProblem_, 1);
break;
case 8: // Closed loop move error
setIntegerParam(pC_->motorStatusProblem_, 1);
break;
case 9: // Closed loop move complete
break;
case 10: // End of travel error
setIntegerParam(pC_->motorStatusProblem_, 1);
if (position > 0) {
setIntegerParam(pC_->motorStatusHighLimit_, 1);
} else {
setIntegerParam(pC_->motorStatusLowLimit_, 1);
}
break;
case 11: // Ramp move error
setIntegerParam(pC_->motorStatusProblem_, 1);
break;
default:
break;

View File

@@ -1,6 +1,26 @@
file "$(MOTOR)/db/basic_asyn_motor.db"
{
pattern
{P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT}
{DSM:, 0, "m$(N)", "asynMotor", MD900, 0, "Bottom", mm, Pos, 2.0, 0.1, .2, 0, 1, .2, -.001, 3, 16, 0, ""}
{P, N, M, DTYP, PORT, ADDR, DESC, EGU, DIR, VELO, VBAS, VMAX, ACCL, BDST, BVEL, BACC, MRES, PREC, DHLM, DLLM, INIT}
{DSM:, 0, "m$(N)", "asynMotor", MD900, 0, "MD-90", mm, Pos, 0.5, 0.025, 0.625, 0, 0, 0.03, 0, .00001, 2, 20, -20, ""}
}
# P IOC prefix
# N Port number
# M Record name pattern
# DTYP Datatype
# PORT Port
# ADDR Address
# DESC Description
# EGU Engineering units
# DIR Direction
# VELO Velocity (EGU / s)
# VBAS Minimum velocity (EGU / s)
# VMAX Maximum velocity (EGU / s) (not getting set here with basic_asyn_motor.db)
# ACCL Acceleration (time in seconds until VELO)
# BDST Backlash distance
# MRES Motor step size (EGU)
# PREC Display precision number of decimal places
# DHLM Dial high travel limit (EGU)
# DLLM Dial low travel limit (EGU)
# INIT Initialization string (seems to be unused/broken)

View File

@@ -5,7 +5,7 @@
dbLoadDatabase("../../dbd/dsm.dbd")
dsm_registerRecordDeviceDriver(pdbbase)
# Port 2 on a Moxa
# Network device
#!drvAsynIPPortConfigure("serial0", "192.168.1.16:4002",0,0,0)
# Local serial port
#!drvAsynSerialPortConfigure("serial0", "/dev/ttyS0", 0, 0, 0)
@@ -24,6 +24,12 @@ asynOctetSetOutputEos("serial0", 0, "\r")
asynSetTraceIOMask("serial0", 0, 2)
#asynSetTraceMask("serial0", 0, 255)
# Turn on the power supply and set the deadband
asynOctetConnect("initConnection", "serial0", 0)
asynOctetWrite("initConnection", "EPS")
asynOctetWrite("initConnection", "SDB 10")
asynOctetDisconnect('initConnection')
MD90CreateController("MD900", "serial0", 1, 100, 5000)
### Motors
@@ -36,3 +42,4 @@ iocInit
# This IOC does not use save/restore, so set values of some PVs
dbpf("DSM:m0.RTRY", "0")
dbpf("DSM:m0.TWV", "0.1")
dbpf("DSM:m0.VMAX", "0.625")