II. Project Overview

The first topic of this website is an experimental apparatus that employs solenoids as linear mechanical actuators. This apparatus was built in 1994 by the late Alex Rokhvarg. [2] A photograph of the apparatus is shown in Figure II.1. The apparatus is designed using a pair of mutually opposed solenoids on opposite ends of a payload. The control plant's payload is an aluminum block attached to the plungers of two solenoids. The currents in the solenoid coils are supplied by voltage-controlled current sources (VCCS) driven by a linear feedback control system. This moves the payload along a straight line from one solenoid to another. It is fastened to the plunger of a linear potentiometer, which measures the payload displacement along the axis. The control system's ultimate task is to move the payload to a user-defined destination. It is implemented by an embedded microcontroller that reads the payload displacement from the linear potentiometer in order to measure and implement a nonlinear feedback control law using this measurement. The resulting closed-loop system behaves as a linear actuator.

The original controller was implemented with an IBM clone 80386 25MHz PC running MS-DOS. It interfaced with the plant via an ADA2210 Advanced Data Acquisition and Control Board from Real Time Devices, Inc. The data acquisition board controlled the (2) VCCS which energized the solenoids and read data from the linear potentiometer via a lowpass filter and scaling amplifier.

Figure II.1: Rokhvarg Motion Apparatus

A. Solenoids

B. Payload

C. Linear Potentiometer

D. 120 V ac Terminal

E. 120 / 24 V ac Transformer

F. AC-to-DC Bridge Rectifier

G. 4200 μF Capacitor

H. Original Circuit to interface to Controller

I. Adafruit M4 Microcontroller Board

J. Circuit Protoboard to interface to Metro M4

The second topic of this article concerns the viability of retrofitting and replacing older embedded hardware with newer Arduino microcontrollers. My task is to replace the original controller with modern firmware and port the control system to this firmware. The IBM clone that hosted the original controller is no longer functional. The ADA2210 data acquisition board is now obsolete and no longer has technical support. For some time, it was desired to port the control system to a modern Arduino-compatible microcontroller. An Arduino microcontroller would be more versatile. The Arduino programming language is a variant of C, which the original controlling algorithm was written in. Porting the code to Arduino firmware would be relatively simple. After the retrofit is done, I can then assess the Arduino microcontroller's performance .

The selected Arduino microcontroller would have to be able to operate the apparatus using the original algorithm. The hardware controller requirements include:

  • The controller must execute a single iteration of the feedback loop within a maximum allotted time of 800 microseconds.
    • 800 μs is the maximum measured time to execute a single loop of the program on the original computer.
    • At the beginning of each 800-μs iteration, the controller must read the payload displacement from the potentiometer's voltage level.
    • Before the end of each iteration, the controller must update the currents that energize each solenoid.
  • Because of this hard real-time requirement, the controller must disable all extraneous interrupts during operation. No external events are allowed to interfere with the reading of the potentiometer or the update of the currents. Thus, the controller can't be run from a typical commercial GUI operating system such as Microsoft Windows.
  • The solenoids require two true digital-to-analog converters (DAC) with precise resolution and a sampling time shorter than 800 μs. Most Arduino microcontrollers have pulse-width modulated (PWM) outputs as opposed to true DAC. While PWM signals can be converted to analog signals, there will be some phase delay introduced by the R-C filter. This can interfere with the necessary hard real-time operation.
  • The potentiometer requires an analog-to-digital converter (ADC) with precise resolution and a sampling time shorter than 800 μs.
  • The linearization module uses a floating-point square root equation to calculate the currents to supply to the solenoids. It is preferred that the controller have a true floating-point processor unit.
  • The controller must be able to log its data to non-volatile memory. After the experiment, the user must be able to view and save this data.

Figure II.2: Adafruit Metro M4

Taken from https://www.adafruit.com/product/3382

The Adafruit Metro M4 [3] is an economical microcontroller board that can be used with the Arduino IDE. A photo of it is shown in Figure II.2. It was selected because it fulfills these requirements and has several other useful features. It has on-board flash memory that can be used for datalogging applications. This flash memory can be used as a file storage system using custom software libraries written by Adafruit, circumventing the need to look for a second vendor. Please see its specs in the links for more information.

[2] A. Rokhvarg, "Single-axis agonistic motion control system with electro-magnetic actuators," New Jersey Institute of Technology, Newark, NJ, 1995.

[3] L. Fried, P. Burgess and K. Rembor, "Adafruit Metro M4 Express featuring ATSAMD51: User Manual," Adafruit Industries, Inc., 2018. [Online]. Available: https://cdn-learn.adafruit.com/downloads/pdf/adafruit-metro-m4-express-featuring-atsamd51.pdf.