Add Z-axis accelerometer and geophone subsystems
This commit is contained in:
parent
3367cabc70
commit
6356b40f5f
BIN
simscape_subsystems/accelerometer_z_axis.slx
Normal file
BIN
simscape_subsystems/accelerometer_z_axis.slx
Normal file
Binary file not shown.
BIN
simscape_subsystems/geophone_z_axis.slx
Normal file
BIN
simscape_subsystems/geophone_z_axis.slx
Normal file
Binary file not shown.
@ -101,15 +101,15 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]].
|
||||
|
||||
*** Initialize Parameters
|
||||
#+begin_src matlab
|
||||
%% Set Sampling Time
|
||||
Ts = args.Ts;
|
||||
Tmax = args.Tmax;
|
||||
%% Set Sampling Time
|
||||
Ts = args.Ts;
|
||||
Tmax = args.Tmax;
|
||||
|
||||
%% Low Pass Filter to filter out the references
|
||||
s = zpk('s');
|
||||
w0 = 2*pi*10;
|
||||
xi = 1;
|
||||
H_lpf = 1/(1 + 2*xi/w0*s + s^2/w0^2);
|
||||
%% Low Pass Filter to filter out the references
|
||||
s = zpk('s');
|
||||
w0 = 2*pi*10;
|
||||
xi = 1;
|
||||
H_lpf = 1/(1 + 2*xi/w0*s + s^2/w0^2);
|
||||
#+end_src
|
||||
|
||||
*** Translation Stage
|
||||
@ -462,6 +462,66 @@ We define some parameters that will be used in the algorithm.
|
||||
save('mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't');
|
||||
#+end_src
|
||||
|
||||
** Z-Axis Geophone
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/initializeZAxisGeophone.m
|
||||
:header-args:matlab+: :comments none :mkdirp yes :eval no
|
||||
:END:
|
||||
<<sec:initializeZAxisGeophone>>
|
||||
|
||||
This Matlab function is accessible [[file:../src/initializeZAxisGeophone.m][here]].
|
||||
|
||||
#+begin_src matlab
|
||||
function [geophone] = initializeZAxisGeophone(args)
|
||||
arguments
|
||||
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
|
||||
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 1 % [Hz]
|
||||
end
|
||||
|
||||
%%
|
||||
geophone.m = args.mass;
|
||||
|
||||
%% The Stiffness is set to have the damping resonance frequency
|
||||
geophone.k = geophone.m * (2*pi*args.freq)^2;
|
||||
|
||||
%% We set the damping value to have critical damping
|
||||
geophone.c = 2*sqrt(geophone.m * geophone.k);
|
||||
|
||||
%% Save
|
||||
save('./mat/geophone_z_axis.mat', 'geophone');
|
||||
end
|
||||
#+end_src
|
||||
|
||||
** Z-Axis Accelerometer
|
||||
:PROPERTIES:
|
||||
:header-args:matlab+: :tangle ../src/initializeZAxisAccelerometer.m
|
||||
:header-args:matlab+: :comments none :mkdirp yes :eval no
|
||||
:END:
|
||||
<<sec:initializeZAxisAccelerometer>>
|
||||
|
||||
This Matlab function is accessible [[file:../src/initializeZAxisAccelerometer.m][here]].
|
||||
|
||||
#+begin_src matlab
|
||||
function [accelerometer] = initializeZAxisAccelerometer(args)
|
||||
arguments
|
||||
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
|
||||
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 5e2 % [Hz]
|
||||
end
|
||||
|
||||
%%
|
||||
accelerometer.m = args.mass;
|
||||
|
||||
%% The Stiffness is set to have the damping resonance frequency
|
||||
accelerometer.k = accelerometer.m * (2*pi*args.freq)^2;
|
||||
|
||||
%% We set the damping value to have critical damping
|
||||
accelerometer.c = 2*sqrt(accelerometer.m * accelerometer.k);
|
||||
|
||||
%% Save
|
||||
save('./mat/accelerometer_z_axis.mat', 'accelerometer');
|
||||
end
|
||||
#+end_src
|
||||
|
||||
* Initialize Elements
|
||||
:PROPERTIES:
|
||||
:ID: a0819dea-8d7a-4d55-b961-2b2ca2312344
|
||||
@ -1311,21 +1371,22 @@ This Matlab function is accessible [[file:../src/initializeSample.m][here]].
|
||||
#+begin_src matlab
|
||||
function [sample] = initializeSample(sample)
|
||||
arguments
|
||||
sample.radius (1,1) double {mustBeNumeric, mustBePositive} = 100
|
||||
sample.height (1,1) double {mustBeNumeric, mustBePositive} = 300
|
||||
sample.mass (1,1) double {mustBeNumeric, mustBePositive} = 50
|
||||
sample.offset (1,1) double {mustBeNumeric} = 0
|
||||
sample.radius (1,1) double {mustBeNumeric, mustBePositive} = 100 % [mm]
|
||||
sample.height (1,1) double {mustBeNumeric, mustBePositive} = 300 % [mm]
|
||||
sample.mass (1,1) double {mustBeNumeric, mustBePositive} = 50 % [kg]
|
||||
sample.freq (1,1) double {mustBeNumeric, mustBePositive} = 100 % [Hz]
|
||||
sample.offset (1,1) double {mustBeNumeric} = 0 % [mm]
|
||||
sample.color (1,3) double {mustBeNumeric} = [0.45, 0.45, 0.45]
|
||||
end
|
||||
|
||||
%%
|
||||
sample.k.x = 1e8;
|
||||
sample.k.x = sample.mass * (2*pi * sample.freq)^2;
|
||||
sample.c.x = 0.1*sqrt(sample.k.x*sample.mass);
|
||||
|
||||
sample.k.y = 1e8;
|
||||
sample.k.y = sample.mass * (2*pi * sample.freq)^2;
|
||||
sample.c.y = 0.1*sqrt(sample.k.y*sample.mass);
|
||||
|
||||
sample.k.z = 1e8;
|
||||
sample.k.z = sample.mass * (2*pi * sample.freq)^2;
|
||||
sample.c.z = 0.1*sqrt(sample.k.z*sample.mass);
|
||||
|
||||
%% Save
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
18
src/initializeZAxisAccelerometer.m
Normal file
18
src/initializeZAxisAccelerometer.m
Normal file
@ -0,0 +1,18 @@
|
||||
function [accelerometer] = initializeZAxisAccelerometer(args)
|
||||
arguments
|
||||
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
|
||||
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 5e2 % [Hz]
|
||||
end
|
||||
|
||||
%%
|
||||
accelerometer.m = args.mass;
|
||||
|
||||
%% The Stiffness is set to have the damping resonance frequency
|
||||
accelerometer.k = accelerometer.m * (2*pi*args.freq)^2;
|
||||
|
||||
%% We set the damping value to have critical damping
|
||||
accelerometer.c = 2*sqrt(accelerometer.m * accelerometer.k);
|
||||
|
||||
%% Save
|
||||
save('./mat/accelerometer_z_axis.mat', 'accelerometer');
|
||||
end
|
18
src/initializeZAxisGeophone.m
Normal file
18
src/initializeZAxisGeophone.m
Normal file
@ -0,0 +1,18 @@
|
||||
function [geophone] = initializeZAxisGeophone(args)
|
||||
arguments
|
||||
args.mass (1,1) double {mustBeNumeric, mustBePositive} = 1e-3 % [kg]
|
||||
args.freq (1,1) double {mustBeNumeric, mustBePositive} = 1 % [Hz]
|
||||
end
|
||||
|
||||
%%
|
||||
geophone.m = args.mass;
|
||||
|
||||
%% The Stiffness is set to have the damping resonance frequency
|
||||
geophone.k = geophone.m * (2*pi*args.freq)^2;
|
||||
|
||||
%% We set the damping value to have critical damping
|
||||
geophone.c = 2*sqrt(geophone.m * geophone.k);
|
||||
|
||||
%% Save
|
||||
save('./mat/geophone_z_axis.mat', 'geophone');
|
||||
end
|
Loading…
Reference in New Issue
Block a user