1189˙ ஊ࿩ࣨ

RaspberryPi Λ༻͍ͨଌఆ‫ث‬σʔλऩूγεςϜͷߏங- ҆Ձʹखܰʹ DAQ ߏங େࡕࢢཱେֶ‫ ࡚ؠ‬ণࢠ
masako@sci.osaka-cu.ac.jpେࡕେֶೆᑍ ૑
nanjo@champ.hep.sci.osaka-u.ac.jp
KEK Ճ଎‫ࢪڀݚث‬ઃଳ໊ ਸ, ্‫ل ాۼ‬඙, ࢁຊ ঢ
takashi.obina@kek.jp, norihiko.kamikubota@kek.jp, noboru.yamamoto@kek.jp
2018 ೥ (ฏ੒ 30 ೥) 2 ݄ 9 ೔1͸͡Ίʹ

RaspberryPi (RPi)[1] ͸ɼARM ϓϩηοαΛ౥ࡌͨ͠खͷͻΒαΠζͷγϯάϧϘʔυίϯϐϡʔλʔͰ͋Δʢਤ 1ʣɻখ‫ܕ‬αΠζͳ͕Βɼ1GB RAM Λ౥ࡌ͠ɼ4 ϙʔτͷ USBɼEthernetɼGPIO ΠϯλʔϑΣʔεΛඋ͑ɼແઢ LAN ΋࢖༻Մೳɼͱ͍͏༏Ε΋ͷͰ͋Δ
ʢRPi3 Ϟσϧ Bʣɻ͔͠΋ɼඇৗʹ҆ՁͰ͋Δʢ∼5000ԁʣɻ͜ͷ RPi Λ༻͍Δͱɼ҆ՁͰՄൖੑʹ༏Εͨଌఆ‫ · ޚ੍ث‬σʔλऩूγεςϜ͕ߏஙͰ͖Δɻ‫ݶ‬ΒΕͨ༧ࢉͱεϖʔεͰӡӦ͍ͯ͠Δେֶͷ‫ͯͬͱʹࣨڀݚ‬ɼ҆ՁͰখ‫͋Ͱܕ‬Δ͜ͱ͸ɼॏཁͳϙΠϯτͰ͋Δɻਤ 1: RaspberryPi3 Ϟσϧ BຊߘͰ͸ɼRPi Λ༻͍ͨଌఆ‫ث‬σʔλऩूγεςϜʹ͍ͭͯɼ1) େࡕࢢཱେֶɼ2) େࡕେֶɼ3)J-PARC Ͱͷ͜ͷ RPi ʹɼωοτϫʔΫ෼ࢄ‫ޚ੍ܕ‬Λߦ͏ͨΊͷι࣮ྫΛ঺հ͢Δɻ·ͨɼRPi ͱ͸ผͷখ‫ܕ‬γϯάϧϘʔϑτ΢ΣΞɼEPICS(Experimental Physics and Indus-υίϯϐϡʔλʔΛ༻͍ͨྫͱͯ͠ɼ4)KEK-PF·cERLtrial Control System [3]) Λಋೖͨ͠ɻEPICS ͸ࠃࡍ‫ڞ‬Ͱͷ࣮ྫʹ͍ͭͯ΋঺հ͢Δɻಉ։ൃ͞ΕͨΦʔϓϯιϑτ΢ΣΞͰɼૉཻࢠɾ‫ࢠݪ‬࣮֩‫ݧ‬ɼՃ଎‫ث‬ɼӉ஦ɼॏྗ೾࣮‫ݧ‬౳Ͱ࢖༻͞Ε͍ͯ2େࡕࢢཱେֶͰͷྫେࡕࢢཱେֶɼӉ஦ૉཻࢠ෺ཧֶ࣮‫Ͱࣨڀݚݧ‬͸ɼֶ෦ 4 ೥ੜͷଔ‫ͯ͠ͱڀݚۀ‬ɼRPi ʢRPi3 Ϟσϧ BʣΛ༻͍ͨωοτϫʔΫ෼ࢄ‫ޚ੍ثػܕ‬γεςϜΛߏங͠
ͨɻRPi ͷ OS ͸ɼެࣜϗʔϜϖʔδ͔Βఏ‫͞ڙ‬ΕΔRaspbian(Linux) Λ࢖༻͍ͯ͠ΔɻRPi ͸ microSD Χʔυ͔Β OS ΛಡΈࠐΈ‫ى‬ಈ͢ΔͨΊɼRaspbian ͷΠϝʔδϑΝΠϧΛ microSD Χʔυʹॻ͖ࠐΜͰಋೖͨ͠ɻ

ΔɻEPICS Ͱ͸ɼσόΠεΛ௚઀੍‫͢ޚ‬ΔͨΊͷ‫ࢉܭ‬‫ػ‬Λ IOC(Input Output Controller)ɼૢ࡞ɾ‫ࢹ؂‬Λߦ͏ͨΊͷ‫ػࢉܭ‬Λ OPI(Operator Interface) ͱ‫Ϳݺ‬ɻֶੜ࣮‫Ͱݧ‬͸ɼRPi Λ IOC ͱͯ͠ɼ‫ثػ‬Λ੍‫ͨ͠ޚ‬ɻ੍‫͠ޚ‬ͨ‫ثػ‬͸ɼϚϧνϝʔλʔ (IWATSU VOAC7523)ɼσδλϧΦγϩείʔϓ (Keysight InfiniiVision DSO-X

2002A)ɼ͓Αͼ Arduino[3](Arduino UNO) Ͱ͋Δɻ‫ػ‬‫ͱث‬ͷ௨৴͸ɼEthernet ௨৴ɼ·ͨ͸ USB-γϦΞϧ௨৴Ͱߦͬͨɻɹ͜͜ͰɼArduino ͸ɼAVR ϚΠίϯɼσδλϧɾΞφϩ2190ά৴߸ೖग़ྗϙʔτΛඋ͑ͨ҆Ձͳ‫ج‬൘Ͱ͋Δʢ∼2600ζͰɼ͔ͭ௿Ձ֨Ͱ͋ΔͨΊɼछʑͷߨश · ࣮शΛߦ͏‫ڥ؀‬ʣΛ༻͍ͯɼArduino Λ੍‫͢ޚ‬ΔͨΊͷιʔείʔϨουϘʔυ 1 ɼͱ͍͏૊Έ߹ΘͤΛ࢖༻ͯ͠ɼEPICSυʢεέονϑΝΠϧʣΛ࡞੒͠ɼ‫ج‬൘ʹΞοϓϩʔυߨशձΛߦͬͨɻ2017 ೥ 2 ݄ʹେࡕࢢཱେֶͰ࣮ࢪͨ͠

Ͱ͖ΔɻArduino UNO ͸ɼ10-bit ͷ ADC Λ౥ࡌ͍ͯ͠ΔͨΊɼArduino Λɼηϯαʔ͔ΒͷΞφϩά৴߸Λ

EPICS ߨशձʢ11 ໊ग़੮ʣͰ͸ɼ্‫ه‬ͷ RPi+ArduinoΛ 5 ηοτ࢖༻࣮ͯ͠शΛߦͬͨɻ2017 ೥ 5 ݄ʹࠃࡍσδλϧม‫ͤ͞׵‬ΔͨΊͷ ADC ͱͯ͠࢖༻ͨ͠ɻϫʔΫγϣοϓ [4] Ͱ࣮ࢪͨ͠ߨशձͰ͸ɼߨࢣ༻ͱࢀ

ԁʣɻެࣜϗʔϜϖʔδ͔Βఏ‫͞ڙ‬ΕΔ IDE ʢ౷߹։ൃ

ͷʹద͍ͯ͠Δɻզʑ͸ɼࢁຊʹΑΔ RPi·Arduino· ϒArduino ͷ IDE ʹ͸ɼ༷ʑͳαϯϓϧεέονϑΝΠ

