#include <emc.hh>
Inheritance diagram for EMC_AXIS_SET_INPUT_SCALE:
Public Methods | |
EMC_AXIS_SET_INPUT_SCALE () | |
void | update (CMS *cms) |
Data Fields | |
double | scale |
double | offset |
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.
|
Definition at line 912 of file emc.hh. 00912 : EMC_AXIS_CMD_MSG(EMC_AXIS_SET_INPUT_SCALE_TYPE, sizeof(EMC_AXIS_SET_INPUT_SCALE)) {}; |
|
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 } |
|
Definition at line 917 of file emc.hh. Referenced by emcTaskIssueCommand().
|
|
Definition at line 917 of file emc.hh. Referenced by emcTaskIssueCommand().
|