Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_pd.h
Go to the documentation of this file.
1//-----------------------------------------------------------------------------------------
2// A PD Based n dof controller for spacecraft
3//-----------------------------------------------------------------------------------------
4// Copyright (c) 2014 Princeton Satellite Systems. All rights reserved.
5//-----------------------------------------------------------------------------------------
6
9
10#ifndef __PD__
11#define __PD__
12
13#ifdef AS_OS_WINDOWS
14 #include "matrixlib.h"
15#else
16 #include <MatrixLib/MatrixLib.h>
17#endif
18
19
24class PD
25{
26
27 private:
29 double gain_a;
31 double gain_b;
33 double gain_c;
35 double gain_d;
37 ml_matrix inertia;
39 ml_matrix angle_command;
40 ml_matrix x;
41
42 public:
44 ml_matrix q_desired_state;
45
47 PD( void );
49 void Initialize( double a, double b, double c, double d, ml_matrix inertia );
51 ml_matrix Update( ml_matrix angle_error );
53 void Reset( void );
55 void SetInertia( ml_matrix inertia ){this->inertia = inertia;};
57 ml_matrix GetInertia( void ){ return this->inertia; };
58
59
60};
61
62
63#endif
Definition: sc_pd.h:25
void SetInertia(ml_matrix inertia)
Set the inertia.
Definition: sc_pd.h:55
PD(void)
Constructor.
Definition: sc_pd.cc:16
void Reset(void)
Reset the pd.
Definition: sc_pd.cc:39
void Initialize(double a, double b, double c, double d, ml_matrix inertia)
Initialize all state matrices.
Definition: sc_pd.cc:28
ml_matrix Update(ml_matrix angle_error)
Update the output.
Definition: sc_pd.cc:52
ml_matrix GetInertia(void)
Get the inertia.
Definition: sc_pd.h:57
ml_matrix q_desired_state
Target quaternion.
Definition: sc_pd.h:44