Ճऀ༻ʹɼRPi+Arduino Λ̓ηοτ༻ҙͨ͠ɻ͜ͷߨϧ͕ɼ͋Β͔͡Ί༻ҙ͞Ε͍ͯΔɻRPi ʹ Arduino IDEशձͰ͸ɼࢀՃऀ͕ 30 ໊Λ௒͑ͨͷͰɼ̒ͭͷάϧʔΛಋೖ͠ɼαϯϓϧεέονϑΝΠϧΛ༻͍ͯɼLEDϓʹ෼͚ͯɼ֤ࣗͷϊʔτ PC ͔Β RPi ʹϦϞʔτϩ఺౮΍ɼԹ౓ηϯαʔ͔ΒͷԹ౓σʔλऔಘ౳Λߦ͍ɼάΠϯ࣮ͯ͠शΛߦͬͨɻRPi ʹ͸ແઢ LAN ͕༻ҙ͞

Arduino ʹΑΔ‫ޚ੍ثػ‬Λߦͬͨɻ࣍ʹɼArduino IDEʹ༻ҙ͞ΕͨγϦΞϧϞχλΛ࢖༻͠ɼRPi ͔ΒͷγϦΕ͍ͯΔͷͰɼωοτϫʔΫӽ͠Ͱͷ࣮शʹ΋ɼඇৗʹศརͰ͋ͬͨɻେֶӃੜ޲͚ͷ‫ڭ‬ҭͱͯ͠ɼσδλϧΦγϩείʔΞϧ௨৴ʹΑΓɼಡΈࠐΈɾॻ͖ࠐΈ໋ྩΛߦ͏ϓϩάϥϜΛ࡞੒ͯ͠ɼArduino ͷ੍‫ޚ‬Λߦͬͨɻϓ͔Βͷ೾‫ܗ‬औಘ࣮श΋ߦ͍ͬͯΔɻσδλϧΦγϩε

Arduino ͸ద༻ྫ͕ଟ͘ɼWEB ্ͰϓϩάϥϜྫΛίʔϓΛɼEthernet ௨৴Ͱ੍‫ͯ͠ޚ‬ɼϦϞʔτͰ৴߸ಡ‫͢ࡧݕ‬Δ͜ͱ΋ՄೳͰ͋Γɼ੍‫ޚ‬ͷ‫ૅج‬Λֶश͢ΔπʔΈऔΓϨϯδΛมߋ͠ɼ೾‫ܗ‬σʔλΛऔಘ͢Δ࣮श಺༰ϧͱͯ͠खܰʹ࢖༻͢Δ͜ͱ͕Ͱ͖ΔɻελʔλʔΩοͱͨ͠ɻ͜͜ͰɼΦγϩείʔϓͷ੍‫ޚ‬ϓϩάϥϜ͸ɼτ౳΋๛෋ʹ͋Γɼֶੜ͕ࣗΒɼϓϩάϥϛϯάͱ࣮शͷऔѻ͍Λशಘͨ͠‫ޙ‬ɼRPi ্ʹ͋Δ EPICS Λ༻͍ͯɼ1)Python ͰϓϩάϥϛϯάΛߦ͍ socket ϞδϡʔϧΛ༻੍͍ͯ‫ޚ‬Λߦ͏ϓϩάϥϜͱɼ2)EPICS Λ༻੍͍ͯ‫ޚ‬Λߦ͏ϓϩάϥϜɼೋछྨΛ࡞੒ͯ͠ɼͦΕͧΕͰ੍γϦΞϧ௨৴ʹΑΓ Arduino ͷ੍‫ޚ‬Λߦ͏ϓϩάϥϜ‫ޚ‬Λߦͬͨɻ‫ޚ੍ثػ‬ΛೋͭͷΞϓϩʔνͰߦ͏ࣄͰɼΛ࡞੒ͨ͠ɻΑΓޮՌతʹ‫ڭ‬ҭΛߦ͏͜ͱ͕ग़དྷͨɻʮRaspberry PiΛਐΊΔ͜ͱ͕Ͱ͖ΔɻҰ࿈ͷ࣮शͰɼֶੜ͕ Arduinoਤ 2 ʹɼRPi ʹΑΔԹ౓ηϯαʔ͔ΒͷσʔλऔಘͷηοτΞοϓΛࣔ͢ɻԹ౓ηϯαʔʢφγϣφϧ ηϛ

ͷ”Pi” ͸ɼPython ͷུͰ͋Δ [5]ʯͱ͋Δ௨ΓɼRPi ͸Python Λ࢖༻͢Δ‫͕ڥ؀‬੔͍ͬͯΔɻ

ίϯμΫλʔ੡ LM35DZʣͰࣨԹΛଌఆ͠ɼηϯαʔ͔ΒͷΞφϩάిѹ৴߸ΛɼϚϧνϝʔλʔɼ͓Αͼ

Arduino ʹΑͬͯͦΕͧΕ AD ม‫͠׵‬ɼϚϧνϝʔλʔ͔Β͸ Ethernet ௨৴ͰɼArduino ͔Β͸γϦΞϧ௨৴ʹΑΓɼRPi ͕औಘ͢Δߏ੒ͱͨ͠ɻେࡕେֶͰͷྫ3େࡕେֶࢁத୎‫Ͱࣨڀݚ‬͸ɼਤ 3 ͷΑ͏ʹɼRPi ͱ‫ܭ‬ଌ‫ث‬΍ճ࿏Λ઀ଓ͍ͯ͠ΔɻEPICS Λհͣ͞ɼ௚઀

Linux ίϚϯυɼPythonɼC ‫ޠݴ‬Λ༻͍ͯ‫ܭ‬ଌ੍‫ޚ‬Λߦ͍ͬͯΔɻ·ͨɼArduino ͷΑ͏ͳϚΠίϯΛհͣ͞ɼ௚઀γϦΞϧ௨৴ΠϯλʔϑΣʔεΛ࣋ͭ IC ͱ௨৴Λߦ͓ͬͯΓ஥հ‫ػ‬ೳΛ௥Ճಋೖ͠ͳ͍ɻ
熱電対読み出しIC
温度・湿度・気圧センサーIC
ADC ICਤ 2: RPi ʹΑΔԹ౓ηϯαʔ͔Βͷσʔλऔಘͷϒオシロスコープ
直流電源

ファン
制御

GPIO
ラズベリーパイ

LAN-LXI (VXI-11)

ϩοΫਤ

リレー
開閉

USB-Serial(RS-232C)

ͱɼϚϧνϝʔλʔ͔Βಉ࣌ʹಘΒΕͨଌఆԹ౓ʢਫ਼౓

0.001 ౓ʣΛൺֱͨ͠ͱ͜ΖɼArduino ͷଌఆਫ਼౓ 1 ϏοArduino ͔Βͷग़ྗσʔλΛߍਖ਼͢Δͱɼ͞Βʹྑ͍Ұக͕ಘΒΕΔͱࢥΘΕΔɻ2600 ԁͷ ADC ͩͱ͍͏͜3.1‫ܭ‬ଌ‫ͱث‬ͷ઀ଓ

ද 1 ʹ‫ܭ‬ଌ‫ث‬ͷ઀ଓྫΛࡌͤΔɻͱΛߟྀ͢Δͱɼඇৗʹຬ଍ͷ͍݁͘ՌͰ͋Δɻ
·ͨɼRPi ͱ Arduino ͸ɼͲͪΒ΋ίϯύΫτͳαΠ

マルチメータ
ソースメジャーユニット
高圧電源ਤ 3: େࡕେֶͰͷ RPi ͱ‫ܭ‬ଌ‫ث‬ɼճ࿏ͷ઀ଓArduino ʹΑͬͯಘΒΕͨଌఆԹ౓ʢଌఆਫ਼౓ 0.5 ౓ʣτ෼ͷͣΕ͕ΈΒΕͨͷ΋ͷͷɼྑ͍Ұக͕ΈΒΕͨɻUSBカメラ

1 4.1 અͰɼৄࡉΛ঺հ͍ͯ͠Δɻ3191

ද 3: SPI ௨৴Ͱ༻͍Δ഑ઢ
SCLK Serial Clock
MOSI Master Out Slave Inද 1: ઀ଓͨ͠‫ܭ‬ଌ‫ث‬ͷྫ
LAN-LXI(VXI11)
ΦγϩείʔϓΦγϩείʔϓ

TDS3000
DPO/MSO

Tektronix
Tektronix௚ྲྀి‫ݯ‬PMX-A

KIKUSUI

USB-Serial(RS-232C)
ϚϧνϝʔλιʔεϝδϟʔVOAC75xx
2400/2410

IWATSU
Keysightߴѹి‫ݯ‬

