SMC Hardware - Summary

T. Ingerson

17 sept 97

A CTIO Smart Motor Controller consists of a small number of standard, commercial cards which plug into an 8 slot STD BUS backplane. STD Bus cards measure 4.5" x 6.5" and have 56 pins on a PC edge connector.

An SMC is completely modular. It is approximately cubical in form, 200 mm on a side, made of anodized alumimum plates with an extruded aluminum cover which slips down over the top. The side facing the backplane into which the STD BUS cards are inserted is the "front". The right side, left side, rear and base are aluminum plates. The top is a 180 mm x 220 mm green printed circuit board which is called the "personality board".

The Standard Power Supply (SPS)

The base and rear plates together make an "L" unit called the "Standard Power Supply" (SPS) module. SPS units are completely interchangable between all controllers. If any of the voltages on the rear plate test incorrectly, the SPS should be changed immediately and a good SPS installed. The SPS can be rapidly disconnected from the rest of the system by removing the four corner screws on the bottom of the backplane which bolt the backplane assembly to the bottom plate and lifting the backplane and personality board away from the SPS. Two electrical plugs must be disconnected; an orange 8 pin connector on the right rear side of the personality board which connects to a cable going down in front of the rear plate and a small purple wire with a one pin press fit connector cconnecting the base plate with the left side plate.

An SPS is made of two 3/16" aluminum plates bolted together at right angles. On the bottom plate are four power supplies. The main +5V STD BUS voltage is provided by a Kepco type FAK 5-5K 5V/5A power supply. The bottom plate also contains a Kepco type FAK 24-2.1K AUXilary 24V/2A power supply. The AUX voltage is electrically isolated from the MAIN voltage to reduce crosstalk. The MAIN +5 volts is fed to a DATEL type BWR-12/105-D5 DC-DC converter which produces +12 and -12 Volts at 100 ma for the STD BUS. The 24V AUX supply feeds a DATEL type UWR-5/500-D48 DC-DC converter to provide an optically isolated +5V/500 ma AUX power supply for motor drivers and similar peripherals. Both of the DATEL supplies are on self contained PCBs with noise filters. The size and current output of all of the power supplies has been deliberately kept to a minimum to mimimize power consumption.

The back side of the "L" module contains external test points for all voltages (MAIN +5V/+12V/-12V and AUX +24V/+5V), fuses, switch, line filter and the 110V AC input.

The +24V AUX power supply is normally turned off when it is not needed. The back panel contains a solid state relay which turns on the +24V motor power supply on command from the cpu. This relay is controlled through a purple jumper wire from the left hand side of the backplane module to the bottom plate. This jumper carries a signal from the cpu which turns on the +24V power supply. To reduce power dissipation, this supply is normally only turned on when needed. There is a button labeled "Manual Control Enable" on the backplane which turns on this power supply when pressed and a potentiometer labeled "Speed Control" which regulates the output voltage when it has been turned on manually. This permits moving motors by hand for test purposes and provides a way of testing the +24V power supply in the field.

The left side plate is also common to all controllers and is also easy to change. It contains cpu/communication I/O functions. These consist of two female DB25 connectors for access to COM1 and COM2. Each COM port has an RJ-11 connector in parallel with the DB25 connector. Normally, COM1 is used to communicate directly with the cpu via RS-232. COM2 is used for external control usually via RS-485. COM2 can also be configured as RS-232. The left panel also contains a male DB-25 connector (currently unused) for the parallel I/O port on the CPU, a hole for access to the CPU's reset button and the wiring for a simple watchdog reset system.

A basic motor controller consumes approximately 11 Watts. Each 2-axis servo motor control card increases the consumption by about 2 watts quiescently and 4 watts when moving motors. Each stepper card increases the consumption by about 3 watts. The 24V motor power supply is turned off when motors are not being used, so the quiescent power consumption is essentially the average consumption. This consumption normally raises the MC surface temperature by no more than 1-2 degrees C, making the heat dissipation small enough so that the controller needs no fan. No ventilation, enclosure or heat extraction is required.

Currently, we only implement one axis of the Prolog Stepper motor control boards. Multiple steppers are controlled one at a time by means of an external de-multiplexor. The demux uses the I/O lines from the ZT8845 to select which motor to move and connects an Escap type EDM-483 microstepping driver to the target motor. The 7342 moves the motor to the requested position. It is then deselected, holding its position via its own magnetic detents.

There is a button on the rear panel which activates the 24V and auxiliary 5V power supplies for motor testing and a potentiometer which regulates the output voltage when this supply is manually activated. There are banana jacks on the rear panel for access to all voltages for testing.

Motor control systems tend to need a small amount of interface electronics; a load resistor, drive transistor, relay, etc.. At Tololo (and many other places!) these have in the past tended to be located in ad hoc locations which we call "little grey boxes". These tend to have been left hanging from odd places on the system. Such electronics could have been located on hand made cards in the STD bus, but this is usually an inconvenient place for such electronics, as it is hard to test and increases the density of the "rat's nest" of wires going into and coming out of the backplane.

