jaron.autopilot
Class MotionController

java.lang.Object
  extended by java.lang.Thread
      extended by jaron.autopilot.MotionController
All Implemented Interfaces:
java.lang.Runnable

public class MotionController
extends java.lang.Thread

The MotionController class provides the functionality for stabilizing and guiding a vehicle. It uses a motion sensor (through the FlightData component) and expects its output for roll an pitch angles to be within -180 to 180 degrees - where 0 is level flight.
The motion controller stabilizes the vehicle as long as there is no external stick input for elevator or aileron.
The pitch and roll at which the vehicle is stabilized preset externally. This is used to guide the vehicle by an external component like the MissionController

Since:
1.2
Version:
1.2
Author:
jarontec gmail com

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static float DEFAULT_UPDATE_FREQUENCY
          The default update frequency of the MotionController is set to 10.0f Hz.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MotionController()
          Creates an new MotionController object.
 
Method Summary
 Signal getAileronInput()
          Returns a reference to the aileron input.
 Signal getAileronOutput()
          Returns a reference to the aileron output.
 Signal getElevatorInput()
          Returns a reference to the elevator input.
 Signal getElevatorOutput()
          Returns a reference to the elevator output.
 Signal getPitchAngle()
          Returns a reference to the pitch angle input.
 Signal getPitchAnglePreset()
          Returns a reference to the pitch angle input.
 Signal getPitchGainD()
          Returns a reference to the pitch stabilization PID parameter gain-D.
 Signal getPitchGainI()
          Returns a reference to the pitch stabilization PID parameter gain-I.
 Signal getPitchGainP()
          Returns a reference to the pitch stabilization PID parameter gain-P.
 Signal getPitchMaxI()
          Returns a reference to the pitch stabilization PID parameter max-I.
 Signal getPitchMinI()
          Returns a reference to the pitch stabilization PID parameter min-I.
 Signal getPitchTrim()
          Returns a reference to the pitch angle output.
 Signal getRollAngle()
          Returns a reference to the roll angle output.
 Signal getRollAnglePreset()
          Returns a reference to the roll angle input.
 Signal getRollGainD()
          Returns a reference to the roll stabilization PID parameter gain-D.
 Signal getRollGainI()
          Returns a reference to the roll stabilization PID parameter gain-I.
 Signal getRollGainP()
          Returns a reference to the roll stabilization PID parameter gain-P.
 Signal getRollMaxI()
          Returns a reference to the pitch stabilization PID parameter max-I.
 Signal getRollMinI()
          Returns a reference to the roll stabilization PID parameter min-I.
 Signal getRollTrim()
          Returns a reference to the roll angle input.
 void run()
           
 void startStabilizing()
          Starts the motion controller.
 void stopStabilizing()
          Stops the motion controller.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_UPDATE_FREQUENCY

public static final float DEFAULT_UPDATE_FREQUENCY
The default update frequency of the MotionController is set to 10.0f Hz.

See Also:
Constant Field Values
Constructor Detail

MotionController

public MotionController()
Creates an new MotionController object.

Method Detail

getAileronInput

public Signal getAileronInput()
Returns a reference to the aileron input. This enables the internal signal for aileron to be externally set thus the motion controller's correction is overridden by an external controller (e.g. a stick control).

Returns:
aileron input signal

getElevatorInput

public Signal getElevatorInput()
Returns a reference to the elevator input. This enables the internal signal for elevator to be externally set thus the motion controller's correction is overridden by an external controller (e.g. a stick control).

Returns:
elevator input signal

getAileronOutput

public Signal getAileronOutput()
Returns a reference to the aileron output.

Returns:
aileron output signal

getElevatorOutput

public Signal getElevatorOutput()
Returns a reference to the elevator output.

Returns:
elevator output signal

getPitchAnglePreset

public Signal getPitchAnglePreset()
Returns a reference to the pitch angle input. This enables the internal signal for pitch angle to be externally set.

Returns:
pitch angle input signal

getRollAnglePreset

public Signal getRollAnglePreset()
Returns a reference to the roll angle input. This enables the internal signal for roll angle to be externally set.

Returns:
roll angle input signal

getPitchAngle

public Signal getPitchAngle()
Returns a reference to the pitch angle input. This enables the internal signal for pitch angle to be externally set.

Returns:
pitch angle input signal

getRollAngle

public Signal getRollAngle()
Returns a reference to the roll angle output.

Returns:
roll angle output signal

getRollTrim

public Signal getRollTrim()
Returns a reference to the roll angle input. This enables the internal signal for roll angle to be externally set by a roll trim.

Returns:
roll angle input signal

getPitchTrim

public Signal getPitchTrim()
Returns a reference to the pitch angle output.

Returns:
roll angle pitch signal

getPitchGainP

public Signal getPitchGainP()
Returns a reference to the pitch stabilization PID parameter gain-P. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the gain-P parameter signal
See Also:
Stabilization.PID

getPitchGainI

public Signal getPitchGainI()
Returns a reference to the pitch stabilization PID parameter gain-I. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the gain-I parameter signal
See Also:
Stabilization.PID

getPitchGainD

public Signal getPitchGainD()
Returns a reference to the pitch stabilization PID parameter gain-D. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the gain-D parameter signal
See Also:
Stabilization.PID

getPitchMinI

public Signal getPitchMinI()
Returns a reference to the pitch stabilization PID parameter min-I. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the min-I parameter signal
See Also:
Stabilization.PID

getPitchMaxI

public Signal getPitchMaxI()
Returns a reference to the pitch stabilization PID parameter max-I. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the max-I parameter signal
See Also:
Stabilization.PID

getRollGainP

public Signal getRollGainP()
Returns a reference to the roll stabilization PID parameter gain-P. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the gain-P parameter signal
See Also:
Stabilization.PID

getRollGainI

public Signal getRollGainI()
Returns a reference to the roll stabilization PID parameter gain-I. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the gain-I parameter signal
See Also:
Stabilization.PID

getRollGainD

public Signal getRollGainD()
Returns a reference to the roll stabilization PID parameter gain-D. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the gain-D parameter signal
See Also:
Stabilization.PID

getRollMinI

public Signal getRollMinI()
Returns a reference to the roll stabilization PID parameter min-I. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the min-I parameter signal
See Also:
Stabilization.PID

getRollMaxI

public Signal getRollMaxI()
Returns a reference to the pitch stabilization PID parameter max-I. This enables the adjustment of this parameter during runtime from outside the motion controller.

Returns:
the max-I parameter signal
See Also:
Stabilization.PID

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

startStabilizing

public void startStabilizing()
Starts the motion controller.


stopStabilizing

public void stopStabilizing()
Stops the motion controller.