EncoderPositionSensor Class Reference

A sensor reading a single Encoder and converting the counter to a physical unit, with support for calibration. More...

#include <EncoderPositionSensor.hpp>

List of all members.

Public Member Functions

 EncoderPositionSensor (EncoderInterface *_enc, double _unit_to_inc, double _minpos, double _maxpos)
 Create a new EncoderInterface to SensorInterface Object.
virtual int readSensor (double &p) const
void limit (double _min, double _max)
 Set the minimal and maximal position.
void calibrationPosition (double pos)
 Set the calibration position of this encoder.
void calibrationDirection (double dir)
 Set the direction in which the calibration will be done.
virtual void calibrate ()
virtual void unCalibrate ()
virtual bool isCalibrated () const
virtual double readSensor () const
virtual double maxMeasurement () const
virtual double minMeasurement () const
virtual double zeroMeasurement () const
double calibrate (double calpos, double sign)
 Calibrate the Axis with a given calibration position and direction of the movement.

Detailed Description

A sensor reading a single Encoder and converting the counter to a physical unit, with support for calibration.

Definition at line 45 of file EncoderPositionSensor.hpp.


Constructor & Destructor Documentation

EncoderPositionSensor ( EncoderInterface *  _enc,
double  _unit_to_inc,
double  _minpos,
double  _maxpos 
) [inline]

Create a new EncoderInterface to SensorInterface Object.

Parameters:
_enc The Encoder to use
_unit_to_inc Conversion of physical units to increments (eg increments / mm )
_minpos The minimal, physical position, after calibration
_maxpos The maximal, physical position, after calibration

Definition at line 65 of file EncoderPositionSensor.hpp.


Member Function Documentation

double calibrate ( double  calpos,
double  sign 
) [inline]

Calibrate the Axis with a given calibration position and direction of the movement.

A calibration position is defined by a positionGet() == 0 (thus, the encoder count is zero), for any turn turnGet() == k. You may call this method only when the encoder is no more than a turn distance away from the intended calibration point. After calibration, readSensor() == cal_pos and isCalibrated() == true .

         * ...|..........|..........|..........| : | = turn increment, . = position increment/decrement
         *    ^turn==N-1 ^ turn==N  ^ turn==N+1
         *               ^ calpos = x mm
         *     |-------------------|  : valid range physical position when calling this method.
         *
         *            ---->           : passed calpos during positive movement, sign = +1
         *            <----           : passed calpos during negative movement, sign = -1
         * 
Parameters:
calpos The physical position of the calibrated zero position counter.
sign Is the calpos left or right from the current position. (meaning : write +1 if you were moving with a positive velocity, write -1 if you were moving with a negative velocity.)
Returns:
The change in position caused by this calibration.

Definition at line 170 of file EncoderPositionSensor.hpp.

void calibrationDirection ( double  dir  )  [inline]

Set the direction in which the calibration will be done.

See also:
calibrate()
Parameters:
dir A positive or negative value.

Definition at line 102 of file EncoderPositionSensor.hpp.

void calibrationPosition ( double  pos  )  [inline]

Set the calibration position of this encoder.

See also:
calibrate()
Parameters:
pos The value the encoder will read out on a calibrated position.

Definition at line 91 of file EncoderPositionSensor.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 15:05:28 2010 for OrocosComponentLibrary by  doxygen 1.6.3