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

PhysicalControlMomentGyro Class Reference

#include <PhysicalControlMomentGyro.h>

Inheritance diagram for PhysicalControlMomentGyro:

Inheritance graph
[legend]
Collaboration diagram for PhysicalControlMomentGyro:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class that provides interface to actual hardware CMGs

Definition at line 36 of file PhysicalControlMomentGyro.h.

Public Member Functions

 PhysicalControlMomentGyro ()
virtual ~PhysicalControlMomentGyro ()
void CommandWheelSpeed (double wheelOmega)
void CommandWheelTorque (double wheelTorque)
void CommandAngle (double wheelAngle)
void CommandGimbalRate (double gimbalRate)
int Stop ()
int Initialize ()
int Deinitialize ()
void SetWheelSpeedLimits (double minWheelSpeed, double maxWheelSpeed)
void SetWheelTorqueLimits (double minWheelTorque, double maxWheelTorque)
void SetMaxTorqueStep (double maxTorqueStep)
void SetDaisyChainNumber (int DaisyChainNumber)
void SetDaisyChainPort (string Port)
double QueryWheelSpeed ()
double QueryWheelTorque ()
double QueryAngle ()
void GetWheelSpeedLimits (double &minWheelSpeed, double &maxWheelSpeed)
void GetWheelTorqueLimits (double &minWheelTorque, double &maxWheelTorque)
void GetMaxTorqueStep (double &maxTorqueStep)
virtual int GetWheelCount ()
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.

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 Member Functions

void GoCommand (int Address)
void FindLimits ()

Private Attributes

double m_CurrentWheelSpeed
double m_CurrentWheelTorque
double m_CurrentAngle
double m_CurrentLAVelocity
double m_CurrentLAAcceleration
int m_LAMax
int m_LAMin
int m_LAMid
int m_WheelAddress
int m_LAAddress
string m_DaisyChainPort
int m_DaisyChainNumber
double m_MaxWheelSpeed
double m_MinWheelSpeed
double m_MaxWheelTorque
double m_MinWheelTorque
double m_MaxTorqueStep

Static Private Attributes

int m_fd = -1


Constructor & Destructor Documentation

PhysicalControlMomentGyro::PhysicalControlMomentGyro  ) 
 

Default Constructor

Definition at line 22 of file PhysicalControlMomentGyro.cpp.

PhysicalControlMomentGyro::~PhysicalControlMomentGyro  )  [virtual]
 

Default Deconstructor

Definition at line 26 of file PhysicalControlMomentGyro.cpp.

References Stop().


Member Function Documentation

void PhysicalControlMomentGyro::CommandAngle double  wheelAngle  ) 
 

Set the angle of the wheel axis with respect to its center position

Parameters:
wheelAngle Desired wheel axis angle in radians

Definition at line 73 of file PhysicalControlMomentGyro.cpp.

References GoCommand(), m_CurrentAngle, m_fd, m_LAAddress, m_LAMid, and say().

Referenced by ControlMomentGyro::SetAngle().

void PhysicalControlMomentGyro::CommandGimbalRate double  gimbalRate  ) 
 

Set the gimbal angle rate of the CMG

Parameters:
gimbalRate Desired gimbal angel rate of the CMG in rad/sec

Definition at line 100 of file PhysicalControlMomentGyro.cpp.

References GoCommand(), m_fd, m_LAAddress, and say().

Referenced by ControlMomentGyro::SetGimbalRate().

void PhysicalControlMomentGyro::CommandWheelSpeed double  wheelOmega  ) 
 

Set angular velocity of the CMG wheel

Parameters:
wheelOmega Desired angular velocity of the CMG wheel in rad/sec

Definition at line 37 of file PhysicalControlMomentGyro.cpp.

References GoCommand(), m_fd, m_WheelAddress, and say().

Referenced by ControlMomentGyro::SetWheelSpeed(), and Stop().

void PhysicalControlMomentGyro::CommandWheelTorque double  wheelTorque  ) 
 

Set torque output to the CMG wheel

Parameters:
wheelTorque Desired output torque in N-m

Definition at line 53 of file PhysicalControlMomentGyro.cpp.

