flex_enable_gearing

NI-Motion Functions

flex_enable_gearing

Device Compatibility

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

Enable Gearing

Usage

status = flex_enable_gearing(u8 boardID, u16 gearMap);

Purpose

Enables slave axes for master-slave gearing.

Tip  Refer to the Remarks section for information about how the behavior of this function differs between controllers.

Parameters

Name Type Description
boardID u8 assigned by Measurement & Automation Explorer (MAX)
gearMap u16 bitmap of slave axes to enable for gearing

Parameter Discussion

gearMap is the bitmap of slave axes to enable for gearing.

D15 ...  D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0
Axis 15 ... Axis 10 Axis 9 Axis 8 Axis 7 Axis 6 Axis 5 Axis 4 Axis 3 Axis 2 Axis 1 0

D1 through D15:
   1 = Gearing enabled
   0 = Gearing disabled (default)

Using This Function

This function enables and disables master-slave gearing functionality of slave axes. When gearing is enabled, the positions of the slave axes and their corresponding masters are recorded as their absolute gearing reference. For axes and encoders, the current position is the value recorded. For ADCs, the binary value is recorded. From then on, as long as the gear ratio remains absolute, every incremental change of a master position is multiplied by the corresponding absolute gear ratio and applied to the slave axis. Refer to the Load Gear Ratio function for more information about absolute versus relative gear ratios.

Note  Changing the absolute gear ratio causes the slave axes to jump to a new position specified by the new gear ratio. With servo motor systems the slave jumps immediately. With stepper systems, if the new slave position is within 4,000 steps, it jumps to the new position. Otherwise, the slave axis waits until the commanded slave position moves to within 4,000 steps and then jumps to the new position. The slave axis then resumes following the master axis according to the gear ratio.

You must call the Configure Gear Master and Load Gear Ratio functions prior to enabling master-slave gearing. In addition, you must enable and activate the slave axes before enabling gearing. An error is generated if a slave is killed when gearing is enabled. These checks ensure that the slave axis enables in a controlled fashion.

Note  If you are running a slave axis move with a stepper axis, it is possible that the slave axis geared velocity exceeds the maximum step rate of the controller. In this case, the controller kills the axis and sets the following error status to true. Refer to the Specifications section of your controller user manual for the maximum step rate of your controller.

You can call this function at any time to disable gearing or to re-enable gearing with new absolute gearing reference positions. If gearing is disabled on a moving axis, the axis immediately stops but remains active. If the slave axis was also implementing a superimposed move, the superimposed move decelerates to a stop.

Executing the Stop Motion function on a slave axis stops the axis and automatically disables gearing for that axis. If the master trips on following error, the slave halt stops and disables gearing. Find Reference cannot be executed on slave axes with gearing enabled. An error is generated and the find sequence does not start.

Note  National Instruments recommends disabling gearing before resetting the position of the master axis or the slave axis. When the position of either the master axis or the slave axis is reset, the reset offset is treated as gearing offset, and the slave axis jumps to the new gear position in one PID period.

Remarks

This section includes information about how the behavior of this function differs among the controllers that support it.

NI SoftMotion Controller Considerations

To enable gearing on axes sixteen through thirty, use the Enable Gearing Single Axis function.