NHS6xxx

iseg

3.2.1

MISO
SSMaster In Slave Out
Slave Slect BarGND

GroundϦϨʔ։ดAC100V ‫ثػ‬Λ੍‫͢ޚ‬ΔͷʹɼϑΥτΧϓϥೖྗͷι*IDN?

ද 2: SCPI ίϚϯυྫ‫ݸثػ‬ମࣝผ໰͍߹ͤ จࣈྻฦ৴:READ?

σʔλಡΈग़͠

จࣈྻฦ৴• LAN-LXI(LAN eXtensions for Instrumentation)

PC ͷ LAN ϙʔτͱɼLXI ‫ثػ‬Λ LAN έʔϒϧͰ઀ଓ͢ΔɻPCɼLXI ‫ثػ‬ͷ IP ΞυϨεΛ༻͍ɼ

TCP/IP Λϕʔεͱ͢Δ VXI-11 ϓϩτίϧͰ௨৴
͢ΔɻC ‫ʹޠݴ‬ΑΔ Linux ༻ͷϥΠϒϥϦ͕ެ։͞Ε͓ͯΓɼ͜ΕΛҰ෦มߋ͠ Mac OSX ༻ʹ΋Ҡ২ͨ͠ɻTektronix ͷΦγϩείʔϓʹΑΔ‫ܭ‬ଌ੍‫ޚ‬ϓϩάϥϜͱ‫ެʹڞ‬։ͨ͠ [6]ɻ• USB-Serial

PC ͷ USB ϙ ʔ τ ͱ RS-232C(RecommendedStandard 232c) ‫ثػ‬ΛɼUSB-Serial ม‫׵‬έʔϒϧΛհ͠઀ଓ͢ΔɻLinux Ͱ͸ USB-Serial ͱ͍͏࢓૊Έ͕ඪ४૷උ͞Ε͓ͯΓɼ/dev/ttyUSB0ϦουεςʔτϦϨʔ OMRON G3CN-202P Λ༻͍ͨɻ

3.3V(2.2mA) Ͱ։ดಈ࡞ՄೳͰ͋ΓɼGPIO3.3V ͔Β௚઀੍‫͠ޚ‬ɼύτϥϯϓͱϒβʔͷ࡞ಈʹར༻ͨ͠ɻ

3.2.2ϑΝϯճస਺੍‫ޚ‬GPIO3.3V Λ௚઀τϥϯδελʹ‫͢څڙ‬Δ͜ͱͰɼ5VTTL ʹϩδοΫϨϕϧม‫͠׵‬ʢਤ 4ʣɼϑΝϯͷճస਺Λ Pulse Width Modulation(PWM) Ͱ੍‫ͨ͠ޚ‬ɻ5V
΋ RPi ͷϐϯ͔Β‫͠څڙ‬ɼ5mA ఔ౓ͷిྲྀফඅͰ͋Δɻ

5V
GPIO 10k0V/3.3VͳͲͷσόΠεͱͯ͠ೝࣝ͞ΕΔɻPC ͔Βಛఆ ͷ ί Ϛ ϯ υ จ ࣈ ྻ Λ ૹ ৴ ͠ (echo จ ࣈ ྻ >/dev/ttyUSB0)ɼඞཁͰ͋Ε͹‫ثػ‬ଆ͔Βͷจࣈ

1k

FAN PWM input
25kHz
5V
1V
FAN GNDਤ 4: PWM ༻ GPIO ઀ଓճ࿏ (఍߅஋ͷ୯Ґ͸ Ω)ྻฦ৴Λड৴͠ɼม਺ʹͭΊΔ (read -n จࣈ਺ม਺ < /dev/ttyUSB0)ɻಛఆͷίϚϯυจࣈྻ͸‫ثػ‬ຖʹఆٛ͞Ε͍ͯΔ͕ɼ͋Δఔ౓‫ڞ‬௨Խ͕ਤΒΕ͓ͯΓɼSCPIʢεΩοϐɼStandard Commands

for Programmable InstrumentsʣίϚϯυͱ‫ݺ‬͹ΕΔ (ද 2)ɻ

3.2.3γϦΞϧ௨৴೤ిରಡΈग़͠ɼԹ౓‫ؾ‬ѹ࣪౓ηϯαʔɼADC ‫ػ‬ೳͳͲΛ΋ͭγϦΞϧ௨৴‫ػ‬ೳΛඋ͑ͨ IC ͕͋ΔɻRPi ͷGPIO ϐϯʹΑΓͱ͜ΕΒͱ௨৴͠ɼ༷ʑͳ‫ܭ‬ଌ͕Ͱ͖Δɻࠓճ͸୅දతͳγϦΞϧ௨৴ SPI (Serial PeripheralInterface) ΛऔΓ্͛ΔɻSPI Ͱ͸ද 3 ʹ͋ΔΑ͏ʹɼά

3.2ճ࿏ͱͷ઀ଓRPi Ͱಛʹศརͳ఺͸ɼGPIO(General Purpose Input Output) ϐϯΛ૷උ͠ɼ֤ Pin Ͱσδλϧೖग़ྗ͕Մೳͳ఺Ͱ͋Δɻ͜ΕΛ༻͍ͯϦϨʔ੍‫ޚ‬ɼϑΝϯճస਺੍‫ޚ‬Λߦ͏ɻ೤ిରಡΈग़͠΍ ADC ‫ػ‬ೳͳͲΛ΋ͭIC ͱͷ௨৴ΛऔΓ্͛Δɻ

ϥϯυΛআ͖ɼ4 ຊͷ഑ઢͰ௨৴Λߦ͏ɻSCLK ͸Ұఆप‫͋Ͱظ‬Δඞཁ΋ͳ͘ɼSCLK ͷΤοδͳͲͰͷ MOSI΍ MISO ͷ৴߸ϨϕϧΛ༻͍ͯɼIC ͰఆΊΔ‫ن‬໿ʹैͬͯ௨৴Λߦ͏ɻෳ਺ͷ IC ؒͰɼSCLKɼMOSIɼMISO͸‫ڞ‬௨ͷόεͱͯ͠ར༻Ͱ͖Δɻ֤ IC ʹରͯ͠ɼSS ϥΠϯΛઃ͚ͯɼ͜ΕΛ Low ʹ͢Δ͜ͱͰɼ௨৴ઌͷ ICΛࢦఆ͢Δɻද 4 ʹ SPI ௨৴Λඋ͑ͨ IC ͷྫΛࡌͤΔɻ4192

ද 4: SPI ௨৴‫ػ‬ೳ౥ࡌ IC ͷྫ೤ిରಡΈग़͠
MAX31855 Maxim

3.3.2

γϦίϯϐΫηϧηϯαʔྫྷ٫γεςϜ

HL-LHC ʹ޲͚ͨγϦίϯϐΫηϧηϯαʔͷςεԹ౓࣪౓‫ؾ‬ѹηϯαʔ

BME280Switch ScienceτϏʔϜʹ͓͚Δɼηϯαʔྫྷ٫γεςϜͷίϯτϩʔADC

MCP3204

Microchipϧ‫ͼٴ‬ϞχλͰ͋Δɻηϯαʔ‫ͼٴ‬ϑϩϯτΤϯυճ࿏Λஅ೤ശ಺ʹઃஔ͢Δɻஅ೤ശ಺ͷྫྷౚ‫ػ‬ϔουʹର͠ɼ3.3ճస਺੍‫ͨ͠ޚ‬ϑΝϯʹΑΔ಺෦ۭ‫ؾ‬॥‫؀‬Λߦ͍ྫྷ٫ΛRPi ‫ܭ‬ଌ੍‫جޚ‬൘ߦ͏ɻྫྷ٫࣌݁࿐͕ͳ͍Α͏஠ૉΨεϑϩʔΛߦ͍ɼԹ͜Ε·Ͱ঺հͨ͠‫ػ‬ೳΛඋ͑ͨ‫ܭ‬ଌ੍‫جޚ‬൘Λ࡞Γར༻ͨ͠ɻਤ 5 ͷΑ͏ʹɼ10cm×20cm ͷϚβʔ‫ج‬൘্ͷ౓࣪౓ΛϞχλ͢ΔɻγϦίϯηϯαʔΛ −33◦ C ʹྫྷ٫ͯ͠ࢼ‫ݧ‬Λߦ͏͜ͱʹ੒ޭͨ͠ɻ40pin ϝεϔομʹ RPi Λᎎ͢ɻSPI ௨৴Մೳͳ IC ͸υʔλʔ‫ج‬൘ʹ࣮૷͠ɼϚβʔ‫ج‬൘ʹૠͯ͠ར༻͢ΔɻMPPC ੍‫ޚ‬γεςϜ͜ͷ༻్ʹ 10pin ͷϑϥοτέʔϒϧίωΫλΛ 6 ‫ݸ‬

