# Presentation: 205137

## Present Status of EPICS Development at the 3GeV Proton Beam Transport Facility Control System in J-PARC

- JAERI
- Motoki Oi	Tetuya Kai	Sinichiro Meigo
- Sinichi Sakai	Hidetaka Kinoshita	Kenji Sakai
- Masanori Kaminaga

**Notes:**
My talk in about present Status of EPICS Development at the 3GeV Proton Beam Transport Facility Control system in J-PARC

## Contents

- Outline of 3NBT monitor system
- Goal of 3NBT EPICS system
- About CC/NET
- Data Read & archive performance test
- Channel access data missing and Tick frequency
- Profile monitor test in KEK
- Summary

**Notes:**
Contents of my talk is
Outline of 3NBT monitor system, goal of 3NBT EPICS system
About CC/NET, Data Read & archive performace, Channel access data missing and tick frequency
Profile monitor test in KEK
And summary

## 3GeV Proton Beam Transport Facility(3NBT)

**3NBT**

- Material & Life
- science Facility

- (MLF)

- 50GeV PS
- Experimental Area

- Beam loss : ~1W/m
- Length : 310m
- Magnet : 108
- Proton monitor : 89

**Notes:**
J-PARC is consist of three proton accelerater and four experimental facilities. 3GeV proton beam transport facility in short 3NBT is beam transport line from 3GeV synchrotron to Material and Life Science facility. Length of 3NBT is  over 300m and there is over 100 magnet and 89 proton monitors. Design criteria of beam loss of 3NBT is under 1W/m. So, proton monitor system and magnet control system is very important.

## Goal of 3NBT EPICS system

- ・ Archive all of proton beam monitor data with data tag
- ・ Control and monitor the beam line components
-    (Magnet power supply, vacuum, etc.)
- ・Joint 3NBT to CCR and MLF control with EPICS network

*Goal of 3NBT EPICS system*

**Notes:**
Goal of 3NBT EPICS system is monitor all of the proton beam monitors at 25Hz.
Archive all of proton beam monitor data with data tag. This is for proton beam line study and trouble shooting.
Control and monitor the beam line components. Such as Magnet power supply, vacuum and etc.
And joint 3NBT to CCR and MLF control with EPICS network.

## Outline of 3NBT Monitor system

*Outline of 3NBT Monitor system*

- EPICS IOC

- EPICS OPI

- Data Archiver

- Profile Monitor

- Loss Monitor

- Halo Monitor

- Current Monitor

- ADC

- CC/NET

- EPICS IOC

- CAMAC modules

- CC/NET: CAMAC controller

- CCR

- EPICS OPI

- 3NBT Control

- MLF

- EPICS IOC

- EPICS IOC

- EPICS OPI

- Total 1100 data
- DAQ at 25Hz

- LAN

- LAN

- Data flow

- Data flow

**Notes:**
This figure shows outline of 3NBT monitor system.
We have four type of proton beam monitors. Profile monitor, halo monitor, loss monitor and current monitor.
These signal is lead to ADC on CAMAC module. As a CAMAC controller, we use CC/NET and EPICS IOC is installed on the CC/NET. Monitor data is archived with data archiver and display with EPICS OPI and lead to EPICS IOC. EPICS IOC is also connected to other facilities.

## What is CC/NET

- Interface: PCI and CAMAC
- CPU:Crusoe500MHz
- Memory:310MB
- Main Drive: Compact Flush 1GB
- Network:100Mbps Ethernet
- OS:2.4 kernel Linux

*What is CC/NET*

- TRIG-IN

- BUSY-OUT

- Ethernet

- RBG OUT

- PS/2

- USB

**Notes:**
About CC/NET.CC/NET is network CAMAC controller which consist of PC104 Plus single board computer with PCI interface and CAMAC interface. It also have trigger input and busy-out signal. Of course Ethernet port and RBG port and PS/2 port. As a operating system, Linux kernel 2.4 is installed. So, we can install EPICS base program directly on the CC/NET.

In 3NBT proton beam monitor system, we use many 16ch CAMAC ADC modules. And as a CAMAC controller, Pipe line CAMAC controller CC/NET is selected. CC/NET consists of a PC104Plus-based single bord computer, PCI interface and CAMAC interface. Linux is installed and of course connectable to Ethernet. Signal handling of trigger input and busy out are also implemented.

右の絵に矢印でどんなコネクタがあるかを明記

## DAQ mode of CC/NET

- CC/NET have three DAQ mode

