Spacecraft Control Framework 1.0
Spacecraft Control Library
sc_pulsewidth_lp.h
Go to the documentation of this file.
1/*
2 * sc_math.h
3 *
4 * Programmers: Stephanie Thomas, Michael Paluszek
5 *
6 * Copyright 2000-2006, Princeton Satellite Systems. All rights reserved.
7 *
8 * Math functions.
9 */
10
12
18#ifndef __SC_PULSEWIDTHLP__
19#define __SC_PULSEWIDTHLP__
20
21#include <math.h>
22#ifdef AS_OS_WINDOWS
23#include "matrixlib.h"
24#else
25#include <MatrixLib/MatrixLib.h>
26#endif
27#include "sc_constants.h"
28
29
38{
39
40private:
42 ml_matrix thruster_positions;
44 ml_matrix thruster_directions;
46 ml_matrix thruster_coefficients;
48 double slack_scale;
50 double slack_weight;
52 double tank_pressure;
54 ml_matrix force_demand;
56 ml_matrix torque_demand;
58 ml_matrix force_matrix;
60 ml_matrix torque_matrix;
62 ml_matrix slack_matrix;
64 ml_matrix center_of_mass;
66 double force_error_weight;
68 double torque_error_weight;
69
70public:
72 ml_matrix pulsewidth;
73
76
78 PulseWidthLP( void );
79
81 void Initialize( void );
82
84 void SetThrusterData( int n, ml_matrix positions, ml_matrix directions, ml_matrix coeffs );
85
87 bool SolveMinPW( void );
88
90 bool SolveMaxForce( void );
91
93 void UpdateForceTorqueMatrix( void );
94
96 void SetForceDemand( ml_matrix force );
97
99 void SetTorqueDemand( ml_matrix torque );
100
102 void SetThrusterPositions( ml_matrix positions );
103
105 void SetThrusterDirections( ml_matrix directions );
106
108 void SetThrusterCoefficients( ml_matrix coeffs );
109
111 void SetErrorWeights( double fW, double tW );
112
114 void SetSlackScale( double scale );
115
117 void SetSlackWeight( double weight );
118
120 void SetCenterOfMass( ml_matrix cm );
121
123 void SetTankPressure( double pressure );
124
126 ml_matrix GetForce( void );
127
129 ml_matrix GetTorque( void );
130
132 ml_matrix GetForceDemand( void );
133
135 ml_matrix GetTorqueDemand( void );
136
138 ml_matrix GetForceMatrix( void );
139
141 ml_matrix GetTorqueMatrix( void );
142
143};
144
145
146#endif
Multi-Thruster Pulsewidth Solution using Linear Program Formulation.
Definition: sc_pulsewidth_lp.h:38
int nThrusters
Number of thrusters.
Definition: sc_pulsewidth_lp.h:75
bool SolveMinPW(void)
Solve for the minimum pulsewidths that achieve force and torque demands.
Definition: sc_pulsewidth_lp.cc:61
void SetSlackScale(double scale)
Set the slack variable scale.
Definition: sc_pulsewidth_lp.cc:212
void SetCenterOfMass(ml_matrix cm)
Set the center of mass.
Definition: sc_pulsewidth_lp.cc:224
void Initialize(void)
Initialize.
Definition: sc_pulsewidth_lp.cc:23
void SetThrusterCoefficients(ml_matrix coeffs)
Set the thruster coefficients.
Definition: sc_pulsewidth_lp.cc:199
ml_matrix pulsewidth
Pulsewidth solution.
Definition: sc_pulsewidth_lp.h:72
PulseWidthLP(void)
Constructor.
Definition: sc_pulsewidth_lp.cc:18
ml_matrix GetForce(void)
Get the achieved force.
Definition: sc_pulsewidth_lp.cc:230
void SetTorqueDemand(ml_matrix torque)
Set the torque demand.
Definition: sc_pulsewidth_lp.cc:181
void SetSlackWeight(double weight)
Set the slack variable weight.
ml_matrix GetForceMatrix(void)
Get the force matrix.
Definition: sc_pulsewidth_lp.cc:262
ml_matrix GetTorque(void)
Get the achieved torque.
Definition: sc_pulsewidth_lp.cc:240
void SetForceDemand(ml_matrix force)
Set the force demand.
Definition: sc_pulsewidth_lp.cc:175
ml_matrix GetForceDemand(void)
Get the force demand.
Definition: sc_pulsewidth_lp.cc:250
void SetTankPressure(double pressure)
Set the tank pressure.
Definition: sc_pulsewidth_lp.cc:218
void SetThrusterPositions(ml_matrix positions)
Set the thruster positions.
Definition: sc_pulsewidth_lp.cc:187
ml_matrix GetTorqueMatrix(void)
Get the torque matrix.
Definition: sc_pulsewidth_lp.cc:268
ml_matrix GetTorqueDemand(void)
Get the torque demand.
Definition: sc_pulsewidth_lp.cc:256
void UpdateForceTorqueMatrix(void)
Update the force matrix and torque matrix.
Definition: sc_pulsewidth_lp.cc:160
void SetThrusterDirections(ml_matrix directions)
Set the thruster directions.
Definition: sc_pulsewidth_lp.cc:193
void SetThrusterData(int n, ml_matrix positions, ml_matrix directions, ml_matrix coeffs)
Set the thruster data.
Definition: sc_pulsewidth_lp.cc:48
bool SolveMaxForce(void)
Solve for the pulsewidths that meets torque demand and maximizes force magnitude in desired direction...
Definition: sc_pulsewidth_lp.cc:97
void SetErrorWeights(double fW, double tW)
Set the error weights for force and torque.
Definition: sc_pulsewidth_lp.cc:205
Physical and mathematical constants.