From bfda809257e8e9fab492aa6293a1ba94d78e371f Mon Sep 17 00:00:00 2001 From: smathis Date: Wed, 23 Apr 2025 13:46:02 +0200 Subject: [PATCH] Added high default value for RDBD See docstring: This is to prevent overshoot stop commands. --- README.md | 26 +++++++++++++------------- db/sinqMotor.db | 9 ++++++--- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index e410191..5ae523e 100644 --- a/README.md +++ b/README.md @@ -46,11 +46,11 @@ The script for controller 1 ("turboPmac1.cmd") for a Turbo PMAC (see https://git ``` # Define the name of the controller and the corresponding port -epicsEnvSet("NAME","actualDriver1") -epicsEnvSet("ASYN_PORT","p$(NAME)") +epicsEnvSet("DRIVER_PORT","actualDriver1") +epicsEnvSet("IP_PORT","p$(DRIVER_PORT)") # Create the TCP/IP socket used to talk with the controller. The socket can be adressed from within the IOC shell via the port name -drvAsynIPPortConfigure("$(ASYN_PORT)","172.28.101.24:1025") +drvAsynIPPortConfigure("$(IP_PORT)","172.28.101.24:1025") # Create the controller object with the defined name and connect it to the socket via the port name. # The other parameters are as follows: @@ -58,25 +58,25 @@ drvAsynIPPortConfigure("$(ASYN_PORT)","172.28.101.24:1025") # 0.05: Busy poll period in seconds # 1: Idle poll period in seconds # 1: Socket communication timeout in seconds -actualDriverController("$(NAME)", "$(ASYN_PORT)", 8, 0.05, 1, 1); +actualDriverController("$(DRIVER_PORT)", "$(IP_PORT)", 8, 0.05, 1, 1); # Define some axes for the specified motor controller at the given slot (1, 2 and 5). No slot may be used twice! -actualDriverAxis("$(NAME)",1); -actualDriverAxis("$(NAME)",2); -actualDriverAxis("$(NAME)",5); +actualDriverAxis("$(DRIVER_PORT)",1); +actualDriverAxis("$(DRIVER_PORT)",2); +actualDriverAxis("$(DRIVER_PORT)",5); # Set the number of subsequent timeouts -setMaxSubsequentTimeouts("$(NAME)", 20); +setMaxSubsequentTimeouts("$(DRIVER_PORT)", 20); # Configure the timeout frequency watchdog: A maximum of 10 timeouts are allowed in 300 seconds before an alarm message is sent. -setThresholdComTimeout("$(NAME)", 300, 10); +setThresholdComTimeout("$(DRIVER_PORT)", 300, 10); # Parametrize the EPICS record database with the substitution file named after the motor controller. epicsEnvSet("SINQDBPATH","$(sinqMotor_DB)/sinqMotor.db") -dbLoadTemplate("$(TOP)/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)") +dbLoadTemplate("$(TOP)/$(DRIVER_PORT).substitutions", "INSTR=$(INSTR)$(DRIVER_PORT):,CONTROLLER=$(DRIVER_PORT)") epicsEnvSet("SINQDBPATH","$(actualDriver_DB)/turboPmac.db") -dbLoadTemplate("$(TOP)/$(NAME).substitutions", "INSTR=$(INSTR)$(NAME):,CONTROLLER=$(NAME)") -dbLoadRecords("$(sinqMotor_DB)/asynRecord.db","P=$(INSTR)$(NAME),PORT=$(ASYN_PORT)") +dbLoadTemplate("$(TOP)/$(DRIVER_PORT).substitutions", "INSTR=$(INSTR)$(DRIVER_PORT):,CONTROLLER=$(DRIVER_PORT)") +dbLoadRecords("$(sinqMotor_DB)/asynRecord.db","P=$(INSTR)$(DRIVER_PORT),PORT=$(IP_PORT)") ``` ### Substitution file @@ -99,7 +99,7 @@ The variable `SINQDBPATH` has been set in "mcu1.cmd" before calling `dbLoadTempl #### Mandatory parameters - `AXIS`: Index of the axis, corresponds to the physical connection of the axis to the MCU. -- `M`: The full PV name is created by concatenating the variables INSTR, NAME and M. For example, the PV of the first axis would be "SQ:SINQTEST:mcu1:lin1". +- `M`: The full PV name is created by concatenating the variables INSTR, DRIVER_PORT and M. For example, the PV of the first axis would be "SQ:SINQTEST:mcu1:lin1". - `EGU`: Engineering units. For a linear motor, this is mm, for a rotaty motor, this is degree. - `DIR`: If set to "Neg", the axis direction is inverted. - `MRES`: This is a scaling factor determining the resolution of the position readback value. For example, 0.001 means a precision of 1 um. A detailed description can be found in section [Motor record resolution MRES](#motor-record-resolution-mres). diff --git a/db/sinqMotor.db b/db/sinqMotor.db index 6016a27..89c5f12 100755 --- a/db/sinqMotor.db +++ b/db/sinqMotor.db @@ -23,7 +23,10 @@ # greater than RDBD, the motor will try again, as if the user had requested a # move from the now current position to the desired position. Only a limited # number of retries will be performed (see RTRY). If the given value is smaller -# than MRES, it is set to MRES. +# than MRES, it is set to MRES. In this version of the record, we set RDBD to a +# very high value in order to suppress both retries and the NTM (new target +# monitor) logic from issuing stop commands during overshoots (see +# https://epics.anl.gov/bcda/synApps/motor/motorRecord.html#Fields_misc). record(motor,"$(INSTR)$(M)") { field(DESC,"$(DESC=$(M))") @@ -38,8 +41,8 @@ record(motor,"$(INSTR)$(M)") field(DLLM, "$(DLLM=0)") field(TWV,"1") field(RTRY,"0") - field(RDBD,"0") - field(BDST,"0") + field(RDBD, "$(RDBD=10e300)") # Suppress retries and overshoot stop commands + field(BDST, "0") field(RMOD,"3") # Retry mode 3 ("In-Position"): This suppresses any retries from the motor record. }