next up previous
Next: About this document ...

SMA Technical Memo #140:

Commanding the Digital Servo Control Board with the Palm Pilot

by T.R. Hunter (April 29, 2000)

The SMA digital Servo Control Board (SCB) can be controlled remotely by the PowerPC-VME antenna computer, or manually by the 3Com Palm Vx  palmtop computer installed in each antenna. In this memo, I give a brief hardware introduction to the Palm Vx, followed by a manual for using the graphical interface program.

The Palm Vx is a small, lightweight package containing a 160x160 pixel greyscale liquid crystal display (LCD), a powerful Motorola MC68328 microprocessor running at 20 MHz, and both an infrared and traditional RS-232 serial interface. Unlike other Palm Pilot models, this one draws its power from rechargeable, long-life lithium-ion batteries. Sharper than previous models, the LCD screen continues to work even at low temperatures (near $0^\circ$ Fahrenheit). A backlight is available for use in the dark.


  
Figure 1:
\begin{figure}
\centerline{\epsfig{file=pp1.ps,width=3.5in}}
\end{figure}

We have embedded the Palm Vx in a protective delrin case that is still comfortable to hold in one hand (Figure 1). There is an Emergency-Stop (E-stop) button mounted onto the top of the case. It is a pure hardware connection and is placed in series with all other E-stop buttons on the antenna. The wires for this button, along with the serial data and power supply lines all run through a single cable with a circular connector. At the other end of the cable, the power supply lines are split out into a separate regulated power supply from 3Com which should be plugged into a regular 120V AC outlet in or near the I/O box. With this power connection, the lithium-ion batteries will remain fully charged despite the continuous drain from the serial line circuitry.


Starting the Palm Vx graphical interface program

First, if the Palm Vx screen is blank, turn on the unit by pressing the green button on the upper right hand side of the palm, accessible via a hole drilled into the delrin case. The control program appears on the Palm Vx menu as a little SMA antenna bitmap icon with the name ``PalmPaddle'' underneath it. You may have to scroll down one screen to find it. Pressing the icon will bring up the PalmPaddle welcome screen shown in Figure 2. The location of the antenna icons on the welcome screen denote the position of the three major summits on the Big Island.


  
Figure 2:
\begin{figure}\centerline{\epsfig{file=welcome.ps}}
\end{figure}

The program interface was designed to avoid requiring use of the stylus. First, virtual buttons are made large enough to accomodate most fingers. Second, each entry on the pull-down menus are padded on both sides with blank lines so that adjacent entries are not selected by mistake. Third, the four shortcut hardkeys at the bottom edge of the Palm Vx have been mapped out by the PalmPaddle application and are physically covered by the delrin case to avoid confusion. Fourth, the two silkscreen buttons on the lower righthand side of the display have also been mapped out. Finally, no use is made of the graffiti area as the PalmPaddle application generates its own alphanumeric input forms with virtual buttons when necessary.


  
Figure 3:
\begin{figure}\centerline{\epsfig{file=adjcontrast.ps}}
\end{figure}

After touching the screen to continue, the contrast adjust window appears, in case you want to change the contrast of the display (see Figure 3). This addition was necessary since the hardware button normally used to bring up this screen (located on the top lefthand edge of the Palm Vx) is hidden when the Palm Vx resides in the protective delrin case. If you want to access this adjustment window again at a later time, I have re-mapped it to the silkscreen button in the lower righthand corner of the display (the magnifying glass).

Once the PalmPaddle begins, it will begin reading the serial packets which are constantly being sent out by the SCB over the RS-232 115kBaud interface. If the cable is not connected to the SCB, the Palm Vx will beep at a 1 Hertz rate to signify the lack of a communications link. Shown in Figure 4 is the default Main Page that will appear on the Palm Vx when the antenna computer has control of the SCB. This page is meant to display a quick summary of all the information the casual user might like to know when they walk into the cabin.

The antenna position, actual velocity, and commanded velocity are displayed on the top two rows. If the ``AZ='' and ``EL='' labels are underlined, then the servos are active and are under control of the antenna computer. In the case of Figure 4, one can see that neither servo is active. Constrast that with Figure 5, in which the elevation servo is active, but the azimuth servo is not (in fact there is a hard fault in azimuth).


  
Figure 4:
\begin{figure}
\centerline{\epsfig{file=axisremote.ps}}\end{figure}

Below the axis information, the pad identification number, the status of the mirror 3 door are listed, along with any hardware or software faults. The constellation at which the antenna is pointed is also shown. The motor tachometers and currents are displayed on the little bar graphs on the bottom of the page. Positive values fill the bar from zero at the left edge to maximum at the right edge. Negative values fill from the right edge toward the left edge. The currents are always positive-valued. If the sun is above the horizon, the SAO sun shield turns white and the angular distance (in degrees) between the sun and the antenna position is displayed inside (Figure 4). If the sun is below the horizon, the SAO sun shield turns dark (Figure 5). If the antenna is within $20^\circ$ of the sun (regardless of whether it is above the horizon), ``SUN!'' flashes in the upper righthand corner of every screen1.


  
Figure 5:
\begin{figure}
\centerline{\epsfig{file=axisremotemoving.ps,width=2.4in}}\end{figure}


Taking command control with the Palm Vx

To take command control from the antenna computer, select the pulldown menu option. This can be achieved in either of two ways: 1) press the top row of the screen (i.e. the page title, as long as the MenuHack2 has been installed and activated), or 2) press the menu softkey (in the lower left corner of the silkscreen area). Depending on which method you use, the screen will then appear like Figure 6 or like Figure 7. You want to select ``Usurp to local mode'' under the ``ChangeMode'' pull-down menu.


  
Figure 6:
\begin{figure}
\centerline{\epsfig{file=menu.ps,width=2.4in}}\end{figure}


  
Figure 7:
\begin{figure}
\centerline{\epsfig{file=changetolocalmode.ps,width=2.4in}}\end{figure}

After you select ``Usurp to local mode'', you will be prompted to set a password for this session (see Figure 8). Do not worry about forgetting the password, as it can be displayed to you on the Palm Vx at any time (via the ChangeMode pulldown menu). This feature is purely for the operator's safety, and is designed to prevent people in the control room from grabbing antenna control away from you. However, if you are in a hurry, or cannot be bothered with such protection, note that the null password (underscores) is accepted by simply hitting ``OK''. Up to eight alphanumeric characters can be entered, one at a time, using an interface similar to the Garmin GPSIII+. The up or down buttons can be held down to run quickly through the alphabet.


  
Figure 8:
\begin{figure}
\centerline{\epsfig{file=setpassword.ps,width=2.4in}}\end{figure}

After entering a password, the current screen will change from remote mode to local mode. Most often, you will be presented with the Axis Control Page as shown in Figure 9 which indicates that the antenna is at rest (the commanded and actual velocities are zero).


  
Figure 9:
\begin{figure}
\centerline{\epsfig{file=axislocal.ps,width=2.4in}}\end{figure}


Starting the servo

You may use this screen to start and stop the servos in order to move the antenna in one or both axes. After pressing one of the start buttons, the antenna warning horn will sound for a few seconds during which time a ``Wait'' message will appear in the servo button(s) you have just activated (see Figure 10). If the ``Wait'' message remains on after the horn has stopped and then eventually reverts back to the ``Start'' button, this usually indicates a hardware problem with the Glentek power relay or circuit breaker. If the breakers all look okay, try pressing ``Start'' again (it sometimes requires one cycle simply to get the power relay turned on reliably). If it fails again, there may be a fault state preventing the system from starting up. See the later section on ``Checking for Faults''.


  
Figure 10:
\begin{figure}
\centerline{\epsfig{file=waitservo.ps,width=2.4in}}\end{figure}


Accelerating a motor axis

Once a servo axis is up and running (and the warning beeper has completed), the plus and minus motion buttons for that axis will appear, as in Figure 11. Each motion button accelerates the antenna in the specified direction. These buttons repeat (at a few Hertz), so you may choose to hold one down to continue accelerating. The antenna can move in both axes at once, but you are only allowed to accelerate in one axis at a time (otherwise both servos will decelerate and shutdown as a safety feature). Therefore, I recommend a one-finger policy at all times. If you hold down a button you will eventually reach and maintain the top speed for that axis. Under manual control, the top speed has been set to approximately one third of the maximum speed the servo can operate ( $v_{\rm max} \approx \pm2^\circ$/sec in elevation3, and $\pm4^\circ$/sec in azimuth).


  
Figure 11:
\begin{figure}
\centerline{\epsfig{file=axisactive.ps,width=2.4in}}\end{figure}


