My Project
|
#include <Encoder.h>
Public Member Functions | |
Encoder (gcp::util::Axis::Type axis) | |
void | reset () |
void | setZero (double zero) |
void | setSlewRate (long rate) |
void | setCountsPerTurn (int per_turn) |
void | setCountsPerRadian (double countsPerRadian) |
void | setLimits (long min, long max) |
void | setLimits (gcp::util::Angle &min, gcp::util::Angle &max) |
gcp::util::Axis::Type | getAxis () |
void | convertMountToEncoder (double angle, double rate, PmacAxis *axis, int current) |
void | applyLimits (double angle, double rate, PmacAxis *axis, double current) |
void | updateMountLimits () |
double | getMountMin () |
double | getMountMax () |
signed | getSlewRate () |
double | convertCountsToSky (int count) |
double | convertAngleToSky (gcp::util::Angle &angle) |
gcp::util::Angle | convertSkyToAngle (gcp::util::Angle sky) |
void | packZero (signed *s_elements) |
void | packCountsPerTurn (signed *s_elements) |
void | packLimits (signed *s_elements) |
Objects of the following type are used to aggregate the encoder calibration parameters of each axis.
Encoder::Encoder | ( | gcp::util::Axis::Type | axis | ) |
Constructor
....................................................................... Constructor sets the axis this object represents
void Encoder::applyLimits | ( | double | angle, |
double | rate, | ||
PmacAxis * | axis, | ||
double | current | ||
) |
Applies the limits to the axis values
....................................................................... Apply Limits
double Encoder::convertCountsToSky | ( | int | count | ) |
Convert from encoder counts to radians on the sky
....................................................................... Convert from encoder counts to radians on the sky
void Encoder::convertMountToEncoder | ( | double | angle, |
double | rate, | ||
PmacAxis * | axis, | ||
int | current | ||
) |
Convert from radians to encoder values on a given axis
....................................................................... Convert from Mount coordinates (radians, radians/sec) to encoder counts and rates.
If the encoder limits cover a turn or more, then the requested position can always be reached. In fact, because of the overlap regions of the drive, a given angle may correspond to more than one encoder position. We want to choose the one that is closest to the current position of the drive. Start by determining the distance between our preliminary encoder position and the current encoder position on this axis.
Axis::Type Encoder::getAxis | ( | ) |
Return the axis type of this encoder
double Encoder::getMountMax | ( | ) |
Get the mount maximum.
double Encoder::getMountMin | ( | ) |
Get the mount minimum.
signed Encoder::getSlewRate | ( | ) |
Get the slew rate.
void Encoder::packCountsPerTurn | ( | signed * | s_elements | ) |
Pack this encoder multiplier for archival in the register database.
....................................................................... Pack this encoder multiplier for archival in the register database.
void Encoder::packLimits | ( | signed * | s_elements | ) |
Method for packing data to be archived in the register database
....................................................................... Pack encoder limits for archival in the register database
void Encoder::packZero | ( | signed * | s_elements | ) |
Pack encoder zero points for archival in the register database.
....................................................................... Pack encoder zero points for archival in the register database.
void Encoder::reset | ( | ) |
Reset the parameters of this object
....................................................................... Reset internal members of this object
void Encoder::setCountsPerRadian | ( | double | countsPerRadian | ) |
Set the counts per radian for this encoder.
....................................................................... Set the counts per radian for this encoder.
void Encoder::setCountsPerTurn | ( | int | countsPerTurn | ) |
Set the counts per turn for this encoder.
....................................................................... Set the counts per turn for this encoder.
void Encoder::setLimits | ( | long | min, |
long | max | ||
) |
Set the limits.
....................................................................... Install new encoder (count) limits
void Encoder::setLimits | ( | gcp::util::Angle & | min, |
gcp::util::Angle & | max | ||
) |
....................................................................... Install new encoder (count) limits
void Encoder::setSlewRate | ( | long | rate | ) |
Set the slew rate.
....................................................................... Set the slew rate for this axis
void Encoder::setZero | ( | double | zero | ) |
Set the zero point of this encoder.
....................................................................... Set the encoder count at the zero point of this axis
void Encoder::updateMountLimits | ( | ) |
Update the mount limits.
....................................................................... Update the mount limits.