Index

Boolean drives_enabled()

Return true if the telescope drive servos are enabled.

Arguments:
(none)

Example:

  # If the drives are currently unavailable, wait for them to become available.

  if(!$drives_available) {
    print "Waiting for the telescope drives to become available"
    until $drives_available
  }

  # Enable the drive servos, and wait for the completion of this operation.

  axes all
  until $acquired(source)

  # Keep an eye out for the drives becoming disabled again, while observing.

  catch(!$drives_enabled) {
    ...observe sources...
  }

Context:
To observe sources with the 40m telescope, the software drive-servos need to be enabled. They aren't permanently enabled, for the following reasons. They are disabled when the telescope is sent to the stow or service positions, since these positions can only reached by hardware servos. They are also disabled after the computer-enable or drive-power switches have been turned off, and after the control system is restarted. Finally, they are disabled after a drive error occurs, as a safety measure that turns on the brakes.

The return value of the $drives_enabled() function indicates whether or not the drives are currently enabled. This can be used before starting a set of observations, to see whether the drive servos need to be enabled, and thereafter, once the drives have been enabled, it can be watched by a catch clause, to detect loss of telescope control during observations.

When loss of telescope control is detected by a catch clause that checks for $drives_enabled() becoming false, the schedule should abandon the current observation, wait for the $drives_available() function to indicate that the drive servos can be newly enabled, then enable the drives using the axes command, before returning to observing.


Martin Shepherd (20-Oct-2010)