Newer
Older
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
function [A, B, C, D] = as_model_lin(ks, ku, r, bs, bu, gf, Ts)
% AS_MODEL_LIN(...) Generate linear model matrices for greybox identification
%
% This function is intended to be given to greyest(). Please see
% the source code of as_model_lin() for explanation of what
% its parameters mean.
ms = 2.5;
mu = ms / r;
% explanation of parameters:
% - ks = stiffness of the spring between the upper and lower masses
% - ku = stiffness of the spring between the lower mass and the road platform
% - ms = mass of the upper mass
% - mu = mass of the lower mass
% - r = ratio of ms/mu. This is what is actually optimized - it seems
% that this removes an unconstrained degree of freedom in the
% parameters.
% - bs = coefficient of viscous friction between the upper mass and the guiding rail connected to the base
% - bu = coefficient of viscous friction between the lower mass and the guiding rail connected to the base
% - gf = relative strength of the actuator between lower and upper masses
% !! no static friction here, as it is nonlinear
% explanation of states/inputs/outputs:
% - x(1) = height of the upper mass above the base, minus its idle position
% - x(2) = speed of the upper mass wrt. the base
% - x(3) = height of the lower mass above the base, minus its idle position
% - x(4) = speed of the lower mass wrt. the base
% - u(1) = road height above the base, minus its idle position
% - u(2) = actuator control signal
% - y(1) = x(1)
% - y(2) = x(3)
A = [
0, 1, 0, 0;
-ks/ms, -bs/ms, +ks/ms, 0;
0, 0, 0, 1;
+ks/mu, 0, (-ks-ku)/mu, -bu/mu;
];
B = [
0, 0;
0, +gf/ms;
0, 0;
+ku/mu, -gf/mu;
];
C = [
1, 0, 0, 0;
0, 0, 1, 0;
];
D = [
0, 0;
0, 0;
];
end