KEKB Magnet Power Supply Control System

Aug. 2001

Tatsuro NAKAMURA \@KEK

Number of the Magnets and Power Supplies

Hardware of the Magnet Power Supply Control System

## PSICM and ARCNET

Functional Requirements

Structure of Software

# Application Level Software

# IOC Level Software

EPICS database Configuration by Oracle

**Number of the Magnets and Power Supplies** (in Aug. 2000)

In the Storage Rings (LER & HER)

4607 Magnets (including auxiliary coils)

2245 Power Supplies (1711 of them are for the steering magnets)

The Power Supplies are located in 8 Buildings around the Rings.

In the Injection Beam Transport Lines (positron & electron)

380 Magnets (including auxiliary coils)

276 Power Supplies

The Power Supplies are located in 3 Buildings along the Lines.

**Hardware of the Magnet Power Supply Control System**

## It can be divided into 3 subsystems

## Setting output current, ON/OFF control,

## and reading various status of Power Supply

##  PSICM mounted in each Power Supply

##  (PSICM = [P]{.underline}ower [S]{.underline}upply [I]{.underline}nterface [C]{.underline}ontroller [M]{.underline}odule)

## Connected to the IOC through ARCNET

## (2) Current monitor

Digital Voltmeter with scanner

## Connected to the IOC through GPIB

\(3\) Interlock system to protect Magnets and Power Supplies

Standalone PLC system

## Connected to the IOC through Modbus Plus 

**Magnet Power Supply System in a Local Building**

## **IOC for the Magnet Power Supply Control**

## Each IOC is located in a Local Control Room in the Local Building

## For the Storage Rings

## 8 IOCs for 8 Local Building (D02,D03,D05,D06,D08,D09,D11,D12)

## Each IOC has

## ARCNET interface board

## GPIB interface board

## Only IOC in D08 has Modbus Plus interface board

## For the Injection BT Lines

## 3 IOCs for 3 Local Building (CBT,ARS,ARW)

## 1 IOC in Central Control Room 

**Current Monitor System of the Magnet Power Supply**

**Interlock System of the Magnet Power Supply**

## **PSICM and ARCNET**

Configuration of Magnet Power Supply Control System

## ![](media/image1.wmf) 

##  ARCNET interface board

## ![](media/image2.jpeg){width="7.111111111111111in" height="5.333333333333333in"}  {#section-1 .unnumbered}

##  ARCNET interface boards in VME subrack

## ![](media/image3.jpeg){width="7.111111111111111in" height="5.333333333333333in"}  {#section-2 .unnumbered}

##  PSICM

## ![](media/image4.jpeg){width="7.111111111111111in" height="5.333333333333333in"}  {#section-3 .unnumbered}

## ![](media/image5.jpeg){width="5.166666666666667in" height="6.888888888888889in"}Power Supply

## with PSICM 

## Two types of ARCNET configuration; without HUB / with HUB

## ![](media/image6.wmf) 

##  ARCNET HUB and Power Supplies with PSICM

## ![](media/image7.jpeg){width="7.111111111111111in" height="5.333333333333333in"}  {#section-5 .unnumbered}

## **PSICM ([P]{.underline}ower [S]{.underline}upply [I]{.underline}nterface [C]{.underline}ontroller [M]{.underline}odule)**

## An ARCNET interface board for the power supply developed at KEK.

## 3U Euro-card format (100mm 160mm)

## It can be plugged into the power supply

## Connection to the power supply

## DIN 64-pin connector

## General-purpose 16 bits I/O lines

## Dedicated pulse output lines

## Connection to the IOC

## STP (shielded twisted pair) cable with 2 conductor pairs

## One for ARCNET

## The other for the Start Pulse for the synchronous operation 

## **Special Function of the PSICM**

## PSICM can change the output current with an arbitrary tracking curve.

## The tracking pattern data are sent from IOC through ARCNET.

## 

## ![](media/image8.wmf) 

## **Timing System** (for the Magnet and Beam Monitor) 

## **Functional Requirements**

## (1) The power supply should be controlled not only by current (in ampere)

## but also by the abstracted parameter of beam optics such as

## K1 for a Q-magnet, K0 for a steering magnet.

## We generically call such parameters **"K-values"** for simplicity.

## (2) An arbitrary number of power supplies should be able to change their

## current synchronously to keep stored beam.

## We call this operation **"Synchronous Operation"**.

## (3) The power supply should have the function called **"Standardization"**.

## It resets the hysteresis of the magnetic field to the standard position.

## There are 2 other similar methods to set current; **"Sequence Setting"**

## and **"Simple Standardize Setting"**, in which the current is set along

## the standard hysteresis loop with less loop count. 

**Direct Setting & Sequence Setting**

![](media/image9.wmf)

### Standardization

![](media/image10.wmf)

**Example of Application Level Software**

**PS control panel**

