-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathContactmodels.m
82 lines (65 loc) · 2.26 KB
/
Contactmodels.m
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
classdef Contactmodels < handle
% 'Contactmodel' is a class containing all properties relevant to contact
% models between a rotor and a stator.
% The resulting object is pass-by-reference.
properties (SetAccess = protected)
name % Name of the contact model
end
properties
mu_k % Friction coefficient
v_0 = 1e-4; % Lower velocity tolerance [m/s]
v_1 = 2e-4; % Upper velocity tolerance [m/s]
calc_ff
end
methods
function obj = Contactmodels(friction_model)
% Constructor function.
% INPUT:
% friction_model: Parameter defining which friction model to use
obj.mu_k = 0.2;
% Assign function handle for the friction model
if strcmp(friction_model, 'ambrosio')
obj.calc_ff = @obj.calc_ff_ambrosio;
elseif strcmp(friction_model, 'none')
obj.calc_ff = @(~, ~) 0;
else
error('Invalid friction model')
end
end
function Ff = calc_ff_ambrosio(obj, Fn, vt_rel)
% Implements the friction model set forth in the article:
% "Influence of the contact–impact force model on the dynamic response
% of multi-body systems"
% In: Proc. IMechE, Year 2006, Volume 220.
% By: Flores, P. and Ambrósio, J. and Claro, J. C. P. and
% Lankarani, H. M.
%
% INPUT:
% Fn: Normal force (scalar)
% vt_rel: Relative tangential velocity
% Dynamical correction coefficient, this makes the friction force
% disappear close to 0 velocity, and introduces a linear increase from
% this 0 niveau to static values
if (obj.v_1 < norm(vt_rel))
n_d = 1;
elseif obj.v_0 < norm(vt_rel) & norm(vt_rel) <= obj.v_1
n_d = (norm(vt_rel) - obj.v_0)/(obj.v_1 - obj.v_0);
elseif norm(vt_rel) <= obj.v_0
n_d = 0;
end
% Magnitude of the friction force (notice the sign follows the velocity)
% | ___ + Ff
% _|_/
% - Ff ___/ |
% -----|----- v
% - 0 +
Ff = Fn * obj.mu_k * sign(vt_rel) * n_d;
end
end
methods (Access = protected)
function print_name(obj)
% Displays the current contact model in the console.
fprintf('Using the %s model.\n', obj.name)
end
end
end % class