CONTENTS

Example: Constant Lighting with EPICS

Our goal here is to integrate the Arduino into EPICS using the cmd_response and demonstrate it as a sensor interface using PID controls. We’ll make constant lighting (maintain a constant level of lighting). Is this a useful thing to do? It’s useful here to demonstrate how PID works in a very safe way; no moving parts, all contacts are low voltage and pose no significant electrical hazard.

In our earlier Python example (see Example: Python program sequence.py), the live information from the Arduino was only available to the Python program. In “real world” situation, control system information may come from many sources and be used for more than one purpose at the same time (such as: logging, operator visualization, process control, web page). EPICS is scalable, allowing for multiple servers and clients, and can easily integrate the signals from the Arduino as part of such a control system.

An EPICS system consists of many layers of components. Let’s visualize this technology stack with the Arduino at the root:

  • you
  • EPICS OPI (operator/programmer interface) client computer(s)
  • EPICS Channel Access (over local computer network)
  • EPICS IOC (input/output controller) server computer
  • USB
  • Arduino

In previous examples, we described the components at the bottom of this technology stack (Arduino and USB). Moving upwards, our EPICS interface (where we integrate the Arduino with an EPICS IOC) consists of three files:

Then we describe the tool to simplify observation of this system:

Finally, we describe the PID controls: