List of all members.
Public Member Functions |
| SINGLETON (CQEMotorUser) |
| This internal macro handles instantiation of this class.
|
unsigned int | GetFrequency () |
| Get control frequency for all axes (motors 13, 14, 15 and 16).
|
int | SetFrequency (unsigned int freq) |
| Set control frequency for all axes (motor 13, 14, 15 and 16).
|
virtual Axis_position | GetPosition (unsigned int axis) |
| Get current position of axis.
|
virtual void | GetPositionVector (Axis_position position[]) |
| Get position of all axes as a vector.
|
void | SetPWM (unsigned int axis, int pwm) |
| Set PWM command value of the specified axis.
|
int | GetPWM (unsigned int axis) |
| Get the PWM command value of the specified axis.
|
void | SetPIDVGains (unsigned int axis, unsigned int pGain, unsigned int iGain, unsigned int dGain, unsigned int vGain) |
| Set PID and Velocity feedforward gains.
|
void | Hold (unsigned int axis, bool val) |
| Set the "hold" state of the axis, which determines if the current axis position is actively held stationary or not when there is no movement command.
|
void | Stop (unsigned int axis) |
| Stop the specified axis at its current position.
|
void | SetPosition (unsigned int axis, Axis_position pos) |
| Set the position of the specified axis.
|
long | GetVelocity (unsigned int axis) |
void | GetVelocityVector (long velocity[]) |
void | SetCalibrate (unsigned int axis, unsigned int cal) |
void | SetTiming (unsigned int axis, unsigned int waitInterval) |
bool | GetDone (unsigned int axis) |
void | HandleOffset () |
void | FlushWriteQueue (unsigned int axis) |
void | SetWriteQueueSize (unsigned int size) |
Protected Member Functions |
| CQEMotorUser () |
virtual | ~CQEMotorUser () |
int | ConstructCall (int axis, int findex,...) |
Protected Attributes |
unsigned int | m_servoAxes |
int | m_handle [QEMOT_NUM_MOTORS] |
Detailed Description
CQEMotorUser is the class that interacts directly with the motor control device driver for regular motors 13, 14, 15 and 16.
It performs low-level motor control tasks such as setting control frequency, setting motor PWM, getting motor position and setting PID gain values. To instantiate this class:
And when done with this class, call Release(), for each call to GetPtr() or GetRef():
Constructor & Destructor Documentation
CQEMotorUser::CQEMotorUser |
( |
|
) |
[protected] |
CQEMotorUser::~CQEMotorUser |
( |
|
) |
[protected, virtual] |
Member Function Documentation
int CQEMotorUser::ConstructCall |
( |
int |
axis, |
|
|
int |
findex, |
|
|
|
... | |
|
) |
| | [protected] |
void CQEMotorUser::FlushWriteQueue |
( |
unsigned int |
axis |
) |
|
bool CQEMotorUser::GetDone |
( |
unsigned int |
axis |
) |
|
unsigned int CQEMotorUser::GetFrequency |
( |
|
) |
|
Get control frequency for all axes (motors 13, 14, 15 and 16).
- Returns:
- value expressed in updates per second.
Axis_position CQEMotorUser::GetPosition |
( |
unsigned int |
axis |
) |
[virtual] |
Get current position of axis.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
- Returns:
- the axis position expressed in "ticks". Ticks are an angular unit based on the back-emf constant of the motor.
void CQEMotorUser::GetPositionVector |
( |
Axis_position |
position[] |
) |
[virtual] |
Get position of all axes as a vector.
- Parameters:
-
| position | array of Axis_position where the axis positions will be written. |
int CQEMotorUser::GetPWM |
( |
unsigned int |
axis |
) |
|
Get the PWM command value of the specified axis.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
- Returns:
- the current PWM value ranging between -255 and 255.
long CQEMotorUser::GetVelocity |
( |
unsigned int |
axis |
) |
|
void CQEMotorUser::GetVelocityVector |
( |
long |
velocity[] |
) |
|
void CQEMotorUser::HandleOffset |
( |
|
) |
|
void CQEMotorUser::Hold |
( |
unsigned int |
axis, |
|
|
bool |
val | |
|
) |
| | |
Set the "hold" state of the axis, which determines if the current axis position is actively held stationary or not when there is no movement command.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
| val | true actively holds the current position, false releases axis from active control when there is no movement command. |
void CQEMotorUser::SetCalibrate |
( |
unsigned int |
axis, |
|
|
unsigned int |
cal | |
|
) |
| | |
int CQEMotorUser::SetFrequency |
( |
unsigned int |
freq |
) |
|
Set control frequency for all axes (motor 13, 14, 15 and 16).
It is highly recommended that you not call this method unless you have a a good understanding of how it affects axis control.
- Parameters:
-
| freq | desired control frequency expressed in updates per second. |
- Returns:
- 0 if success, nonzero otherwise.
void CQEMotorUser::SetPIDVGains |
( |
unsigned int |
axis, |
|
|
unsigned int |
pGain, |
|
|
unsigned int |
iGain, |
|
|
unsigned int |
dGain, |
|
|
unsigned int |
vGain | |
|
) |
| | |
Set PID and Velocity feedforward gains.
It is highly recommended that you not call this method unless you have a a good understanding of how it affects axis control.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
| pGain | proportional gain value. |
| iGain | integral gain value. |
| dGain | derivative gain value. |
| vGain | velocity feedforward gain value. |
void CQEMotorUser::SetPosition |
( |
unsigned int |
axis, |
|
|
Axis_position |
pos | |
|
) |
| | |
Set the position of the specified axis.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
| pos | the position to set. |
void CQEMotorUser::SetPWM |
( |
unsigned int |
axis, |
|
|
int |
pwm | |
|
) |
| | |
Set PWM command value of the specified axis.
The PWM value determines the voltage that the motor will receive and hence the motor's speed and torque.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
| pwm | the desired PWM value ranging between -255 and 255. Values outside this range will be limited to the respective maximum or minimum value. |
void CQEMotorUser::SetTiming |
( |
unsigned int |
axis, |
|
|
unsigned int |
waitInterval | |
|
) |
| | |
void CQEMotorUser::SetWriteQueueSize |
( |
unsigned int |
size |
) |
|
This internal macro handles instantiation of this class.
void CQEMotorUser::Stop |
( |
unsigned int |
axis |
) |
|
Stop the specified axis at its current position.
- Parameters:
-
| axis | the axis in question, either 0, 1, 2, or 3, corresponding to motor ports 13, 14, 15, and 16, respectively. |
Member Data Documentation
The documentation for this class was generated from the following files: