.

Proportional Selector

Overview

Overview

The Selector block  proportionally selects two inputs and outputs this selection. This block implements the following equation to proportionally select the two inputs:

Output =  Selector * Input0 + (1-Selector) * Input1

This block allows two main functions, the ability to Mix two signals (similar to a Crossfader on a mixer, switching between two music sources) and smooth transitions between states.

For example, to change the gain of Kp in a control system, an abrupt change might introduce a disturbance large enough to cause instability. However, the selector will work to gradually change Kp.

Example

The following example shows how to calculate the Sine & Cosine of a radian angle stored in UserBuffer[0]. The selector is used to choose the Sine or Cosine calculation output to UserBuffer[2]. UserBuffer[1] is used to select which calculation is chosen.

A BiQuad block with a Lowpass 1Hz filter was added after UserBuffer[1] block, before the selector. This writes an instaneous Zero or One to UserBuffer[1] and the selector takes 1 second to fade from the origin to the destination.

For example: if UserBuffer[1] is originally = 0, the Selector outputs the value of Cos(UserBuffer[0]). If 1 is written to UserBuffer[1] rather than the Selector outputting Sin(UserBuffer[0]), it gradually fades from Cosine to Sine using the equation:

Output =  Selector * Input0 + (1-Selector) * Input1

T(0) = Output = 0 * Sin + 1 * Cos (Our Initial State)
T(0.25) = Output = 0.25*Sin + 0.75 * Cos (0.25 seconds into transition)
T(0.5) = Output = 0.5 * Sin + 0.5 * Cos (0.5 seconds into transition)
T(0.75) = Output = 0.75 * Sin + 0.25 * Cos (0.75 seconds into transition)
T(1) = Output = 1 * Sin + 0 * Cos (Final state of Output)


The configuration values  for this block are as follows:

 
Evaluate Block This block allows you to specify whether the block executes Every Sample, Every Other Sample (Odd or Even), or Every Fourth Sample (and specify the First, Second, Third, or Fourth) or background. This provides greater flexibility in controlling the execution of a model and to preserve performance for other areas of motion control.
User Defined Block Priority When selected, allows you to enter a Priority Code to modify Execution Ordering of this block. For more information, see Block Execution Order and User Defined Block Priority.
Priority For an explanation of how the Priority field is used by the MechaWare Model Downloader, see Block Execution Order and User Defined Block Priority.
User Data 0 Application-specific data. See User Data Storage.
User Data 1 Application-specific data. See User Data Storage.

 

Matlab/Simulink

Simulink Interface

Proportional Selector Parameters Dialog Box

This block has three inputs Input 0, Input 1 and Selector.  The block implements the equation defined in the Overview.  

The block has two user data fields (User Data 0, User Data 1) to store application-specific data for convenient storage and retrieval. See User Data Storage for details.

The block's update schedule is determined by the Evaluate Block. The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:

Proportional Selector Simulink Block

C++ API

SELECTORBlock

Declaration

Public Method

 
class SELECTORBlock: public virtual Block
{
public:
	// User accessible coefficients
};
 

Required Header: mechaware.h

Description

The Selector block computes the proportional selection of two inputs. This block has no configurable parameters.

Methods

Block Methods

See Also

Switch (on Input) | Manual Switch

       Legal Notice  |  Tech Email  |  Feedback
      
Copyright ©
2001-2012 Motion Engineering