To avoid this kind of "ugly" interface, all SMCs contain a customization PC board mounted on top of the backplane. This board acts as the interface between the connectors on the STD Bus backplane (usually IDS type) and more robust Bendix connectors on the right side of the SMC which go to cables leading to the devices being controlled. This PC board has space for locating a modest number of discrete parts and interfacing components in just the right place for convenient service and customization. All voltages are testable and accessible on this board. It also provides test points for all the I/O on the system at a convenient and accessible location on top of the box.. This customization board is attached to the I/O connectors in an "L" configuration, which form the top and right sides of a controller and is detachable from the basic SMC as a unit.

In a sense, this "L" module (sometimes called the "personality" module) "is" the SMC. The rest of the system does not vary from controller to controller. Controllers only differ in the mix of cards they use, the personality module and the application control software. The concept of a personality module thus gives great flexibility to the system while maintaining a high degree of standardization. An SMC can be built for any instrument, having any mix of motors of different types, while still requiring nothing but standard parts for repair, except for those few specialized components which may be contained on the personality/interface board. Even these almost never consist of anything more than standard resistors, drive transistors and relays. A controller can control any number of motors, though if the number of I/O connectors were to exceed 10-12, the density of Bendix connectors would be high enough to make connection and disconnection inconvenient.

2. OPERATING SYSTEM - STD DOS

The CTIO motor controllers are controlled by ZT88CT09A STD Bus Single Board Computers containing a cpu, memory in RAM and ROM, a clock, parallel port, interrupt controller, etc... They have two I/O ports, one configurable as RS-232 and one as RS-232/422/485. The SBC runs a version of DOS which boots from internal ROM. This operating system, called STD DOS, is normal DOS with the important exception that the machine is designed to run with an EXTERNAL console, floppy and hard disc.

It is not essential that STD DOS be used. It would be easy to make an application program stand- alone and burn it into ROM. DOS is primarily used to provide a programming environment in which it is easy to develop, test and debug a control program. The small additional cost of having STD DOS available is returned manyfold by the flexibility and ease of programming and modification of the resulting system.

The external console is another PC, usually a laptop computer. The STD Bus computer contains a driver called "VSC.SYS" and the laptop runs a program called VSC.EXE. "VSC" stands for Virtual Serial Console. We usually set up VSC to run through COM1 of the ZT88CT09 at 115 Kbaud. The laptop runs VSC.EXE, which permits the laptop's keyboard and display to function as the console of the STD Bus computer. On the laptop, one can toggle the display and keyboard between functioning either as the console for the "Host" (Laptop) or "Target" (STD Bus computer). When the console is controlling the HOST, the laptop functions normally. Disc "A" is the laptop's floppy drive and disc "C" the laptop's hard disk.

The system does not need a console. The application program is usually called from the AUTOEXEC.BAT file and starts up automatically on bootstrap. To bring it up as a PC, AUTOEXEC.BAT must be aborted. Normally the MC system will ask you if you want to abort the automatic loading of the motor control program and if you type anything within the next few seconds, loading the application program will be aborted and STD DOS will start automatically.

The program is written in "C" and uses a standard public domain multi-tasking system called CTASK. ASCII commands are received via the command channel and interpreted by the application program, producing appropriate actions and subsequent messages. Generally, a command to move a motor starts a task under CTASK, which terminates automatically when the motion is finished. The system is designed to be "set and forget". Once a motor has been activated, no further action is required on the part of the master, though it is usually polled to verify when the motor has arrived at its intended destination. An SMC will normally automatically take appropriate remedial action in the event of emergency. Currently, it does not generate messages unless asked, though it could.

RS-485 is currently used for the command channel. Other standard cards can be used to permit commands to be sent and received equally well via most standard I/O methods, such as Ethernet, Allen- Bradley 1771, BITBUS, etc.... RS-485 is a shared. multidrop serial line, similar to RS-232 except that RS- 485 has one "master" transmitter and many "remote" units. Each unit responds by enabling its transmitter only when it has been selected, disabling itself when another unit is selected. Commands can also be entered from the laptop's keyboard for testing even while the application program is running. To improve performance, standard DOS I/O to COM2 is not used. Instead, an interrupt driven I/O package contained within CTASK is employed.

The source can be modified and recompiled on the laptop, although this is not normally be done in the field except for experiments, as any change in the release version of the software must be certified. Once a new version has been generated, one toggles to the STD Bus computer and copies the program from drive C: on the laptop (U: on the STD Bus machine) to drive S: on the STD Bus PC. Then the program can be executed like any normal DOS program on the STD Bus computer. Obviously, if it is to be loaded automatically on startup, AUTOEXEC.BAT must contain the name of the program to be executed. Application programs are stored in battery-backed RAM. They could be burned into the ROM for higher reliability, but no problems have been encountered with the RAM disc, so applications are currently left in RAM to make them easier to modify.