References m_CurrentWheelTorque, m_fd, m_WheelAddress, and say().

Referenced by ControlMomentGyro::SetWheelTorque(), and Stop().

int PhysicalControlMomentGyro::Deinitialize  )  [virtual]
 

Deinitialize all components of the CMG

Reimplemented from Device.

Definition at line 252 of file PhysicalControlMomentGyro.cpp.

References m_fd.

Referenced by ControlMomentGyro::Deinitialize().

void PhysicalControlMomentGyro::FindLimits  )  [private]
 

Private function used to initialize the the linear actuator by finding its upper and lower limits and then repositioning itself to the center of its travel

Definition at line 444 of file PhysicalControlMomentGyro.cpp.

References GoCommand(), hear(), m_fd, m_LAAddress, m_LAMax, m_LAMid, m_LAMin, and say().

Referenced by Initialize().

Vector Device::GetLocation  )  const [inherited]
 

Returns the physical location of the device with respect to whorl body coordinates.

Returns:
Physical center of the device [x,y,z]^T (meters).

Definition at line 75 of file Device.cpp.

References O_SESSAME::Vector.

void PhysicalControlMomentGyro::GetMaxTorqueStep double &  maxTorqueStep  ) 
 

Sets maxTorqueStep to the maximun allowable chang in torque values

Definition at line 428 of file PhysicalControlMomentGyro.cpp.

virtual int Actuator::GetWheelCount  )  [inline, virtual, inherited]
 

Reimplemented in MomentumWheel.

Definition at line 27 of file Actuator.h.

void PhysicalControlMomentGyro::GetWheelSpeedLimits double &  minWheelSpeed,
double &  maxWheelSpeed
 

Get the angular velocity limts of the CMG wheel

Parameters:
minWheelSpeed Set to the minimum speed limit of the CMG wheel
maxWheelSpeed Set to the maximum speed limit of the CMG wheel

Definition at line 414 of file PhysicalControlMomentGyro.cpp.

void PhysicalControlMomentGyro::GetWheelTorqueLimits double &  minWheelTorque,
double &  maxWheelTorque
 

Get the torque output limts to the CMG wheel

Parameters:
minWheelTorque Set to the minimum torque output to the CMG wheel
maxWheelTorque Set to the maximum torque output to the CMG wheel

Definition at line 421 of file PhysicalControlMomentGyro.cpp.

void PhysicalControlMomentGyro::GoCommand int  Address  )  [private]
 

Private member function to send a Go command to the smart motor

Parameters:
Address Is either the CMG wheel address of the lineasr actuator address

Definition at line 434 of file PhysicalControlMomentGyro.cpp.

References m_fd, and say().

Referenced by CommandAngle(), CommandGimbalRate(), CommandWheelSpeed(), FindLimits(), and Initialize().

int PhysicalControlMomentGyro::Initialize  )  [virtual]
 

Initialize all components of the CMG

Reimplemented from Actuator.

Definition at line 139 of file PhysicalControlMomentGyro.cpp.

References FindLimits(), GoCommand(), init_serial(), m_DaisyChainPort, m_fd, m_LAAddress, m_WheelAddress, and say().

Referenced by ControlMomentGyro::Initialize().

bool Device::IsActive  )  [inherited]
 

Returns the current state of m_bActiveState.

Author:
Andrew Turner
Date:
March 25, 1999 This member function is used to inspect the state of the device External Methods Called: None Assumptions: None

Definition at line 59 of file Device.cpp.

Referenced by Device::Device().

double PhysicalControlMomentGyro::QueryAngle  ) 
 

Get the current angle of the CMG wheel axis with respect ot its center position, returns a double in radians

Definition at line 389 of file PhysicalControlMomentGyro.cpp.

References hear(), m_CurrentAngle, m_fd, m_LAAddress, and say().

Referenced by ControlMomentGyro::GetAngle().

double PhysicalControlMomentGyro::QueryWheelSpeed  ) 
 

Get the angular velocity of the CMG wheel, returns a double in rad/sec

Definition at line 298 of file PhysicalControlMomentGyro.cpp.

