The motor record is intended to support motors of all kinds, but currently supports only the following variety of motor controllers (in addition to Soft Channel support):
Except where specified otherwise, fields associated with the motor position and its derivatives take values in user-specified "engineering units", such as degrees; the engineering unit name is contained in the field EGU. Thus, generally, speeds are expressed in EGU's per second. Accelerations, however, are expressed as the number of seconds taken to accelerate to full speed. However, additional fields are provided so that the motor position can be specified in steps and the speed in revolutions per second, and so that the step size can be set by specifying the number of steps per revolution and the number of EGU's per revolution.
The motor record can read motor position from the controller's readback register or encoder register, or from any other EPICS record, via an EPICS input link. While the motor is moving, the record can trigger an output link periodically, to send readback information to other EPICS records. When a complete motion (possibly including backlash takeout) is finished, the record can trigger a forward link to process other EPICS records.
The motor record can force its drive fields to agree with its readback fields, and it does so in a variety of circumstances (e.g., when the user tells a motor to stop, and when a limit switch is hit). Therefore, if you are driving the motor record's VAL or DVAL field with the output of another record, and you want that record always to contain the same value as the motor record, you must handle this behavior in the database. One way to do this is to forward link the motor record to a soft analog output record, and to cause that AO record to grab the motor record's VAL or DVAL field and poke it into your record.
The motor record is unlike most other EPICS records in that its processing is neither "synchronous" nor "asynchronous", as these terms are used in the EPICS Record Reference Manual. Currently, the PACT field is always FALSE after record processing has completed, even though a motor motion may be in progress. This means the record always responds to channel-access puts, and can be stopped or retargeted at any time. The record's forward link is not executed until the motor has stopped and no motion requests are pending.
Name | Access | Prompt | Data type | Comment | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ACCL | R/W | Seconds to Velocity | FLOAT | acceleration time | ||||||||||||
ATHM | R | At HOME | SHORT | uses the HOME switch | ||||||||||||
BACC | R/W | BL Seconds to Veloc. | FLOAT | backlash acceleration time | ||||||||||||
BDST | R/W | BL Distance (EGU) | FLOAT | backlash distance | ||||||||||||
BVEL | R/W | BL Velocity (EGU/s) | FLOAT | backlash speed | ||||||||||||
CARD | R | Card Number | SHORT | EPICS card # | ||||||||||||
CBAK | None | Callback structure | NOACCESS | |||||||||||||
CNEN | R/W | Enable control | RECCHOICE | (0:"Disable", 1:"Enable") | ||||||||||||
DCOF | R/W | Derivative Gain | FLOAT | |||||||||||||
DHLM | R/W* | Dial High Limit | FLOAT | |||||||||||||
DIFF | R | Difference dval-drbv | DOUBLE | |||||||||||||
DINP | R/W | DMOV Input Link | INLINK | |||||||||||||
DIR | R/W* | User Direction | RECCHOICE | (0:"Pos", 1:"Neg") | ||||||||||||
DLLM | R/W* | Dial Low Limit | FLOAT | |||||||||||||
DLY | R/W | Readback settle time (s) | FLOAT | |||||||||||||
DMOV | R | Done moving to value | SHORT | The "done" flag | ||||||||||||
DOL | R | Desired Output Loc | INLINK | only for closed-loop mode | ||||||||||||
DRBV | R | Dial Readback Value | DOUBLE | |||||||||||||
DVAL | R/W* | Dial Desired Value | DOUBLE | |||||||||||||
EGU | R/W | Engineering Units | STRING | |||||||||||||
ERES | R/W* | Encoder Step Size (EGU) | FLOAT | |||||||||||||
FOF | R/W | Freeze Offset | SHORT | |||||||||||||
FOFF | R/W | Offset-Freeze Switch | RECCHOICE | (0:"Variable", 1:"Frozen") | ||||||||||||
FRAC | R/W | Move Fraction | FLOAT | |||||||||||||
GAIN | R/W | Combined Gain | FLOAT | |||||||||||||
HHSV | R/W* | Hihi Severity | GBLCHOICE | |||||||||||||
HIGH | R/W* | High Alarm Limit | FLOAT | |||||||||||||
HIHI | R/W* | Hihi Alarm Limit | FLOAT | |||||||||||||
HLM | R/W* | User High Limit | FLOAT | |||||||||||||
HLS | R | At High Limit Switch | SHORT | |||||||||||||
HLSV | R/W* | HW Lim. Violation Svr | GBLCHOICE | |||||||||||||
HOMF | R/W* | Home Forward | SHORT | |||||||||||||
HOMR | R/W* | Home Reverse | SHORT | |||||||||||||
HOPR | R/W | High Operating Range | FLOAT | |||||||||||||
HSV | R/W* | High Severity | GBLCHOICE | |||||||||||||
ICOF | R/W | Integral Gain | FLOAT | |||||||||||||
INIT | R/W | Startup commands | STRING | |||||||||||||
JOGF | R/W* | Jog motor Forward | SHORT | careful! | ||||||||||||
JOGR | R/W* | Jog motor Reverse | SHORT | careful! | ||||||||||||
LDVL | R | Last Dial Des Val | DOUBLE | |||||||||||||
LLM | R/W* | User Low Limit | FLOAT | |||||||||||||
LLS | R | At Low Limit Switch | SHORT | |||||||||||||
LLSV | R/W* | Lolo Severity | GBLCHOICE | |||||||||||||
LOLO | R/W* | Lolo Alarm Limit | FLOAT | |||||||||||||
LOPR | R/W | Low Operating Range | FLOAT | |||||||||||||
LOW | R/W* | Low Alarm Limit | FLOAT | |||||||||||||
LRLV | R | Last Rel Value | DOUBLE | |||||||||||||
LRVL | R | Last Raw Des Val | DOUBLE | |||||||||||||
LSPG | R | Last SPMG | RECCHOICE | (See SPMG) | ||||||||||||
LSV | R/W* | Low Severity | GBLCHOICE | |||||||||||||
LVAL | R | Last User Des Val | DOUBLE | |||||||||||||
LVIO | R | Limit violation | SHORT | |||||||||||||
MIP | R | Motion In Progress | SHORT | |||||||||||||
MISS | R | Ran out of retries | SHORT | |||||||||||||
MMAP | R | Monitor Mask | ULONG | |||||||||||||
MOVN | R | Motor is moving | SHORT | Don't confuse with DMOV | ||||||||||||
MRES | R/W* | Motor Step Size (EGU) | FLOAT | |||||||||||||
MSTA | R | Motor Status | ULONG | |||||||||||||
NMAP | R | Monitor Mask | ULONG | |||||||||||||
OFF | R/W | User Offset (EGU) | DOUBLE | |||||||||||||
OMSL | R/W | Output Mode Select | GBLCHOICE | |||||||||||||
OUT | R/W | Output Specification | OUTLINK | |||||||||||||
PCOF | R/W | Proportional Gain | FLOAT | |||||||||||||
PERL | R/W | Periodic Limits | RECCHOICE | (0:"No", 1:"Yes") | ||||||||||||
PDIF | R | Previous RDIF | LONG | |||||||||||||
POST | R/W | Post-move commands | STRING | |||||||||||||
PP | R | Post process command | SHORT | |||||||||||||
PREC | R/W | Display Precision | SHORT | |||||||||||||
PREM | R/W | Pre-move commands | STRING | |||||||||||||
RBV | R | User Readback Value | DOUBLE | |||||||||||||
RCNT | R | Retry count | SHORT | |||||||||||||
RDBD | R/W | Retry Deadband (EGU) | FLOAT | |||||||||||||
RDBL | R | Readback Location | INLINK | |||||||||||||
RDIF | R | Difference rval-rrbv | LONG | |||||||||||||
REP | R | Raw Encoder Position | DOUBLE | |||||||||||||
RES | R | Step Size (EGU) | FLOAT | |||||||||||||
RHLS | R | Raw High Limit Switch | SHORT | |||||||||||||
RINP | R/W | RMP Input Link | INLINK | |||||||||||||
RLLS | R | Raw Low Limit Switch | SHORT | |||||||||||||
RLNK | R | Readback OutLink | OUTLINK | |||||||||||||
RLV | R/W* | Relative Value | DOUBLE | |||||||||||||
RMP | R | Raw Motor Position | DOUBLE | |||||||||||||
RRBV | R | Raw Readback Value | DOUBLE | |||||||||||||
RRES | R/W | Readback Step Size (EGU) | FLOAT | |||||||||||||
RTRY | R/W | Max retry count | SHORT | |||||||||||||
RVAL | R/W* | Raw Desired Value | DOUBLE | |||||||||||||
RVEL | R | Raw Velocity | LONG | |||||||||||||
S | R/W | Speed (revs/sec) | FLOAT | |||||||||||||
SBAK | R/W | BL Speed (RPS) | FLOAT | |||||||||||||
SBAS | R/W | Base Speed (RPS) | FLOAT | |||||||||||||
SET | R/W | Set/Use Switch | RECCHOICE | (0:"Use", 1:"Set") | ||||||||||||
SPMG | R/W* | Stop/Pause/Move/Go | RECCHOICE | (0:"Stop", 1:"Pause", 2:"Move", 3:"Go") | ||||||||||||
SREV | R/W* | Steps per Revolution | LONG | |||||||||||||
SSET | R/W | Set SET Mode | SHORT | |||||||||||||
STOO | R/W | STOP OutLink | OUTLINK | |||||||||||||
STOP | R/W* | Stop | SHORT | |||||||||||||
SUSE | R/W | Set USE Mode | SHORT | |||||||||||||
TDIR | R | Direction of Travel | SHORT | |||||||||||||
TWF | R/W* | Tweak motor Forward | SHORT | |||||||||||||
TWR | R/W* | Tweak motor Reverse | SHORT | |||||||||||||
TWV | R/W* | Tweak Step Size (EGU) | FLOAT | |||||||||||||
UEIP | R/W* | Use Encoder If Present | RECCHOICE | (0:"No", 1:"Yes") | ||||||||||||
UREV | R/W* | EGU's per Revolution | FLOAT | |||||||||||||
URIP | R/W* | Use RDBL Link If Present | RECCHOICE | (0:"No", 1:"Yes") | ||||||||||||
VAL | R/W* | User Desired Value | DOUBLE | |||||||||||||
VBAS | R/W | Base Velocity (EGU/s) | FLOAT | |||||||||||||
VELO | R/W | Velocity (EGU/s) | FLOAT | |||||||||||||
VERS | R | Code Version | FLOAT | e.g., "1.95" | ||||||||||||
VOF | R/W | Variable Offset | SHORT | |||||||||||||
|
PID related record fields accept only normalized
values (i.e., 0.0 <= value <= 1.0). Before sending them to
the motor controller, device support scales the record fields to valid
motor controller parameters,. Let the motor controller PID parameters
be represented by CKP, CKI and CKD; then the PID coefficients are converted
from motor record fields to controller parameters as follows:
For the MM4000; CKP = PCOF, CKI = ICOF and CKD = DCOF.
Note the following:
|
||||
|
|
|
|
|
CNEN | R/W | Enable control | RECCHOICE | (0:"Disable", 1:"Enable") Enable/Disable closed-loop position control. This field is active only if the GAIN_SUPPORT bit in the MSTA is true. This field is set by both the user and device support. CNEN is set to Disable by device support when it detects a motion controller error; e.g. maximum following error exceeded. |
GAIN | R/W | Combined Gain | FLOAT | Valid range; 0.0 <= GAIN <= 1.0. GAIN sets
the motor controller PID parameters as follows;
For the MM4000 For all OMS controllers
|
PCOF | R/W | Proportional Gain | FLOAT | Valid range; 0.0 <= PCOF <= 1.0 |
ICOF | R/W | Integral Gain | FLOAT | Valid range; 0.0 <= ICOF <= 1.0 |
DCOF | R/W | Derivative Gain | FLOAT | Valid range; 0.0 <= DCOF <= 1.0 |
SOURCE CODE
files to be placed in <top>/<app>App/src/ |
|
---|---|
motorRecord.c | Record support for the motor record |
motor.h | Header included by all .c files |
motordevCom.c | Device support common to all motor Record device drivers. |
motordevCom.h | Device support header file. |
motordrvCom.c | Driver support common to all motor Record device drivers. |
motordrvCom.h | Driver support header file. |
NOTE: The above files are required for any and all motor Record device drivers. | |
devOmsCom.c | Device support common to all Oregon Microsystems device drivers. |
devOmsCom.h | Device support header file common to all Oregon Microsystems device drivers. |
drvOmsCom.h | Driver support header file common to all Oregon Microsystems device drivers. |
NOTE: The above files are required for any and all Oregon Microsystems device drivers. | |
devOms.c | Device support for Oregon Microsystems VME8 and VME44 series boards |
drvOms.c | Driver for Oregon Microsystems VME8 and VME44 series boards |
drvOms.h | Header included by devOms.c and drvOms.c |
devOms58.c | Device support for Oregon Microsystems VME58 series boards |
drvOms58.c | Driver for Oregon Microsystems VME58 series boards |
drvOms58.h | Header included by devOms58.c and drvOms58.c |
devV544.c | Device support for Highland Technology boards. |
drvV544.c | Driver for Highland Technology boards. |
drvV544.h | Header included by devV544.c and drvV544.c |
devMM4000.c | Device support for Newport MM4000. |
drvMM4000.c | Driver for Newport MM4000. |
drvMM4000.h | Header included by devMM4000.c and drvMM4000.c |
devSoft.c | Soft Channel device support. |
devSoftAux.c | Soft Channel device support (Note: CA and record access code cannot both reside in the same file; each defines (redefines) the DBR's. Hence, functions are split between this and the above file base on whether they are record oriented (devSoft.c) or CA oriented (devSoftAux.c). |
devSoft.h | Header included by devSoft.c and devSoftAux.c |
Makefile.Vx | This file is not included in the distribution. However, the user must
edit this file and add lines similar to the following:
MOTOR_OBJS = recMotor.o devOms.o drvOms.o devOms58.o drvOms58.o LIBNAME = mylib.o LIBOBJS = $(MOTOR_OBJS) $(other objects here) |
ASCII FILES
files to be placed in <top>/cat_ascii/ |
|
---|---|
motorRecord.ascii | This file defines all of the fields for the motor record. |
choiceRecMotor.ascii | This file defines all of the choice values for the motor record. |
choiceMotor.h | This file is included by choiceRecMotor.ascii and by recMotor.c. |
choiceRec.ascii | This file is not included in the distribution. However, the user must
edit this file and add the line:
#include <choiceRecMotor.ascii> |
dbRecType.ascii | This file is not included in the distribution. However, the user must
edit this file and add the line:
"motor" |
devSup.ascii | This file is not included in the distribution. However, the user must
edit this file and add the following lines:
! Device Support for motor record "motor" VME_IO "devOMS" "OMS VME8, VME44" "motor" VME_IO "devOms58" "OMS VME58" "motor" VME_IO "devV544" "Highland V544" |
drvSup.ascii | This file is not included in the distribution. However, the user must
edit or create this file and add the following lines:
! Driver support for the OME VME58 motor controller "drvOms58" |
MEDM DISPLAY SCREENS
files to be placed in <top>/<app>App/op/adl/ |
|
---|---|
motorx.adl | Small motor-control screen |
motorx_tiny.adl | Tiny motor-control screen |
motorx_more.adl | Medium motor-control screen |
motorx_setup.adl | Setup screen for a single motor |
motorx_all.adl | Debug screen for a single motor |
These files build medm screens to access the motor
record. To use one of them from the command line, type, for example
medm -x -macro "P=XXX:,M=m1" motorx.adlwhere XXX:m1 is the name of a motor record in an IOC. These files can also be used as related displays from other medm screens by passing the argument "P=XXX:,M=m1". |
EPICS STARTUP FILES
files to be placed in <top>/ioc/ioc<name>/ |
|||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
st.cmdmv167 | Startup script | ||||||||||||||
A sample startup script, containing excerpts relevant to
motors, is included in the distribution. Here is an annotated copy:
####################################################################### # vxWorks startup script to load and execute system (iocCore) software.Load standard EPICS software # the following should be loaded first - BEGIN ld < targetmv167/iocCore ld < targetmv167/drvSup ld < targetmv167/devSup ld < targetmv167/recSup # the following should be loaded first - ENDLoad custom EPICS software (including motor support) ld < ../../stdApp/src/O.mv167/stdlib.oMotor-related debug switches recMotordebug = 0 #OMS vme8/vme44 debug switches devOMSdebug = 0 drvOMSdebug = 0 #OMS vme58 debug switches devOms58debug = 0 drvOms58debug = 0 #Highland Technology V544 debug switches devV544ebug = 0 drvV544debug = 0Motor-related databases # load this before loading any databases dbLoad "../../default.dctsdr" #allstop dbLoadRecords("../../stdApp/gDb/allstop.db","P=tmm:") #motors dbLoadRecords("../../stdApp/gDb/m16.db","P=tmm:")Specify motor-controller board address, interrupt vector, etc.
# OMS VME8, VME44, VMEX driver setup parameters: omsSetup(5, 8, 0xFC00, 180, 5, 10) # OMS VME58 driver setup parameters: oms58Setup(5, 8, 0x2000, 190, 5, 10) # Highland Technology V544 driver setup parameters: v544Setup(5, 4, 0xDD00, 200, 5, 10)Start EPICS iocInit |
BACKUP/RESTORE (BURT) REQUEST FILES
files to be placed in <top>/<app>App/op/burt/ |
|
---|---|
settings.req | sample request file to save settings of all motors. Edit this file, supplying names of the motor records whose settings you want saved. (The sample file also saves the states of other records in the sample database, m16.db, that enable or disable the motor records.) |
yyMotorSettings.req | save settings of a specified motor. This file is #include'd (once for each motor) by settings.req. |
positions.req | sample request file to save positions of all motors. Edit this file, supplying names of the motor records whose positions you want saved. |
yyMotorPositions.req | save position of a specified motor, This file is #include'd (once for each motor) by positions.req. |
These files tell the backup/restore tool how to save motor
settings and positions. To use them from the command line, type, for example
burtrb -f settings.req -o myMotorSettings.snap burtrb -f positions.req -o myMotorPositions.snapTo restore the motor settings and positions saved by the above commands, type burtwb -f myMotorSettings.snap burtwb -f myMotorPositions.snap |
There is no way to ask for a reading of the motor's position register, encoder, or limit switches. These are read only while the motor is moving.
Because of the way limit-switch information is conveyed by the OMS hardware, the motor record cannot know the states of both limit switches at the same time. It only knows the state of the switch toward which the motor is moving.
If a move is requested while the motor already is in motion, the original move will still receive a (useless) backlash correction.
Changing MRES (the motor resolution) should change VELO (the speed in
engineering units per second), and leave S (the speed in revolutions per
second) unchanged. Currently, neither VELO nor S appears to change, but
the record behaves as though S had been changed to agree with VELO. A similar
thing happens with SBAK and SBAS.