3.3.3༻ҙͨ͠ɻϑϥοτέʔϒϧ‫ܦ‬༝Ͱɼ཭Εͨ৔ॴʹυʔλʔ‫ج‬൘Λઃஔ͢Δ͜ͱ΋Ͱ͖Δɻ͜ͷଞʹɼGPIO ग़2018 ೥౓ʹ༧ఆ͢Δ KOTO ࣮‫ݧ‬ͷΧϩϦϝʔλΞοϓάϨʔυʹ͓͍ͯɼundoped CsI ݁থԼྲྀଆͷ PMTྗΛϦϨʔ։ดʹ༻͍ͨΓɼPWM ੍‫ʹޚ‬ΑΓϑΝϯͷʹՃ͑ɼ্ྲྀଆʹ΋ MPPC ΛͱΓ͚ͭɼγϯνϨʔγϣճస਺੍‫ޚ‬Λߦ͏ɻϯޫΛಡΈग़͢ɻ͜ͷ MPPC ͷҹՃిѹͷ On/Oﬀ Λ

温度湿度気圧センサー

20cm
GPIOx5PhotoMOS ϦϨʔͰߦ͍ɼ҉ిྲྀग़ྗͱԹ౓Λ SPI ௨৴‫ػ‬ೳ෇͖ IC ͰϞχλ͢Δɻͪ͜Β͸ผͷઐ༻‫ج‬൘Λ༻͍͍ͯΔ͕ɼ঺հͨ͠ RPi ͷ‫ػ‬ೳΛͦͷ··༻͍ͯ
͍ΔɻLXI ‫ػ‬ೳΛඋ͑ͨ٠ਫిࢠͷి‫ʹݯ‬ΑΔ MPPC

SPIx6

PWMx1

熱電対読み出しIC΍ΞϯϓͷిѹҹՃ΋ɼRPi ͔Βߦ͏ɻJ-PARC ͰͷऔΓ૊Έ

4

熱電対FanKEK ͷՃ଎‫ࢪث‬ઃ͕ӡ༻͢ΔՃ଎‫ث‬ͷଟ͕͘ɼEPICSΛϕʔεʹ։ൃ͞Ε͍ͯΔɻEPICS ͷίΞͱͳΔ IOCιϑτ΢ΣΞ͓Αͼ௨৴ϓϩτίϧͰ͋Δ CA(Channel40-pin socket

RaspberryPi

10-pin socketਤ 5: RPi ‫ܭ‬ଌ੍‫جޚ‬൘ҎԼԠ༻ྫΛࣔ͢ɻAccess) ϥΠϒϥϦ͸ Posix ४‫ڌ‬ͷ Unix Ͱಈ࡞͢Δɻ
J-PARC ηϯλʔ/KEK ͷՃ଎‫ޚ੍ث‬άϧʔϓͰ͸ɼ
EPICS ͷ‫ڭ‬ҭ༻πʔϧͱͯ͠ͷԠ༻Λ౰ॳͷ໨తͱͯ͠ɼ
RPi ΍ Arduino ͳͲͷ௒খ‫ܕ‬ίϯϐϡʔλʔΛ EPICS
Ͱར༻͢Δ‫ڥ؀‬ͷ੔උΛߦ͖ͬͯͨɻՃ଎‫ث‬ͷ੍‫΁ޚ‬ͷ௚઀ͷԠ༻͸ͳ͍͕ɼ‫ؾ‬Թɼ‫ؾ‬ѹͳͲͷ‫ڥ؀‬σʔλͷऔಘͳͲ΁ͷԠ༻΋‫ݕ‬౼͞Ε͍ͯΔɻ·ͨɼ์ࣹઢ࡞‫ۀ‬தͷ์ࣹઢඃമྔ؅ཧ΁ͷԠ༻Λ૝ఆͨ͠։ൃͳͲ΋ߦͬ
͍ͯΔɻ

3.3.1νΣϯόΨε‫څڙ‬γεςϜ‫ࢹ؂‬J-PARC KOTO ࣮‫͚͓ʹݧ‬ΔΨεϫΠϠνΣϯόͷΨε‫څڙ‬γεςϜͷ‫͋Ͱࢹ؂‬Δɻ֤ॴͷԹ౓ɼՄ೩Ψεೱ౓ηϯαʔͷग़ྗΛ SPI ௨৴Մೳͳ IC ͰϞχλ͢Δɻ͜ͷଞʹɼ௨ৗͷ USB ΧϝϥΛ༻͍όϒϥͷ‫ࢹ؂‬Λߦ͏ɻҟৗͷࡍ͸ɼύτϥϯϓ‫ͼٴ‬ϒβʔͰ΋‫͢ࠂܯ‬Δɻ

KOTO ࣮‫ ͯʹݧ‬2015 ೥ΑΓӡ༻தͰ͋Δɻ

4.1

Arduino for EPICS training

EPICS ͸֤छͷ LinuxɼMacOSXɼWindows Subsystem for Linux ͳͲͰಈ࡞͢Δɻಛʹ Virtual Box ͳͲͷԾ૝‫্ڥ؀‬ͷ Linux Ͱ΋ಈ࡞͢Δɻ͜ͷ͜ͱ͔Βɼ
EPICS ͷಋೖ‫ڭ‬ҭͰ͸डߨऀ͸֤ࣗͷ‫ Ͱڥ؀‬EPICS ιϑτ΢ΣΞΛಈ࡞ͤ͞Δ͜ͱ͕Ͱ͖ΔɻEPICS ‫ڭ‬ҭͰ͸͜ͷΑ͏ͳ࣮श (Hands On) ͕ॏཁʹͳΔɻ࣮शͷࡍʹ͸ɼ࣮ࡍʹʢLED ΍εΠονͳͲͷ୯७ͳ෺Ͱྑ͍ͷ͕ͩʣ૷ஔΛ EPICS ‫ܦ‬༝Ͱ੍‫ޚ‬ʗ‫͢ࢹ؂‬Δ͜ͱ͕༗

5193

ޮͰ͋Δɻ͜ͷΑ͏ͳ࣮शͷࡍʹ؆୯ͳೖग़ྗͷ૷ஔͱEPICS ίϛϡχςΟͷதͰ΋ RPi ͸ධՁ͕ਐΜͰ͓ͯ͠࢖͑ΔΑ͏ʹɼArduino Λ ϕʔεʹͨ͠ηοτΛΓɼGPIO ೖग़ྗ΍ɼI2C/SPI ‫ܦ‬༝Ͱͷ૷ஔ੍‫ޚ‬Λα༻ҙͨ͠ʢਤ 6ʣ[7]ɻ

ϙʔτ͢ΔͨΊͷσόΠεαϙʔτ͕ଘࡏ͍ͯ͠Δ [8]ɻProcessing ‫Ͱڥ؀‬ͷ EPICS ར༻

4.3

Processing[9] ͸ Java ϕʔεͷϓϩάϥϜ‫͋Ͱڥ؀‬ΔɻϓϩάϥϛϯάΛઐ໳ͱ͢ΔํͰͳͯ͘΋ը૾ॲཧͳͲͷ༷ʑͳ࣮࣌ؒॲཧΛߦ͏ΞϓϦέʔγϣϯΛ࡞੒Ͱ͖Δ͜ͱΛ໨తʹ։ൃ͞Ε͍ͯΔɻProcessing ‫Ͱڥ؀‬͸ɼ

AR(Augmented Reality) ϚʔΧʔͷॲཧ͕؆୯ʹར༻
Ͱ͖Δ͜ͱ͔ΒɼηϯαʔͷϞχλʔ஋Λը૾্ͷϞχλʔҐஔʹॏͶͯදࣔ͢ΔϓϩτλΠϓʢਤ 7ʣΛ࡞੒ਤ 6: EPICS training ͷͨΊʹ༻ҙ͞Εͨ Arduino IO

