flex_enable_axis |
Enable Axis
Usage
status = flex_enable_axis(u8 boardID, u8 reserved, u8 PIDrate, u16 axisMap);
Purpose
Enables the operating axes and defines the PID and trajectory update rate.
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) |
reserved | u8 | unused input |
PIDrate | u8 | PID update rate |
axisMap | u16 | bitmap of axes to enable |
Parameter Discussion
reserved is an unused input. The input value is ignored.
PIDrate is the PID control loop and trajectory generator update rate, for NI 73xx motion controllers. For stepper axes, this parameter also determines how often the step generator is updated. The range for this parameter is 0 to 7, with a default of 3 (250 µs).
Update Rate = (PIDrate + 1) x 62.5 µs
PIDrate | Update Rate |
---|---|
0 | 62.5 µs |
1 | 125 µs |
2 | 188 µs |
3 | 250 µs (default) |
4 | 312 µs |
5 | 375 µs |
6 | 438 µs |
7 | 500 µs |
axisMap is the bitmap of enabled axes.
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 = Axis enabled
0 = Axis disabled (default)
Using This Function
Caution Illegally configured axes cannot be enabled and attempting to do so generates an error. For example, an attempt to enable a servo axis that does not at least have its Primary Feedback device mapped generates an error. |
You can set the update rate slower than the maximum. This is useful in many applications to scale the effective range of the PID control loop parameters and/or to improve stability. Refer to the Load Single PID Parameter function for more information about the PID parameters affected by the update rate.
You cannot change the PID rate when axes are enabled. To change the PID rate from the default (250 µs) while not changing the number of axes enabled, you must disable all axes and then re-enable them with the new PID rate.
Caution If an axis is configured for onboard commutation, the axis attempts to initialize the current phase. Depending on the phase initialization type, this may cause the axis to move. If you disable the axis, the current phase information and the phase initialization occur when you enable the axis. |
Note To use a slower PID rate, set the NIMC_PID_RATE_MULTIPLIER attribute in the Load Advanced Control Parameter function. |
Remarks
This section includes information about how the behavior of this function differs among the controllers that support it.
NI 73xx Controller Considerations
The following list includes considerations you must make when you are using this function with a 73xx motion controller:
- The ADC channel scan rate is affected by the number of channels enabled. This could limit the effective update rate (for axes with analog feedback). Refer to the Enable ADCs function for more information.
This function is used to enable the specific axes required for the application and set the servo (and stepper) update or sample rate. An axis is enabled for operation by a True in the corresponding location in the bitmap. Only enabled axes are updated and there is a direct correspondence between the number of enabled axes and the fastest update rate allowed.
Number of
Enabled Axes
(7330/40/90)Fastest
Update RateNumber of
Enabled Axes
(7350)Fastest
Update Rate1 62 µs 1–2 62 µs 2 125 µs 3–4 125 µs 3 188 µs 5–6 188 µs 4 250 µs 7–8 250 µs The fastest update rate is achievable only when all axes are single-feedback servo axes and no extra encoders are enabled.
Caution Update rates that are too fast for the number of axes, stepper outputs, and/or encoders enabled generates an error and the previous setting remains in effect. Refer to Errors and Error Handling for information about errors and error handling. - The Enable Axis function automatically enables the feedback devices mapped to the enabled axes. It is not necessary to explicitly enable the encoders or ADC channels before enabling the axes. Axes must be killed before they are disabled or the error NIMC_wrongModeError is generated. Refer to the Enable Encoders and Enable ADCs functions for more information about enabling and disabling these resources when you are using them not mapped to an axis.
NI SoftMotion Controller Considerations
The following list includes considerations you must make when you are using this function with the NI SoftMotion Controller:
- Use the Load Axis Configuration Parameter function to enable axes sixteen through thirty.
- It is not necessary to kill, or deactivate, an axis before disabling it.
- When you are using this function with the NI SoftMotion Controller, you can enable axes, but you cannot change the PID rates. To configure the axes on these drives, use the configuration utility that is included with the Copley Controls drive.
- The NI SoftMotion Controller host loop update rates depend on the number of axes in the system as follows:
- 10 ms for a motion control system that uses 1 to 8 axes
- 20 ms for a motion control system that uses 9 to 15 axes
- 30 ms for a motion control system that uses 16 to 23 axes
- 40 ms for a motion control system that uses 24 to 30 axes