References hear(), m_CurrentWheelSpeed, m_fd, m_WheelAddress, and say().

Referenced by ControlMomentGyro::GetWheelSpeed().

double PhysicalControlMomentGyro::QueryWheelTorque  ) 
 

Get the current torque output to the CMG wheel, returns a double in N-m

Definition at line 363 of file PhysicalControlMomentGyro.cpp.

References hear(), m_CurrentWheelTorque, m_fd, m_WheelAddress, and say().

Referenced by ControlMomentGyro::GetWheelTorque().

void PhysicalControlMomentGyro::SetDaisyChainNumber int  DaisyChainNumber  ) 
 

Set which daisy chain the CMG is located on

Definition at line 284 of file PhysicalControlMomentGyro.cpp.

References m_DaisyChainNumber.

Referenced by ControlMomentGyro::ControlMomentGyro().

void PhysicalControlMomentGyro::SetDaisyChainPort string  Port  ) 
 

Set the port to which the CMG is plugged into

Parameters:
Port A string contaaining the name of the proper port, S0 for serial 1, USB1 for usb port 2, etc

Definition at line 289 of file PhysicalControlMomentGyro.cpp.

References m_DaisyChainPort.

Referenced by ControlMomentGyro::ControlMomentGyro(), ControlMomentGyro::Initialize(), and ControlMomentGyro::SetPort().

void Device::SetLocation const Vector newDeviceLocation  )  [inherited]
 

Specify the physical location of the device with respect to whorl body coordinates.

Parameters:
newDeviceLocation Physical center of the device [x,y,z]^T (meters).

Definition at line 67 of file Device.cpp.

References Device::m_Location, and O_SESSAME::Vector.

void PhysicalControlMomentGyro::SetMaxTorqueStep double  maxTorqueStep  ) 
 

Set the maximum change in torque outputs

Parameters:
maxTorqueStep The maximum allowable change between two consecutive torque outputs in N-m

Definition at line 279 of file PhysicalControlMomentGyro.cpp.

References m_MaxTorqueStep.

void PhysicalControlMomentGyro::SetWheelSpeedLimits double  minWheelSpeed,
double  maxWheelSpeed
 

Set the maximum and minimum angular speeds of the CMG wheel

Parameters:
minWheelSpeed Minimum allowable CMG wheel speed
maxWheelSpeed Maximum allowable CMG wheel speed

Definition at line 265 of file PhysicalControlMomentGyro.cpp.

References m_MaxWheelSpeed, and m_MinWheelSpeed.

void PhysicalControlMomentGyro::SetWheelTorqueLimits double  minWheelTorque,
double  maxWheelTorque
 

Set the maximum and minimum torque outputs to the CMG wheel

Parameters:
minWheelTorque Minimum allowable CMG torque output
maxWheelTorque Maximum allowable CMG torque output

Definition at line 272 of file PhysicalControlMomentGyro.cpp.

References m_MaxWheelTorque, and m_MinWheelTorque.

Referenced by ControlMomentGyro::ControlMomentGyro().

int PhysicalControlMomentGyro::Stop  )  [virtual]
 

Stop the CMG wheel

Implements Actuator.

Definition at line 131 of file PhysicalControlMomentGyro.cpp.

References CommandWheelSpeed(), and CommandWheelTorque().

Referenced by ControlMomentGyro::Stop(), and ~PhysicalControlMomentGyro().


Member Data Documentation

const bool Device::c_bActive = true [static, inherited]
 

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().

const bool Device::c_bNotActive = false [static, inherited]
 

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().

double PhysicalControlMomentGyro::m_CurrentAngle [private]
 

Double for the current angle of the wheel axis with respect to its center position in radians

Definition at line 142 of file PhysicalControlMomentGyro.h.

Referenced by CommandAngle(), and QueryAngle().

double PhysicalControlMomentGyro::m_CurrentLAAcceleration [private]
 

Double holding the acceleration of the LA

Definition at line 148 of file PhysicalControlMomentGyro.h.

double PhysicalControlMomentGyro::m_CurrentLAVelocity [private]
 

Double holding the current LA velocity

Definition at line 145 of file PhysicalControlMomentGyro.h.