The system is brought up as a standard MS-DOS computer by plugging the laptop running VSC into COM1 and toggling over to the STD bus computer with alt-space. The STD Bus computer can be reset as any PC with "control-alt-del", the reset button or by cycling the power. As previously mentioned, automatic startup of any application program must be aborted. A normal MS-DOS prompt (ZT\:>) will be received on the external console and the system can be used as a regular PC. If the software needs to be changed, for example when a new or replacement ZT88CT09A is installed in a Motor Controller, an appropriate program is usually downloaded from the laptop.

Commands come to the controllers from a remote "host" computer via the external command stream, currently RS-485. Responses are returned to the command stream. Commands may also be entered and received via the STD DOS console (Laptop PC), which allows the controller to operate in a stand-alone fashion. The command structure, syntax and responses are the same whether commands are entered via the console, RS-485 or Ethernet.

Commands are sent in straight ASCII, as a series of strings separated by any number of blanks. A controller does nothing until its token has been received. Once it has received its token, it interprets the successive string commands until a carriage return has been received. The RS-485 transmit line in the MC is enabled and any immediate response is delivered to the sender after which the MC disconnects. No further gratuitous transmissions are produced. An MC is presumed to be a "set and forget device". It is completely stand-alone and is required to be able to handle emergency error conditions by itself. Status information is held in the MC's internal queue. The host verifies that motors are in the desired position by polling at its leisure.

The general SMC command syntax is:

[target] [mechanism] [action] [argument(s)]

Thus, a command like "pfccd filwheel1 move 5" tells filter wheel #1 of the pfccd to move to position 5. If it is already at position 5, it will inform the sender, and if there is an error, this will be reported. If position 5 is a valid position and the filter wheel is not at this position, the controller will start to move it, send the word "moving" to the host computer and then disconnect. If desired, the host can send "pfccd filwheel1 position" to the controller any time to see if it is finished. It will receive "active", until the motion is finished and the position (5 in this case) after it is done. In the event of error, a code "errN" will be received. Error codes are normally followed by text giving further information about the error. A Motor Controller can be assumed to have done its job and does not ever have to be polled unless desired.

Because of the shared nature of RS-485, the host computer must wait for a response from a controller before interrogating another one on the same line. An SMC is required to send a response to any command and disconnect within less than one second. Thus, if the host sends any command to an SMC and receives no answer within one second, it can assume the SMC is not on line.

3. HOW DOES AN SMC APPLICATION PROGRAM WORK?

When an SMC is turned on, STD DOS executes an AUTOEXEC.BAT program which waits 5 seconds after bootstrap for entry from the console. If nothing is received, the motor control application program starts automatically. This program is a DOS XXX.EXE file with XXX the name of the identifying token for the controller being used. Thus, the application program for the PFCCD is PFCCD.EXE. There is also a parameter file called PFCCD.PAR from which the application program gets configuration information. This is an ASCII text file and is easy to edit in order to change system parameters. This, of course, can be dangerous, so don't attempt to edit it unless you are sure you know what you are doing!

All systems contain a parser and command line interpreter (CLI) written at CTIO by G. Schumacher as well as a commercial multitasking system called "CTASK". Essentially, commands are interpreted by the parser and CLI. If an action is required, a task is started to perform the action. Once the action is completed, the task is killed. All of the software to do this is in the "SYSTEM" area. The serial I/O package will also be found in the SYSTEM area.

Physical actions are performed using commercial Device Drivers. These drivers will be found in the "DDP" (Device Driver Packages) area.

Controllers all use the basic system, calling modules as required. There are three modules which are different for each controller. The basic control code for each controller will be found in a single program named "token".c, i.e. cf4m.c, pfccd.c, f8sec.c, etc... These programs actually do the actions requested, start up the tasks, etc... There is also a "command" module which interprets the command stream in the context of the individual controller, calling appropriate actions. A complete list of the commands each controller obeys will be found in its command module, as cf36cm.c, pfccdcm.c, pf4mcm.c, etc... Finally, system parameters will be found in a module .par, e.g. cf60.par.

There are some standalone test programs which operate directly from the console. As they do not contain the multitasking, parsing, CLI system they are easy to modify for doing specific tests and diagnostics. They will be found in the "DIAGNOSE" subdirectory along with instructions on how to recompile them. Normally their names are "t" followed by the name of the hardware they test, i.e. trs485.c, tstep.c, etc... .

On the laptop, all motor controller code will be found in the directory "MCONTROL". This directory is divided into sub-directories with obvious names as shown below:

MCONTROL DIRECTORY CONTENTS

Note: "MCONTROL" Contains the entire CTIO system. MicroSoft "C" must be installed in a directory "MC" in order to compile programs.