diff --git a/build-groups.yml b/build-groups.yml index deec076..5588e82 100644 --- a/build-groups.yml +++ b/build-groups.yml @@ -48,6 +48,7 @@ groups: - motorSmarAct - pmac - optics + - smargon adcore: desc: "ADCore and the plugins most area detector IOCs use" diff --git a/smargon/fastGridScanRecords.pvi.device.yaml b/smargon/fastGridScanRecords.pvi.device.yaml new file mode 100644 index 0000000..a5cb35e --- /dev/null +++ b/smargon/fastGridScanRecords.pvi.device.yaml @@ -0,0 +1,177 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/pvi/releases/latest/download/pvi.device.schema.json +# Grouped from the DLS EDM screen fast-grid-scans.edl (smargon 2-24). +# Generated from that screen. Hand edits may be overwritten by regeneration. + +label: fastGridScanRecords +children: +- type: Group + name: General + layout: + type: Grid + labelled: true + children: + - type: SignalRW + name: FgsXNumSteps + label: Number of X Steps + write_pv: $(P):FGS:X_NUM_STEPS + write_widget: + type: TextWrite + read_pv: $(P):FGS:X_NUM_STEPS_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsYNumSteps + label: Number of Y Steps + write_pv: $(P):FGS:Y_NUM_STEPS + write_widget: + type: TextWrite + read_pv: $(P):FGS:Y_NUM_STEPS_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsZNumSteps + label: Number of Z Steps + write_pv: $(P):FGS:Z_NUM_STEPS + write_widget: + type: TextWrite + read_pv: $(P):FGS:Z_NUM_STEPS_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsXStepSize + label: X Step Size (mm) + write_pv: $(P):FGS:X_STEP_SIZE + write_widget: + type: TextWrite + read_pv: $(P):FGS:X_STEP_SIZE_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsYStepSize + label: Y Step Size (mm) + write_pv: $(P):FGS:Y_STEP_SIZE + write_widget: + type: TextWrite + read_pv: $(P):FGS:Y_STEP_SIZE_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsZStepSize + label: Z Step Size (mm) + write_pv: $(P):FGS:Z_STEP_SIZE + write_widget: + type: TextWrite + read_pv: $(P):FGS:Z_STEP_SIZE_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsDwellTime + label: Dwell Time (ms) + write_pv: $(P):FGS:DWELL_TIME + write_widget: + type: TextWrite + read_pv: $(P):FGS:DWELL_TIME_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsXStart + label: X Start Position (mm) + write_pv: $(P):FGS:X_START + write_widget: + type: TextWrite + read_pv: $(P):FGS:X_START_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsYStart + label: Y1 Start Position (mm) + write_pv: $(P):FGS:Y_START + write_widget: + type: TextWrite + read_pv: $(P):FGS:Y_START_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsZStart + label: Z1 Start Position (mm) + write_pv: $(P):FGS:Z_START + write_widget: + type: TextWrite + read_pv: $(P):FGS:Z_START_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsY2Start + label: Y2 Start Position (mm) + write_pv: $(P):FGS:Y2_START + write_widget: + type: TextWrite + read_pv: $(P):FGS:Y2_START_RBV + read_widget: + type: TextRead + - type: SignalRW + name: FgsZ2Start + label: Z2 Start Position (mm) + write_pv: $(P):FGS:Z2_START + write_widget: + type: TextWrite + read_pv: $(P):FGS:Z2_START_RBV + read_widget: + type: TextRead + - type: SignalR + name: FgsPosCounter + label: Position Counter + read_pv: $(P):FGS:POS_COUNTER + read_widget: + type: TextRead + - type: SignalR + name: FgsXCounter + label: X Counter + read_pv: $(P):FGS:X_COUNTER + read_widget: + type: TextRead + - type: SignalR + name: FgsYCounter + label: Y Counter + read_pv: $(P):FGS:Y_COUNTER + read_widget: + type: TextRead + - type: SignalR + name: FgsScanInvalid + label: Scan Valid + read_pv: $(P):FGS:SCAN_INVALID + read_widget: + type: TextRead + - type: SignalW + name: FgsStopProc + write_pv: $(P):FGS:STOP.PROC + write_widget: + type: ButtonPanel + actions: + Stop: '1' + - type: SignalR + name: FgsScanStatus + read_pv: $(P):FGS:SCAN_STATUS + read_widget: + type: TextRead +- type: Group + name: ProtectedControls + label: Protected Controls + layout: + type: SubScreen + labelled: false + children: + - type: Group + name: ProtectedGeneral + label: General + layout: + type: Grid + labelled: true + children: + - type: SignalW + name: FgsRunProc + write_pv: $(P):FGS:RUN.PROC + write_widget: + type: ButtonPanel + actions: + Run: '1' diff --git a/smargon/robotInterlocks.pvi.device.yaml b/smargon/robotInterlocks.pvi.device.yaml new file mode 100644 index 0000000..d90307e --- /dev/null +++ b/smargon/robotInterlocks.pvi.device.yaml @@ -0,0 +1,156 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/pvi/releases/latest/download/pvi.device.schema.json +# Grouped from the DLS EDM screen RobotInterlocks.edl (smargon 2-24). +# Generated from that screen. Hand edits may be overwritten by regeneration. + +label: robotInterlocks +children: +- type: Group + name: General + layout: + type: Grid + labelled: true + children: + - type: Group + name: RowRlX1HighThreshold + label: RlX1HighThreshold + layout: + type: Row + children: + - type: SignalR + name: RlX1HighThreshold + read_pv: $(P):RL_X1_HIGH_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlX2HighThreshold + read_pv: $(P):RL_X2_HIGH_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlYHighThreshold + read_pv: $(P):RL_Y_HIGH_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlZHighThreshold + read_pv: $(P):RL_Z_HIGH_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlOmegaHighThreshold + read_pv: $(P):RL_OMEGA_HIGH_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlPhiHighThreshold + read_pv: $(P):RL_PHI_HIGH_THRESHOLD + read_widget: + type: TextRead + - type: Group + name: RowX1RawPos + label: X1RawPos + layout: + type: Row + children: + - type: SignalR + name: X1RawPos + read_pv: $(P):X1_RAW_POS + read_widget: + type: TextRead + - type: SignalR + name: X2RawPos + read_pv: $(P):X2_RAW_POS + read_widget: + type: TextRead + - type: SignalR + name: YRawPos + read_pv: $(P):Y_RAW_POS + read_widget: + type: TextRead + - type: SignalR + name: ZRawPos + read_pv: $(P):Z_RAW_POS + read_widget: + type: TextRead + - type: SignalR + name: OmegaRawPos + read_pv: $(P):OMEGA_RAW_POS + read_widget: + type: TextRead + - type: SignalR + name: PhiRawPos + read_pv: $(P):PHI_RAW_POS + read_widget: + type: TextRead + - type: Group + name: RowRlX1LowThreshold + label: RlX1LowThreshold + layout: + type: Row + children: + - type: SignalR + name: RlX1LowThreshold + read_pv: $(P):RL_X1_LOW_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlX2LowThreshold + read_pv: $(P):RL_X2_LOW_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlYLowThreshold + read_pv: $(P):RL_Y_LOW_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlZLowThreshold + read_pv: $(P):RL_Z_LOW_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlOmegaLowThreshold + read_pv: $(P):RL_OMEGA_LOW_THRESHOLD + read_widget: + type: TextRead + - type: SignalR + name: RlPhiLowThreshold + read_pv: $(P):RL_PHI_LOW_THRESHOLD + read_widget: + type: TextRead + - type: Group + name: RowX1Inpos + label: X1Inpos + layout: + type: Row + children: + - type: SignalR + name: X1Inpos + read_pv: $(P):X1:INPOS + read_widget: + type: TextRead + - type: SignalR + name: X2Inpos + read_pv: $(P):X2:INPOS + read_widget: + type: TextRead + - type: SignalR + name: YInpos + read_pv: $(P):Y:INPOS + read_widget: + type: TextRead + - type: SignalR + name: ZInpos + read_pv: $(P):Z:INPOS + read_widget: + type: TextRead + - type: SignalR + name: OmegaInpos + read_pv: $(P):OMEGA:INPOS + read_widget: + type: TextRead + - type: SignalR + name: PhiInpos + read_pv: $(P):PHI:INPOS + read_widget: + type: TextRead diff --git a/smargon/smargon.ibek.support.yaml b/smargon/smargon.ibek.support.yaml new file mode 100644 index 0000000..ab88997 --- /dev/null +++ b/smargon/smargon.ibek.support.yaml @@ -0,0 +1,230 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/ibek/releases/download/3.1.2/ibek.support.schema.json + +module: smargon + +entity_models: + - name: smargon + description: |- + SmarGon multi-axis goniometer. Creates the motor controller, coordinate + system motors, homing logic, stub offsets, and centering records. + The pmac motor/CS entities are expanded from XML templates by the converter. + parameters: + name: + type: str + description: GUI element name used by the homing template. + P: + type: str + description: Device prefix, e.g. "BL03I-MO-SGON-01". + PPMAC_PORT: + type: str + description: Power PMAC asyn port name. + SSH_PORT: + type: str + description: Low-level SSH port name for the Power PMAC. + PPMAC_NO: + type: int + description: Power PMAC number. + IP_ADDRESS: + type: str + description: Power PMAC IP address. + ZEBRA: + type: str + description: Base PV for the zebra used for homing. + UNAME: + type: str + description: SSH username. + default: root + PASSWORD: + type: str + description: SSH password. + default: deltatau + CS_NO: + type: int + description: Coordinate system number. + default: 1 + PROG_NO: + type: int + description: Motion program number. + default: 10 + pre_init: + - value: | + # Create SSH Port (PortName, IPAddress, Username, Password, Priority, DisableAutoConnect, noProcessEos) + drvAsynPowerPMACPortConfigure("{{SSH_PORT}}", "{{IP_ADDRESS}}", "{{UNAME}}", "{{PASSWORD}}", "0", "0", "0") + # Configure Model 3 Controller Driver (ControlerPort, LowLevelDriverPort, Address, Axes, MovingPoll, IdlePoll) + pmacCreateController("{{PPMAC_PORT}}", "{{SSH_PORT}}", 0, 8, 100, 1000) + # Configure Model 3 Axes Driver (Controler Port, Axis Count) + pmacCreateAxes("{{PPMAC_PORT}}", 8) + # Create CS (CSPortName, ControllerPort, CSNumber, ProgramNumber) + pmacCreateCS("CS{{CS_NO}}", "{{PPMAC_PORT}}", {{CS_NO}}, {{PROG_NO}}) + # Configure Model 3 CS Axes Driver (CSPortName, CSAxisCount) + pmacCreateCSAxes("CS{{CS_NO}}", 9) + pmacSetCoordStepsPerUnit("CS{{CS_NO}}", 1, 1) + pmacSetCoordStepsPerUnit("CS{{CS_NO}}", 2, 1) + + post_init: + - value: | + {% for i in range(1, 7) %} + pmacSetAxisScale {{PPMAC_PORT}} {{i}} 200 + {% endfor %} + dbpf "{{P}}:FEEDRATE", "100" + dbpf "{{P}}:FEEDRATE_LIMIT", "0" + {% for i in range(1, 7) %} + dbpf "{{P}}:MOTOR_{{i}}.NTMF", "10000" + {% endfor %} + {% for i in range(1, 7) %} + dbpf "{{P}}:MOTOR_{{i}}.NTM", "NO" + {% endfor %} + {% for axis in ['X', 'Y', 'Z', 'OMEGA', 'PHI', 'CHI'] %} + dbpf "{{P}}:{{axis}}.NTMF", "10000" + {% endfor %} + {% for axis in ['X', 'Y', 'Z', 'OMEGA', 'PHI', 'CHI'] %} + dbpf "{{P}}:{{axis}}.NTM", "NO" + {% endfor %} + + databases: + - file: $(SMARGON)/db/smargonHoming.template + args: + name: + P: + PPMAC_PORT: + ZEBRA: + - file: $(SMARGON)/db/stubOffsets.template + args: + P: + PPMAC_PORT: + - file: $(SMARGON)/db/stubOffsetSoftMotor.template + args: + P: + AXIS: X + - file: $(SMARGON)/db/stubOffsetSoftMotor.template + args: + P: + AXIS: Y + - file: $(SMARGON)/db/stubOffsetSoftMotor.template + args: + P: + AXIS: Z + - file: $(SMARGON)/db/csCentering.template + args: + P: + + pvi: + yaml_path: smargonHoming.pvi.device.yaml + ui_macros: + P: + pv_prefix: "$(P):" + + - name: fastGridScans + description: |- + Fast grid scan records for the SmarGon, driven via a Power PMAC + coordinate system. + parameters: + P: + type: str + description: Device prefix. + PPMAC_PORT: + type: str + description: Power PMAC asyn port name. + CS_NO: + type: int + description: Coordinate system number. + PVAR_CENT: + type: int + description: P variable centre used for FGS. + default: 80 + DITHER_PLC: + type: int + description: Dither PLC number. + default: 13 + PROG_NO: + type: int + description: FGS program number. + default: 11 + databases: + - file: $(SMARGON)/db/fastGridScanRecords.template + args: + .*: + + pvi: + yaml_path: fastGridScanRecords.pvi.device.yaml + ui_macros: + P: + pv_prefix: "$(P):FGS:" + + - name: homingSafeCheck + description: |- + Homing safe-check records for the SmarGon. Monitors whether the + goniometer X axis is in a safe position before allowing homing. + parameters: + P: + type: str + description: Device prefix. + PPMAC_PORT: + type: str + description: Power PMAC asyn port name. + GEOBRICK_PORT: + type: str + description: GeoBrick asyn port name. + GON_X_SAFE_VAR: + type: str + description: Gonio X safe-for-homing variable name, e.g. P817. + GON_X_AXIS_NUM: + type: int + description: Gonio X axis number. + databases: + - file: $(SMARGON)/db/smargonHomingSafeCheck.template + args: + P: + PPMAC_PORT: + GEOBRICK_PORT: + DOM: "{{ P[:5] }}" + GON_X_SAFE_VAR: + GON_X_AXIS_NUM: + + - name: omegaProtection + description: |- + Omega protection PLC records for the SmarGon. Monitors and controls + the omega-axis protection interlock. + parameters: + P: + type: str + description: Device prefix. + PPMAC_PORT: + type: str + description: Power PMAC asyn port name. + PLC_NO: + type: int + description: Omega protection PLC number. + default: 11 + databases: + - file: $(SMARGON)/db/omegaProtection.template + args: + P: + PPMAC_PORT: + DOM: "{{ P[:5] }}" + PLC_NO: + + - name: robotInterlocks + description: |- + Robot interlock status records for the SmarGon. Reads PLC variables + that indicate axis in-position and robot-ready status. + parameters: + P: + type: str + description: Device prefix. + PPMAC_PORT: + type: str + description: Power PMAC asyn port name. + PLC_NO: + type: int + description: Interlock PLC number. + databases: + - file: $(SMARGON)/db/robotInterlocks.template + args: + .*: + + pvi: + yaml_path: robotInterlocks.pvi.device.yaml + ui_macros: + P: + pv_prefix: "$(P):" diff --git a/smargon/smargon.install.yml b/smargon/smargon.install.yml new file mode 100644 index 0000000..fdbd140 --- /dev/null +++ b/smargon/smargon.install.yml @@ -0,0 +1,21 @@ +# yaml-language-server: $schema=../_scripts/support_install_variables.json + +module: smargon +# 2-25 is the first release with the homing lookup as an aSub record, so it +# builds without genSub. +version: 2-25 + +organization: https://github.com/DiamondLightSource + +dbds: + - smargon.dbd + +libs: + - smargon + +# etc and iocs only build example IOCs and docs with the Diamond builder, which +# is not in the container. The top Makefile adds both through $(wildcard), so +# removing them is enough. +remove_files_prebuild: + - etc + - iocs diff --git a/smargon/smargonHoming.pvi.device.yaml b/smargon/smargonHoming.pvi.device.yaml new file mode 100644 index 0000000..efea20a --- /dev/null +++ b/smargon/smargonHoming.pvi.device.yaml @@ -0,0 +1,198 @@ +# yaml-language-server: $schema=https://github.com/epics-containers/pvi/releases/latest/download/pvi.device.schema.json +# Grouped from the DLS EDM screen Smargon.edl (smargon 2-24). +# Generated from that screen. Hand edits may be overwritten by regeneration. + +label: smargonHoming +children: +- type: Group + name: General3 + label: General + layout: + type: Grid + labelled: true + children: + - type: SignalW + name: StubOffsets + label: Stub Offsets + write_pv: $(P):RESTORE_SETSTUBOFFSETS + write_widget: + type: ButtonPanel + actions: + RestoreStubs: '1' + - type: Group + name: RowXStubOffsetUser + label: X + layout: + type: Row + children: + - type: SignalW + name: XStubOffsetUser + write_pv: $(P):X_STUB_OFFSET_USER + write_widget: + type: TextWrite + - type: SignalR + name: XStubOffset + read_pv: $(P):X_STUB_OFFSET_RBV + read_widget: + type: TextRead + - type: Group + name: RowYStubOffsetUser + label: Y + layout: + type: Row + children: + - type: SignalW + name: YStubOffsetUser + write_pv: $(P):Y_STUB_OFFSET_USER + write_widget: + type: TextWrite + - type: SignalR + name: YStubOffset + read_pv: $(P):Y_STUB_OFFSET_RBV + read_widget: + type: TextRead + - type: Group + name: RowZStubOffsetUser + label: Z + layout: + type: Row + children: + - type: SignalW + name: ZStubOffsetUser + write_pv: $(P):Z_STUB_OFFSET_USER + write_widget: + type: TextWrite + - type: SignalR + name: ZStubOffset + read_pv: $(P):Z_STUB_OFFSET_RBV + read_widget: + type: TextRead + - type: Group + name: Centering + label: Centering + layout: + type: SubScreen + labelled: false + children: + - type: Group + name: General + layout: + type: Grid + labelled: true + children: + - type: Group + name: RowNewCsCenter + label: NewCsCenter + layout: + type: Row + children: + - type: SignalR + name: NewCsCenter + read_pv: $(P):NEW_CS_CENTER + read_widget: + type: LED + - type: SignalR + name: XStubOffsetStoreCen + read_pv: $(P):X_STUB_OFFSET_STORE_CEN + read_widget: + type: TextRead + - type: SignalR + name: YStubOffsetStoreCen + read_pv: $(P):Y_STUB_OFFSET_STORE_CEN + read_widget: + type: TextRead + - type: SignalR + name: ZStubOffsetStoreCen + read_pv: $(P):Z_STUB_OFFSET_STORE_CEN + read_widget: + type: TextRead + - type: Group + name: RowNewCsCenter + label: NewCsCenter + layout: + type: Row + children: + - type: SignalR + name: XPositionStoreCen + read_pv: $(P):X_POSITION_STORE_CEN + read_widget: + type: TextRead + - type: SignalR + name: YPositionStoreCen + read_pv: $(P):Y_POSITION_STORE_CEN + read_widget: + type: TextRead + - type: SignalR + name: ZPositionStoreCen + read_pv: $(P):Z_POSITION_STORE_CEN + read_widget: + type: TextRead + - type: Group + name: SmarGonRealMotors + label: SmarGonRealMotors + layout: + type: SubScreen + labelled: false + children: + - type: Group + name: General2 + label: General + layout: + type: Grid + labelled: true + children: + - type: SignalW + name: HomeProc + label: SmarGon homing is disabled when cryojet (coarse) or flu detector is in + write_pv: $(P):HOME.PROC + write_widget: + type: ButtonPanel + actions: + Home: '1' + - type: SignalR + name: Homestatus + label: SmarGon homing is disabled when cryojet (coarse) or flu detector is in + read_pv: $(P):HOMESTATUS + read_widget: + type: TextRead + - type: DeviceRef + name: FastGridScanRecords + label: fastGridScanRecords + pv: :PVI + ui: fastGridScanRecords.pvi.bob + macros: {} + - type: DeviceRef + name: RobotInterlocks + label: Robot Interlocks + pv: $(P):PVI + ui: robotInterlocks.pvi.bob + macros: + P: $(P) +- type: Group + name: ProtectedControls + label: Protected Controls + layout: + type: SubScreen + labelled: false + children: + - type: Group + name: ProtectedGeneralCenteringGeneral + label: General / Centering / General + layout: + type: Grid + labelled: true + children: + - type: SignalW + name: CenterCsProc + write_pv: $(P):CENTER_CS.PROC + write_widget: + type: ButtonPanel + actions: + Apply: '0' + - type: SignalW + name: RestorePosStubsProc + write_pv: $(P):RESTORE_POS_STUBS.PROC + write_widget: + type: ButtonPanel + actions: + Restore: '0'