# Stepper motor control, plc vs vme \*

Herb Strong, Pam Gurd, Spallation Neutron Source (SNS), Oak Ridge
National Laboratory (ORNL), Oak Ridge, TN 37831, USA

Abstract

Traditionally, EPICS-based accelerator control systems have used
VME-based motion control modules to interface with stepper motors. For
systems that include some Programmable Logic Controllers (PLC), there is
an option for using PLC-based stepper motor interface modules. As with
all control system choices, there are trade-offs. This paper will
delineate some of the pros and cons of both methods of interfacing with
stepper motors.

## VME-based STEPPER MOTOR USAGE

Stepper motors are used at the Spallation Neutron Source to control
beam-insertable devices such as scrapers, diagnostic devices and
stripper foils. They are used in the superconducting portion of the
linac to tune the frequency of the cavities.

### Cryomodule Cavity Tuner Controls

The cavity tuner controls were developed by controls personnel at the
Los Alamos National Laboratory. The stepper motors for the
superconducting cavities are located inside the cryomodules and the
tuning mechanism is connected to the cavities. One of the requirements
for components located inside the cryomodule is to minimize the amount
of heat produced. Also, signals from the cryogenic temperature sensors
(silicon diodes) are sensitive to electrical noise. The controls for the
superconducting cavity tuners were implemented to reduce the amount of
heat and noise produced by the stepper motors.

![](media/image1.jpeg){width="2.5131944444444443in"
height="1.8847222222222222in"}

Figure 1: Superconducting cavity tuner

The stepper motor control board chosen was the Pro-Dex Inc. \[1\]
(Oregon Micro Systems) VME58 8 channel stepper motor controller. Phytron
\[2\] SINCOS stepper motor drive modules were chosen to reduce the
electrical noise. They have a linear power stage. Two custom interface
boards connect the Pro-Dex module to the motor drives and stepper
motors. One board mounts in the back of the VME chassis and is used to
interface the Pro-Dex board to a drive interface chassis. The drive
interface chassis routes the Pro-Dex motion control signals to the motor
drives. It also converts the 24 volts direct current (vdc) clockwise and
counterclockwise limit switch signals to Transistor Transistor Logic
(TTL) levels.

During start-up of the tuner control systems, numerous problems were
encountered with the custom interface modules. Most were due to field
wiring errors that caused failures of the TTL-integrated circuits.
Several spare interface modules were fabricated to assure we could keep
the accelerator in operation. During fabrication of the spare modules,
we learned that several of the components were obsolete. After initial
start-up wiring problems were corrected, the failure rate has been
essentially zero and none of the spare modules have been used.

### Foil and Scraper Controls

The controls for the insertable foils and scrapers were developed by
Brookhaven National Laboratory. The scraper devices are designed to be
precisely positioned into the edge of the beam to remove electrons from
the particles that are outside the desired beam profile. These scraped
particles are then routed to a collimator or dump. A single axis of
motion is provided. A feedback potentiometer is used to accurately
determine the position of the edge of the foil in relation to the
centroid of the desired beam line. Due to the mechanical design of the
4-ring primary scraper, a brake was required to hold the mechanism in
the desired position.

![](media/image2.jpeg){width="2.9145833333333333in"
height="1.9243055555555555in"}

Figure 2: Primary stripper foil mechanism

The primary stripper foil is used to strip the SNS accelerator H^-^ beam
to produce H^+^ particles that are injected into the storage ring. The
mechanism that positions the stripper foils looks similar to a chain
saw. Foils are attached to brackets that are connected to the chain. A
stepper motor drives the chain in both directions. Limit switches
provide indication that a stripper foil is near a desired location. The
second stepper motor is used to drive the entire chain-drive slide
mechanism closer to or further from the beam. A feedback potentiometer
provides accurate feedback of the slide position. A video camera has a
direct view of the primary stripper foil area. Once the selected foil is
close to the desired position, the image from the video camera is used
to precisely position the foil. The chain-drive moves the foil in the
vertical and horizontal directions and the slide-drive moves the foil in
the horizontal direction only.

![](media/image3.png){width="1.9145833333333333in"
height="1.4326388888888888in"}

Figure 3: Primary stripper foils and chain

The stepper motor control board chosen was the Pro-Dex VME58 8-channel
stepper motor controller. Pacific Scientific stepper motor drive modules
were used to power the motors. A custom module designed by Brookhaven is
used to interface six of the eight channels of the Pro-Dex module to the
drives and limit switches. Thus, two of the Pro-Dex channels are not
used. The auxiliary outputs provided on the Pro-Dex module were used to
control the brake. A VMIC module is used to monitor the primary stripper
foil position switches. External relays are used to convert the 24 vdc
signal from the limit and position switches to TTL levels.

![](media/image4.jpeg){width="1.3618055555555555in"
height="2.7243055555555555in"} ![](media/image5.jpeg){width="1.6375in"
height="2.7243055555555555in"}

Figure 4a and 4b: Front and rear of VME-based stepper motor control
cabinet.

