Added scaffolding for velocity mode
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s

Added records to support detection of the current operation mode
(position or velocity), whether one is allowed to change between the two
and a record to actually change between the two. Also added a
doMoveVelocity method which should be implemented by derived drivers if
they support velocity mode.
This commit is contained in:
2026-01-20 14:11:06 +01:00
parent e234d05815
commit 6f639d7233
7 changed files with 352 additions and 26 deletions

View File

@@ -347,3 +347,37 @@ record(waveform, "$(INSTR)$(M):EncoderType") {
field(NELM, "80")
field(SCAN, "I/O Intr")
}
# Motors can operate either in position mode (0) or velocity mode (1). If the
# mode is stored within the controller, the driver writes the corresponding mode
# value into this record. If not, motors are always assumed to operate in
# position mode.
record(longin, "$(INSTR)$(M):Mode")
{
field(DTYP, "asynInt32")
field(INP, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_MODE")
field(SCAN, "I/O Intr")
field(PINI, "NO")
field(VAL, "0")
}
# Motors can operate either in position mode (0) or velocity mode (1). If it is
# possible to switch between the two, this record has a value of 1, otherwise
# its value is 0.
record(longin, "$(INSTR)$(M):CanSetMode")
{
field(DTYP, "asynInt32")
field(INP, "@asyn($(CONTROLLER),$(AXIS)) MOTOR_CAN_SET_MODE")
field(SCAN, "I/O Intr")
field(PINI, "NO")
field(VAL, "$(CANSETMODE=0)")
}
# Set the operation mode of the motor to position mode (0) or velocity mode (1).
# If CanSetMode is 0, the mode cannot be changed and writing to this record
# will have no effect.
record(longout, "$(INSTR)$(M):SetMode") {
field(DTYP, "asynInt32")
field(OUT, "@asyn($(CONTROLLER),$(AXIS),1) MOTOR_SET_MODE")
field(PINI, "NO")
}