#include <MomentumWheel.h>
Inheritance diagram for MomentumWheel:
Definition at line 32 of file MomentumWheel.h.
Public Types | |
enum | StringValue { ON, OFF } |
Value-Definitions of the different string values. More... | |
Public Member Functions | |
MomentumWheel () | |
Default Constructor. | |
MomentumWheel (TiXmlHandle handle, string wheel) | |
Constructor that accepts a cfgBody variable sent from the cfgPars function. | |
virtual | ~MomentumWheel () |
Deconstructor. | |
int | Initialize (TiXmlHandle handle, string wheel) |
Initialize the wheels. | |
int | Deinitialize () |
Deinitialize the wheels. | |
int | Stop () |
Stop the wheel Calls PhysicalMomentumWheel::Stop( ). | |
int | TorqueCommand (double _power) |
Enable torque mode for the wheel motor. Calls PhysicalMomentumWheel::TorqueCommand( int _power ). | |
void | StartSpeedQuery () |
Start the speed reading routine of the motor in a separate thread. Calls PhysicalMomentumWheel::StartSpeedQuery( ). | |
void | StopSpeedQuery () |
Stop the speed reading routine of the motor. This function does not need to be called a t the end of the program. Calls PhysicalMomentumWheel::StopSpeedQuery( ) The thread will be closed automatically when the program ends. | |
void | SetWheelTorque (double wheelTorque) |
Set the torque applied to the wheel Calls PhysicalMomentumWheel::CommandWheelTorque( double _wheelTorque ). | |
void | SetWheelSpeed (double wheelOmega) |
Set the desired wheel speed. The wheel controller is running in a thread and this function updates the desired wheel rate value passed to the wheel controller. Calls PhysicalMomentumWheel::CommandWheelSpeed( double wheelOmega ). | |
void | StartPID () |
Start the PID Control Thread Calls PhysicalMomentumWheel::StartPID( ). | |
void | StopPID () |
End the PID Control Thread (will be called by the deconstructor) Calls PhysicalMomentumWheel::StopPID( ). | |
void | SetSystemTorque (double wheelTorque) |
Set the old-style torque applied to the wheel Calls PhysicalMomentumWheel::CommandSystemTorque( double wheelTorque ). | |
void | SetWheelSpeedCoefficients (Vector _Coefficients1, Vector _Coefficients2, Vector _Coefficients3, Vector _Coefficients4) |
Set the wheel speed coefficients. The wheel speed coefficients are determined from the characterization of each wheel motor. Calls PhysicalMomentumWheel::SetWheelSpeedCoefficients( Vector _Coefficients1, Vector _Coefficients2, Vector _Coefficients3, Vector _Coefficients4 ). | |
void | SetWheelAddress (int wheeladdress) |
Set the address of the wheel on its daisy chain Calls PhysicalMomentumWheel::SetWheelAddress( int wheelAddress ). | |
void | SetWheelAxis (const Vector &newWheelAxis) |
Set the axis of rotation for the wheel. | |
void | SetChainNumber (int daisyChain) |
Set communications port Calls PhysicalMomentumWheel::SetDaisyChainNumber( int daisyChain ). | |
void | SetPort (string Port) |
Set communications port Calls PhysicalMomentumWheel::SetDaisyChainPort( string DaisyChainPort );. | |
void | SetBiasSpeed (double BiasSpeed) |
Set the bias wheel wheel speed for a Momentum wheel Calls PhysicalMomentumWheel::SetBiasSpeed( double BiasSpeed ). | |
void | SetAxialInertia (double axialInertia) |
Set the axial inertia for a Momentum wheel Calls PhysicalMomentumWheel::SetAxialInertia( double axialInertia ). | |
void | SetWheelTorqueLimits (double torque_limit_low, double torque_limit_high) |
Set the momentum wheel torque limits Calls PhysicalMomentumWheel::SetWheelTorqueLimits( const double& minWheelTorque, const double& maxWheelTorque ). | |
void | SetWheelName (string _wheelName) |
Set the momentum wheel string name Calls PhysicalMomentumWheel::SetWheelName( string _wheelName ). | |
void | GetWheelSpeed (double &Speed, double &measTime) |
Get the current angular speed of the wheel, returns the wheel speed in rad/sec. Calls PhysicalMomentumWheel::GetWheelSpeed( double& Speed, double& measTime ). | |
double | GetWheelTorque () |
Get the current torque output to the wheel, returns the value in N-m. This is not necessarily the torque being applied to the system. This value is determined from the smart motors. Calls PhysicalMomentumWheel::QueryWheelTorque( ). | |
Vector | GetWheelAxis () const |
Get the axis of the wheel, returns a 3x1 vector. | |
int | GetWheelCount () |
Returns an integer representing the total number of momentum wheels instantiated. | |
double | GetAxialInertia () |
Returns a double representing the axial inertia of the wheel in kg-m^2 Calls PhysicalMomentumWheel::GetAxialInertia( ). | |
string | GetWheelName () |
Returns a string representing the wheel name Calls PhysicalMomentumWheel::GetWheelName( ). | |
int | GetWheelFD () |
Get the file desciptor of the wheel. Calls PhysicalMomentumWheel::GetWheelFD( ). | |
double | GetAmps () |
Get the current used by the motor. Calls PhysicalMomentumWheel::GetAmps( ). | |
double | GetVolts () |
Get the voltage at the motor. Calls PhysicalMomentumWheel::GetVolts( ). | |
void | StartWheelSpeedDataLogging () |
Start the wheel speed data collection routine Each wheel's speed query needs to be started individually. The performance occurs when the spart calls for each wheel are spread evenly over sec (value subject to change). | |
void | StopWheelSpeedDataLogging () |
Stop the speed reading routine of the motor. This function does not need to be called a t the end of the program. The thread will be closed automatically when the program ends. | |
virtual int | Initialize () |
Initializes the device for use. | |
bool | IsActive () |
Returns the current state of m_bActiveState. | |
Vector | GetLocation () const |
Returns the physical location of the device with respect to whorl body coordinates. | |
void | SetLocation (const Vector &newDeviceLocation) |
Specify the physical location of the device with respect to whorl body coordinates. | |
Public Attributes | |
map< string, StringValue > | s_mapStringValues |
Map to associate the strings with the enum values. | |
Static Public Attributes | |
const bool | c_bNotActive = false |
a constant bool that is equal to false. | |
const bool | c_bActive = true |
a constant bool that is equal to true. | |
Protected Attributes | |
char * | name |
Private Attributes | |
Vector | m_WheelAxis |
3x1 vector corresponding to the axis normal to the wheel | |
PhysicalMomentumWheel | m_PhysicalMomentumWheel |
Member PhysicalMomentumWheel object. | |
WheelHistory * | m_WheelHistory |
Member WheelHistory in MomentumWheel.h, saving time and wheel speed for for initialized wheel. | |
string | m_LogData |
Member string in MomentumWheel.h, ON or OFF for logging. | |
pthread_t | m_DataSpeedThreadID |
Member pthread for Wheel Speed Data Logging. | |
pthread_mutex_t | m_DataMutex |
Memeber mutex lock variable for Data. | |
int | m_exitConditionData |
Static Private Attributes | |
int | m_WheelCount = 0 |
Static member integer representing the total number of wheels instantiated. | |
Friends | |
void * | DataWheelSpeed (void *arg) |
Friend function split in a new thread that queries the wheel speed repeatedly. It begins running in the StartSpeedQuery function. Velocity by Position: This function determines the velocity of the wheel by differentiating the position reported by the wheel. The function asks the wheel for its position and then gets the time of day at which the measurement is reported. The code then delays for a small time and asks for the position and gets the time again. The velocity is then calculated by dividing the change in position byt he change in time. The return value is the velocity in rev/sec. |
|
Value-Definitions of the different string values.
Definition at line 249 of file MomentumWheel.h. |
|
Default Constructor.
Definition at line 21 of file MomentumWheel.cpp. |
|
Constructor that accepts a cfgBody variable sent from the cfgPars function.
Definition at line 27 of file MomentumWheel.cpp. References Actuator::Initialize(). |
|
Deconstructor.
Definition at line 32 of file MomentumWheel.cpp. References Deinitialize(). |
|
Deinitialize the wheels.
Reimplemented from Device. Definition at line 147 of file MomentumWheel.cpp. References OFF, ON, s_mapStringValues, and StopWheelSpeedDataLogging(). Referenced by main(), and ~MomentumWheel(). |
|
Get the current used by the motor. Calls PhysicalMomentumWheel::GetAmps( ).
Definition at line 313 of file MomentumWheel.cpp. References PhysicalMomentumWheel::GetAmps(), and m_PhysicalMomentumWheel. Referenced by main(). |
|
Returns a double representing the axial inertia of the wheel in kg-m^2 Calls PhysicalMomentumWheel::GetAxialInertia( ).
Definition at line 298 of file MomentumWheel.cpp. References PhysicalMomentumWheel::GetAxialInertia(), and m_PhysicalMomentumWheel. Referenced by Controller::FindMOI_sw(). |
|
Returns the physical location of the device with respect to whorl body coordinates.
Definition at line 75 of file Device.cpp. References O_SESSAME::Vector. |
|
Get the voltage at the motor. Calls PhysicalMomentumWheel::GetVolts( ).
Definition at line 318 of file MomentumWheel.cpp. References PhysicalMomentumWheel::GetVolts(), and m_PhysicalMomentumWheel. Referenced by main(). |
|
Get the axis of the wheel, returns a 3x1 vector.
Definition at line 286 of file MomentumWheel.cpp. References O_SESSAME::Vector. Referenced by Controller::FindA(). |
|
Returns an integer representing the total number of momentum wheels instantiated.
Reimplemented from Actuator. Definition at line 292 of file MomentumWheel.cpp. Referenced by Controller::FindA(), Controller::FindMOI_sw(), and Controller::SetWheelTorque(). |
|
Get the file desciptor of the wheel. Calls PhysicalMomentumWheel::GetWheelFD( ).
Definition at line 308 of file MomentumWheel.cpp. References PhysicalMomentumWheel::GetWheelFD(), and m_PhysicalMomentumWheel. |
|
Returns a string representing the wheel name Calls PhysicalMomentumWheel::GetWheelName( ).
Definition at line 303 of file MomentumWheel.cpp. References PhysicalMomentumWheel::GetWheelName(), and m_PhysicalMomentumWheel. |
|
Get the current angular speed of the wheel, returns the wheel speed in rad/sec. Calls PhysicalMomentumWheel::GetWheelSpeed( double& Speed, double& measTime ).
Definition at line 275 of file MomentumWheel.cpp. References PhysicalMomentumWheel::GetWheelSpeed(), and m_PhysicalMomentumWheel. Referenced by main(), testController::Run(), slidingModeControlMRPMW::Run(), MWCMGController::Run(), MRPTracking::Run(), DefaultController::Run(), and AngularRateController::Run(). |
|
Get the current torque output to the wheel, returns the value in N-m. This is not necessarily the torque being applied to the system. This value is determined from the smart motors. Calls PhysicalMomentumWheel::QueryWheelTorque( ).
Definition at line 281 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::QueryWheelTorque(). |
|
Initializes the device for use.
Reimplemented from Device. Reimplemented in ControlMomentGyro, PhysicalControlMomentGyro, PhysicalMomentumWheel, Thruster, and Relay. Definition at line 28 of file Actuator.cpp. References Device::Initialize(). Referenced by MomentumWheel(). |
|
Initialize the wheels.
Definition at line 41 of file MomentumWheel.cpp. References checkResponse(), TiXmlHandle::Child(), TiXmlHandle::Element(), TiXmlHandle::FirstChild(), PhysicalMomentumWheel::Initialize(), CAMdoubleVector::initialize(), m_DataMutex, m_exitConditionData, m_LogData, m_PhysicalMomentumWheel, m_WheelAxis, m_WheelHistory, OFF, ON, s_mapStringValues, SetAxialInertia(), SetBiasSpeed(), SetChainNumber(), SetPort(), SetWheelAddress(), SetWheelAxis(), SetWheelName(), SetWheelSpeedCoefficients(), SetWheelTorqueLimits(), StartWheelSpeedDataLogging(), and O_SESSAME::Vector. Referenced by main(). |
|
Returns the current state of m_bActiveState.
Definition at line 59 of file Device.cpp. Referenced by Device::Device(). |
|
Set the axial inertia for a Momentum wheel Calls PhysicalMomentumWheel::SetAxialInertia( double axialInertia ).
Definition at line 249 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetAxialInertia(). Referenced by Initialize(). |
|
Set the bias wheel wheel speed for a Momentum wheel Calls PhysicalMomentumWheel::SetBiasSpeed( double BiasSpeed ).
Definition at line 244 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetBiasSpeed(). Referenced by Initialize(). |
|
Set communications port Calls PhysicalMomentumWheel::SetDaisyChainNumber( int daisyChain ).
Definition at line 234 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetDaisyChainNumber(). Referenced by Initialize(). |
|
Specify the physical location of the device with respect to whorl body coordinates.
Definition at line 67 of file Device.cpp. References Device::m_Location, and O_SESSAME::Vector. |
|
Set communications port Calls PhysicalMomentumWheel::SetDaisyChainPort( string DaisyChainPort );.
Definition at line 239 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetDaisyChainPort(). Referenced by Initialize(), and main(). |
|
Set the old-style torque applied to the wheel Calls PhysicalMomentumWheel::CommandSystemTorque( double wheelTorque ).
Definition at line 214 of file MomentumWheel.cpp. References PhysicalMomentumWheel::CommandSystemTorque(), and m_PhysicalMomentumWheel. |
|
Set the address of the wheel on its daisy chain Calls PhysicalMomentumWheel::SetWheelAddress( int wheelAddress ).
Definition at line 224 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetWheelAddress(). Referenced by Initialize(). |
|
Set the axis of rotation for the wheel.
Definition at line 229 of file MomentumWheel.cpp. References m_WheelAxis, and O_SESSAME::Vector. Referenced by Initialize(). |
|
Set the momentum wheel string name Calls PhysicalMomentumWheel::SetWheelName( string _wheelName ).
Definition at line 259 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetWheelName(). Referenced by Initialize(). |
|
Set the desired wheel speed. The wheel controller is running in a thread and this function updates the desired wheel rate value passed to the wheel controller. Calls PhysicalMomentumWheel::CommandWheelSpeed( double wheelOmega ).
Definition at line 198 of file MomentumWheel.cpp. References PhysicalMomentumWheel::CommandWheelSpeed(), m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetWheelSpeed(). Referenced by main(). |
|
Set the wheel speed coefficients. The wheel speed coefficients are determined from the characterization of each wheel motor. Calls PhysicalMomentumWheel::SetWheelSpeedCoefficients( Vector _Coefficients1, Vector _Coefficients2, Vector _Coefficients3, Vector _Coefficients4 ).
Definition at line 264 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, PhysicalMomentumWheel::SetWheelSpeedCoefficients(), and O_SESSAME::Vector. Referenced by Initialize(). |
|
Set the torque applied to the wheel Calls PhysicalMomentumWheel::CommandWheelTorque( double _wheelTorque ).
Definition at line 193 of file MomentumWheel.cpp. References PhysicalMomentumWheel::CommandWheelTorque(), and m_PhysicalMomentumWheel. Referenced by main(), and Controller::SetWheelTorque(). |
|
Set the momentum wheel torque limits Calls PhysicalMomentumWheel::SetWheelTorqueLimits( const double& minWheelTorque, const double& maxWheelTorque ).
Definition at line 254 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::SetWheelTorqueLimits(). Referenced by Initialize(). |
|
Start the PID Control Thread Calls PhysicalMomentumWheel::StartPID( ).
Definition at line 204 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::StartPID(). |
|
Start the speed reading routine of the motor in a separate thread. Calls PhysicalMomentumWheel::StartSpeedQuery( ).
Definition at line 183 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::StartSpeedQuery(). Referenced by main(). |
|
Start the wheel speed data collection routine Each wheel's speed query needs to be started individually. The performance occurs when the spart calls for each wheel are spread evenly over sec (value subject to change).
Definition at line 328 of file MomentumWheel.cpp. References DataWheelSpeed, and m_DataSpeedThreadID. Referenced by Initialize(). |
|
Stop the wheel Calls PhysicalMomentumWheel::Stop( ).
Implements Actuator. Definition at line 170 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::Stop(). Referenced by main(). |
|
End the PID Control Thread (will be called by the deconstructor) Calls PhysicalMomentumWheel::StopPID( ).
Definition at line 209 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::StopPID(). |
|
Stop the speed reading routine of the motor. This function does not need to be called a t the end of the program. Calls PhysicalMomentumWheel::StopSpeedQuery( ) The thread will be closed automatically when the program ends.
Definition at line 188 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::StopSpeedQuery(). |
|
Stop the speed reading routine of the motor. This function does not need to be called a t the end of the program. The thread will be closed automatically when the program ends.
Definition at line 372 of file MomentumWheel.cpp. References m_DataMutex, m_DataSpeedThreadID, and m_exitConditionData. Referenced by Deinitialize(). |
|
Enable torque mode for the wheel motor. Calls PhysicalMomentumWheel::TorqueCommand( int _power ).
Definition at line 176 of file MomentumWheel.cpp. References m_PhysicalMomentumWheel, and PhysicalMomentumWheel::TorqueCommand(). |
|
Friend function split in a new thread that queries the wheel speed repeatedly. It begins running in the StartSpeedQuery function. Velocity by Position: This function determines the velocity of the wheel by differentiating the position reported by the wheel. The function asks the wheel for its position and then gets the time of day at which the measurement is reported. The code then delays for a small time and asks for the position and gets the time again. The velocity is then calculated by dividing the change in position byt he change in time. The return value is the velocity in rev/sec.
Definition at line 334 of file MomentumWheel.cpp. Referenced by StartWheelSpeedDataLogging(). |
|
a constant bool that is equal to true. Used for setting the active state Definition at line 50 of file Device.h. Referenced by Device::Initialize(). |
|
a constant bool that is equal to false. Used for setting the active state. Definition at line 48 of file Device.h. Referenced by Device::Deinitialize(), and Device::Device(). |
|
Memeber mutex lock variable for Data.
Definition at line 280 of file MomentumWheel.h. Referenced by DataWheelSpeed(), Initialize(), and StopWheelSpeedDataLogging(). |
|
Member pthread for Wheel Speed Data Logging.
Definition at line 277 of file MomentumWheel.h. Referenced by StartWheelSpeedDataLogging(), and StopWheelSpeedDataLogging(). |
|
Definition at line 282 of file MomentumWheel.h. Referenced by DataWheelSpeed(), Initialize(), and StopWheelSpeedDataLogging(). |
|
Member string in MomentumWheel.h, ON or OFF for logging.
Definition at line 274 of file MomentumWheel.h. Referenced by Initialize(). |
|
Member PhysicalMomentumWheel object.
Definition at line 267 of file MomentumWheel.h. Referenced by GetAmps(), GetAxialInertia(), GetVolts(), GetWheelFD(), GetWheelName(), GetWheelSpeed(), GetWheelTorque(), Initialize(), SetAxialInertia(), SetBiasSpeed(), SetChainNumber(), SetPort(), SetSystemTorque(), SetWheelAddress(), SetWheelName(), SetWheelSpeed(), SetWheelSpeedCoefficients(), SetWheelTorque(), SetWheelTorqueLimits(), StartPID(), StartSpeedQuery(), Stop(), StopPID(), StopSpeedQuery(), and TorqueCommand(). |
|
3x1 vector corresponding to the axis normal to the wheel
Definition at line 264 of file MomentumWheel.h. Referenced by Initialize(), and SetWheelAxis(). |
|
Static member integer representing the total number of wheels instantiated.
Definition at line 15 of file MomentumWheel.cpp. |
|
Member WheelHistory in MomentumWheel.h, saving time and wheel speed for for initialized wheel.
Definition at line 271 of file MomentumWheel.h. Referenced by Initialize(). |
|
|
|
Map to associate the strings with the enum values.
Definition at line 253 of file MomentumWheel.h. Referenced by Deinitialize(), and Initialize(). |