libximc  2.14.20
Working with user units

In addition to working in basic units(steps, encoder value), the library allows you to work with user units. For this purpose are used:

The structure of the conversion units calibration_t

To specify conversion of the basic units in the user and back, calibration_t structure is used. With the help of coefficients A and MicrostepMode, specified in this structure, steps and microsteps which are integers are converted into the user value of the real type and back.

Conversion formulas:

Alternative functions for working with user units and data structures for them

Structures and functions for working with user units have the _calb postfix. The user using these functions can perform all actions in their own units without worrying about the computations of the controller. The data format of _calb structures is described in detail. For _calb functions particular descriptions are not used. They perform the same actions as the basic functions do. The difference between them and the basic functions is in the position, velocity, and acceleration of the data types defined as user-defined. If clarification for _calb functions is necessary, they are provided as notes in the description of the basic functions.

Coordinate correction table for more accurate positioning

Some functions for working with user units support coordinate transformation using a correction table. To load a table from a file, the load_correction_table() function is used. Its description contains the functions and their data supporting correction.

Note
For data fields which are corrected in case of loading of the table in the description of the field is written - corrected by the table.

File format:

Sample file:

     X  dX
     0  0
     5.0        0.005
     10.0       -0.01