sample ΩοτɻϒϨουϘʔυʢӈ্ʣʹ LEDɼεΠονɼԹ౓ηϯαʔʢαʔϛελʣɼর౓ηϯαʔ (CdS)ͳͲ͕഑ஔʢࠨɿ഑ઢਤʣ͞Ε͍ͯΔɻ͜ΕΒͷ෦඼͸ɼϒϨουϘʔυͷԼͷ ArduinoʢӈԼʣʹ઀ଓ͞Ε͍ͯΔɻ

Arduino ͸ EPICS IOC ͱͳΔ PC ͱ USB ઀ଓ͞Εɼ
EPICS IOC ͔Β͸γϦΞϧ઀ଓͷ૷ஔͱͯ͠ೝࣝ͞ΕΔɻ͜ͷγϦΞϧ઀ଓ‫ܦ‬༝Ͱ EPICS IOC ͔Β ArduinoΛ੍‫͢ޚ‬ΔͨΊʹ EPICS/StreamDevice 2 Λ࢖ͬͨɻ؆୯ͳγϦΞϧ௨৴্ͷϓϩτίϧΛఆٛ͠ɼ͜ΕΛ࣮૷
͢Δ Arduino ଆͷϓϩάϥϜͱ EPICS IOC ଆͷϓϩͯ͠ΈͨɻCPU ෛՙͷ෼ࢄΛߟྀ͢Δͱɼը૾ॲཧΛ୲౰͢ΔProcessing ‫ͱڥ؀‬ɼηϯαʔ͔ΒͷσʔλΛऔಘ͢Δϓϩηεʹ෼཭͍ͨ͠ɻProcessing ‫ Ͱڥ؀‬EPICS CA ͷೖग़ྗ͕Ͱ͖Ε͹ɼ͜ͷΑ͏ͳγεςϜ͸؆୯ʹߏஙͰ
͖ΔɻEPICS CA ϥΠϒϥϦʹ͸‫׵ޓ‬ੑͷ͋Δ C/C++൛ͱ Java ൛ͷೋ͕ͭ͋Δɻ Processing ͸ Java ϕʔεͰ͋Δ͜ͱ͔Β Java ൛ͷ EPICS CA ϥΠϒϥϦΛ Pro-cessing ‫ʹڥ؀‬ಋೖͨ͠ɻ͜ΕʹΑΓɼProcessing ‫ڥ؀‬
Ͱ EPICS IOC ͔Βऔಘͨ͠ηϯαʔσʔλΛɼUSB Χϝϥ͔Βऔಘͨ͠ը૾্ͷ AR ϚʔΧʔͷҐஔʹදࣔ͢ΔΞϓϦέʔγϣϯ͕؆୯ʹߏஙͰ͖Δ͜ͱ֬ೝ͍ͯ͠ΔɻτίϧϑΝΠϧΛ։ൃͨ͠ɻEPICS ‫ڭ‬ҭͰ͸͜ΕΒͷඞཁͳઃఆΛఏ‫Ͱ্ͨ͠ڙ‬ɼ
EPICS DB ͷߏங΍ɼEPICS Sequencer ϓϩάϥϜͷ࣮शͳͲΛߦ͏ɻ

4.2

EPICS on RPiRPi ͷ CPU Ͱ͋Δ ARM ͸ҎલΑΓ EPICS Ͱͷαϙʔτʹ‫·ؚ‬Ε͓ͯΓɼRaspibian Ͱͷ EPICS ‫ߏڥ؀‬ங͸ɼେ͖ͳ໰୊ͳ࣮͘ߦͰ͖ΔɻΑΓ؆୯ʹ Raspbian‫ ʹڥ؀‬EPICS ΛΠϯετʔϧ͢ΔͨΊʹɼRaspibian ༻όΠφϦΛ‫ؚ‬Ή EPICS base Λ tar.gz ϑΝΠϧͱͯ͠༻ҙ͍ͯ͠Δɻ

RPi ͸Ϣʔβʔ͕ࣗ༝ʹ࢖͑Δ GPIO Λ΋͕ͭɼADC

ਤ 7: ࣓‫ؾ‬ηϯαʔͷҐஔΛ AR ϚʔΧʔΛ༻͍ͯ‫ݕ‬ग़ɻΧϝϥը૾ͷͦͷ৔ॴʹɼ࣓৔ΛϕΫτϧͱͯ͠දࣔ͠
͍ͯΔɻ‫ػ‬ೳΛ࣋ͨͳ͍ɻEPICS ‫ڭ‬ҭʹ޲͚ͯɼArduino ͳͲͷ ADC ‫ػ‬ೳΛ΋ͭϘʔυ΍ɼI2C/SPI ͳͲͰ઀ଓՄೳ
ͳ ADC ͳͲΛ༻ҙ͢Δඞཁ͕͋ΔɻArduino ͷ৔߹ʹ͸ɼલઅͱಉ༷ʹ USB ઀ଓͰ RPi ্ͷ IOC ͔Β͜ͷ

ADC ‫ػ‬ೳΛ࢖͍͜ͳͤΔɻ

2 StreamDevice ͸ EPICS ͰɼγϦΞϧɼGPIBɼVXI-11 ͳͲͷ઀ଓΛαϙʔτ͢ΔͨΊʹ൚༻ϥΠϒϥϦͰ͋Δɻ

5KEK-PF/cERL ͰͷऔΓ૊Έ

5.1

EPICS ಺ଂσόΠεαʔόʔখ‫ܕ‬ΧʔυαΠζͷγϯάϧϘʔυίϯϐϡʔλʔͱͯ͠͸ RPi ͕ಛʹ༗໊Ͱ͋ΔҰํɼ΄͔ʹ΋ଟ͘ͷ੡

6194

඼͕ࢢ৔ͰೖखՄೳͱͳ͍ͬͯΔɻKEK-PF/cERL Ͱ͸ɼͦΕΒͷத͔Β “BeagleBone Black” (BBB) [10] Λ࢖༻ͯ͠ RS232C ‫ثػ‬Λԕִ͔Β੍‫͢ޚ‬ΔͨΊͷখ‫ܕ‬σόΠεαʔόʔΛ։ൃͨ͠ɻ͜Ε͸࣮ࡍʹ์ࣹઢͷϞχλʔ΍Թ౓ɾ࣪౓ϞχλʔͳͲʹ࢖༻͓ͯ͠Γɼ਺೥ʹΘͨͬͯ҆ఆͯ͠࿈ଓՔಇ͍ͯ͠Δɻਤ 9: EPICS ಺ଂσόΠεαʔόͷࣸਅɻࠨɿ4 ϙʔτϞσϧɼӈɿ1 ϙʔτϞσϧɻ͸͡Ί֤छͷ I/O ϙʔτ͕Χʔυͷ୹ลํ޲ʹूதͯ͠ਤ 8: RS232C ‫ثػ‬Λԕ੍ִ‫͢ޚ‬Δࡍͷయ‫ܕ‬తͳϒϩοΫਤɻ্ɿϝσΟΞίϯόʔλΛ࢖༻ͨ͠৔߹ɼԼɿEPICS಺ଂͨ͠σόΠεαʔόʔͰͷߏ੒ɻUSB ‫ثػ‬΍ RS232C ‫ثػ‬౳ͷγϦΞϧ઀ଓσόΠεΛ Ethernet ‫ܦ‬༝Ͱԕִૢ࡞͢Δͱ͖ɼ΋ͬͱ΋୯७ͳํ๏͸੍‫ޚ‬ର৅‫ ʹثػ‬Ethernet-RS232 ม‫ث׵‬Λ઀ଓ͠ɼ

