-
Notifications
You must be signed in to change notification settings - Fork 164
/
GenerateStribeckFrictionTable.mo
32 lines (31 loc) · 1.35 KB
/
GenerateStribeckFrictionTable.mo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
within Modelica.Mechanics.Translational.Examples.Utilities;
function GenerateStribeckFrictionTable
"Generate Stribeck friction table for example Friction for the SupportFriction"
extends Modelica.Icons.Function;
input Real F_prop(final unit="N.s/m", final min=0)
"Velocity dependent friction coefficient";
input Modelica.SIunits.Force F_Coulomb
"Constant friction: Coulomb force";
input Modelica.SIunits.Force F_Stribeck "Stribeck effect";
input Real fexp(final unit="s/m", final min=0) "Exponential decay";
input Real v_max "Generate table from v=0 ... v_max";
input Integer nTable(min=2) = 100 "Number of table points";
output Real table[nTable, 2] "Friction table";
algorithm
for i in 1:nTable loop
table[i, 1] := v_max*(i - 1)/(nTable - 1);
table[i, 2] := F_Coulomb + F_prop*table[i, 1] + F_Stribeck*Modelica.Math.exp(-fexp*
table[i, 1]);
end for;
annotation (Documentation(info="<html>
<p>
Returns a table with the friction characteristic
table[nTable, 2] = [0, f1; …; v_max, fn],
where the first column is the velocity v in the range 0 … v_max
and the second column is the friction force according to the Stribeck curve:
</p>
<blockquote><pre>
f = F_Coulomb + F_prop*v + F_Stribeck*exp(-fexp*v);
</pre></blockquote>
</html>"));
end GenerateStribeckFrictionTable;