00001 ////////////////////////////////////////////////////////////////////////////////////////////////// 00002 /*! \file DefaultController.h 00003 * \brief The DefaultController class contains the actual equations for angular velocity control. 00004 * It is derived from the Contorller class. 00005 * \author $Author: cakinli $ 00006 * \version $Revision: 1.4 $ 00007 * \date $Date: 2005/02/25 18:40:53 $ 00008 *////////////////////////////////////////////////////////////////////////////////////////////////// 00009 /*! 00010 */ 00011 ////////////////////////////////////////////////////////////////////////////////////////////////// 00012 00013 00014 #ifndef __SSSL_MWCMGCONTROLLER_H__ 00015 #define __SSSL_MWCMGCONTROLLER_H__ 00016 00017 #include <Controller/Controller.h> 00018 #include <sys/time.h> 00019 00020 using namespace std; 00021 using namespace O_SESSAME; 00022 00023 class MWCMGController : public Controller { 00024 00025 public: 00026 /** Constructors */ 00027 MWCMGController(); 00028 MWCMGController(Whorl* ptr_whorl) { 00029 m_whorl = ptr_whorl; 00030 Initialize(); 00031 }; 00032 00033 /** Destructor */ 00034 virtual ~MWCMGController() {}; 00035 00036 /*! Runs the default controller */ 00037 int Run(); 00038 00039 /*! Initializes the default controller */ 00040 int Initialize(); 00041 00042 /*! Lookup a line in the lookup table. */ 00043 double *tlu(double curtime); 00044 00045 /*! Load the lookup table. */ 00046 int LoadLUT(char *filename); 00047 00048 protected: 00049 00050 Matrix m_gainMatrix; 00051 Vector m_controlTorque; 00052 00053 private: 00054 00055 struct timeval InitialTime; 00056 struct timeval RunTime; 00057 struct timeval CurrentTime; 00058 Vector MRPcurrent; 00059 Vector MRPRef; 00060 Vector omegaRef; 00061 Vector Qcurrent; 00062 Matrix RBR; 00063 Vector dMRP; 00064 Vector domega; 00065 double **lut; 00066 double *myRow; 00067 double SIGMA; 00068 00069 }; 00070 00071 #endif 00072 00073 // Do not change the comments below - they will be added automatically by CVS 00074 /***************************************************************************** 00075 * $Log: MWCMGController.h,v $ 00076 * Revision 1.4 2005/02/25 18:40:53 cakinli 00077 * Created Makefiles and organized include directives to reduce the number of 00078 * include paths. Reorganized libraries so that there is now one per source 00079 * directory. Each directory is self-contained in terms of its Makefile. 00080 * The local Makefile in each directory includes src/config.mk, which has all 00081 * the definitions and general and pattern rules. So at most, to see what 00082 * goes into building a target, a person needs to examine the Makefile in 00083 * that directory, and ../config.mk. 00084 * 00085 * Revision 1.3 2003/08/21 13:58:35 cskelton 00086 * Controller updated. MRP shadow set added. TLU and LUT corrected. 00087 * 00088 * Revision 1.2 2003/08/15 16:12:08 cskelton 00089 * *** empty log message *** 00090 * 00091 * Revision 1.1 2003/08/15 04:50:14 cskelton 00092 * *** empty log message *** 00093 * 00094 * Revision 1.3 2003/08/13 23:17:32 mavandyk 00095 * Altered structure as outline in meeting. 00096 * 00097 * Revision 1.2 2003/07/31 20:42:38 mavandyk 00098 * Fixed some minor problems. 00099 * 00100 * Revision 1.1 2003/07/31 20:27:17 mavandyk 00101 * This is the default controller for Whorl. 00102 * 00103 * Revision 1.3 2003/07/07 14:10:52 simpliciter 00104 * Added log blocks. 00105 * 00106 * 00107 * 00108 ******************************************************************************/