double PhysicalControlMomentGyro::m_CurrentWheelSpeed [private]
 

Double for the current wheel speed in rad/sec

Definition at line 136 of file PhysicalControlMomentGyro.h.

Referenced by QueryWheelSpeed().

double PhysicalControlMomentGyro::m_CurrentWheelTorque [private]
 

double for the current wheel torque output in N-m

Definition at line 139 of file PhysicalControlMomentGyro.h.

Referenced by CommandWheelTorque(), and QueryWheelTorque().

int PhysicalControlMomentGyro::m_DaisyChainNumber [private]
 

THe number of the daisy chain that the CMG is on

Definition at line 172 of file PhysicalControlMomentGyro.h.

Referenced by SetDaisyChainNumber().

string PhysicalControlMomentGyro::m_DaisyChainPort [private]
 

String holding the port to which the CMG is connected

Definition at line 169 of file PhysicalControlMomentGyro.h.

Referenced by Initialize(), and SetDaisyChainPort().

int PhysicalControlMomentGyro::m_fd = -1 [static, private]
 

Static integer representing the file descriptor for talking to the CMG

Definition at line 16 of file PhysicalControlMomentGyro.cpp.

Referenced by CommandAngle(), CommandGimbalRate(), CommandWheelSpeed(), CommandWheelTorque(), Deinitialize(), FindLimits(), GoCommand(), Initialize(), QueryAngle(), QueryWheelSpeed(), and QueryWheelTorque().

int PhysicalControlMomentGyro::m_LAAddress [private]
 

THe integer address of the LA

Definition at line 163 of file PhysicalControlMomentGyro.h.

Referenced by CommandAngle(), CommandGimbalRate(), FindLimits(), Initialize(), and QueryAngle().

int PhysicalControlMomentGyro::m_LAMax [private]
 

the maximum position count of the LA

Definition at line 151 of file PhysicalControlMomentGyro.h.

Referenced by FindLimits().

int PhysicalControlMomentGyro::m_LAMid [private]
 

The position count at mid-travel for the LA

Definition at line 157 of file PhysicalControlMomentGyro.h.

Referenced by CommandAngle(), and FindLimits().

int PhysicalControlMomentGyro::m_LAMin [private]
 

the minimum position count of the LA

Definition at line 154 of file PhysicalControlMomentGyro.h.

Referenced by FindLimits().

double PhysicalControlMomentGyro::m_MaxTorqueStep [private]
 

MAximum allowable change in consecutive torque values

Definition at line 187 of file PhysicalControlMomentGyro.h.

Referenced by SetMaxTorqueStep().

double PhysicalControlMomentGyro::m_MaxWheelSpeed [private]
 

MAximun allowable wheel speed in rad/sec

Definition at line 175 of file PhysicalControlMomentGyro.h.

Referenced by SetWheelSpeedLimits().

double PhysicalControlMomentGyro::m_MaxWheelTorque [private]
 

Maximum torque output to the wheel in N-m

Definition at line 181 of file PhysicalControlMomentGyro.h.

Referenced by SetWheelTorqueLimits().

double PhysicalControlMomentGyro::m_MinWheelSpeed [private]
 

Minimum allowable wheel speed in rad/sec

Definition at line 178 of file PhysicalControlMomentGyro.h.

Referenced by SetWheelSpeedLimits().

double PhysicalControlMomentGyro::m_MinWheelTorque [private]
 

Minimum torque output to the wheel in N-m

Definition at line 184 of file PhysicalControlMomentGyro.h.

Referenced by SetWheelTorqueLimits().

int PhysicalControlMomentGyro::m_WheelAddress [private]
 

THe integer address of the CMG wheel

Definition at line 160 of file PhysicalControlMomentGyro.h.

Referenced by CommandWheelSpeed(), CommandWheelTorque(), Initialize(), QueryWheelSpeed(), and QueryWheelTorque().

char* Device::name [protected, inherited]
 

Definition at line 56 of file Device.h.


The documentation for this class was generated from the following files:
Generated on Wed Sep 5 12:54:41 2007 for DSACSS Operational Code by  doxygen 1.3.9.1