What if the motors do not move?

If you find that the motors do not move at all, even though the servos are enabled, the Glentek amplifiers may be in a fault state that is not indicated by the normal fault line. We have seen this condition at Haystack, and it may be due to incomplete circuitry on the Glentek board. To fix this problem, you should reset each Glentek via the Motor Display Page (see the section on page 11) and then restart the servos.


Maintaining a velocity

Once the antenna is moving, the velocity displays will register the commanded and actual rates, and the ``Maintain'' button will appear, as seen in Figure 12. As soon as you release an acceleration button, the velocity will decay to zero in several seconds as a safety feature. If you want to bypass this feature and maintain a constant velocity, then hold down the ``Maintain'' button.


  
Figure 12:
\begin{figure}
\centerline{\epsfig{file=axismoving.ps,width=2.4in}}\end{figure}


Stopping the antenna

If you choose to hold down the ``Maintain'' button, then as soon as you release it, the normal decay will promptly ensue. Starting from maximum (manual) velocity on the elevation axis ( $\approx 0.67^\circ
{\rm s}^{-1}$), the antenna will travel about $5^\circ$ during the normal decay process before coming to rest. In azimuth, the corresponding value is about $10^\circ$. To stop more quickly than that, press and hold the reverse direction button for the desired axis (don't worry, it will stop at zero). Once stopped, you may wish to accelerate in the reverse direction (i.e. past zero), but you will have to release the button and press it again. A quicker way to stop is to press the ``Stop Servo'' button in the middle of the page. This is the fastest way (in software) to stop the antenna since it will engage all three dynamic brakes followed by both mechanical brakes. It is equivalent to hitting a software encoder limit. Of course, the absolute fastest way to stop the antenna is to use the red E-stop button, which cuts power to the Glenteks and will register as a HardFault on the display until all the E-stop buttons are released. Aside from the ``Stop Servo'' button and the E-stop buttons, the servos will be disabled automatically if 60 seconds passes with no velocity commands coming from the Palm Vx (see Figure 13). So if you go off on a POG break, you can rest easy that things will be shut down when you get back.


  
Figure 13:
\begin{figure}
\centerline{\epsfig{file=localmodetimeout.ps,width=2.4in}}\end{figure}

The same safety feature acts during remote mode, but with a timeout of only 2 seconds, since the antenna computer should always be sending velocity commands at 100 Hz. In both cases, the antenna will decelerate incrementally before the servos are disabled (but this is relevant only in remote mode, since the normal decay in local mode will have already decelerated the antenna to zero before the timeout period).


Escaping a software limit switch

If you have encountered a software encoder limit (antenna too high or too low), a SoftFault will appear along with the appropriate ``Escape limit'' button (Figure 14).


  
Figure 14:
\begin{figure}
\centerline{\epsfig{file=escapelimit.ps,width=2.4in}}\end{figure}

You may press this button to safely escape the limit. The Palm Vx  will temporarily relax the limit, release the brake, enable the servo and move the antenna in the proper direction. If you have also passed the corresponding hardware prelimit switch, the SCB will automatically ignore the prelimits (temporarily) before enabling the servo. If you encountered the limit at a high speed, you may have to hit the button more than once to fully escape the limit. Watch the position display move on the appropriate axis during the ``wait'' period. If the escape button disappears and the servo axis in question remains active, then you have successfully escaped the limit. Otherwise, the servo will turn off and the brake will re-engage. If for some reason you have the software limits placed beyond the hardware pre-limit switch, you will first have to enable ``bypass pre-limits'' from the Limit Switch page before you try to press the ``Escape limit'' button.


Further details on other pages

If you need more information or control than is given by the Main Page, there are five additional screens available. In both local and remote modes, you can navigate between the six major screens by using the up/down hardkey located at the bottom edge of the Palm Vx, or by using the pulldown menu option shown in Figure 6. Hitting the up or down key will cycle through the available screens as indicated from Figure 15 through Figure 25.


  
Figure 15:
\begin{figure}
\centerline{\epsfig{file=motorremote.ps,width=2.4in}}\end{figure}


Motor Display Page

The Motor Display Page has useful lower-level system information, including the raw encoder readings, the velocity and torque commands, and the motor temperatures and currents. In local mode, the Glentek amplifiers and servo loops can also be turned on and off from this screen. A checkbox will appear when you press on appropriate status field (with your fingernail, or with the stylus (do not use a pencil or ink-tipped or ball-point pen). A numeric velocity can also be commanded via the VelCmd field. Instead of using the Graffiti region, a customized numeric entry form will pop up (see Figure 23) which provides an interface similar to the password entry form (and to HP power supplies and synthesizers). The ``up'' and ``down'' value buttons repeat when held, while the ``left'' and ``right'' buttons select which power-of-ten you are adjusting. Pressing the center button is a convenient way to zero the value (e.g. microcontroller reset count). Speaking of microcontroller resets, they will never be necessary in normal operation. Nevertheless, resets can be commanded by sending a pulse on the appropriate channel of the digital output Industry Pack card on the antenna computer (e.g., via the interactive program 'tscb2'). Of course, a reset also occurs when the board is powered up. If a reset occurs, a transient notification message will pop up on the Palm (see Figure 16) for 10 seconds, or until you hit ``OK'' (which ever comes first).


  
Figure 16:
\begin{figure}
\centerline{\epsfig{file=reset.ps,width=2.4in}}\end{figure}


Resetting a Glentek Amplifier fault

The Status (either ``okay'' or ``fault'') of each of the three Glentek amplifiers is also shown on the Motor Display page. Pressing on one of these fields will bring up a checkbox (Figure 17) that you can use to briefly toggle the appropriate reset line. This feature is enabled only in local mode, of course.


  
Figure 17:
\begin{figure}
\centerline{\epsfig{file=glentekreset.ps,width=2.4in}}\end{figure}

A miniature version of the axis control buttons appears on the Motor Display Page in local mode. This is purely meant for power users who want maximum feedback, usually for debugging purposes. Also available on the Motor Display page is a button which brings up bar graphs of the motor tachometer readings and motor current readings (see Figure 18). These are larger versions of the bar graphs that appear on the main page in remote mode. Touching any of the lower three bar graphs will toggle the display between the motor currents and the servo torque commands to all three motors.


  
Figure 18:
\begin{figure}
\centerline{\epsfig{file=graphs.ps,width=2.4in}}\end{figure}


Hardware Limit Switch Page (and Mirror 3 Door)

The Limit Switch Page (Figure 19) contains the status of all hardware switches, including the position of the Mirror 3 door. Also shown are the low-resolution azimuth encoder readings beyond which the SCB will begin confirming whether or not the azimuth rocker assembly has deployed properly (if not, a fault is registered). The rocker deploys approximately 90 degrees before the antenna encounters the hard stop, so these limits should be set to values comfortably beyond these points.


  
Figure 19:
\begin{figure}
\centerline{\epsfig{file=limitremote.ps,width=2.4in}}\end{figure}

In local mode, the Palm Vx can command the SCB to ignore, i.e. bypass, the pre-limit switches. This feature can be useful for exploring the location of the final limit switches, which cut power to the Glentek amplifiers. Pressing on the status field of any of the four pre-limit switches will bring up the checkbox shown in Figure 20. If you enable bypassing, it will remain in effect for all four prelimits for 100 seconds, with the SCB controlling the countdown. The bypass state will be indicated accordingly as shown in Figure 21. It will revert to the normal state when the timeout is complete, or when you disable the bypass-mode via the same checkbox.


  
Figure 20:
\begin{figure}
\centerline{\epsfig{file=setbypass.ps,width=2.4in}}\end{figure}


  
Figure 21:
\begin{figure}
\centerline{\epsfig{file=bypassing.ps,width=2.4in}}\end{figure}

Also from the Limit Switch page, one can control the position of the mirror 3 door by tapping on the underlined field and then using the checkbox form that pops up. If neither the ``Open'' nor ``Closed'' box is checked, then the door must be sitting in an unknown position, according to the limit switches. The same effect will be seen if there are no limit switches installed.


  
Figure 22:
\begin{figure}
\centerline{\epsfig{file=diagnosticslocal.ps,width=2.4in}}\end{figure}


  
Figure 23:
\begin{figure}
\centerline{\epsfig{file=newvalue.ps,width=2.4in}}\end{figure}


Diagnostics Page

Many useful numbers can be found on the Diagnostics page, including the current Julian date, universal time, local sidereal time, the various software version information as well as the low-resolution encoder limits and zero points (see Figure 22). The azimuth, elevation, right ascension and declination of the sun is also shown, along with the right ascension and declination at which the antenna is pointed. Of course, the accuracy of those values which are time-dependent rely on the Palm Vx clock to be set correctly to universal time. A mechanism exists to synchronize the Palm Vx time to the antenna computer time. The servo program running on the antenna computer periodically sends a serial packet containing the current Unix time (ultimately synchronized to the GPS receiver) to the Palm Vx  via the servo control board4. The times and coordinates are displayed only to precision of minutes and arc minutes for simplicity and due to lack of screen space. Each value is recalculated in double precision arithmetic every 4 seconds or so, which puts minimal extra load on the processor.


Checking for Faults

Also from the Diagnostics page, you can hit the ``Check Faults'' button to display the 32-bit fault word. As seen in Figure 24, this will list which of the faults have occurred since the last time the faults were cleared (either from the Palm Vx  or the antenna computer). The eight-digit value on the top line represents the 32-bit word, and the table lists all 32 bits: ``fault'' indicates the fault condition currently exists, while ``old'' means it happened recently but is okay now. In localmode, the ``CLEAR'' button will convert all bits with status ``old'' to ``okay''. Use the up/down hardware button, or the software scroll bar on the lefthand side of the screen to navigate through the list. Many of these faults, if present, will prevent the servos from engaging when requested. For example, near the bottom of the list lies the ``Azimuth Rocker Fault''. If this fault exists, the most likely cause is that the SCB variables ``azRockerHigh'' and ``azRockerLow'' are not set to appropriate values of the low resolution azimuth encoder. They should be set to values about 70 degrees from each endpoint of azimuth travel. The values can be set via the tscb2 program. It is unlikely that the rocker mechanism itself will fail to deploy properly.

One final detail: the number in the top righthand corner lists the number of times the Palm has failed to respond to an ``are_you_alive?'' query from the SCB. In normal operation, it should be zero (or very close to zero).


  
Figure 24:
\begin{figure}
\centerline{\epsfig{file=faultwordlocal.ps,width=2.4in}}\end{figure}


Servo Gains Page

The Servo Gains Page (Figure 25) displays the proportional, integral and derivative gains for both axes along with the azimuth torque bias currently in use on the SCB. Normally these values should not be changed on a functional antenna, and in fact you are prohibited from changing them from the Palm Vx (at least individually). However, when the antenna is on the transporter, the servo may require a different set of gains. If the transporter is given a unique pad identification (as planned), then the gains will be adjusted automatically when the servo is initialized in local mode. In the interim, software buttons have been allotted to accomplish the change in local mode (Figure 26) between ``normal'' and ``transporter'' gains (assuming of course, that the storage variables have been set up correctly beforehand).

The tachometer divisors are also displayed on this page (but are not editable). These values provide a gain calibration for the individual tachometer responses and are computed by monitoring the high-resolution encoders during periods of constant velocity motion. These values are periodically updated by Bob Wilson's servo code running on the antenna computer. Therefore, any motor/tachometer unit or the SCB itself can be replaced and the software will re-calibrate itself automatically.

Finally, the antennaType variable can be changed from the Palm Vx and should be set to zero for old antennas (commissioned pre-2000), and one for new antennas. This affects only the elevation display on the Palm pilot (due to the different gear ratio on the low-resolution elevation encoder).


  
Figure 25:
\begin{figure}
\centerline{\epsfig{file=servogainremote.ps,width=2.4in}}\end{figure}


  
Figure 26:
\begin{figure}
\centerline{\epsfig{file=servogainlocal.ps,width=2.4in}}\end{figure}


Entering and exiting from Lockdown mode

If you need to climb on or under the antenna, you should consider using the ``lockdown'' feature. In addition to preventing the control room from taking over, it also prevents people holding the Palm Vx  from taking over (if they do not know the password). Figure 27 shows how the screen looks in lockdown mode. Of course, you should also press the red round hardware E-stop button on the Palm Vx case. For clarification, at all times when any E-stop button is depressed, the lower righthand corner of each page on the Palm Vx flashes ``E-STOP!''. (Eventually, removing the hermetic screw cap on the outdoor Palm Vx connection will serve as an additional E-stop in the final antenna cabin design.)


  
Figure 27:
\begin{figure}
\centerline{\epsfig{file=lockdown.ps,width=2.4in}}\end{figure}

If the password is entered correctly, the display will return to the prior screen from which lockdown mode was selected. If an incorrect password is given, the screen in Figure 28 will appear. After the user presses ``OK'', the Palm Vx will revert to the same (blank) password entry screen, ready for the next attempt.


  
Figure 28:
\begin{figure}
\centerline{\epsfig{file=sorrydave.ps,width=2.4in}}\end{figure}


Giving control back to the antenna computer

When you are through with activities in the antenna cabin, you probably want to abdicate control back to the antenna computer via the ChangeMode pull-down menu (see Figure 29). If you forget to do this before walking back to the control building, there is a facility to send the appropriate password from the antenna computer to the Palm via the SCB. But remember that all alphabetic characters are capitalized. If you forget your password, you can display it by selecting the appropriate entry on the ChangeMode pull-down menu (see Figure 30).


  
Figure 29:
\begin{figure}
\centerline{\epsfig{file=changetoremotemode.ps,width=2.4in}}\end{figure}


  
Figure 30:
\begin{figure}
\centerline{\epsfig{file=showpassword.ps,width=2.4in}}\end{figure}

If while in local mode, someone in the control room attempts to harmlessly read the status or the values of variables, they will be allowed to do so, but you will be notified by a blinking ``Traffic'' field located on the lower lefthand edge of every PalmPaddle page. However, if someone attempts to crack your password and fails, you will be immediately notified by the popup-window shown in Figure 31. If someone successfully enters your password, the antenna computer immediately asserts command control and you will be notified by the transient window shown in Figure 32. It will go away automatically after 60 seconds. However, if you are not finished working, then press ``OK'', and simply select ``Usurp to local mode'' again. And use a better password this time! If you are in the middle of a slew when someone grabs control, the antenna will decelerate gently before enabling the brakes and transferring control. The same safety feature works in the other direction too (i.e. you can safely grab control with the Palm even during an antenna computer slew).


  
Figure 31:
\begin{figure}
\centerline{\epsfig{file=break-in.ps,width=2.4in}}\end{figure}


  
Figure 32:
\begin{figure}
\centerline{\epsfig{file=control-transfer.ps,width=2.4in}}\end{figure}


Stopping the PalmPaddle program

Normally, the PalmPaddle application should be left running at all times. However, it is possible to exit the application and run other Palm Vx programs (such as the calculator or the constellation finder). You can use the ``home'' silkscreen button to exit from PalmPaddle. However, after touching it, you will be asked to confirm your choice before exiting the application. Highlight the checkbox and press ``OK'' (Figure 33) if you really want to exit. Alternatively, you can just hit the ``home'' button again to exit. If you exit the application while in local mode, the SCB will remain in local mode until the Palm Vx is reconnected or until the SCB is reset via the antenna computer digital output line. Since the password is stored on the Palm Vx, control cannot be passed by this method if the Palm Vx is not present.


  
Figure 33:
\begin{figure}
\centerline{\epsfig{file=confirmexit.ps,width=2.4in}}\end{figure}


Engaging and Inverting the backlight

If you have to use the Palm Vx in the dark, you will want to use the built-in backlight. To turn it on, hold down the green power button for a few seconds. To turn it off, do the same thing. You might also find the GreenLightHack5 to be useful. This freeware hack inverts the pixels while the backlight is illuminated. It can be activated from the HackMaster menu icon (outside of the PalmPaddle program).



 
next up previous
Next: About this document ...

2000-04-29