diff --git a/simscape_subsystems/accelerometer_z_axis.slx b/simscape_subsystems/accelerometer_z_axis.slx new file mode 100644 index 0000000..074ea76 Binary files /dev/null and b/simscape_subsystems/accelerometer_z_axis.slx differ diff --git a/simscape_subsystems/geophone_z_axis.slx b/simscape_subsystems/geophone_z_axis.slx new file mode 100644 index 0000000..c4742c8 Binary files /dev/null and b/simscape_subsystems/geophone_z_axis.slx differ diff --git a/simscape_subsystems/index.org b/simscape_subsystems/index.org index 66fa113..3504e9d 100644 --- a/simscape_subsystems/index.org +++ b/simscape_subsystems/index.org @@ -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: +<> + +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: +<> + +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 diff --git a/simscape_subsystems/nano_hexapod_F.slx b/simscape_subsystems/nano_hexapod_F.slx index f430125..6332b66 100644 Binary files a/simscape_subsystems/nano_hexapod_F.slx and b/simscape_subsystems/nano_hexapod_F.slx differ diff --git a/simscape_subsystems/nano_hexapod_leg.slx b/simscape_subsystems/nano_hexapod_leg.slx index 03118bb..9976ac6 100644 Binary files a/simscape_subsystems/nano_hexapod_leg.slx and b/simscape_subsystems/nano_hexapod_leg.slx differ diff --git a/simscape_subsystems/reference_mirror.slx b/simscape_subsystems/reference_mirror.slx index a1224f5..4c727a0 100644 Binary files a/simscape_subsystems/reference_mirror.slx and b/simscape_subsystems/reference_mirror.slx differ diff --git a/src/initializeZAxisAccelerometer.m b/src/initializeZAxisAccelerometer.m new file mode 100644 index 0000000..b7ce957 --- /dev/null +++ b/src/initializeZAxisAccelerometer.m @@ -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 diff --git a/src/initializeZAxisGeophone.m b/src/initializeZAxisGeophone.m new file mode 100644 index 0000000..8612793 --- /dev/null +++ b/src/initializeZAxisGeophone.m @@ -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