.


Subsampling

Subsampling allows the designer to specify the computation rate for blocks that do not need to be computed every sample. Reduce the computational load on the processor by specifying when to perform computation for specified blocks.

By default, MechaWare performs computation for each MechaWare block every sample period. In some cases, this may not be necessary and the computation could be performed with a lower frequency. By computing the block every other sample or every fourth sample, the computational load on the controller processor is reduced by 50% or 75% respectively.

Each MechaWare block has a SubSampling field that specifies the schedule for the computation of that block. See SubSampling Field below.

To change the subsample code of a block, select the desired schedule from the drop-down. Matlab generates the appropriate number in the Subsample Code field as displayed in the table below:

 
Description Computation Pattern (counted samples are in bold) Subsample Code

EVERY Sample (default)

1 2 3 4 1 2 3 4

0

ODD Samples

1 2 3 4 1 2 3 4

5

EVEN Samples

1 2 3 4 1 2 3 4

10

First of Every 4 Samples

1 2 3 4 1 2 3 4

14

Second of Every 4 Samples

1 2 3 4 1 2 3 4

13

Third of Every 4 Samples

1 2 3 4 1 2 3 4

11

SubSampling Field

The following diagram displays the subsampling field that specifies the schedule for the computation of that block.

Example

Further optimize the computation by specifying which sample a particular block is counted. For example, if the Relation, Compare, and Differentiator blocks only need to be counted once every four samples, you can specify different samples counts to compute each block's data.

In the example below, each block is evaluated on a different sample.

 
Block Subsample
Code
Computation Pattern
(counted samples are in bold)
Relation 14 1 2 3 4 1 2 3 4
Compare 13 1 2 3 4 1 2 3 4
Differentiator 11 1 2 3 4 1 2 3 4

Note: Specifying the same subsample code for a number of blocks might be counterproductive by overloading the computational load on a specific sample count. For example, setting a subsample code of 13 for multiple blocks might overload the controller on the second sample of every four samples.

 

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