PSO Window Functions

The PSO Window module lets you configure a range of position values called a window. Each window includes a counter and two comparison values: a lower bound and an upper bound. The window counter tracks one feedback source and changes in real time to respond to the tracked feedback source. In most cases, the output of the PSO Window module is active when the window counter value is greater than or equal to the lower bound and also less than or equal to the upper bound. You can use the output of the PSO Window module to mask events from other modules.

The PSO Window module lets you configure and use two windows at the same time. If you want only one window, use Window 0. If you want two windows, use Window 0 and Window 1. With two windows, the output of each window is combined into one PSO Window module output. This means that the PSO Window module output is active when each window output is active (both window counters are within their respective window bounds).

Optional Purchase Necessary: PSO Window 1 is available only on drives that support two and three dimensional PSO distance tracking, which is a paid option on some drives. Review your ordering information to see the number of dimensions that your drive supports.

The PSO Window module also lets you use the drive array to specify a sequence of window ranges (array mode). The module has many advanced features, such as letting you generate events when entering or exiting a window range.

Configuring the Window Inputs

HARDWARE: When you specify the input to PSO as primary or auxiliary feedback, the drive that you use with PSO will only support encoders that give you incremental feedback. This condition applies to the PsoDistanceConfigureInputs(), PsoTransformationConfigure(), and PsoWindowConfigureInput() functions.

Table: Supported Feedback Types

Input (Enum Values) Feedback Type Encoder Multiplier Options
IncrementalEncoderSquareWave Primary Encoder multiplier options do not apply.
Auxiliary Encoder multiplier options do not apply.
IncrementalEncoderSineWave Primary -MX2, -MX3, and -MX4 (for XR3 drives only)
Auxiliary -MX4 (for XR3 drives only)
AbsoluteEncoderEnDatwithSineWaveIncremental Primary -MX2, -MX3, and -MX4 (for XR3 drives only)
AbsoluteEncoderBiSSwithSineWaveIncremental Primary -MX2, -MX3, and -MX4 (for XR3 drives only)

Use the PsoWindowConfigureInput() function to specify the source of the position feedback signals you want the PSO window counter to track. If you want the window counter to count in the opposite direction of the selected position feedback signals, you can use the $reverseDirection argument. Once you specify a valid input for the window counter, it immediately starts to track the feedback signals. The PSO Window module can track input speeds up to 100 MHz (100,000,000 counts/second).

Use the PsoWindowInput enumeration to select the PSO window tracking input for your drive.

Configuring the Window Ranges

Each PSO window operates by comparing the window counter against a lower bound value and an upper bound value, together known as a range. The PSO Window module activates the output of each window when the corresponding counter is greater than or equal to the lower bound and also less than or equal to the upper bound. You can configure the module to use a single, fixed pair of range values, or an array of window range values from the drive array. To specify a fixed window range, use the PsoWindowConfigureFixedRange() function. The PSO Window module uses the values that you specify in the $lowerBound and $upperBound arguments as the lower and upper bounds of the window range, respectively. The specified window bounds must each be an integer number of counts. If you try to specify a non-integer number of counts, Automation1 Studio reports an error. You can use the Trunc() function to make sure that you specify valid integer window bounds, but this can change your expected window range by very small values.

To specify an array of window ranges, use the PsoWindowConfigureArrayRanges() function. Before you use this function, make sure that you write the number of range pair values specified by the $numberOfRanges argument, in counts, to the drive array starting with the location that you specify with the $driveArrayStartAddress argument. You must write the range pairs to the drive array in sequence, lower bound followed by upper bound. To write values to the drive array to be used as window range pairs, use the DriveArrayWrite() function and specify DriveArrayType.PsoWindowRanges as the $driveArrayType argument.

For more information on writing values to the drive array, see the DriveArrayWrite() function in the Device Functions topic.

When you use window ranges from the drive array, the PSO Window module uses the first specified pair of range values as the active window. When the PSO window counter exits the active window, the module loads the next pair of values from the drive array and uses the pair as the next window range. The module continues to use the values in the drive array in this way until the configured number of ranges is reached. You can use the $enableRepeat argument to tell the module to use an infinite number of drive array values. In this mode, the module returns to the value at the $driveArrayStartAddress and uses the same set of values again after the module uses the last pair of range values in the drive array.

By default, when you use the window ranges from the drive array, the PSO Window module loads the next window range when the counter generates an internal event that is tied to exiting the active window range in either direction. This internal event is always generated upon exiting the window and does not require calling the PsoWindowConfigureEvents() function. If you want the module to load a new window range only when the counter exits the active window in a specific direction, use the PsoWindowConfigureEventDirection() function. Refer to the Controlling the Window Events section for more information about the PsoWindowConfigureEventDirection() function.

The window update direction and the window counter are relative to the encoder direction. The ReverseMotionDirection parameter does not have an effect on them. If the window update direction is negative, then the window is updated when the lower bound is exited. If the window update direction is positive, then the window is updated when the upper bound is exited.

Controlling the Window Counter

You can specify conditions under which the counter will reset to zero by using the PsoWindowConfigureCounterReset() function. You can specify multiple counter reset condition options simultaneously. To do this, set the $optionsMask argument to the bitwise OR of all desired option mask options, as defined in the PsoWindowCounterResetMask enumeration.

You can directly set the PSO window counter to a specified value by using the PsoWindowCounterSetValue() function. Specify the desired value in counts as the $value argument.

Controlling the Window Events

By default, the PSO Window module does not send events to the PSO event module. Optionally, you can use the PsoWindowConfigureEvents() function to configure the module to output events when entering and/or exiting the active window range. Specify the desired behavior for the $eventMode argument by using the PsoWindowEventMode enumeration.

By default, any configured PSO Window module events will be generated regardless of the direction that the counter is counting when it enters or exits the window range. If you want the module to only generate events in a specific direction, use the PsoWindowConfigureEventDirection() function. Note that the event direction that you specify will be applied to both events generated through the PsoWindowConfigureEvents() function as well as the internal events used to load the next window range when you use the PsoWindowConfigureArrayRanges() function. Specify the desired behavior for the $eventDirection argument by using the PsoWindowEventDirection enumeration. For example, you can specify PsoWindowEventDirection.Positive to only allow the module to generate enter events when entering the window by crossing the lower bound of the active range, and/or generate exit events when exiting the window by crossing the upper bound of the active range.

Controlling the Window Output

By default, the PSO window output is disabled and is not active when the counter is within the active range. To enable the output, use the PsoWindowOutputOn() function. Once enabled, the output of the window module will be active when the counter is within the active range.

To return the output to its default disabled state, use the PsoWindowOutputOff() function.

Related Help Pages 

Position Synchronized Output (PSO)