flex_configure_camming_master |
Configure Camming Master
Usage
i32 status = flex_configure_camming_master(i32 boardID, i32 axisID, i32 masterResource, f64 masterCycle);
Purpose
Configures the master device for camming operation.
Tip Refer to the Remarks section for information about how the behavior of this function differs between controllers. |
Parameters
Name | Type | Description |
---|---|---|
boardID | i32 | assigned by Measurement & Automation Explorer (MAX) |
axisID | i32 | slave axis to control |
masterResource | i32 | axis, encoder or ADC channel to use as the master |
masterCycle | f64 | repeat period for the master device |
Parameter Discussion
axisID is the slave 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.
masterResource is the axis (NIMC_AXIS1 through NIMC_AXIS30), trajectory generator, encoder (NIMC_ENCODER1 through NIMC_ENCODER30), or ADC channel (NIMC_ADC1 through NIMC_ADC30) to use as the master for this slave axis. A zero (0) value means no master is assigned (default). On motion controllers that support fewer than thirty axes, configuring non-existent resources returns error 70006 (NIMC_badResourceIDOrAxisError). Refer to Axes, Encoders, and ADC Channels, respectively for axis, encoder, and ADC channel resource IDs.
Note axisID and masterResource cannot be the same, because an axis cannot be its own master. |
masterCycle is the repeat period, in user units, for the master device.
Using This Function
Use this function to assign a master axis, encoder, or ADC channel to the slave axis selected for the camming application. Any number of slave axes can have the same master, but each slave axis must have only one master.
Before starting the camming operation, you must configure the master device. Using an axis as the master device allows the slave axis to follow the trajectory generation output of the master axis. This functionality is useful when the master axis is an open-loop system or when using a feedback device (encoder or ADC) as the master, which causes high following error.
You also can use a feedback device, such as an encoder or ADC, as the master device so that any movement made by the master is immediately propagated to the slave.
The master device position is interpreted, or modularized, within the master cycle, which allows the camming operation to repeat continuously as the master device moves. Along with slave positions, the master cycle is used to calculate the camming ratio at any time.
For example, if the master cycle is 5000 and the current master position is 12,500, the master position inside the master cycle is
position = ((12,500 modulus 5,000) = 2,500)
Using the previous master cycle but with a master position of -4000, the master position inside the cycle is
position = ((-4,000 modulus 5,000) = 1,000)
You also can use the Load Camming Parameter function to change the camming cycle at any time.
Refer to the Camming section of the NI-Motion Help for more information about camming operations.
Remarks
This section includes information about how the behavior of this function differs among the controllers that support it.
NI SoftMotion Controller Considerations
The following list includes considerations you must make when you are using this function with the NI SoftMotion Controller:
- The NI SoftMotion Controller does not support using analog feedback as the camming master.