- Single mode	Programmed 	Dynamic Memory
- 		 I/O mode	 Access mode
- Small		Small		Large
- Low		Middle		Fast
- High		Low		Middle

- Over head
- DAQ Speed
- CPU load

- Pipeline method used in PIO and DMA mode

**Notes:**
CC/NET have three Data Acquisition mode. So call Single mode, PIO mode and DMA mode.
General performance of these three mode is shown this. Over head of Single and PIO mode is small but DMA mode is large. And this figure shows comparison of access time of PIO mode and DAM mode.
If data frame size is small, PIO mode is faster but the data size is large, DMA mode is fast.

Single mode is simply send one CAMAC command and Receave one data. PIO mode send multiple CAMAC command at onece and Resieve Multiple data at once. DMA mode is almost same as PIO mode but Reseave data in order. 
CC/NETは3種類のDAQモードを使用できる。SingleモードとPIOモードとDMAモードである。
一般的に、シングルモードとPIOモードのオーバーヘッドは小さく、DMAのは大きい。
DAQスピードは、SingleよりPIO、PIOよりDMAモードが早いとされている。
この図は、PIOモードとDMAモードの性能を比較した物だが、フレーム数が増えると、PIOモードよりDMAモードの方が早い事が分かる。

## EPICS DAQ test sequence

*EPICS DAQ test sequence*

- START

- Channel Archiver

- EPICS IOC

- Data Archive

- Channel Access

- NIM module

- CAMAC module

- Linux WS

- CC/NET EPICS IOC

- ADC

- Repeat at 25Hz

- Clock generator

- Gate generator

- Base clock

- Gate signal

- Trig signal : delay 200 nsec

- CAMAC DAQ

- Max 368 data

- Max 23 ADC

- EPICS 3.14.6
- Channel Archiver 2.1 2

**Notes:**
This figure shows EPICS DAQ test sequence. 
At first, gate signal is input and monitor data is read with ADC.
Then, Trigger signal input to CC/NET and monitor data becomes EPICS record.
These data are archived with Channel Archiver and Channel access to EPICS IOC.
And repeat this cycle at 25 Hz.

CAMACモジュール1台あたりのデータ点数を書いて、次のテストでの意味付けを明確にする。
各種枠内に入れる文字を再検討
付加する文字についても検討する。
CAMACモジュール1台当り最大368点だが、実際に取り扱うデータは、64点とする可能性もある。
その事を明確にした構成に

## Data Taking

- Change the NELM / Record and examine CC/NET-EPICS DAQ performance test

- 16ch ADC x 23 slot = 368 data / CAMAC module
- 368 data / waveform is not reasonable.

- 64 data / Profile monitor
- 4 data / Halo monitor
- 4 data / Loss monitor

**64 data is reasonable**

**Notes:**
About data taking.
We use 16ch ADC and 23 ADC for one CAMAC create. So we got 368 data par CAMAC module.
But 368 data par waveform is not reasonable.
Because one profile monitor gives 64 data, halo monitor is 4 data and loss monitor is 4 data. 
And also, large data is not easy to take with channel archiver because it takes long time to read.
So, 64 or more less data is reasonable. 
Then, change NELM par record and examine CC/NET to EPICS DAQ performance test.  

## Data Read & Archive performance test @25Hz

- For small _Number of Element_, PIO mode is the better

- CPU load

- DAQ time

**Notes:**
This figure shows the result of Data read and archive performance test at 25Hz.
This means Number of Element by Number of Records. CPU load of CAMAC access with EPICS Channel access. DAQ time is only CAMAC access time.
 From this result, if we use 368 data par 1 waveform, DMA mode is the best. But 64 element or more less, PIO mode is better than DMA mode.

## Data missing in Channel Access

- CC/NET
- EPICS IOC

- Linux WS
- Channel Archiver

- Linux WS
- EPICS IOC

- Data Missing 0%

- Data Missing ~1%

- CCR, MLF
- EPICS IOC

- In the channel access between EPICS IOC to EPICS IOC,
- we got data missing.
- As a cause of data missing, I expect Linux tick frequency.
- Default tick frequency is 100 Hz.
- DAQ frequency is 25 Hz.
- These are near in order.

- Change Linux tick 1000 Hz
- Compare Data missing ratio

**Notes:**
Next is about data missing in channel access.
In the previous test, data transfer from CC/NET to Channel archiver was perfect. But data transfer of CC/NET EPICS IOC to Linux WS EPICS IOC lost some data.
 As a cause of data missing, I expect Linux tick frequency.