TCP/IP Socket ௨৴౳ͰίϚϯυΛ΍ΓͱΓ͢ΔํࣜͰ͋Ζ͏ɻϝσΟΞίϯόʔλʔͱͯ͠ࢢൢ඼΋ଟ͋͘Γɼੑೳ΍‫ػ‬ೳʹԠͯ͡Ձ֨΋༷ʑͳબ୒ࢶ͕͋Δɻ੍‫ޚ‬ͷ‫ن‬໛͕খ͍͞৔߹΍ɼ੍‫͢ޚ‬Δϗετଆ͕͚̍ͭͩͷ৔߹͸͜Ε͚ͩͰ΋े෼͔΋͠Εͳ͍͕ɼՃ଎‫ث‬ͷΑ഑ஔ͞Ε͍ͯͯ૊ΈࠐΈ༻్ʹద͍ͯ͠Δ͜ͱɼUART4 ϙʔτΛಉ࣌ʹ࢖༻ՄೳͳσβΠϯ͕࠷ॳ͔Β༻ҙ͞Ε͍ͯΔ͜ͱɼͳͲͷཧ༝Ͱզʑ͸ BBB Λ࠾༻ͨ͠ɻ੡඼ൺֱ΍ಋೖͷ‫ܦ‬ҢͳͲɼৄ͘͠͸Ճ଎‫ֶث‬ձͰͷൃද [11] ʹ‫ه‬ड़͍ͯ͠Δʢͨͩ͠ 2014 ೥࣌఺Ͱͷ৘ใͳͷͰ‫Ͱࡏݱ‬͸গ͠ঢ়‫͕گ‬มΘ͍ͬͯΔ෦෼΋͋Δʣɻ͜ΕΒͷϋʔυ΢ΣΞ‫ ͼٴ‬EPICS ιϑτ΢ΣΞ৘ใ͸͢΂ͯ‫ޙ‬ड़͢Δ wiki ʹެ։͍ͯ͠ΔͨΊɼͩΕͰ΋੡࡞ՄೳͰ͋Δɻ੡଄ʹ͋ͨͬͯ͸ Web ‫ܦ‬༝Ͱ CAD ਤΛૹΔͱϓϦϯτ‫ج‬൘Λ੡࡞͢ΔαʔϏεΛར༻ͨ͠ɻ‫ج‬൘αΠζ΋খ͍ͨ͞Ί҆Ձ͔ͭ 1 िؒఔ౓ͷ୹ೲ‫Ͱظ‬੡଄ՄೳͰ͋Δɻ͏ͳେ‫ن‬໛૷ஔɼͦͯ͠ଟ͘ͷ։ൃऀ΍ӡసһ͕͔͔ΘΔ‫Ͱڥ؀‬͸੍‫ڞޚ‬௨ͷʮ‫ݴ‬༿ʯͰ௨৴Λ͢Δඞཁ͕͋Γɼ

EPICS ͷ৔߹͸‫ʹط‬આ໌͞Ε͍ͯΔ CA ϓϩτίϧͰ
͋Δɻਤ 8 ্ਤʹࣔ͢Α͏ʹɼయ‫ܕ‬తʹ͸αʔόʔ‫ܭ‬ࢉ‫ʹͲͳػ‬ιϑτ΢ΣΞϕʔεͷೖग़ྗίϯτϩʔϥʔ(IOC) Λஔ͖ɼσόΠεͱͷؒΛ Socket ௨৴ɼEPICSϗετͱͷ௨৴Λ CA ϓϩτίϧͰߦ͏ߏ੒͕Α͘࢖༻͞Ε͍ͯΔɻ
௨ৗɼRS232C ‫ثػ‬ͷ௨৴଎౓͸ Ethernet ‫ʹثػ‬ൺ΂ͯ஗͍ͨΊ͜ͷΑ͏ͳํࣜͰ΋ωοτϫʔΫଳҬʹରͯ͠Ө‫ڹ‬Λ༩͑Δ΄ͲͰ͸ͳ͘ɼ໰୊ʹͳΔ͜ͱ͸ແ͍ɻ͔͠͠ɼωοτϫʔΫΛ৑௕ͳ௨৴σʔλ͕ྲྀΕΔ͜ͱ͸ࣄ࣮Ͱ͋Γɼࠓ‫ޙ‬σόΠεͷ਺͕૿͑ͨΓɼߴ଎௨৴Λߦ͏Α͏ʹͳΔͱσʔλ௨৴ྔ͕૿Ճͯ͠͠·͍໰୊ʹͳΔՄೳੑ΋͋Δɻͦ͜Ͱ RS232C ΠϯλʔϑΣʔεΛ༗ͨ͠ EPICS IOC Λ੡࡞͢Ε͹ԕ੍ִ‫ʹޚ‬ඞཁͳσʔλͷΈΛ Ethenet ଆʹྲྀ͢͜ͱ͕ՄೳͱͳΔɻ࠷ॳʹ 1 ͭͷ BBB ͔Β 4 ୆ͷγϦΞϧ‫ثػ‬Λ੍‫͢ޚ‬ΔϞσϧΛ࡞੒͠ɼͦͷ‫Ͱޙ‬ΑΓখ‫ܕ‬ԽΛ໨ࢦͨ͠ 1 ϙʔτϞσϧΛ੡࡞ͨ͠ɻਤ 9 ʹ 4 ϙʔτϞσϧͱ 1 ϙʔτϞσϧͷࣸਅΛࣔ͢ɻRPi Ͱ΋΄΅ಉ͡‫ػ‬ೳΛ΋ͭϋʔυ΢ΣΞΛ੡࡞͢Δ͜ͱ͸ՄೳͰ͋Δ͕ɼBBB ͸૊ΈࠐΈΛߟྀͯ͠“Cape”ͱ‫ݺ‬͹ΕΔ֦ுϘʔυͷ‫͕֨ن‬ఆΊΒΕ͍ͯΔ͜
ͱɼDigital I/O ϐϯͷ਺͕ଟ͍͜ͱɼUSB ΍ HDMI Λ

5.2

BBB for EPICS training

EPICS ‫ڭ‬ҭʹ͓͍ͯɼHands-on ࣮श͕ॏཁͰ͋Δ͜ͱ͸ J-PARC ͷऔΓ૊ΈͰऔΓ্͛ͨ௨ΓͰ͋Δɻ͜͜Ͱ͸࣮श໨తͱͯ͠ͷ BBB ʹ͍ͭͯड़΂Δɻ

BBB ͷେ͖ͳಛ௃ͱͯ͠ɼ
ʮΞφϩάೖྗ͕͋Δʯ͜ͱ͕‫͛ڍ‬ΒΕΔɻ7 νϟϯωϧͱ͍͏ଟೖྗ਺͸ັྗతͰ͋ΔҰํɼೖྗిѹ͕ 0 - 1.8 V ͱগ͠‫ͱ͍͜ڱ‬΍෼
ղೳ͕ 12 bit ͔͠ͳ͍͜ͱɼGND ͕‫ڞ‬௨Ͱ͋Δ͜ͱͳͲɼຊ֨తͳ‫ܭ‬ଌʹ࢖༻͢Δʹ͸গ͠‫ྼݟ‬Γ͢ΔεϖοΫͱͳ͍ͬͯΔɻ͔͠͠ɼBBB ຊମ͚ͩͰΞφϩάೖྗ͕‫ܭ‬ଌՄೳͱ͍͏ͷ͸ಛʹॳֶऀʹͱͬͯͱͯ΋ັྗతͰ͋Γɼ؆୯ʹʮϋʔυ΢ΣΞʯͱʮιϑτ΢ΣΞʯͷ૬‫༻࡞ޓ‬Λ࣮‫͖Ͱײ‬ΔϓϥοτϗʔϜͱͯ͠ɼಛʹ‫ڭ‬ҭ༻్ʹద͍ͯ͠Δͱ͍͑Δɻ࠷ۙͰ͸ BBB ͱͦͷ೿ੜ൛Ͱ͋Δ BeagleBone Green (BBG) Λ࢖ͬͯ EPICSೖ໳ͷߨशʹ࢖༻͓ͯ͠Γ (ਤ 10)ɼྫ͑͹• ϒϨουϘʔυͱ BBB Λ࢖͍ LED ఺໓• EPICS ͔Β LED ੍‫ޚ‬
• Push Switch ͷׂΓࠐΈͰ EPICS Λಈ͔͢• ΞφϩάԹ౓ηϯαʔ IC Λ EPICS ͰϞχλʔ• ϊʔτ PC ʹ EPICS GUI Λߏங੍ͯ͠‫ޚ‬ͱ͍߲ͬͨ໨Λ‫࣮ૅج‬शͱͯ͠ߦͬͨɻ͜͜Ͱ͸ಛʹϋʔυ΢ΣΞׂΓࠐΈͰ EPICS ϨίʔυΛϓϩηεͰ