During start-up of the foil and scraper control systems, no problems
were encountered with the custom interface modules. Several of the
Pacific Scientific modules failed, probably due to numerous field wiring
errors. After initial start-up wiring problems were corrected, only one
drive module failed, quite likely because of the initial wiring errors.

## PLC-based STEPPER MOTOR CONTROLS

A cryomodule test facility was constructed at the SNS site. At the time
construction on this facility started, we were still concerned with the
problems encountered with the VME-based stepper motor controls. It was
decided to pursue a more commercially-based stepper motor control system
to use for controlling the cryomodule cavity tuners. Since we used
numerous standard Allen-Bradley Programmable Logic Controllers (PLCs),
we picked a stepper motor controller that would reside in the PLC
chassis. The Advanced Micro Controls Inc. \[3\] (AMCI) 3204 4-channel
stepper motor controller was chosen.

### Hardware Interface

The AMCI module step and direction signals are TTL compatible and thus
interface directly with the Phytron stepper motor drives. The switch
inputs for the clockwise, counterclockwise, and home limit switches are
designed for 24 vdc signals and were connected directly to the wiring
from the switches. This greatly reduces the size and complexity of the
interface modules.

![](media/image6.jpeg){width="2.8354166666666667in"
height="2.1215277777777777in"}

Figure 5: VME interface module (large green board) and PLC interface
module (small yellow board)

As noted earlier, one of the requirements for the cavity tuners is to
minimize the amount of heat dissipated in the cryomodule. The AMCI
module has no auxiliary output that can be used to deactivate the drive
current. A separate PLC TTL output module and interface board was
required to provide an open collector signal required by the Phytron
stepper motor drive to turn off the drive current.

### ![](media/image7.jpeg){width="1.3131944444444446in" height="1.4993055555555554in"} ![](media/image8.jpeg){width="1.3291666666666666in" height="1.4993055555555554in"}

Figure 6a and 6b: Front and rear of PLC-based stepper motor control
cabinet.

### Software Interface

While a mature EPICS device driver is available for the Pro-Dex VME-58
module, a PLC-based device driver had to be developed for the AMIC
module. The minimal PLC programming examples provided with the module
were barely enough to make the module operate and much less than the
detail required to start the development of an interface.

![](media/image9.jpeg){width="2.35in" height="2.807638888888889in"}

Figure 7: EPICS stepper motor detail screen.

The AMCI module itself has a good set of control functions and provides
sufficient status and feed-back information. The most difficult part of
the interface involves the manner in which the module reacts to the
activation of either of the end-of-travel limit switches. It is designed
with the assumption that a limit switch is outside the normal range of
travel. Any time a limit switch is activated the module stops motion and
reports an error condition. While a limit switch is active, the module
ignores absolute and relative move commands. It will respond to reset
and preset commands. The only way to move the mechanics from the limit
switch is to first reset the error status and then issue the appropriate
jog command to the motor controller. If the clockwise limit switch is
active, a jog-clockwise command will result in another error. For some
applications such as the cryomodule cavity tuners, where it is never
desirable to drive the tuner to the limit, this response is acceptable.
If the tuner ever reaches a limit switch, some control system problem
has likely occurred.

### Valve Control

Early this year, another opportunity arose to use the PLC and AMCI
stepper motor controls. The controls for the ORNL High Flux Isotope
Reactor Cold Source included several control valves actuated by stepper
motors. The original PLC software developed for control of the valves
proved inadequate. The PLC device driver written for cryomodule tuner
control was used as a starting point for a device driver for the Cold
Source valves. The major difference for this application was that when
the valve was fully closed, the closed limit switch was activated. The
device driver was modified to automatically recover from closure of the
switch. When the valve is commanded fully closed and the switch is
activated, error conditions are reset and the current valve position is
preset to 0%. Since the limit switch is still active, the only way to
move the valve away from the limit is to use the jog command. The device
driver automatically jogs the valve until it clears the limit switch and
then issues an absolute-move command to move the valve to the desired
position.

## Summary: PLC and VME 

Both VME-based and PLC-based stepper motor controls have been
successfully developed and implemented. Both have proved to be reliable
and easy to maintain.

PLC-based controls have the following advantages:

-   Fewer custom interface modules

-   Less cabinet wiring

-   Directly connects to 24 vdc limit switches

-   Easier to integrate motion control and interlock logic

-   Safer limit switch response

VME-based controls have the following advantages:

-   More complete device driver

-   Less custom device driver logic

-   Higher density per module (8 channel vs. 4)

-   Faster EPICS updates

-   Auxiliary outputs included on VME module

Technically, there is no clear reason to choose VME- over PLC-based
stepper motor controls. The most likely reason to choose one over the
other is the need and availability of a VME or PLC chassis used for
other portions of the control system.

## References

\[1\] Pro-Dex Inc., (Oregon Micro Systems),
[www.omsmotion.com](http://www.amci.com/)

\[2\] Phytron, [www.phytron.com](http://www.phytron.com/)

\[3\] AMCI, Advanced Micro Controls Inc.
[www.amci.com](http://www.amci.com/)