Main Content

Coulomb and Viscous Friction

Model discontinuity at zero, with linear gain elsewhere

  • Coulomb and Viscous Friction block

Libraries:
Simulink / Discontinuities
HDL Coder / Discontinuities

Description

The Coulomb and Viscous Friction block models Coulomb (static) and viscous (dynamic) friction. The block models a discontinuity at zero and a linear gain otherwise.

The block output matches the MATLAB® result for:

y = sign(x) .* (Gain .* abs(x) + Offset)

where y is the output, x is the input, Gain is the signal gain for nonzero input values, and Offset is the Coulomb friction.

The block accepts one input and generates one output. The input can be a scalar, vector, or matrix with real and complex elements.

  • For a scalar input, Gain and Offset can have dimensions that differ from the input. The output is a scalar, vector, or matrix depending on the dimensions of Gain and Offset.

  • For a vector or matrix input, Gain and Offset must be scalar or have the same dimensions as the input. The output is a vector or matrix of the same dimensions as the input.

Examples

expand all

This example shows a model that provides a scalar input to a Coulomb & Viscous Friction block. The Coulomb & Viscous Friction uses scalar expansion to produce a vector output.

Double click the Coulomb & Viscous Friction block to see the parameters. The Coefficient of viscous friction (Gain) parameter has a scalar value of 2, and the Coulomb friction value (Offset) parameter has a vector value of [1 3 2 0]. Because the dimensions of the input and the dimensions of the offset are different, the block uses element-wise scalar expansion to compute the output.

Each output is calculated using this formula.

$y = sign(x) .* (Gain .* abs(x) + Offset(idx))$

For example, this equation shows the calculation for the first offset, 1.

$y = - * ((2 * 5) + 1)$

$y = -11$

No scalar expansion is necessary if the input and offset have the same dimensions.

Ports

Input

expand all

The input signal to the model of Coulomb and viscous friction.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Output

expand all

The output signal calculated by applying the friction models to the input.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | fixed point

Parameters

expand all

To edit the parameters for the Coulomb and Viscous Friction block, double-click the block icon.

Specify the offset that applies to all input values.

Programmatic Use

Block Parameter: offset
Type: character vector
Value: real values
Default: '[1 3 2 0]'

Specify the signal gain for nonzero input values.

Programmatic Use

Block Parameter: gain
Type: character vector
Value: real values
Default: '1'

Block Characteristics

Data Types

double | fixed point | integer | single

Direct Feedthrough

yes

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

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

PLC Code Generation
Generate Structured Text code using Simulink® PLC Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced before R2006a