.

Matrix Gain

Overview

Overview

The Matrix Gain block is used to output a weighted sum of the Observer block’s states.  The matrix gain block can only be connected to the states output of the observer block.  The output of the matrix gain block is a double, and can be connected to any of the other mechaware blocks. 

The weighting of the states is specified by a file that contains the weighting coefficients.  The length of the matix gain block is k, where k is the order of the observer that the matrix gain block is connected to.  The maximum order of an observer is 16 (defined by MEIXmpMaxObserverSize), and this is also the maximum length of the matrix gain block. 

The coefficients for this block are as follows:

 

Matrix Gain(.txt)

The file name of a text file containing the coefficients.  This is a 1 X k array where k is the order of the observer.

Ts

Sample period of the filter algorithm. This is the cycle time of the BiQuad block in Simulink simulation. This value has no effect on the BiQuad execution on the controller.

Subsample Code

A code which determines the schedule for updating this block (every sample, even samples only, etc.) See Subsampling.

User Data 0 Application-specific data. See User Data Storage.
User Data 1 Application-specific data. See User Data Storage.

 

Matlab/Simulink

Simulink Interface

Matrix Gain Simulink Block

The Matrix Gain block is used to output a weighted sum of the Observer block’s states.  The matrix gain block can only be connected to the states output of the observer block.  The output of the matrix gain block is a double, and can be connected to any of the other mechaware blocks. 

The weighting of the observer states is specified by the file specified by the Matrix Gain parameter in the block’s simulink parameter listing (see below). 

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 Subsample Code (See Subsampling). The following Parameter Dialog Box can be opened by double-clicking on the block in a Simulink Model:

Matrix Gain Parameters Dialog Box

C++ API

MATRIXGAINBlock

Declaration

Public Method

 
MATRIXGAINBlock&   MATRIXGAIN();
 

Required Header: mechaware.h

Description

The Matrix Gain block is used to output a weighted sum of the Observer block’s states.  The length of the matrix gain block is specified by Length, and it is the order of the observer block that the matrix gain block is connected.  The Coefficients of the matrix gain block are specified by the coefficient registers.   

Parameters

 

long

MATRIXGAIN().Length

Order of the MATRIXGAIN BLOCK.  Maximum order is 16

double

MATRIXGAIN().Coeff[]

The coefficients of the matrix gain block.  These are multiplied by the internal states of the observer’s, X array to create the weighted sum of the observer’s state’s.  The maximum array size is 16 (defined by  MEIXmpMaxObserverSize)

Methods

Block Methods

See Also

Observer

 

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