Skip to Main Content Skip to Search
Product Documentation

Saturation - Limit range of signal

Library

Discontinuities

Description

The Saturation block imposes upper and lower limits on an input signal.

When the input is...Where...The block output is the...

Within the range specified by the Lower limit and Upper limit parameters

Lower limit ≤ Input value ≤ Upper limitInput value

Less than the Lower limit parameter

Input value < Lower limitLower limit

Greater than the Upper limit parameter

Input value > Upper limitUpper limit

When the Lower limit and Upper limit parameters have the same value, the block output is that value.

Data Type Support

The Saturation block accepts real signals of the following data types:

For more information, see Data Types Supported by Simulink in the Simulink documentation.

Parameters and Dialog Box

The Main pane of the Saturation block dialog box appears as follows:

The Signal Attributes pane of the Saturation block dialog box appears as follows:

Show data type assistant

Display the Data Type Assistant.

Settings

The Data Type Assistant helps you set the Output data type parameter.

See Specifying Block Output Data Types for more information.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Upper limit

Specify the upper bound on the input signal.

Settings

Default: 0.5

Minimum: value from the Output minimum parameter

Maximum: value from the Output maximum parameter

Tip

Command-Line Information

See Block-Specific Parameters for the command-line information.

Lower limit

Specify the lower bound on the input signal.

Settings

Default: -0.5

Minimum: value from the Output minimum parameter

Maximum: value from the Output maximum parameter

Tips

Command-Line Information

See Block-Specific Parameters for the command-line information.

Treat as gain when linearizing

Select this parameter to cause the linearization commands to treat the gain as 1

Settings

Default: On

On

Select to cause the linearization commands to treat the gain as 1.

Off

Clear to cause the linearization commands to treat the gain as 0.

Tips

Linearization commands in Simulink software treat this block as a gain in state space.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Enable zero-crossing detection

Select to enable zero-crossing detection. For more information, see Zero-Crossing Detection.

Settings

Default: On

On

Enable zero-crossing detection.

Off

Do not enable zero-crossing detection.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Sample time (-1 for inherited)

Enter the discrete interval between sample time hits or specify another appropriate sample time such as continuous or inherited.

Settings

Default: -1

By default, the block inherits its sample time based upon the context of the block within the model. To set a different sample time, enter a valid sample time based upon the table in Types of Sample Time.

See also How to Specify the Sample Time in the online documentation for more information.

Command-Line Information

See Block-Specific Parameters for the command-line information.

Lock output data type setting against changes by the fixed-point tools

Select to lock the output data type setting of this block against changes by the Fixed-Point Tool and the Fixed-Point Advisor.

Settings

Default: Off

On

Locks the output data type setting for this block.

Off

Allows the Fixed-Point Tool and the Fixed-Point Advisor to change the output data type setting for this block.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

For more information, see Fixed-Point Tool and Fixed-Point Advisor in the Simulink Fixed Point documentation.

Integer rounding mode

Specify the rounding mode for fixed-point operations.

Settings

Default: Floor

Ceiling

Rounds both positive and negative numbers toward positive infinity. Equivalent to the MATLAB ceil function.

Convergent

Rounds number to the nearest representable value. If a tie occurs, rounds to the nearest even integer. Equivalent to the Fixed-Point Toolbox convergent function.

Floor

Rounds both positive and negative numbers toward negative infinity. Equivalent to the MATLAB floor function.

Nearest

Rounds number to the nearest representable value. If a tie occurs, rounds toward positive infinity. Equivalent to the Fixed-Point Toolbox nearest function.

Round

Rounds number to the nearest representable value. If a tie occurs, rounds positive numbers toward positive infinity and rounds negative numbers toward negative infinity. Equivalent to the Fixed-Point Toolbox round function.

Simplest

Automatically chooses between round toward floor and round toward zero to generate rounding code that is as efficient as possible.

Zero

Rounds number toward zero. Equivalent to the MATLAB fix function.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

For more information, see Rounding in the Simulink Fixed Point User's Guide.

