Main Content

Ramp

Generate signal that follows input value bound by rising or falling slope

Since R2023b

  • Ramp block

Libraries:
AUTOSAR Blockset / Classic Platform / Library Routines / Math Operations

Description

The Mathematical Floating point Library (MFL) Ramp block generates a signal that starts at a specified value and changes by a specified rate until the value of the input signal is reached. The block parameters Rise slope, Fall slope, Initial condition, and Sample time, and the input signal u determine the characteristics of the output signal.

When you select the AUTOSAR 4.0 Code Replacement Library (CRL) for your AUTOSAR model, your model replaces code that you generate for this block with calls to the following AUTOSAR library routines:

  • Mfl_Ramp_InitState

  • Mfl_Ramp_SetParam

  • Mfl_RampCalc

  • Mfl_RampOut_f32

Ports

Input

expand all

Input signal used to generate ramp signal, specified as a scalar.

Data Types: single

Option to reset the output signal to the initial condition, specified as a scalar.

Dependencies

To enable this port, select the Show reset port parameter.

Data Types: Boolean

The rate at which the output signal is increased, specified as a scalar.

Dependencies

To enable this port, set the Source field of the Rise slope parameter to Input port.

Data Types: single

The rate at which the output signal is decreased, specified as a scalar.

Dependencies

To enable this port, set the Source field of the Fall Slope parameter to Input port.

Data Types: single

Output

expand all

Output signal, returned as a scalar.

Data Types: single

Parameters

expand all

Specify the Source field of this parameter as one the following values.

  • Dialog — Set the slope using the Value field of this parameter.

  • Input port — Set the slope using the rs port. The block uses the value from this port as the slope.

Programmatic Use

Block Parameter: RiseSlope
Type: character vector
Values: real finite nonnegative values
Default: '1'

Programmatic Use

Block Parameter: RiseSlopeSource
Type: character vector
Values: 'Dialog' | 'Input port'
Default: 'Dialog'

Specify the Source field of this parameter as one the following values.

  • Dialog — Set the slope using the Value field of this parameter.

  • Input port — Set the slope using the fs port. The block uses the value from this port as the slope.

Programmatic Use

Block Parameter: FallSlope
Type: character vector
Values: real finite nonnegative values
Default: '1'

Programmatic Use

Block Parameter: FallSlopeSource
Type: character vector
Values: 'Dialog' | 'Input Port'
Default: 'Dialog'

Enable the R input port.

Programmatic Use

Block Parameter: ShowResetPort
Type: character vector
Values: 'off' | 'on'
Default: 'off'

The initial condition of the output signal, specified as a double. The default is 0.

When Show reset port is selected, the initial condition is set to the value specified in the Initial Condition parameter.

Programmatic Use

Block Parameter: InitialCondition
Type: character vector
Values: real finite values
Default: '0'

Specify the sample period in seconds.

For more information specifying discrete sample times, see Specify Sample Time.

Programmatic Use

Block Parameter: SampleTime
Type: character vector
Values: real finite values
Default: '-1'

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2023b