stella.util
Class TelescopeAxis

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.util.TelescopeAxis
All Implemented Interfaces:
Cloneable, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class TelescopeAxis
extends PropertyBundles

A telescope axis represents either axis on STELLA. It is used in PID-tuning to have a more realistic model for the telescope's reaction to a guider offset.
It simulates the axis movement considering a few cornerstones:


Nested Class Summary
static class TelescopeAxis.Randomize
          Tests the axis movement by a randomized offset.
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  double deadtime
          The deadtime of the movement.
private static double DEFALPHA
          The default alpha value.
private static double DEFBETA
          The default beta value.
private static double DEFJERK
          The default jerk in degree/s^3.
static String KEY_ALPHA
          The key to the alpha time-share of the S-curve.
static String KEY_BETA
          The key to the beta time-share of the S-curve.
static String KEY_JERK
          The key to the jerk of the S-curve.
private  SCurve movealong
          The old s-curve movement.
private  SCurve moveto
          The next active s-curve.
private  double switchover
          The time at which the new s-curve will become active.
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Constructor Summary
TelescopeAxis(Map prop)
          Constructs a new telescope axis object.
 
Method Summary
 double getAxisPosition(double tnow)
          Gets the telescope axis position at the time in question.
 void setDeadtime(double dead)
          Sets the deadtime.
 void setDesiredOffset(double offset, double tnow)
          Set the offset the axis should acquire.
 void setJerkConstant(double jerk)
          Sets the motor jerk.
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, init, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

KEY_ALPHA

public static final String KEY_ALPHA
The key to the alpha time-share of the S-curve.

See Also:
Constant Field Values

KEY_BETA

public static final String KEY_BETA
The key to the beta time-share of the S-curve.

See Also:
Constant Field Values

KEY_JERK

public static final String KEY_JERK
The key to the jerk of the S-curve.

See Also:
Constant Field Values

DEFALPHA

private static final double DEFALPHA
The default alpha value.

See Also:
Constant Field Values

DEFBETA

private static final double DEFBETA
The default beta value.

See Also:
Constant Field Values

DEFJERK

private static final double DEFJERK
The default jerk in degree/s^3.

See Also:
Constant Field Values

deadtime

private double deadtime
The deadtime of the movement.


moveto

private SCurve moveto
The next active s-curve.


movealong

private SCurve movealong
The old s-curve movement.


switchover

private double switchover
The time at which the new s-curve will become active.

Constructor Detail

TelescopeAxis

public TelescopeAxis(Map prop)
Constructs a new telescope axis object.

Method Detail

setDeadtime

public void setDeadtime(double dead)
Sets the deadtime. This is the time out from the measurement of an offset until it gets active on the telescope axis. The deadtime should be set in seconds.


setJerkConstant

public void setJerkConstant(double jerk)
Sets the motor jerk. This is a property value as it is needed for the S-curve movement.


setDesiredOffset

public void setDesiredOffset(double offset,
                             double tnow)
Set the offset the axis should acquire.

Parameters:
offset - The offset the telescope should now follow.
tnow - The current time. This determines when the new offset will get active, at tnow plus deadtime.

getAxisPosition

public double getAxisPosition(double tnow)
Gets the telescope axis position at the time in question. First, we check if the old s-curve movement should be used. If so, query the SCurve.getDistance(double) method with the current time and return. If the time in question is over the switchover time for the first time, we query the telescope axis movealong object for the acceleration, velocity and distance at the switchover time. This are the BC's for the moveto object, which is then started at the switch time. The moveto object is now shifted to the movealong state, and distances are queried from it.