Output minimum

Specify the minimum value that the block should output.

Settings

Default: [] (unspecified)

This number must be a finite real double scalar value.

Simulink uses the minimum to perform:

Command-Line Information

See Block-Specific Parameters for the command-line information.

Output maximum

Specify the maximum value that the block should output.

Settings

Default: [] (unspecified)

This number must be a finite real double scalar value.

Simulink uses the maximum value to perform:

Command-Line Information

See Block-Specific Parameters for the command-line information.

Output data type

Specify the output data type.

Settings

Default: Inherit: Same as input

Inherit: Inherit via back propagation

Use data type of the driving block.

Inherit: Same as input

Use data type of input signal.

double

Output data type is double.

single

Output data type is single.

int8

Output data type is int8.

uint8

Output data type is uint8.

int16

Output data type is int16.

uint16

Output data type is uint16.

int32

Output data type is int32.

uint32

Output data type is uint32.

fixdt(1,16,0)

Output data type is fixed point fixdt(1,16,0).

fixdt(1,16,2^0,0)

Output data type is fixed point fixdt(1,16,2^0,0).

<data type expression>

Use a data type object, for example, Simulink.NumericType.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying Block Output Data Types in the Simulink User's Guide for more information.

Mode

Select the category of data to specify.

Settings

Default: Inherit

Inherit

Inheritance rules for data types. Selecting Inherit enables a second menu/text box to the right. Select one of the following choices:

  • Inherit via back propagation

  • Same as input (default)

Built in

Built-in data types. Selecting Built in enables a second menu/text box to the right. Select one of the following choices:

  • double (default)

  • single

  • int8

  • uint8

  • int16

  • uint16

  • int32

  • uint32

Fixed point

Fixed-point data types.

Expression

Expressions that evaluate to data types. Selecting Expression enables a second menu/text box to the right, where you can enter the expression.

Dependency

Clicking the Show data type assistant button enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Using the Data Type Assistant in the Simulink User's Guide.

Signedness

Specify whether you want the fixed-point data as signed or unsigned.

Settings

Default: Signed

Signed

Specify the fixed-point data as signed.

Unsigned

Specify the fixed-point data as unsigned.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Word length

Specify the bit size of the word that holds the quantized integer.

Settings

Default: 16

Minimum: 0

Maximum: 32

Dependencies

Selecting Mode > Fixed point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Scaling

Specify the method for scaling your fixed-point data to avoid overflow conditions and minimize quantization errors.

Settings

Default: Best precision

Binary point

Specify binary point location.

Slope and bias

Enter slope and bias.

Best precision

Specify best-precision values.

Dependencies

Selecting Mode > Fixed point enables this parameter.

Selecting Binary point enables:

Selecting Slope and bias enables:

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Fraction length

Specify fraction length for fixed-point data type.

Settings

Default: 0

Binary points can be positive or negative integers.

Dependencies

Selecting Scaling > Binary point enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Slope

Specify slope for the fixed-point data type.

Settings

Default: 2^0

Specify any positive real number.

Dependencies

Selecting Scaling > Slope and bias enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Bias

Specify bias for the fixed-point data type.

Settings

Default: 0

Specify any real number.

Dependencies

Selecting Scaling > Slope and bias enables this parameter.

Command-Line Information

See Block-Specific Parameters for the command-line information.

See Also

See Specifying a Fixed-Point Data Type in the Simulink User's Guide for more information.

Examples

The sldemo_boiler model shows how you can use the Saturation block.

The Saturation block appears in the Boiler Plant model/digital thermometer/ADC subsystem.

The ADC subsystem digitizes the input analog voltage by:

For more information, see Exploring the Fixed-Point "Bang-Bang Control" Model in the Stateflow documentation.

Characteristics

Direct Feedthrough

Yes

Sample Time

Specified in the Sample time parameter

Scalar Expansion

Yes, of parameters and input

Dimensionalized

Yes

Zero-Crossing Detection

Yes, if enabled.

See Also

Saturation Dynamic

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS