| commit | author | age | ||
| 3533a3 | 1 | # New ISTTOK Slow Control System |
| B | 2 | ## Intro |
| 3 | ||
| 4 | The new ISTTOK slow control system is designed to replace the former vacuum/power/slow timing system based is the EDWARDS controller. | |
| 5 | ||
| 6 | The new system uses the [EPICS](https://epics-controls.org) framework and the [Control System Studio](http://controlsystemstudio.org), below there is a detailed description of the used software. | |
| 7 | In the next figure is depicted the system structure. | |
| 8 |  | |
| 9 | ||
| 10 | At the present the software are installed in two IOC servers with the exception of the Control System Studio that is also used for the GUI management. | |
| 11 | ||
| 12 | All software stored in IPFN GIT [server](https://git.ipfn.tecnico.ulisboa.pt/summary/ISTTOK.git) | |
| 13 | ||
| 14 | ## Team and responsabilities | |
| 15 | - **Horácio Fernandes** (ISTTOK Leader) | |
| 16 | - **Bernardo Carvalho** (Project Leader) | |
| 17 | - **Humberto Figueiredo** (ISTTOK Session Leader) | |
| 18 | - **Hugo Alves** (ISTTOK Session Leader, State Machine development) | |
| 19 | - **Tiago Pereira** (dsPIC development, RS232 protocol/ Sensor Interface/ Wiring) | |
| 20 | - **Paulo F. Carvalho** ( Epics Applications), CS-S Gui Panels) | |
| 21 | ||
| 22 | ## System description | |
| 23 | Presently there are two instances of EPICS IOC Server implemented. | |
| 24 | One responsible for the Temperature Node. | |
| 25 | And a second one, installed in a Raspberry Pi, implemented in the new control unit launched at ISTTOK for the remote control of the vacuum pumps, named Central Node. | |
| 26 | ||
| 27 | ### Temperature/Vacuum Node: Temperature Sensors and ELCO Voltage Measurement Systems | |
| 28 | - Thermocouple Sensor | |
| 29 | - ELCO voltage measurement | |
| 30 | - For communication was used a fiber optic | |
| 31 | ||
| 32 | The dsPic uses the internal ADC to read the voltage signal from the thermocouple. | |
| 33 | To measure the ELCO's voltage it was developed two boards one to read the ELCO's voltage and another to connect the fiber optic to dsPIC. | |
| 34 | ||
| 35 | ||
| 36 | #### Hardware Platform | |
| 37 | - Thermocouple Sensor | |
| 38 | - ELCO voltage measurement | |
| 39 | ||
| 40 | 1. One PC Controller | |
| 41 | ||
| 42 | * Intel(R) Atom(TM) CPU330 1.60GHz, Dual Core, 1 Gbyte RAM, 4 RAM | |
| 43 | * 4 Serial Ports | |
| 44 | * IP addr: 192.168.1.152 ( ISTTOK private network) | |
| 45 | * Scientific [Linux CERN 6](http://linux.web.cern.ch/linux/scientific6) (SLC6) | |
| 46 | with MRG Realtime extensions | |
| 47 | *Linux kernel 3.2.33-rt50.66.el6rt.x86_64 | |
| 48 | * NTP time conected to IPFN Gps NTP/PPS server IP:10.136.236.255 and | |
| 49 | baco.ipfn.tecnico.ulisboa.pt (193.136.136.129) | |
| 50 | ||
| 51 | 2. Local Control | |
| 52 | * One or more dsPic board running an embedded firmware | |
| 53 | ||
| 54 | Temperature Sensors and ELCO Voltage Measurement Systems | |
| 55 | -For communication was used a fiber optic | |
| 56 | ||
| 57 | The dsPic uses the internal ADC to read the voltage signal from the thermocouple. | |
| 58 | To measure the ELCO's voltage it was developed two boards one to read the ELCO's voltage and another to connect the fiber optic to dsPIC. | |
| 59 | ||
| 60 | #### Protocol for communication between dspics and PC | |
| 61 | * all bytes are readable ASCII | |
| 62 | * all messages all terminated with two bytes: \r\n (13 10) | |
| 63 | * messages have variable length | |
| 64 | * framing character for fields inside message is space (32) | |
| 65 | * individual fields inside each message have variable length | |
| 66 | * the last three characters before the terminator are the ASCII representation of the checksum of all other bytes, excluding the terminator | |
| 67 | * Messages are sent periodically (1s) | |
| 68 | ||
| 69 | Examples: | |
| 70 | PIC -> PC | |
| 71 | `VL01_1 VL02_1 VL03_0 TE01_150.9 TE02_80.1 UP_7200 PR01_1.3e-4 CKS\r\n` | |
| 72 | ||
| 73 | PC -> PIC | |
| 74 | `VL01_1 CKS\r\n` | |
| 75 | ||
| 76 | Table of word fields | |
| b2288e | 77 | |
| BBC | 78 | | N | A | |
| 3533a3 | 79 | |:------|-----| |
| b2288e | 80 | | VLxx_| Valve| |
| BBC | 81 | | TExx_| Temperature| |
| 82 | | UP_ | Uptime | | |
| 83 | | PRDxx_| Wave Period | | |
| 84 | | PRxx_ | Pressure | | |
| 3533a3 | 85 | |
| B | 86 | #### Software Platform |
| 87 | ||
| 88 | 1. EPICS V3.15.7 (instaled in `/opt/epics/base-3.15.7`) | |
| 89 | * IOC sources (versioned) in `/home/codac-dev/ISTTOK/epics/iocs/ISTTOKdsPIC` | |
| 90 | * IOC binaries in `/opt/epics/apps/ISTTOK` | |
| 91 | * Init IOC script in `/etc/rc.local` | |
| 92 | 2. Modules ( (instaled in `/opt/epics/modules`) | |
| 93 | * ASYN [git package](https://github.com/epics-modules/asyn.git) | |
| 94 | * STREAM [git](https://github.com/paulscherrerinstitute/StreamDevice.git) | |
| 95 | 3. CS-Studio | |
| 96 | * Archive [Engine] (http://cs-studio.sourceforge.net/docbook/ch11.html) | |
| 97 | * Init script in `/etc/init.d/isttok-archive-engine` | |
| 98 | * MySQL server (user: report ) | |
| 99 | * ArchiveConfigTool in `/home/bernardo/css/ArchiveConfigTool` | |
| 100 | ||
| b2288e | 101 | Process Value in this IOC Server: |
| 3533a3 | 102 | |
| B | 103 | |PV Name |PV Type |Archive| |
| 104 | |:----------|-------|---:| | |
| 105 | |ISTTOK:temperature:Uptime |longin| no| | |
| 106 | |ISTTOK:temperature:Last_Uptime | ai | no | | |
| 107 | |ISTTOK:temperature:Temperature_0 |ai |yes | |
| 108 | |ISTTOK:temperature:Temperature_1 |ai | no | | |
| 109 | |ISTTOK:temperature:Temperature_2 |ai | no | | |
| 110 | |ISTTOK:temperature:Temperature_3 |ai | no | | |
| 28e027 | 111 | |ISTTOK:temperature:Capbank_Voltage | ai| no | |
| BBC | 112 | |ISTTOK:temperature:VVessel-Temperature | ai | yes | |
| 3533a3 | 113 | ---------- |
| B | 114 | |
| 115 | ### Central Control/Vacuum Node | |
| 116 | - Vacuum Sensors | |
| 117 | - Pffeifer rotatory vacuum pump | |
| 118 | - Edwards electro valve | |
| 119 | - Seiko Seiki turbomolecular pump and control unit | |
| 120 | - Main State Machine | |
| 121 | ||
| 122 | #### Hardware Platform | |
| 96807b | 123 | 1. A Raspberry Pi 3, running a linux distribution.. |
| BBC | 124 | * Has a USB/RS485 port for monitoring pressure (to be connected soon) |
| 125 | 2. Two Interface Boards, Velleman Model [k8000](https://www.velleman.eu/products/view/?id=9383).. | |
| 3533a3 | 126 | * connected to raspberry Pi through I2C interface; |
| B | 127 | * 8 isolated output connected to the relays (6 relays installed for the rotatory control) |
| 128 | * 4 isolated outputs connected to SEIKO unit controller | |
| 129 | * Indicator leds for the relays in the front panel | |
| 130 | * 24 V power supply | |
| 131 | ||
| 132 | #### Software Platform | |
| 133 | [//]: # (This may be the most platform independent comment) | |
| 134 | ||
| 135 | 1. Linux Raspian "Stretch" (user :pi): | |
| 136 | * IP addr:192.168.1.110 ( ISTTOK private network) | |
| 137 | * NTP/timedatectl time conected to IPFN Gps NTP/PPS server IP:10.136.227.237 193.136.136.129 | |
| 138 | (this is mandatory, Rpi does not have a Real Time clock see https://www.raspberrypi.org/forums/viewtopic.php?t=178763) | |
| 139 | * EPICS v. base-3.15.5 (in /usr/local/epics) including modules: | |
| 140 | * synApps_5_8 | |
| 141 | * asyn-4-26 | |
| 142 | * seq-2-2-1 | |
| 143 | * autosave-5-6-1 | |
| 144 | * IOC installed in '/opt/epics/iocs/' | |
| 145 | * Running in `screen deamon` (see `/etc/rc.local`) | |
| 146 | ||
| 147 | For installation EPICS in Rpi see this [link](prjemian.github.io/epicspi) | |
| 148 | ||
| b2288e | 149 | #### Process Variables |
| BBC | 150 | Process Variables in this IOC Server: |
| 151 | ||
| d230af | 152 | * State machine PVs |
| b2288e | 153 | |
| BBC | 154 | |PV Name |PV Type |Archive| |
| 155 | |:----------|-------|---:| | |
| 156 | |ISTTOK:central:AUTHORISATION | bo | no | | |
| 157 | |ISTTOK:central:OPREQ | bo | no | | |
| 158 | |ISTTOK:central:PROCESS-MODE | bo | no | | |
| 159 | |ISTTOK:central:PROCESS-REQ | bo | no | | |
| 160 | |ISTTOK:central:COUNTER | calc | no | | |
| 161 | |ISTTOK:central:COUNTDOWN | mbbi | no | | |
| 162 | |ISTTOK:central:PULSE-NUMBER | longout | yes | | |
| 163 | |ISTTOK:central:OPSTATE |longout | yes | | |
| 164 | |ISTTOK:central:CurrentTime | stringin | no | | |
| 165 | |ISTTOK:central:TraceMessage | stringout | yes | | |
| 166 | |ISTTOK:central:LogMessage | stringout | yes | | |
| 167 | ---------- | |
| 1c1efe | 168 | |
| 38c96c | 169 | * Connected to PCF8574 I2C Address = 56 (Bottom Valleman) |
| 1c1efe | 170 | |
| b2288e | 171 | |PV Name | PV Type | Bit | |
| BBC | 172 | |:----------|-------|---:| |
| 173 | | ISTTOK:central:TMPump1-ControllerOn | bo | 0 | | |
| 174 | |ISTTOK:central:TMPump1-ControllerOff | bo | 1 | | |
| 175 | |ISTTOK:central:TMPump1-MotorOn | bo | 2 | | |
| 176 | |ISTTOK:central:TMPump1-MotorOff | bo | 3 | | |
| 177 | |ISTTOK:central:TMPump1-Power | bi | 4 | | |
| 178 | |ISTTOK:central:TMPump1-Acceleration | bi | 5 | | |
| 179 | |ISTTOK:central:TMPump1-Emergency | bi | 6 | | |
| 180 | |ISTTOK:central:TMPump1-NormalOperation | bi | 7 | | |
| 181 | ---------- | |
| 182 | ||
| d230af | 183 | * Connected to PCF8574 I2C Address = 57 |
| 1c1efe | 184 | |
| b2288e | 185 | |PV Name | PV Type | Bit | |
| BBC | 186 | |:----------|-------|---:| |
| 187 | |ISTTOK:central:TMPump2-Emergency | bi | 0 | | |
| 188 | |ISTTOK:central:TMPump2-Acceleration | bi | 1 | | |
| 189 | |ISTTOK:central:TMPump2-MotorOn | bo | 2 | | |
| 190 | |ISTTOK:central:Buzzer| bo | 3 | | |
| d230af | 191 | |ISTTOK:central:Emergency-PhysButton| bi | 4 | |
| b2288e | 192 | |ISTTOK:central:TTSystem-tzero| bo | 7 | |
| BBC | 193 | ---------- |
| 194 | ||
| d230af | 195 | * Connected to PCF8574 Address = 60 (Top Valleman) |
| 1c1efe | 196 | |
| b2288e | 197 | |PV Name | PV Type | Bit | |
| BBC | 198 | |:----------|-------|---:| |
| 199 | |ISTTOK:central:RPump1-Motor| bo | 0 | | |
| 200 | |ISTTOK:central:RPump1-Valve| bo | 1 | | |
| 201 | |ISTTOK:central:RPump2-Motor| bo | 2 | | |
| 202 | |ISTTOK:central:RPump2-Valve| bo | 3 | | |
| 203 | |ISTTOK:central:VVessel-Filament| bo | 4 | | |
| 204 | |ISTTOK:central:Clean-TorContactor| bo | 7 | | |
| 205 | ---------- | |
| 206 | ||
| 207 | ||
| 9a933d | 208 | * Connected to TDA8444 DAC @ address 0x20=d32 (Bottom Valleman) |
| 28e027 | 209 | |
| BBC | 210 | |PV Name |PV Type |Archive| |
| 211 | |:----------|-------|---:| | |
| d230af | 212 | | ISTTOK:central:TDA8444:32:DAC_CH0| longout | no | |
| BBC | 213 | | ISTTOK:central:TDA8444:32:DAC_CH1| longout | no | |
| 214 | | ISTTOK:central:TDA8444:32:DAC_CH2| longout | no | | |
| 215 | | ISTTOK:central:TDA8444:32:DAC_CH3| longout | no | | |
| 216 | | ISTTOK:central:TDA8444:32:DAC_CH5| longout | no | | |
| 217 | | ISTTOK:central:TDA8444:32:DAC_CH6| longout | no | | |
| 9a933d | 218 | | ISTTOK:central:Shot-TorPSCurrent| longout | no | |
| bd1328 | 219 | ---------- |
| BBC | 220 | |
| 9a933d | 221 | * Connected to PCF8591 ADC / DAC register @ address 0x48=d72 |
| bd1328 | 222 | |
| BBC | 223 | |PV Name |PV Type | CH |Archive| |
| 224 | |:----------|-------|---:| | |
| 097fad | 225 | | ISTTOK:central:TMPump2-Speed| ai | ch1 | no | |
| BBC | 226 | | ISTTOK:central:TMPump2-Current| ai | ch2 | no | |
| 9a933d | 227 | | ISTTOK:central:Shot-TorPSCurrentImage"| ai | ch3 | no | |
| 28e027 | 228 | ---------- |
| BBC | 229 | |
| d230af | 230 | * Connected to RS485 Bus |
| 1c1efe | 231 | |
| b2288e | 232 | |PV Name |PV Type |Archive| |
| BBC | 233 | |:----------|-------|---:| |
| 234 | | ISTTOK:central:RPump1-Pressure | ai | yes | | |
| 235 | |ISTTOK:central:RPump2-Pressure | ai | yes | | |
| 236 | |ISTTOK:central:TMPump1-PressureAdmission | ai | yes | | |
| e44d20 | 237 | ISTTOK:central:VVessel-Pressure | ai | yes |
| b2288e | 238 | |
| BBC | 239 | |
| 3533a3 | 240 | ##### Start the IOC on power up |
| B | 241 | 1. Make sure `screen` is installed in Linux |
| 242 | 2. Include following Line in /etc/rc.local | |
| 243 | * `screen -dm bash -c "cd [..]/ISTTOKrpi/iocBoot/iocISTTOKrpi; ../../bin/linux-arm/ISTTOKrpi st.cmd"` | |
| 244 | 3. To access EPICS console run | |
| 245 | * `sudo screen -r` | |
| 246 | ||
| 247 | ||
| 00a749 | 248 | ## Download and configure CS-Studio |
| BBC | 249 | |
| 250 | * Install JAVA JDK (version Java SE Development Kit 8) | |
| 251 | * Download ISTTOK EPICS Files to a working folder | |
| ae2b1d | 252 | * `git clone https://bernardo@git.ipfn.tecnico.ulisboa.pt/r/ISTTOK.git` |
| BBC | 253 | * Goto site [CS-Studio](http://download.controlsystemstudio.org/release/4.5/) and download latest version to your OS |
| 00a749 | 254 | * Uncompress folder |
| BBC | 255 | * Run `cs-studio` executable |
| ae2b1d | 256 | * Choose a workplace folder |
| 00a749 | 257 | * Goto to Menu EDIT->Preferences->CSS Core->Data Sources->Channel Access |
| ae2b1d | 258 | * On Address List replace `localhost` with `epics.ipfn.tecnico.ulisboa.pt` |
| BBC | 259 | * Uncheck `Auto Address List` |
| 260 | * Restart CS-Studio | |
| 00a749 | 261 | * Run File -> Import -> General-> Projects from folder |
| BBC | 262 | * point to cloned folder |
| 263 | * Navigate to `ISTTOK/epics/css/sys-mng-opi/CSS` | |
| ae2b1d | 264 | * Open ´SystemManagerIsttok.opi` with "OPI Display" |
| 00a749 | 265 | |
| BBC | 266 | |
| 3533a3 | 267 | ### EPICS Channel Access Configuration |
| B | 268 | ``` |
| 269 | export EPICS_CA_ADDR_LIST="192.168.1.110 192.168.1.152" | |
| 270 | export EPICS_CA_AUTO_ADDR_LIST="NO" | |
| 271 | ``` | |
| 272 | ||
| 273 | ### References | |
| 274 | *"EPICS IOC module development and implementation for the ISTTOK machine subsystem operation and control"* | |
| 275 | Paulo Carvalho, André Duarte, Tiago Pereira, Bernardo Carvalho, Jorge Sousa, Horácio Fernandes, Carlos Correia, Bruno Gonçalves, Carlos Varandas | |
| 276 | ||
| 277 | Fusion Engineering and Design 86 (2011) 1085–1090 | |