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 with a scalar input to a Coulomb & Viscous Friction block that uses scalar expansion to output a vector.

Double click the friction block to see the parameters. Coefficient of viscous friction (Gain) is a scalar value 2, but Coulomb friction value (Offset) is a vector value [1 3 2 0] . Therefore, 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)$

For example, the first offset 1 is calculated as follows.

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

$y = -11$

If the dimensions for the input and Offset are the same, then no expansion is necessary.

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