flex_load_torque_offset

NI-Motion Functions

flex_load_torque_offset

Device Compatibility

Device Compatibility
7330
Y
7340
Y
7344
Y
7350
Y
7390
Y
NI SoftMotion Controller for CANopen—Xenus
N
NI SoftMotion Controller for CANopen—Accelnet
N

Load Torque Offset

Usage

status = flex_load_torque_offset(u8 boardID, u8 axis, i16 primaryOffset, i16 secondaryOffset, u8 inputVector);

Purpose

Loads primary and secondary DAC torque offsets for an axis.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
axis u8 axis to control
primaryOffset i16 offset for primary DAC
secondaryOffset i16 offset for secondary DAC
inputVector u8 source of the data for this function

Parameter Discussion

axis is the axis to control. Valid values are NIMC_AXIS1 through NIMC_AXIS30. On motion controllers that support fewer than thirty axes, configuring non-existent axes returns error –70006 (NIMC_badResourceIDOrAxisError). Refer to Axes for axis resource IDs.

primaryOffset is the primary DAC torque (or velocity) offset. The offset range is –32,768 to +32,767 (–10 V to +10 V) with a default value of 0 (0 V).

secondaryOffset is the secondary DAC torque (or velocity) offset. The offset range is –32,768 to +32,767.

Note  The offset value must be within the range limits set by the Load Torque Limit function.

inputVector contains the primary and secondary parameters that are the source of data for this function.

Available input vectors include immediate (0xFF), variable (0x01 through 0x78), or indirect variable (0x81 through 0xF8). Refer to Input and Return Vectors for more detailed information.

Using This Function

This function loads offset values for the DACs mapped to the selected servo axis. This function has no effect on stepper axes or independent DAC outputs that are not mapped to an axis. When a DAC is connected to a velocity block servo amplifier, the torque offset functions as a velocity offset.

A torque (or velocity) offset shifts the DAC output(s) by the programmed offset value without requiring any action from the PID loop. In a servo system, this can be used to overcome amplifier input offsets, system imbalances, or the effects of outside forces such as gravity. Different torque offsets can be loaded for the primary and secondary DAC.

Note  When an axis is killed, its DAC outputs are zeroed regardless of the torque offset loaded.

DAC offsets can be used in conjunction with DAC range limits to interface to servo amplifiers with unipolar input ranges (for example, 0 to 5 V or 0 to 10 V).

Example

Calling the Load Torque Offset function with primaryOffset = 4,096 and secondaryOffset = 0 shifts the output ranges of the primary DAC mapped to the axis as shown in the following figure.

The result of this function call is to limit the primary DAC to a range of –8.75 V to +10 V with an offset or null value of +1.25 V. This is because even when the PID loop is commanding full negative torque, the torque offset is added and the resulting output is –8.75 V. In the positive direction, the DAC cannot go above +10 V no matter what the offset is.

The function call leaves the secondary DAC offset at its default value of zero (0). This example assumes the full torque range is available and not limited by the Load Torque Limit function.

Note  The offset value must be within the range limits set by the Load Torque Limit function.