7195

͖Δ͜ͱΛ࣮‫ͯ͠ײ‬΋Β͏͜ͱΛॏࢹ͍ͯ͠Δɻಉ࣌ʹEPICS ࠷େͷϝϦοτͰ͋ΔɼωοτϫʔΫ෼ࢄ੍‫ޚ‬͕ՄೳͰ͋Δ͜ͱ΋͜͜Ͱମ‫͖Ͱײ‬Δɻࠓ‫ޙ‬͸࣮शऀͷशख़౓ʹԠͯ͡ I2CɼSPI ͳͲΛհͨ͠ηϯαʔ͔Βͷೖग़ྗΛߦͬͨΓɼιϑτ΢ΣΞ։ൃʹ‫ڵ‬ຯ͕͋Δ৔߹͸ࣗ෼Ͱ EPICS Base/Module ιϑτ΢ΣΞΛ BBB ্ʹߏங͢Δԋश΍σόΠεαϙʔτ੡࡞࣮शͳͲɼཁ๬ʹԠ֤ͯ͡छͷτϐοΫεΛऔΓ্͍͛ͯ͘͜ͱΛ༧ఆ͍ͯ͠Δɻ·ͨɼ࣮शʹ࢖༻͍ͯ͠Δ‫ࡐڭ‬΍ EPICS Πϝʔδͷߏஙํ๏ͳͲ͸‫ޙ‬ड़͢Δ wiki Ͱެ։͍ͯ͠Δɻਤ 11: EPICS ೔ຊ‫ޠ‬৘ใ wiki αΠτ

6EPICS ͱ RPi ʹ͍ͭͯ

6.1EPICS ॳ৺ऀͷօ͞Μʹ޲͚ͯEPICS ͰՃ଎‫ޚ੍ث‬γεςϜΛ։ൃͨ͠ KEK ΍ JPARC Ͱ͸ɼա‫ ʹڈ‬EPICS ʹ͍ͭͯਘͶΒΕͨΓɼߨशձΛߦͬͨΓ͖ͯͨ͠ɻEPICS ͷ Document ͸େྔʹ͋Δɻͨͩ͠ӳ‫ޠ‬ͷ reference manual తͳ΋ͷ͕ଟ͘ɼॳ৺ऀ͸๲େͳจॻͷத͔ΒԿΛ࠷ॳʹಡΉ΂͖͔Θ͔Βͳ͍ɻͦͷதͰ͸ɼա‫ʹڈ‬։࠵͞Εͨߨशձਤ 10: EPICS ࣮श༻Ωοτͷࢿྉʢྫ͑͹ [14]ʣ͕ద౰ͱࢥΘΕΔ͕ɼॳ৺ऀͷಠशʹ͸ෑ‫͔͍ߴ͕ډ‬΋͠Εͳ͍ɻ೥ʹ 2 ճ͋Δ EPICS

collaboration meeting[15] ͷߨशձʹࢀՃͰ͖Ε͹ਃ͠

5.3

೔ຊ‫ʹޠ‬ΑΔ EPICS ৘ใ෼ͳ͍͕ɼࠃ಺։࠵͸ͳ͔ͳ͔ճͬͯ͜ͳ͍ɻEPICS ͸༷ʑͳπʔϧͷू߹ମͰ͋ΔɻϨΰʹྫ͑ैདྷΑΓ EPICS ͸ࠃࡍ‫ͯ͠ͱྗڠ‬։ൃ͞Ε͖ͯͨͨΕ͹͍Ζ͍Ζͳ‫ܗ‬ͷϒϩοΫͰ͋Δɻ੍‫ޚ‬΍ DAQ ΛΊɼӳ‫Ͱޠ‬ͷϝʔϦϯάϦετ [12] Ͱ͸‫ʹൃ׆‬৘ใަ‫׵‬͕ͳ͞Ε͖ͯͨɻ͔͠͠ɼಛʹ EPICS ॳ৺ऀ΍ೖ໳ऀʹ

EPICS Ͱ։ൃ͢Δ͜ͱ͸ɼͦͷϒϩοΫͰंΛ࡞Δ͔͓৓Λ࡞Δ͔ɼͱ͍͏࿩ʹ૬౰͢Δɻπʔϧʹ͸ෳ਺ͱͬͯ͸͍͖ͳΓӳ‫ ޠ‬ML ʹ࣭໰Λ౤ߘ͢Δ͜ͱ͸͔ͳͷબ୒ࢶ͕͋Γɼྫ͑͹ GUI editor Ͱ͸ɼmedm/edmɼΓෑ‫͏͍ͱ͍ߴ͕ډ‬ͷ΋ࣄ࣮Ͱ͋ͬͨɻ͍͖͓͍ɼपΓCSS-BOYɼQt-base ͳͲ͓ֆ͔͖‫͔ܥ‬ΒɼSAD[16] ΍ͷਓ΍஌ਓͷπςͰ࣭໰͢Δ͚ͩʹͳͬͯ͠·ͬͯ৘ใͷ‫ڞ‬༗͕ਐ·ͳ͍ͱ͍͏ঢ়‫͕گ‬ଟ͘‫ݟ‬ΒΕͨΑ͏ʹࢥ͏ɻ

Python-base ͳͲ script ‫ܥ‬΋͋Δɻࣗ෼ͷ໨తʹ͸ͲΕΛબͿ΂͖͔ཧղ͕଍Βͳ͍··։ൃʹணख͢Δͱɼ

ͦ͜Ͱ 2012 ೥ʹ͸೔ຊ‫Ͱޠ‬ͷٞ࿦͕Ͱ͖ΔϝʔϦϯάϦ

EPICS-base Ͱ΋όϥϯεΛ͍ܽͨมͳ΋ͷ͕ग़དྷΔɻετͱͯ͠ “EPICS Users ML” Λ։ઃͯ͠ɼKEK ͸΋ΨΠυͱͳΔ৘ใʢಛʹ೔ຊ‫ޠ‬ʣ͕ແ͍ͷ͕‫఺࣌ݱ‬ͷͪΖΜେֶ΍‫ؔػڀݚ‬ɼҰൠ‫ۀا‬ͷํ΋‫ؚ‬Ίͯ৘ใަ‫׵‬໰୊Ͱ͋ΔɻJ-PARC ‫ݐ‬ઃॳ‫ظ‬ʢ2004 ೥ࠒʣɼ෦ୂ͸

͕Ͱ͖Δ‫͍ͯͬͳͱڥ؀‬ΔɻML Ͱ࿩୊ʹ্ͬͨτϐοΫJAEA ৬һʢՃ଎‫ث‬ͷ‫͕ݧܦ‬ແ͍ਓ͕ओྗʣͱ KEK-PSεͷ΄͔ɼ͍Ζ͍Ζͳ։ൃΞΠςϜ΍ͪΐͬͱͨ͠ Tips৬һ͕ଟ͔͕ͬͨɼ͍ͣΕ΋ EPICS ͷ‫ݧܦ‬͸ແ͔ͬͨɻͳͲɼ৘ใΛ‫ڞ‬༗͢ΔͨΊͷ wiki αΠτ΋࡞੒ͯ͠౰࣌ KEKB ʹ͸ EPICS ‫͕ऀݧܦ‬ଟ਺͍͕ͨɼJ-PARC