Basic operation on each power supply

Operation on multiple power supplies.

Monitor various status of the power supply

Static parameters from RDB are also shown on the panel.

Written in Python with tkinter (tcl/tk GUI)

##  Access to the IOCs through CA

Example: set a K-value (k) to a Q-magnet

**caput("MGLPS:QT5NFP:KDIR",k)**

Example: read power supply current monitored by the DV

##  **current = caget("MGLPS:QT5NFP:IMON")** 

## ![](media/image11.png){width="9.322916666666666in" height="6.5256944444444445in"}

![](media/image12.png){width="9.322916666666666in"
height="6.5256944444444445in"}

**IOC Level Software**

**PS-record**

Most of the control logics are implemented in the PS-record.

They are written in C.

Conversion between K-value and current

Calculate tracking pattern data

Sequence control of the Standardization

Inhibit some operation under some condition (Software Interlock)

etc.

## 

##  PS-record holds many characteristic constants in its fields

##  Maximum/Minimum Current

## Ramping Speed and Loop Count of Standardization

##  Polynomial Coefficients of the Magnetic Excitation Curve

##  etc.

Conversion from K-value to Digital setting value

![](media/image13.wmf)

**Record Support**

Some record types are developed at KEK.

Record type of the PS-record: "**hugesub**"

"**hugesub**" is essentially a large size (more fields) subroutine
record.

### Device Support and Driver Support

The elemental services of the Driver Support are transmission and

receiving single packet.

These packets are queued.

##  The Device Support also provides single packet I/O. 

**Example of SAD Application & Synchronous Operation**

**CCC ([C]{.underline}ontinuous [C]{.underline}losed Orbit
[C]{.underline}orrection)**

Read BPMs -\> Calculate Orbit -\> Set Steering Magnet properly

Continuous Operation

Save/Restore Data (BPM / Steering setting / Reference orbit)

Also works as server for other application which use Steering Magnet

Written in SAD with tkinter (tcl/tk GUI)

Basically the steering magnets are set by Synchronous Operation.

**EPICS database Configuration by Oracle**

![](media/image14.wmf)

EPICS database Template File "BTMGPS.db"

**：**

**：**

**record(ai,\"\$(HEAD):\$(NAME):INP_AMP\") {**

**field(DESC,\"analog input record\")**

**field(SCAN,\"Passive\")**

**field(PINI,\"NO\")**

**field(PHAS,\"0\")**

**field(EVNT,\"0\")**

**field(DTYP,\"Soft Channel\")**

**field(DISV,\"1\")**

**field(SDIS,\"0.000000000000000e+00\")**

**field(DISS,\"NO_ALARM\")**

**field(PRIO,\"LOW\")**

**field(FLNK,\"\$(HEAD):\$(NAME):INP_AMP_PUT.VAL\")**

**field(INP,\"0.000000000000000e+00\")**

**field(PREC,\"0\")**

**field(LINR,\"NO CONVERSION\")**

**field(EGUF,\"0.0000000e+00\")**

**field(EGUL,\"0.0000000e+00\")**

**field(EGU,\"volts\")**

**field(HOPR,\"\$(PS_MAX)\")**

**field(LOPR,\"\$(PS_MIN)\")**

**field(AOFF,\"0.0000000e+00\")**

**：**

**：**

EPICS database Parameter File "MGPS_B.dbprm"

**：**

**：**

**file BTMGPS.db {**

**{**

**CHANNEL=\"1\",**

**DV_ADR=\"1\",**

**DV_AO=\".00827\",**

**DV_AS=\"1.0000389\",**

**DV_CH=\"101\",**

**DV_K=\"20\",**

**DV_P_HI=\"65\",**

**DV_P_LO=\"5\",**

**HEAD=\"BTePS\",**

**NAME=\"B0E\",**

**NODE_NO=\"1\",**

**PS_MAX=\"200\",**

**PS_MIN=\"0\",**

**THRU_COEFF=\" 3.333333\"**

**}**

**}**

**：**

**：**

**How to maintain the parameter files ?**

Some parameters are common to the same device type.

Some parameters appear in the different files.

How to keep consistency of these parameters ?

We chose an RDB

RDB is the source of information.

All of the parameter files should be derived from the RDB.

Maintenance of the parameters is concentrated on the RDB.

**Upgrade**

PF-AR upgrade (this year, 2001)

Control System: HIDIC & NODAL VME, Unix & EPICS

Interface of Magnet Power Supplies: CAMAC ARCNET

Also installing new Power Supplies for Steerings & Backlegs.

Control System for KEKB Magnet PS is reusable for PF-AR ?

Hardware:

> YES (ARCNET and PSICM are enough for PF-AR)
>
> Software:
>
> Partially YES
>
> Most of its functions are enough
>
> but
>
> PF-AR needs synchronous ramping (acceleration).

Now developing additional db and code