Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages | Examples

Controller.h

Go to the documentation of this file.
00001 //////////////////////////////////////////////////////////////////////////////////////////////////
00002 /*! \file Controller.h
00003  *  \brief The Controller class is an abstract class, all controllers will be derived from it.
00004 *          It is derived from the Algorithm Class.
00005 *  \author $Author: jayhawk_hokie $
00006 *  \version $Revision: 1.10 $
00007 *  \date    $Date: 2007/07/24 09:26:11 $
00008 *//////////////////////////////////////////////////////////////////////////////////////////////////
00009 /*! 
00010 */
00011 //////////////////////////////////////////////////////////////////////////////////////////////////
00012 
00013 
00014 #ifndef __SSSL_CONTROLER_H__
00015 #define __SSSL_CONTROLER_H__
00016 
00017 #include <Base/Whorl.h>
00018 
00019 #include <vector.h>
00020 
00021 #include "attitude/Attitude.h"
00022 #include "attitude/AttitudeState.h"
00023 #include "attitude/AttitudeModels/QuaternionAngVelDynamics.h"
00024 #include "attitude/AttitudeModels/AttitudeModels.h"
00025 
00026 #include "rotation/Rotation.h"
00027 
00028 #include "utils/RungeKuttaIntegrator.h"
00029 
00030 #include <Utils/matrixFunctionInterface.h>
00031 
00032 using namespace std;
00033 using namespace O_SESSAME;
00034 
00035                                 
00036 Vector NullFunctor( const ssfTime& _pSSFTime, const OrbitState& _pOrbitState, const AttitudeState& _pAttitudeState );
00037 
00038 Vector AttitudeTrajectory(const ssfTime &_time, const Vector& _state, Orbit *_Orbit, Attitude *_Attitude, const Matrix &_parameters, const Functor &_torqueFuncPtr);
00039 
00040 class Controller {
00041         public:
00042         
00043                 /** Constructors */
00044                 Controller( );
00045                 Controller( Whorl* ptr_whorl );
00046         
00047                 /** Destructors */
00048                 virtual ~Controller( );
00049                 
00050                 /** Facilitators */
00051                         
00052                         /** Mutators */
00053                         
00054                                 /*! \brief Set the torque produced by the momentum wheels 
00055                                 * @param ControlTorque a 3 x 1 vector representing the desired control torque in N-m
00056                                 */
00057                                 int SetWheelTorque(Vector ControlTorque);
00058                         
00059                                 /*! \brief Sets the torque produced by the thrusters */
00060                                 int SetThrusterTorque( char Thruster_set, int Number_of_Pulses,double Pulse_length);
00061                         
00062                                 /*! \brief Runs the controller (pure virtual function) */
00063                                 virtual int Run() = 0;
00064                         
00065                                 /*! \brief Initializes the controller (pure virtual function) */
00066                                 virtual int Initialize() = 0;
00067                                 
00068                         /** Facilitators */
00069                                 
00070                                 /*! \brief Determines the A matrix for the momentum wheels */
00071                                 Matrix FindA();
00072                                 
00073                                 /*! \brief Determines the MOI of the momentum wheels */
00074                                 Matrix FindMOI_sw();
00075                                 
00076                                 /*! \brief Create a spacecraft reference model based on the quaternion kinematic equation
00077                                  *  and Euler Rotational Equation of Motion. The quaternion and angular rates are numerically
00078                                  *  integrated.
00079                                  *  @param deltaTime is a ssfTime variable that change in time of the reference model.
00080                                  */
00081                                 void ReferenceModelSC( ssfTime deltaTime );
00082                 
00083                                 void ReferenceTrajectory( ssfTime deltaTime );
00084                         
00085                                 Vector Saturation( Vector _s, Vector _phi );
00086 
00087                                 Vector Sign( Vector _s );
00088 
00089                                 double SignSingle( double _s );
00090                 
00091                                 /*! \brief Actuator Saturation function for the reaction wheels. Max toruqe is set with m_uMax.
00092                                  *  @param _u input control torque vector
00093                                  */             
00094                                 Vector WheelSaturation( Vector _u );
00095                         
00096         protected:
00097 
00098                 /*! \brief Member object in Controller Class */         
00099                 Whorl* m_whorl;
00100 
00101                 /*! \brief Member matrix in Controller Class that provides the orientation of the momentum wheels */
00102                 Matrix A; 
00103                            
00104                 /*! \brief Member matrix in Controller Class that is a diagonal matrix with the MOI of the momentum 
00105                  *      wheels as its memebers */
00106                 Matrix MOI_sw;      
00107 
00108                 /*! \brief Member vector in Controller Class that is the angular rates of the reference model. */
00109                 Vector m_angularRateReference;
00110                 
00111                 /*! \brief Member vector in Controller Class that is the angular acceleration of the reference model. */
00112                 Vector m_angularAccelReference;
00113                 
00114                 /*! \brief Member vector in Controller Class that is the quaternion of the reference model. */
00115                 Vector m_quaternionReference;
00116                 
00117                 /*! \brief Member vector in Controller Class that is the MRP's of the reference model. */
00118                 Vector m_mrpReference;
00119 
00120                 /*! \brief Member double in Controller Class that is the max wheel control torque. */
00121                 double m_uMax;
00122 };
00123 
00124 #endif
00125                 
00126 // Do not change the comments below - they will be added automatically by CVS
00127 /*****************************************************************************
00128 *       $Log: Controller.h,v $
00129 *       Revision 1.10  2007/07/24 09:26:11  jayhawk_hokie
00130 *       Added attitude reference models.
00131 *       
00132 *       Revision 1.9  2007/05/23 22:18:10  jayhawk_hokie
00133 *       Implemented spacecraft reference model.
00134 *       
00135 *       Revision 1.8  2005/02/25 18:40:52  cakinli
00136 *       Created Makefiles and organized include directives to reduce the number of
00137 *       include paths.  Reorganized libraries so that there is now one per source
00138 *       directory.  Each directory is self-contained in terms of its Makefile.
00139 *       The local Makefile in each directory includes src/config.mk, which has all
00140 *       the definitions and general and pattern rules.  So at most, to see what
00141 *       goes into building a target, a person needs to examine the Makefile in
00142 *       that directory, and ../config.mk.
00143 *       
00144 *       Revision 1.7  2003/08/13 23:16:57  mavandyk
00145 *       Altered structure as outline in meeting.
00146 *       
00147 *       Revision 1.6  2003/08/06 21:47:18  mavandyk
00148 *       Updated comments and notation and fixed class structure.
00149 *       
00150 *       Revision 1.5  2003/08/01 11:19:23  mavandyk
00151 *       Changed the class structure, and fixed bugs.
00152 *       
00153 *       Revision 1.4  2003/07/31 20:21:19  mavandyk
00154 *       Changed functions to represent new class structure, and added more comments.
00155 *       
00156 *       Revision 1.3  2003/07/07 14:10:52  simpliciter
00157 *       Added log blocks.
00158 *       
00159 *       
00160 *
00161 ******************************************************************************/

Generated on Wed Sep 5 12:54:18 2007 for DSACSS Operational Code by  doxygen 1.3.9.1