File tree Expand file tree Collapse file tree 2 files changed +36
-5
lines changed
src/Mechanical/Translational Expand file tree Collapse file tree 2 files changed +36
-5
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ include("components.jl")
21
21
export Force, Position, Velocity, Acceleration
22
22
include (" sources.jl" )
23
23
24
- export ForceSensor, PositionSensor
24
+ export ForceSensor, PositionSensor, AccelerationSensor
25
25
include (" sensors.jl" )
26
26
27
27
end
Original file line number Diff line number Diff line change @@ -5,8 +5,8 @@ Linear 1D force input sensor.
5
5
6
6
# Connectors:
7
7
8
- - `flange`: 1-dim. translational flange
9
- - `output`: real output
8
+ - `flange`: 1-dim. translational flange
9
+ - `output`: real output
10
10
"""
11
11
@mtkmodel ForceSensor begin
12
12
@components begin
@@ -30,8 +30,8 @@ Linear 1D position input sensor.
30
30
31
31
# Connectors:
32
32
33
- - `flange`: 1-dim. translational flange
34
- - `output`: real output
33
+ - `flange`: 1-dim. translational flange
34
+ - `output`: real output
35
35
"""
36
36
@mtkmodel PositionSensor begin
37
37
@components begin
@@ -49,3 +49,34 @@ Linear 1D position input sensor.
49
49
flange. f ~ 0.0
50
50
end
51
51
end
52
+
53
+ """
54
+ AccelerationSensor(; name)
55
+
56
+ Linear 1D position input sensor.
57
+
58
+ # States:
59
+
60
+ - `a`: [m/s^2] measured acceleration
61
+
62
+ # Connectors:
63
+
64
+ - `flange`: 1-dim. translational flange
65
+ - `output`: real output
66
+ """
67
+ @mtkmodel AccelerationSensor begin
68
+ @components begin
69
+ flange = MechanicalPort ()
70
+ output = RealOutput ()
71
+ end
72
+
73
+ @variables begin
74
+ a (t) = 0.0
75
+ end
76
+
77
+ @equations begin
78
+ a ~ D (flange. v)
79
+ output. u ~ a
80
+ flange. f ~ 0.0
81
+ end
82
+ end
You can’t perform that action at this time.
0 commit comments