Default tick frequency of Linux 2.4 is 100Hz. On the other hand, our DAQ frequency is 25 Hz. These are near in order and it makes this data missing.
 Then, Change Linux tick to 1000 Hz and compare data missing ratio.

ここまでの試験において、EPICS IOCから、Channel Archiverへのデータ転送では、データロスは確認されていない。しかしながら、EPICS IOC間でデータ転送をした場合に、データMissingが生じている

## Tick and DAQ frequency

- DAQ	Tick (Hz)	100Hz		1000Hz
- 1Hz			0.1%		0.1%
- 10Hz			0.2% 		0.2%
**25Hz****	****	****	****0.8% ****	****	****0.2%**
- 33Hz			0.7% 		0.2%
- 50Hz			0.6% 		0.2%

- PIO mode	_Waveform 368 element_

- Channel Access Data missing CC/NET to Linux IOC

- CA performance is a little bit improved.
- This CA result is not perfect but enough
- for monitoring with I/O display

**Notes:**
This is result of the difference of tick frequency and DAQ frequency.
DAQ frequency of 1Hz to 50 Hz was examined. For 1Hz and 10Hz there is almost no difference between 100 Hz tick and 1000 Hz tick.but when DAQ frequency becomes larger than 25Hz, 1000 Hz tick frequency shows little bit better performance.
 This Channel access result is not perfect and not enough to data archive, but enough for monitoring with I/O display. 

## Profile Monitor Test in KEK

-  3NBT line transports 1 MW power proton beam, we have to develop long life profile monitor.
-  SiC wire type profile monitor is developed.
- Profile monitor performance is tested in KEK proton beam dump line.

**Notes:**
Next is about profile monitor test in KEK
3NBT line transports 1MW  power proton beam, and we have to develop long long profile monitor.
Thenm We develop SiC wire type profile monitor and its performance is tested in KEK proton beam dump line

## KEK NML Beam Dump

- Proton Energy : 500 MeV
- Proton current : 182x1010ppb
- Frequency : 0.45 Hz
- Beam port : Beam dump line

- to Beam dump

- from KEK-PS

*KEK NML Beam Dump*

- Profile monitor

- Beam dump

- to KENS

- NML Beam dump

**Notes:**
About KEK NML beam dump line. This figure shows around Proton beam dump line and profile monitor is installed here. And this is profile monitor chamber. Proton energy is 500 MeV proton current is 182 to 10 ppb. Beam frequency is 0.45 Hz. This is due to the limit of this beam dump. 

## Profile monitor test component

*Profile monitor test component*

- INV AMP

- Data Archiver

- MEDM

- Prototype profile monitor

- ADC

- CC/NET EPICS IOC

- Linux WS

- CAMAC

- H:16  V:16 wires

**SiC clad tungsten wire ********100********m**

- Oscilloscope

- Signal check

- Profile monitoring

- 32ch

**Notes:**
This figure shows prototype profile monitor tested in KEK. There is 16 wires in horizontal and 16 wires in vertical. 
At first, signal from this wire is checked with oscilloscope and lead to inverter amp. Then AD converted with ADC.
The data is read by CC/NET and display with MEDM on another Linux WS.

## Results

- Horizontal

- Channel No

- Channel No

- ADC count

- MEDM window

- Vertical

- Inv AMP

- ADC

- EPICS IOC

- x32ch

- Raw signal

*Results*

- Successfully get proton beam profile with SiC wire profile monitor!!

**Notes:**
This is the result of measurement, this is raw signal from SiC wire and this is measured proton beam profile. 
As a results we got successflly proton beam profile with SiC wire profile monitor.

## Summary

- ・EPICS for 3NBT control system is under construction
-  ・Data archive at 25Hz from CAMAC-CC/NET to Channel archiver on Linux WS is successful, but data transport among EPICS IOC has still data missing.
-   ・ 25Hz DAQ data taking becomes better with changing the linux tick to 1000Hz.
-   ・SiC wire proton beam profile monitor test was succeeded.

**Notes:**
Summary
EPICS for 3NBT control system is under construction.
Data archive at 25Hz from CAMAC on CC/NET to Channel archiver on Linux WS is successful but data transport among EPICS IOCS has still data missing.
25Hz DAQ data taking becomes better with changing the linux tick to 1000 Hz
SiC wire proton beam profile monitor test was succeeded.

## Future plan

- ・Improve the EPICS data missing problem.
- ・PLC (FA-M3) data I/O operation test.
- ・Design 3NBT OPI display.
- ・Design and test the DAQ and data archive system with full scale system.