Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

EMC_AXIS_SET_INPUT_SCALE Class Reference

#include <emc.hh>

Inheritance diagram for EMC_AXIS_SET_INPUT_SCALE:

Inheritance graph
[legend]
Collaboration diagram for EMC_AXIS_SET_INPUT_SCALE:

Collaboration graph
[legend]

Public Methods

 EMC_AXIS_SET_INPUT_SCALE ()
void update (CMS *cms)

Data Fields

double scale
double offset

Detailed Description

Change the scale factor and offset for the position input. This command sets the same value as the INPUT_SCALE parameter in the ".ini" file. These two values are the scale and offset factors for the axis input from the raw feedback device, e.g., an incremental encoder. The second value (offset) is subtracted from raw input (e.g., encoder counts), and divided by the first value (scale factor), before being used as feedback. The units on the scale value are in raw units (e.g., counts) per user units (e.g., inch). The units on the offset value are in raw units(e.g., counts).

Specifically, when reading inputs, the EMC first reads the raw sensor values. The units on these values are the sensor units, typically A/D counts, or encoder ticks. These units, and the location of their 0 value, will not in general correspond to the quasi-SI units used in the EMC. * Hence a scaling is done immediately upon sampling:

input = (raw - offset) / scale

The value for scale can be obtained analytically by doing a unit analysis, i.e., units are [sensor units]/[desired input SI units]. For example, on a 2000 counts per rev encoder, and 10 revs/inch gearing, and desired units of mm, we have

[scale units] = 2000 [counts/rev] * 10 [rev/inch] * 1/25.4 [inch/mm] [scale units] = 787.4 counts/mm

and, as a result,

input [mm] = (encoder [counts] - offset [counts]) / 787.4 [counts/mm]

Note that the units of the offset are in sensor units, e.g., counts, and they are pre-subtracted from the sensor readings. The value for this offset is obtained by finding the value of counts for which you want your user units to read 0.0. This is normally accomplished automatically during a homing procedure.

Note that using this command to change the scale is not a good idea once things have gotten underway, since the axis will jump servo to the "new" position, the gains will no longer be appropriate, etc.

Definition at line 909 of file emc.hh.


Constructor & Destructor Documentation

EMC_AXIS_SET_INPUT_SCALE::EMC_AXIS_SET_INPUT_SCALE   [inline]
 

Definition at line 912 of file emc.hh.


Member Function Documentation

void EMC_AXIS_SET_INPUT_SCALE::update CMS *    cms
 

Reimplemented from EMC_AXIS_CMD_MSG.

Definition at line 1631 of file emc.cc.

01632 {
01633 
01634         EMC_AXIS_CMD_MSG::update(cms);
01635         cms->update(scale);
01636         cms->update(offset);
01637 
01638 }


Field Documentation

double EMC_AXIS_SET_INPUT_SCALE::offset
 

Definition at line 917 of file emc.hh.

Referenced by emcTaskIssueCommand().

double EMC_AXIS_SET_INPUT_SCALE::scale
 

Definition at line 917 of file emc.hh.

Referenced by emcTaskIssueCommand().


The documentation for this class was generated from the following files:
Generated on Sun Dec 2 15:28:47 2001 for EMC by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001