EPICS Motor Record Device and Driver Support

March 11, 2012

Mark Rivers

University of Chicago

Table of Contents

Introduction

This document describes the device and driver support for the EPICS motors. It briefly describes the older APIs for such support (referred to as Model 1 and Model 2), but focuses mainly on the newer Model 3 API, which is the API which should be used for new motor drivers.

The APIs described here are mainly intended to be used with the EPICS motor record. However, the Model 2 and Model 3 drivers are actually independent of the motor record. They implement standard EPICS asyn interfaces, and can in principle be used with any EPICS records, and do not require the motor record. However, the motor record currently provides the only "state machine" logic that keeps track of backlash, enforcing soft limits, etc. Model 2 and 3 drivers permit access to controller-specific features that the motor record does not support, and this is typically implemented using standard EPICS records (ao, ai, bo, bi, etc.).

Model 1 device and driver support

Model 1 is the API that was used for all motor drivers prior to 2006, when Model 2 was introduced. Model 1 drivers have the following characteristics:

Because this API was the only one supported prior to 2006, the majority of existing motor drivers are written using this Model 1 API.

Model 2 device and driver support

Because of the recognized deficiencies in the Model 1 API, in 2006 Diamond Light Source and APS collaborated in developing a new API, now called Model 2. The Model 2 API has the following characteristics:

There are Model 2 drivers in the motor module for the simulation motor, Newport MM4000, Newport XPS, Pro-Dex MAXnet, Attocube ANC150, and Aerotech Ensemble.

Model 3 device and driver support

In 2011 the Model 3 API was introduced. This API is based in part on the ideas and infrastructure that were developed for the areaDetector module. The Model 3 API has the following characteristics:

The Model 3 C++ API is based on the concept of two types of objects: a motor controller and one or more motor axes. The controller object supports the functions that apply to the entire controller. The controller supports one or more axes. The axis objects support the functions for a specific axis. These objects are implemented in the device-dependent driver. There is a base class for each of these objects, asynMotorController and asynMotorAxis.

The asynMotorController base class has methods that handle much of the work in writing a driver, including implementing the asyn interfaces and calling the appropriate methods in the axis classes. A basic motor driver derived class will often only need to implement the constructor for the controller class, and can just use the base class implementation of all other methods in the asynMotorController class.

The asynMotorAxis base class on the other hand mainly provides dummy methods (asynMotorAxis::move(), asynMotorAxis::stop(), etc.). The main work in writing a Model 3 driver consists of implementing these methods in the derived class.

There are Model 3 drivers in the motor module for the simulation motor, Hytec 8601, Newport XPS, Parker ACR series controllers (e.g. Aires), and the ACS MCB-4B.

The ACS MCB-4B is the simplest Model 3 driver, consisting of only 336 lines of well-commented C++ code (ACSSrc/MCB4BDriver.h and MCB4BDriver.cpp). It does not implement any controller-specific features, it only implements support for standard motor record features. It is a very good starting point for writing a new driver with basic motor record support.

asynMotorController base class

The asynMotorController base class defines the following methods:

asynMotorAxis base class

The asynMotorAxis base class defines the following methods:

NOTE: This documentation file is incomplete. It needs to be completed.