Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Build image
on:
push:
tags:
- 'v*'
pull_request:

jobs:
build_and_push:
permissions:
packages: write
contents: read
uses: cnpem/epics-in-docker/.github/workflows/ioc-images.yml@main
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "docker"]
path = docker
url = https://github.com/cnpem/epics-in-docker.git
branch = release
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EPICS SoftIOC to auto adjust the cryo load.


This repository contains the EPICS Soft Input/Output Controller (IOC) used at
LNLS for leveling the cryomodule load till reach a desired total power value.

## Running the IOC

You can use the following command to run it in the background using the default
start-up script from
[epics-in-docker](https://github.com/cnpem/epics-in-docker).

```bash
TAG={latest} docker compose up -d
```

## Building the IOC image

This project uses [epics-in-docker](https://github.com/cnpem/epics-in-docker)
for building container images.
2 changes: 1 addition & 1 deletion cryoLevelerApp/Db/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ include $(TOP)/configure/CONFIG
#----------------------------------------------------
# Create and install (or just install) into <top>/db
# databases, templates, substitutions like this
#DB += xxx.db
DB += cll.db

#----------------------------------------------------
# If <anyname>.db template is not named <anyname>*.template add
Expand Down
83 changes: 83 additions & 0 deletions cryoLevelerApp/Db/cll.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
record(ao, "$(P)$(R)$(CRYO_MOD):CLLTotalPower-SP")
{
field(DESC, "Desired CLL total power")
field(EGU, "W")
field(PINI, "YES")
}
Comment thread
gustavosr8 marked this conversation as resolved.

record(ai, "$(P)$(R)$(CRYO_MOD):CLLTotalPower-RB")
{
field(DESC, "Desired CLL total power")
field(EGU, "W")
field(INP, "$(P)$(R)$(CRYO_MOD):CLLTotalPower-SP CP")
}

record(calc, "$(P)$(R)$(CRYO_MOD):CLLTotalPower-Mon")
{
field(DESC, "Sum of RF and Heater powers")
field(EGU, "W")

field(INPA, "$(P)$(R)$(CRYO_MOD):EB$(CRYO_MOD)10_CLLHeaterPower-Mon CP")
field(INPB, "$(P)$(RF_R)$(SRF_CAV):PwrW-Mon CP")
field(CALC, "A+B")
}

record(calcout, "$(P)$(R)$(CRYO_MOD):TargetHeaterPwr")
{
field(DESC, "Heater pwr to reach desired total pwr")
field(EGU, "W")

field(SDIS, "$(P)$(R)$(CRYO_MOD):CLLAutoEn-Sel")
field(DISV, "0")

field(INPA, "$(P)$(R)$(CRYO_MOD):CLLTotalPower-SP CP")
field(INPB, "$(P)$(R)$(CRYO_MOD):CLLTotalPower-Mon CP")
field(INPC, "$(P)$(R)$(CRYO_MOD):EB$(CRYO_MOD)10_CLLInternalRefPower-Mon")
field(INPD, "$(P)$(R)$(CRYO_MOD):CLLPowerDeadband-SP")

field(CALC, "MOD(A-B)>D")
field(OCAL, "(A-B)+C")

# When the error is greater than the deadband
# write the corrected power to the heater
field(OOPT, "When Non-zero")
field(DOPT, "Use OCAL")
field(OUT, "$(P)$(R)$(CRYO_MOD):EB$(CRYO_MOD)10_CLLInternalRefPower-SP")
}

record(bo, "$(P)$(R)$(CRYO_MOD):CLLAutoEn-Sel")
{
field(DESC, "Enable CLL auto-adjust")
field(PINI, "YES")
field(ZNAM, "Disable")
field(ONAM, "Enable")

field(FLNK, "$(P)$(R)$(CRYO_MOD):TargetHeaterPwr")
}
Comment thread
gustavosr8 marked this conversation as resolved.

record(bi, "$(P)$(R)$(CRYO_MOD):CLLAutoEn-Sts")
{
field(DESC, "Enable CLL auto-adjust")

field(INP, "$(P)$(R)$(CRYO_MOD):CLLAutoEn-Sel CP")
field(ZNAM, "Disable")
field(ONAM, "Enable")
}

record(ao, "$(P)$(R)$(CRYO_MOD):CLLPowerDeadband-SP")
{
field(DESC, "deadband for auto-adjust")
field(EGU , "W")
field(PINI, "YES")

field(VAL, "0.1")
field(PREC, "3")
}
Comment thread
gustavosr8 marked this conversation as resolved.

record(ai, "$(P)$(R)$(CRYO_MOD):CLLPowerDeadband-RB")
{
field(DESC, "deadband for auto-adjust")
field(EGU , "W")
field(PREC, "3")
field(INP, "$(P)$(R)$(CRYO_MOD):CLLPowerDeadband-SP CP")
}
1 change: 1 addition & 0 deletions docker
Submodule docker added at 58656c
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
services:
ioc:
image: ghcr.io/cnpem/cryo-load-leveler-epics-softioc:$TAG
network_mode: "host"
build:
context: ./
dockerfile: docker/Dockerfile
target: static-link
labels:
org.opencontainers.image.source: https://github.com/cnpem/cryo-load-leveler-epics-softioc
args:
REPONAME: cryo-load-leveler-epics-softioc
RUNDIR: /opt/cryo-load-leveler-epics-softioc/iocBoot/ioccryoLeveler
16 changes: 10 additions & 6 deletions iocBoot/ioccryoLeveler/st.cmd
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
#!../../bin/linux-x86_64/cryo-load-leveler

#- You may have to change cryo-load-leveler to something else
#- everywhere it appears in this file
#!/opt/cryo-load-leveler-epics-softioc/bin/linux-x86_64/cryoLeveler

< envPaths

epicsEnvSet("P", "SI-03SP:")
epicsEnvSet("R", "RF-CryoMod-")
epicsEnvSet("RF_R", "RF-SRFCav-")

cd "${TOP}"

## Register all support components
dbLoadDatabase "dbd/cryo-load-leveler.dbd"
cryo_load_leveler_registerRecordDeviceDriver pdbbase
dbLoadDatabase "dbd/cryoLeveler.dbd"
cryoLeveler_registerRecordDeviceDriver pdbbase

dbLoadRecords("$(TOP)/db/cll.db", "P=$(P), R=$(R), RF_R=$(RF_R), CRYO_MOD=1, SRF_CAV=A")
dbLoadRecords("$(TOP)/db/cll.db", "P=$(P), R=$(R), RF_R=$(RF_R), CRYO_MOD=2, SRF_CAV=B")

cd "${TOP}/iocBoot/${IOC}"
iocInit