flex_load_velocity_filter_parameter |
Load Velocity Filter Parameter
Usage
status = flex_load_velocity_filter_parameter(u8 boardID, u8 axis, u16 filterDistance, u16 filterTime, u8 inputVector);
Purpose
Loads the velocity filter parameters and sets the velocity threshold, above which an axis is considered running.
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) |
axis | u8 | axis to control |
filterDistance | u16 | number of position changes necessary for a velocity to be reported |
filterTime | u16 | filter time constant in ms |
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.
filterDistance is the number of position changes in counts/steps necessary for a velocity to be reported. The range for this parameter is from 0 to 1000 counts/steps. A value of 0 turns off the velocity filter.
filterTime is the maximum velocity update period in ms. The range for this parameter is 1 to 2500 ms.
inputVector contains the distance and interval parameters that are the source of the 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 configures the internal filter for velocity reporting. The reported velocity can oscillate due to feedback quantization error, noise, and jittery systems, rendering the data useless. You can apply a filter over multiple data samples to calculate an average velocity that reflects the actual system behavior. This filter is represented by filterDistance. The larger the filterDistance, the more position changes accumulate to perform velocity calculation. This is usually better for a noisy system.
A large filterDistance can introduce a longer delay in velocity reporting as the position changes accumulate. To limit this delay and sluggish data reading, specify a minimum update interval using the filterTime parameter. The axis velocity is updated within this update interval if the filterDistance requirement is not met.
Note Velocity quantization noise is a measurement-only phenomenon and does not affect the ability of the motion controller to accurately control velocity and position during a move. |
Note This function expects the parameters to be loaded in the following order if onboard variables are used: filterDistance, filterTime. |
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:
- For the inputVector parameter, the NI SoftMotion Controller supports only the immediate return vector (0XFF).