forked from modelica/ModelicaStandardLibrary
-
Notifications
You must be signed in to change notification settings - Fork 1
/
PartialFriction.mo
112 lines (106 loc) · 5.3 KB
/
PartialFriction.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
within Modelica.Mechanics.Rotational.Interfaces;
partial model PartialFriction "Partial model of Coulomb friction elements"
// parameter SI.AngularVelocity w_small=1 "Relative angular velocity near to zero (see model info text)";
parameter SI.AngularVelocity w_small=1.0e10
"Relative angular velocity near to zero if jumps due to a reinit(..) of the velocity can occur (set to low value only if such impulses can occur)"
annotation (Dialog(tab="Advanced"));
// Equations to define the following variables have to be defined in subclasses
SI.AngularVelocity w_relfric
"Relative angular velocity between frictional surfaces";
SI.AngularAcceleration a_relfric
"Relative angular acceleration between frictional surfaces";
//SI.Torque tau "Friction torque (positive, if directed in opposite direction of w_rel)";
SI.Torque tau0 "Friction torque for w_relfric=0 and forward sliding";
SI.Torque tau0_max "Maximum friction torque for w_relfric=0 and locked";
Boolean free "= true, if frictional element is not active";
// Equations to define the following variables are given in this class
Real sa(final unit="1")
"Path parameter of friction characteristic tau = f(a_relfric)";
Boolean startForward(start=false, fixed=true)
"= true, if w_relfric=0 and start of forward sliding";
Boolean startBackward(start=false, fixed=true)
"= true, if w_relfric=0 and start of backward sliding";
Boolean locked(start=false) "= true, if w_rel=0 and not sliding";
constant Integer Unknown=3 "Value of mode is not known";
constant Integer Free=2 "Element is not active";
constant Integer Forward=1 "w_relfric > 0 (forward sliding)";
constant Integer Stuck=0
"w_relfric = 0 (forward sliding, locked or backward sliding)";
constant Integer Backward=-1 "w_relfric < 0 (backward sliding)";
Integer mode(
final min=Backward,
final max=Unknown,
start=Unknown,
fixed=true)
"Mode of friction (-1: backward sliding, 0: stuck, 1: forward sliding, 2: inactive, 3: unknown)";
protected
constant SI.AngularAcceleration unitAngularAcceleration=1
annotation (HideResult=true);
constant SI.Torque unitTorque=1 annotation (HideResult=true);
equation
/* Friction characteristic
locked is introduced to help the Modelica translator determining
the different structural configurations,
if for each configuration special code shall be generated
*/
startForward = pre(mode) == Stuck and (sa > tau0_max/unitTorque or pre(
startForward) and sa > tau0/unitTorque) or pre(mode) == Backward and
w_relfric > w_small or initial() and (w_relfric > 0);
startBackward = pre(mode) == Stuck and (sa < -tau0_max/unitTorque or pre(
startBackward) and sa < -tau0/unitTorque) or pre(mode) == Forward and
w_relfric < -w_small or initial() and (w_relfric < 0);
locked = not free and not (pre(mode) == Forward or startForward or pre(
mode) == Backward or startBackward);
a_relfric/unitAngularAcceleration = if locked then 0 else if free then sa
else if startForward then sa - tau0_max/unitTorque else if
startBackward then sa + tau0_max/unitTorque else if pre(mode) ==
Forward then sa - tau0_max/unitTorque else sa - sign(w_relfric)*tau0_max/unitTorque;
/* Friction torque "tau" has to be defined in a subclass. Example for possible
realization of a clutch utilizing interpolation by ExternalCombiTable1D see:
Modelica.Mechanics.Rotational.Components.Clutch
*/
// finite state machine to determine configuration
mode = if free then Free else (if (pre(mode) == Forward or pre(mode) ==
Free or startForward) and w_relfric > 0 then Forward else if (pre(mode)
== Backward or pre(mode) == Free or startBackward) and w_relfric < 0
then Backward else Stuck);
annotation (Documentation(info="<html>
<p>
Basic model for Coulomb friction that models the stuck phase in a reliable way.
</p>
<p>
This procedure is implemented in a "clean" way
by state events and leads to a mixed continuous/discrete
system of equations if friction elements are dynamically coupled
which has to be solved by appropriate numerical methods.
The method is described in [Otter1999]
(see also a short sketch in
<a href=\"modelica://Modelica.Mechanics.Rotational.UsersGuide.ModelingOfFriction\">UsersGuide.ModelingOfFriction</a>).
</p>
<p>
The parameter <code>w_small</code> is introduced for particular
cases where a reinit is triggered at zero velocity.
For such – rather rare – cases the friction handling
logic is no longer correct. On the other hand, introducing
<code>w_small</code> in general leads to problems when more
friction elements are connected together. To omit such problems
in the most common situations, the parameter has a large
value per default, thus eliminating its effect.
The user has to <strong>set <code>w_small</code> to
a small value only when</strong> the special case with
<strong>reinit occurs</strong>.
</p>
<h4>References</h4>
<table border=\"0\" cellspacing=\"0\" cellpadding=\"2\">
<tr>
<td>[Otter1999]</td>
<td>Otter M., Elmqvist H., and Mattsson S.E.,
"<a href=\"https://ieeexplore.ieee.org/document/808640\">Hybrid
Modeling in Modelica based on the Synchronous Data Flow Principle</a>",
<em>CACSD'99</em>,
Aug. 22.-26, Hawaii 1999.
</td>
</tr>
</table>
</html>"));
end PartialFriction;