͍Δ (ਤ 11ɼhttp://cerldev.kek.jp/trac/EpicsUsersJPʹ͸͋·Γҟಈ͠ͳ͔ͬͨɻͦ͜ͰɼJ-PARC ؔ܎ऀΛ[13])ɻ࠷ۙͰ͸ຊߘͰऔΓ্͍͛ͯΔσόΠεαʔόʔ೦಄ʹ EPICS ‫ڭ‬ҭ༻ࢿྉʮminiEPICSʯͷ੔උΛਐΊΛ͸͡Ί؆қͳԹ౓ଌఆγεςϜͳͲͷ੡࡞৘ใ΋‫ࡌه‬ͨ [17] ͕ɼࢲʢ্‫ాۼ‬ʣ͕ J-PARC ‫ݐ‬ઃͰ๩ࡴ͞Εɼ୲͍ͯ͠Δ΄͔ɼEPICS ೖ໳ࢿྉΛ·ͱΊ͍ͯΔͷͰ‫ڵ‬ຯ౰ऀ΋ҟಈ͠ɼ࢒೦ͳ͕Β‫׬‬਱͠ͳ͔ͬͨɻ͔͜͠͠ͷͷ͋Δํ͸ΞΫηεͯ͠௖͖͍ͨɻML ͳͲ΁ͷϑΟʔ࣌ͷࢿྉ͸ɼ2012 ೥ 12 ݄ʢΠϯυʣ΍ 2017 ೥ 5 ݄ʢ‫ژ‬υόοΫΛ௖͚Ε͹޾͍Ͱ͋Δɻେ‫ࢠݪ‬࿍ʣͷ EPICS ߨशձͰ࠶ߏ੒͞Εར༻͞Εͨ [4]ɻ

8196

6.2

࠷ۙͷ EPICS ࣄ৘ͱ RPiEPICS ͸ɼࠃ಺Ͱ͸ KEKɼJ-PARCɼRIBFɼKURRI
ͳͲͷՃ଎‫ʹޚ੍ث‬ಋೖ͞Ε͍ͯΔɻੈքͰ͸ଟ਺ͷՃ଎‫Ͱث‬ಋೖ͞Ε͍ͯΔ͕ɼ৽‫ن‬ͷେ‫ܭܕ‬ըͰ΋ྑ͘࠾༻͞ΕΔʢྫ͑͹ ESS ΍ FRIB ΍ CSNS ͳͲ;CERN ͸ಠ
ࣗ࿏ઢʣɻ࠷ۙ͸ɼՃ଎‫ث‬Ҏ֎΁ͷ EPICS ಋೖ͕໨ΛҾ͘ɻITERʢ֩༥߹ʣ͕ EPICS ಋೖΛܾΊɼؔ࿈͢Δ

QST-੨৿ (IFMIFʣ΍ QST-ಹՑ΁ EPICS ͕೾‫ͯ͠ٴ‬͍Δɻ·ͨɼLIGOʢॏྗ೾ʣͷ࠷্Ґ෦෼ (Guardian)͕ EPICS Ͱߏங͞Ε͓ͯΓ [18]ɼKAGRA Ͱ΋ EPICS
͕ಋೖ͞Ε͍ͯΔɻQST ΍ KAGRA ͷ EPICS ঢ়‫گ‬͸ɼ2017 ೥ 5 ݄ͷ EPICS meeting ʹใࠂ͕͋Δ [4]ɻࠃ಺ͰՃ଎‫ث‬Ҏ֎Λ‫ؚ‬Ί EPICS ͕޿·͍ͬͯΔ͕ɼࢧ͑Δਓࡐ͸গͳ͍ɻ୹‫ظ‬తʹ͸֎ࠃͷ EPICS ‫ऀݧܦ‬ΛೖΕΔ͔͠ͳͦ͞͏ͩɻ௕‫ظ‬తʹ͸ɼKEK ΍ J-PARCͳͲͷ EPICS ‫ߨ͕ऀݧܦ‬शձΛ։࠵͠ɼࠃ಺Ͱ EPICSମ‫ऀݧ‬Λ૿΍͢౒ྗΛ͢΂͖Ͱ͋Ζ͏ɻͯ͞ɼຊߘͰ΋঺հ͕͋ΔΑ͏ʹɼRPi ʹ EPICS baseΛ࣮૷͢Δ͜ͱࣗମ͸೉͘͠͸ͳ͍ɻ‫ڀݚ‬ɾ‫ڭ‬ҭ༻ʹɼRPi ͸खܰͰ௿ίετͳ EPICS system ʹͳΔɻ·ͨɼੈʹ͋;ΕΔ IoT device Λ RPi Ͱ EPICS Խ͢Ε͹ɼ
EPICS ͷ༷ʑͳ൚༻πʔϧ (GUIɼArchiverɼ..) ͕ར
༻Ͱ͖Δɻଟ਺ͷ IoT deviceʢEPICS Խͨ͠ RPiʣΛ
DAQ ͨ͠Γ࿈‫ͨͤ͞ܞ‬Γ͢Δͷ͸ɼEPICS ͷಘҙٕͰ͋ΔɻRPi ͱ IoT device Ͱ EPICS ߨशձͷ‫ࡐڭ‬Λ࡞ΓɼߨशձΛ։࠵͠ɼEPICS ‫ऀݧܦ‬Λ૿΍͍ͯ͘͠ɾɾɻࠓ‫ޙ‬ͷ‫׆‬ಈ͸ɼ͜ͷํ޲ʹऩᏑ͍͖ͯͦ͠͏Ͱ͋Δɻ7·ͱΊຊߘͰ͸ɼRPi ΍ BBB ͱ͍ͬͨɼখ‫ܕ‬γϯάϧϘʔυίϯϐϡʔλʔΛ༻͍ͨଌఆ‫ث‬σʔλऩूγεςϜ[5] E. Upton et.al., ”Raspberry Pi ϢʔβʔΨΠυ”,ΠϯϓϨεδϟύϯ, 2013 ೥.

[6] http://osksn2.hep.sci.osaka-u.ac.jp/~nanjo/dokuwiki/doku.php?id=scopeman:scopeman[7] “Arduino as a Tool for EPICS training”,
Noboru Yamamamoto, https://epics.anl.
gov/meetings/2012-10/program/1024-A1_
Arduino_as_tool_for_EPICS_training.pdf,
EPICS collaboration meeting 2012.
[8] Florian Feldbauer, epics-devgpio, https://github.com/ffeldbauer/epics-devgpio/
blob/master/README.md, (2016)[9] Processing Home Page, https://processing.
org/; “Processing: A Programming Handbook
for Visual Designers and Artists (Second Edition)”, Casey Reas and Ben Fry, The MITPress(2014).
[10] BeagleBoard.org
black

https://beagleboard.org/[11] ଳ ໊ ਸ, ࿏ ઒ ప ໵, “EPICS ಺ ଂ খ ‫ܕ‬σ ό Π ε α ʔ ό ͷ ։ ൃ”, Ճ ଎ ‫ ֶ ث‬ձ ೥ ձ(2014) MOOL08 https://www.pasj.jp/web_publish/pasj2014/proceedings/PDF/MOOL/
MOOL08_oral.pdf[12] EPICS

Tech-Talk

https://epics.anl.gov/tech-talk/[13] EPICS Users JP (೔ຊ‫ ޠ‬EPICS ৘ใ) http://cerldev.kek.jp/trac/EpicsUsersJPͷ࣮ྫΛ঺հͨ͠ɻ͜ͷྫͰ͸ɼPythonɼCɼ͋Δ͍͸EPICS Λ༻͍ͨ‫ޚ੍ثػ‬Λߦ͍ͬͯΔɻ࠷ۙͷࢢൢখ[14] https://epics.anl.gov/docs/USPAS2014.php‫ܕ‬γϯάϧϘʔυίϯϐϡʔλʔ͸ɼ௿Ձ֨Ͱඇৗʹί[15] https://epics.anl.gov/meetings.phpϯύΫτͰ͋Γͳ͕Βɼ‫ڭ‬ҭ΍‫ڀݚ‬໨తͰ࢖༻Մೳͳ‫ػ‬ೳ΍ੑೳΛඋ͍͑ͯΔɻࠓ‫ޙ‬΋༷ʑͳ༻్ʹ࢖༻Ͱ͖Δ͜ͱ͕‫ظ‬଴͞ΕΔɻࢀߟจ‫ݙ‬[1] Raspberry Pi https://www.raspberrypi.org/[16] SAD Home Page http://acc-physics.kek.
jp/SAD/[17] ্‫لాۼ‬඙, ଞ “খ‫ن‬໛‫ ܥ‬EPICS ύοέʔδ(miniEPICS) ͷ։ൃ”, Ճ଎‫ֶث‬ձ (2005) pp.211213.
[18] “Status of the Advanced LIGO Project”, talk[2] Arduino https://www.arduino.cc/at ICALEPCS 2015 http://accelconf.web.

[3] EPICS https://epics.anl.gov/

cern.ch/AccelConf/ICALEPCS2015/talks/
moa3o03_talk.pdf[4] Spring 2017 EPICS Collaboration Meeting
http://www.rri.kyoto-u.ac.jp/EPICS/