diff --git a/Analysis/ground_motion_experiment.m b/Analysis/ground_motion_experiment.m deleted file mode 100644 index dd0a8a8..0000000 --- a/Analysis/ground_motion_experiment.m +++ /dev/null @@ -1,75 +0,0 @@ -%% Load open loop data -% gm_ol = load('../data/ground_motion_001.mat'); -%% -clear; close all; clc; - -%% -sim Assemblage; - -%% -Dsample.Data = Dsample.Data - Dsample.Data(1, :); - -%% Time domain X-Y-Z -figure; -hold on; -plot(Dsample.Time, Dsample.Data(:, 1)); -plot(Dsample.Time, Dsample.Data(:, 2)); -plot(Dsample.Time, Dsample.Data(:, 3)); -legend({'x', 'y', 'z'}) -hold off; -xlabel('Time [s]'); ylabel('Displacement [m]'); - -exportFig('tomo_time_translations', 'normal-normal') - -%% Time domain angles -figure; -hold on; -plot(Dsample.Time, Dsample.Data(:, 4)); -plot(Dsample.Time, Dsample.Data(:, 5)); -plot(Dsample.Time, Dsample.Data(:, 6)); -legend({'$\theta_x$', '$\theta_y$', '$\theta_z$'}) -hold off; -xlabel('Time [s]'); ylabel('Angle [rad]'); - -exportFig('tomo_time_rotations', 'normal-normal') - -%% PSD X-Y-Z -han_windows = hanning(ceil(length(Dsample.Time)/10)); - -[psd_x, freqs_x] = pwelch(Dsample.Data(:, 1), han_windows, 0, [], 1/Ts); -[psd_y, freqs_y] = pwelch(Dsample.Data(:, 2), han_windows, 0, [], 1/Ts); -[psd_z, freqs_z] = pwelch(Dsample.Data(:, 3), han_windows, 0, [], 1/Ts); - -figure; -hold on; -plot(freqs_x, sqrt(psd_x)); -plot(freqs_y, sqrt(psd_y)); -plot(freqs_z, sqrt(psd_z)); -set(gca,'xscale','log'); set(gca,'yscale','log'); -xlabel('Frequency [Hz]'); ylabel('PSD [$m/\sqrt{Hz}$]'); -legend({'x', 'y', 'z'}) -hold off; - -exportFig('tomo_psd_translations', 'normal-normal') - -%% PSD -han_windows = hanning(ceil(length(Dsample.Time)/10)); - -[psd_x, freqs_x] = pwelch(Dsample.Data(:, 4), han_windows, 0, [], 1/Ts); -[psd_y, freqs_y] = pwelch(Dsample.Data(:, 5), han_windows, 0, [], 1/Ts); -[psd_z, freqs_z] = pwelch(Dsample.Data(:, 6), han_windows, 0, [], 1/Ts); - -figure; -hold on; -plot(freqs_x, sqrt(psd_x)); -plot(freqs_y, sqrt(psd_y)); -plot(freqs_z, sqrt(psd_z)); -set(gca,'xscale','log'); set(gca,'yscale','log'); -xlabel('Frequency [Hz]'); ylabel('PSD [$rad/s/\sqrt{Hz}$]'); -legend({'$\theta_x$', '$\theta_y$', '$\theta_z$'}) -hold off; - -exportFig('tomo_psd_rotations', 'normal-normal') - -%% -save('./data/ground_motion.mat', 'Dsample') \ No newline at end of file diff --git a/Assemblage.slx b/Assemblage.slx deleted file mode 100644 index d771139..0000000 Binary files a/Assemblage.slx and /dev/null differ diff --git a/Micro_Station.slx b/Micro_Station.slx deleted file mode 100644 index 67e80a9..0000000 Binary files a/Micro_Station.slx and /dev/null differ diff --git a/demonstration/Micro_Station_Displacement.slx b/demonstration/Micro_Station_Displacement.slx deleted file mode 100644 index dec4b22..0000000 Binary files a/demonstration/Micro_Station_Displacement.slx and /dev/null differ diff --git a/demonstration/displacement_sim.m b/demonstration/displacement_sim.m index 3d332e3..9ab982f 100644 --- a/demonstration/displacement_sim.m +++ b/demonstration/displacement_sim.m @@ -2,4 +2,4 @@ clear; close all; clc; %% -sim('Micro_Station_Displacement.slx'); +sim('sim_nano_station_disp.slx'); diff --git a/demonstration/sample_pos_init.m b/demonstration/sample_pos_init.m index 65cae45..cb8ffb9 100644 --- a/demonstration/sample_pos_init.m +++ b/demonstration/sample_pos_init.m @@ -3,7 +3,7 @@ clear; close all; clc; %% Initialize simulation configuration opts_sim = struct(... - 'Tsim', 1 ... + 'Tsim', 0.1 ... ); initializeSimConf(opts_sim); @@ -14,36 +14,33 @@ load('./mat/sim_conf.mat', 'sim_conf') time_vector = 0:sim_conf.Ts:sim_conf.Tsim; % Translation Stage -ty = 0*ones(length(time_vector), 1); +Ty = 0.20*ones(length(time_vector), 1); % Tilt Stage -ry = 2*pi*(0/360)*ones(length(time_vector), 1); -% ry = 2*pi*(3/360)*sin(2*pi*time_vector); +Ry = 2*pi*(3/360)*ones(length(time_vector), 1); +% Ry = 2*pi*(3/360)*sin(2*pi*time_vector); % Spindle -rz = 2*pi*1*(time_vector); -% rz = 2*pi*(190/360)*ones(length(time_vector), 1); +Rz = 2*pi*3*(time_vector); +% Rz = 2*pi*(190/360)*ones(length(time_vector), 1); % Micro Hexapod -u_hexa = zeros(length(time_vector), 6); +Dh = zeros(length(time_vector), 6); % Gravity Compensator system -mass = zeros(length(time_vector), 2); -mass(:, 2) = pi; +Dm = zeros(length(time_vector), 2); +Dm(:, 2) = pi; opts_inputs = struct(... - 'ty', ty, ... - 'ry', ry, ... - 'rz', rz, ... - 'u_hexa', u_hexa, ... - 'mass', mass ... + 'Ty', Ty, ... + 'Ry', Ry, ... + 'Rz', Rz, ... + 'Dh', Dh, ... + 'Dm', Dm ... ); initializeInputs(opts_inputs); -%% Initialize SolidWorks Data -initializeSolids(); - %% Initialize Ground initializeGround(); diff --git a/demonstration/sample_pos_sim.m b/demonstration/sample_pos_sim.m index 3d332e3..9ab982f 100644 --- a/demonstration/sample_pos_sim.m +++ b/demonstration/sample_pos_sim.m @@ -2,4 +2,4 @@ clear; close all; clc; %% -sim('Micro_Station_Displacement.slx'); +sim('sim_nano_station_disp.slx'); diff --git a/demonstration/sim_nano_station_disp.slx b/demonstration/sim_nano_station_disp.slx new file mode 100644 index 0000000..b482687 Binary files /dev/null and b/demonstration/sim_nano_station_disp.slx differ diff --git a/identification/id_flexible_rigid.m b/identification/id_flexible_rigid.m index 9bcecac..2c1d40e 100644 --- a/identification/id_flexible_rigid.m +++ b/identification/id_flexible_rigid.m @@ -13,7 +13,7 @@ options = linearizeOptions; options.SampleTime = 0; %% Name of the Simulink File -mdl = 'sim_micro_station'; +mdl = 'sim_micro_station_id'; %% Micro-Hexapod % Input/Output definition diff --git a/identification/id_micro_station.m b/identification/id_micro_station.m index 8f7aef4..47cc310 100644 --- a/identification/id_micro_station.m +++ b/identification/id_micro_station.m @@ -11,7 +11,7 @@ options = linearizeOptions; options.SampleTime = 0; %% Name of the Simulink File -mdl = 'sim_micro_station'; +mdl = 'sim_micro_station_id'; %% Micro-Hexapod % Input/Output definition diff --git a/identification/id_stages.m b/identification/id_stages.m index b96b043..92362fa 100644 --- a/identification/id_stages.m +++ b/identification/id_stages.m @@ -13,7 +13,7 @@ options = linearizeOptions; options.SampleTime = 0; %% Name of the Simulink File -mdl = 'sim_nano_station'; +mdl = 'sim_nano_station_id'; %% Y-Translation Stage % Input/Output definition diff --git a/identification/sim_micro_station.slx b/identification/sim_micro_station.slx deleted file mode 100644 index a9cd0d8..0000000 Binary files a/identification/sim_micro_station.slx and /dev/null differ diff --git a/identification/sim_micro_station_id.slx b/identification/sim_micro_station_id.slx new file mode 100644 index 0000000..992b0d0 Binary files /dev/null and b/identification/sim_micro_station_id.slx differ diff --git a/identification/sim_nano_station.slx b/identification/sim_nano_station.slx deleted file mode 100644 index 873053a..0000000 Binary files a/identification/sim_nano_station.slx and /dev/null differ diff --git a/identification/sim_nano_station_id.slx b/identification/sim_nano_station_id.slx new file mode 100644 index 0000000..24ac450 Binary files /dev/null and b/identification/sim_nano_station_id.slx differ diff --git a/init_data.m b/init_data.m index 1994e97..6f1d3d1 100644 --- a/init_data.m +++ b/init_data.m @@ -11,15 +11,12 @@ initializeSimConf(opts_sim); %% Initialize Inputs opts_inputs = struct(... 'Dw', true, ... - 'ry', false, ... + 'Ry', false, ... 'Rz', true ... ); initializeInputs(opts_inputs); -%% Initialize Solids -initializeSolids(); - %% Initialize Ground initializeGround(); diff --git a/init_simulation.m b/init_simulation.m index ce08643..8b6a0e7 100644 --- a/init_simulation.m +++ b/init_simulation.m @@ -5,13 +5,15 @@ load('./mat/sim_conf.mat'); %% Load SolidWorks Data -load('./mat/solids.mat'); +% load('./mat/solids.mat'); %% Load data of each stage -load('./mat/stages.mat'); +% TODO - This is now loaded by mask of each stage +% load('./mat/stages.mat'); %% Load Signals Applied to the system -load('./mat/inputs.mat'); +% TODO - This is now loaded by the input referenced system +% load('./mat/inputs.mat'); %% Load Controller load('./mat/controllers.mat'); diff --git a/initialize/initializeAxisc.m b/initialize/initializeAxisc.m index 50b30c6..f2282ed 100644 --- a/initialize/initializeAxisc.m +++ b/initialize/initializeAxisc.m @@ -2,7 +2,27 @@ function [axisc] = initializeAxisc() %% axisc = struct(); - axisc.m = 40; % [kg] + %% Axis Compensator - Static Properties + % Structure + axisc.structure.density = 3400; % [kg/m3] + axisc.structure.color = [0.792 0.820 0.933]; + axisc.structure.STEP = './STEPS/axisc/axisc_structure.STEP'; + % Wheel + axisc.wheel.density = 2700; % [kg/m3] + axisc.wheel.color = [0.753 0.753 0.753]; + axisc.wheel.STEP = './STEPS/axisc/axisc_wheel.STEP'; + % Mass + axisc.mass.density = 7800; % [kg/m3] + axisc.mass.color = [0.792 0.820 0.933]; + axisc.mass.STEP = './STEPS/axisc/axisc_mass.STEP'; + % Gear + axisc.gear.density = 7800; % [kg/m3] + axisc.gear.color = [0.792 0.820 0.933]; + axisc.gear.STEP = './STEPS/axisc/axisc_gear.STEP'; + + axisc.m = 40; % TODO [kg] + + %% Axis Compensator - Dynamical Properties axisc.k.ax = 1; % TODO [N*m/deg)] axisc.c.ax = (1/1)*sqrt(axisc.k.ax/axisc.m); diff --git a/initialize/initializeGranite.m b/initialize/initializeGranite.m index 91db88a..2bc12ac 100644 --- a/initialize/initializeGranite.m +++ b/initialize/initializeGranite.m @@ -2,8 +2,14 @@ function [granite] = initializeGranite() %% granite = struct(); - granite.m = 2000; % [kg] + %% Static Properties + granite.density = 2800; % [kg/m3] + granite.volume = 0.72; % [m3] TODO - should + granite.mass = granite.density*granite.volume; % [kg] + granite.color = [1 1 1]; + granite.STEP = './STEPS/granite/granite.STEP'; + %% Dynamical Properties granite.k.x = 1e8; % [N/m] granite.c.x = 1e4; % [N/(m/s)] diff --git a/initialize/initializeInputs.m b/initialize/initializeInputs.m index c2fe63b..41908b0 100644 --- a/initialize/initializeInputs.m +++ b/initialize/initializeInputs.m @@ -101,10 +101,11 @@ function [inputs] = initializeInputs(opts_param) Fg = zeros(length(t), 3); %% External Forces applied on the Sample - Fs = zeros(length(t), 3); + Fs = zeros(length(t), 6); %% Create the input Structure that will contain all the inputs inputs = struct( ... + 'Ts', sim_conf.Ts, ... 'Dw', timeseries(Dw, t), ... 'Dy', timeseries(Dy, t), ... 'Ry', timeseries(Ry, t), ... diff --git a/initialize/initializeMirror.m b/initialize/initializeMirror.m index b11b101..10234df 100644 --- a/initialize/initializeMirror.m +++ b/initialize/initializeMirror.m @@ -22,6 +22,7 @@ function [] = initializeMirror(opts_param) mirror.rad = 180; % radius of the mirror (at the bottom surface) [mm] mirror.density = 2400; % Density of the mirror [kg/m3] + mirror.color = [0.4 1.0 1.0]; % Color of the mirror mirror.cone_length = mirror.rad*tand(opts.angle)+mirror.h+mirror.jacobian; % Distance from Apex point of the cone to jacobian point diff --git a/initialize/initializeRy.m b/initialize/initializeRy.m index 8fc923f..15e4ca1 100644 --- a/initialize/initializeRy.m +++ b/initialize/initializeRy.m @@ -12,8 +12,27 @@ function [ry] = initializeRy(opts_param) %% ry = struct(); - ry.m = 200; % [kg] + %% Tilt Stage - Static Properties + % Ry - Guide for the tilt stage + ry.guide.density = 7800; % [kg/m3] + ry.guide.color = [0.792 0.820 0.933]; + ry.guide.STEP = './STEPS/ry/Tilt_Guide.STEP'; + % Ry - Rotor of the motor + ry.rotor.density = 2400; % [kg/m3] + ry.rotor.color = [0.792 0.820 0.933]; + ry.rotor.STEP = './STEPS/ry/Tilt_Motor_Axis.STEP'; + % Ry - Motor + ry.motor.density = 3200; % [kg/m3] + ry.motor.color = [0.792 0.820 0.933]; + ry.motor.STEP = './STEPS/ry/Tilt_Motor.STEP'; + % Ry - Plateau Tilt + ry.stage.density = 7800; % [kg/m3] + ry.stage.color = [0.792 0.820 0.933]; + ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP'; + ry.m = 200; % TODO [kg] + + %% Tilt Stage - Dynamical Properties if opts.rigid ry.k.tilt = 1e10; % Rotation stiffness around y [N*m/deg] else diff --git a/initialize/initializeRz.m b/initialize/initializeRz.m index f0ef2c9..18164bd 100644 --- a/initialize/initializeRz.m +++ b/initialize/initializeRz.m @@ -12,9 +12,24 @@ function [rz] = initializeRz(opts_param) %% rz = struct(); + %% Spindle - Static Properties + % Spindle - Slip Ring + rz.slipring.density = 7800; % [kg/m3] + rz.slipring.color = [0.792 0.820 0.933]; + rz.slipring.STEP = './STEPS/rz/Spindle_Slip_Ring.STEP'; + % Spindle - Rotor + rz.rotor.density = 7800; % [kg/m3] + rz.rotor.color = [0.792 0.820 0.933]; + rz.rotor.STEP = './STEPS/rz/Spindle_Rotor.STEP'; + % Spindle - Stator + rz.stator.density = 7800; % [kg/m3] + rz.stator.color = [0.792 0.820 0.933]; + rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP'; + % Estimated mass of the mooving part rz.m = 250; % [kg] + %% Spindle - Dynamical Properties % Estimated stiffnesses rz.k.ax = 2e9; % Axial Stiffness [N/m] rz.k.rad = 7e8; % Radial Stiffness [N/m] diff --git a/initialize/initializeSolids.m b/initialize/initializeSolids.m deleted file mode 100644 index b5d3833..0000000 --- a/initialize/initializeSolids.m +++ /dev/null @@ -1,97 +0,0 @@ -function [solids] = initializeSolids() - %% Granite - solids.granite.density = 2800; % [kg/m3] - solids.granite.color = [1 1 1]; - solids.granite.STEP = './STEPS/granite/granite.STEP'; - - %% Y-Translation - % Ty Granite frame - solids.ty.granite_frame.density = 7800; % [kg/m3] - solids.ty.granite_frame.color = [0.753 1 0.753]; - solids.ty.granite_frame.STEP = './STEPS/Ty/Ty_Granite_Frame.STEP'; - % Guide Translation Ty - solids.ty.guide.density = 7800; % [kg/m3] - solids.ty.guide.color = [0.792 0.820 0.933]; - solids.ty.guide.STEP = './STEPS/ty/Ty_Guide.STEP'; - % Ty - Guide_Translation12 - solids.ty.guide12.density = 7800; % [kg/m3] - solids.ty.guide12.color = [0.792 0.820 0.933]; - solids.ty.guide12.STEP = './STEPS/Ty/Ty_Guide_12.STEP'; - % Ty - Guide_Translation11 - solids.ty.guide11.density = 7800; % [kg/m3] - solids.ty.guide11.color = [0.792 0.820 0.933]; - solids.ty.guide11.STEP = './STEPS/ty/Ty_Guide_11.STEP'; - % Ty - Guide_Translation22 - solids.ty.guide22.density = 7800; % [kg/m3] - solids.ty.guide22.color = [0.792 0.820 0.933]; - solids.ty.guide22.STEP = './STEPS/ty/Ty_Guide_22.STEP'; - % Ty - Guide_Translation21 - solids.ty.guide21.density = 7800; % [kg/m3] - solids.ty.guide21.color = [0.792 0.820 0.933]; - solids.ty.guide21.STEP = './STEPS/Ty/Ty_Guide_21.STEP'; - % Ty - Plateau translation - solids.ty.frame.density = 7800; % [kg/m3] - solids.ty.frame.color = [0.792 0.820 0.933]; - solids.ty.frame.STEP = './STEPS/ty/Ty_Stage.STEP'; - % Ty Stator Part - solids.ty.stator.density = 5400; % [kg/m3] - solids.ty.stator.color = [0.792 0.820 0.933]; - solids.ty.stator.STEP = './STEPS/ty/Ty_Motor_Stator.STEP'; - % Ty Rotor Part - solids.ty.rotor.density = 5400; % [kg/m3] - solids.ty.rotor.color = [0.792 0.820 0.933]; - solids.ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP'; - - %% Tilt Stage - % Ry - Guide for the tilt stage - solids.ry.guide.density = 7800; % [kg/m3] - solids.ry.guide.color = [0.792 0.820 0.933]; - solids.ry.guide.STEP = './STEPS/ry/Tilt_Guide.STEP'; - % Ry - Rotor of the motor - solids.ry.rotor.density = 2400; % [kg/m3] - solids.ry.rotor.color = [0.792 0.820 0.933]; - solids.ry.rotor.STEP = './STEPS/ry/Tilt_Motor_Axis.STEP'; - % Ry - Motor - solids.ry.motor.density = 3200; % [kg/m3] - solids.ry.motor.color = [0.792 0.820 0.933]; - solids.ry.motor.STEP = './STEPS/ry/Tilt_Motor.STEP'; - % Ry - Plateau Tilt - solids.ry.stage.density = 7800; % [kg/m3] - solids.ry.stage.color = [0.792 0.820 0.933]; - solids.ry.stage.STEP = './STEPS/ry/Tilt_Stage.STEP'; - - %% Spindle - % Spindle - Slip Ring - solids.rz.slipring.density = 7800; % [kg/m3] - solids.rz.slipring.color = [0.792 0.820 0.933]; - solids.rz.slipring.STEP = './STEPS/rz/Spindle_Slip_Ring.STEP'; - % Spindle - Rotor - solids.rz.rotor.density = 7800; % [kg/m3] - solids.rz.rotor.color = [0.792 0.820 0.933]; - solids.rz.rotor.STEP = './STEPS/rz/Spindle_Rotor.STEP'; - % Spindle - Stator - solids.rz.stator.density = 7800; % [kg/m3] - solids.rz.stator.color = [0.792 0.820 0.933]; - solids.rz.stator.STEP = './STEPS/rz/Spindle_Stator.STEP'; - - %% Axis Compensator - % Structure - solids.axisc.structure.density = 3400; % [kg/m3] - solids.axisc.structure.color = [0.792 0.820 0.933]; - solids.axisc.structure.STEP = './STEPS/axisc/axisc_structure.STEP'; - % Wheel - solids.axisc.wheel.density = 2700; % [kg/m3] - solids.axisc.wheel.color = [0.753 0.753 0.753]; - solids.axisc.wheel.STEP = './STEPS/axisc/axisc_wheel.STEP'; - % Mass - solids.axisc.mass.density = 7800; % [kg/m3] - solids.axisc.mass.color = [0.792 0.820 0.933]; - solids.axisc.mass.STEP = './STEPS/axisc/axisc_mass.STEP'; - % Gear - solids.axisc.gear.density = 7800; % [kg/m3] - solids.axisc.gear.color = [0.792 0.820 0.933]; - solids.axisc.gear.STEP = './STEPS/axisc/axisc_gear.STEP'; - - %% Save - save('./mat/solids.mat', 'solids') -end diff --git a/initialize/initializeTy.m b/initialize/initializeTy.m index a3e7fab..43b1d9b 100644 --- a/initialize/initializeTy.m +++ b/initialize/initializeTy.m @@ -8,12 +8,51 @@ function [ty] = initializeTy(opts_param) opts.(opt{1}) = opts_param.(opt{1}); end end - + %% ty = struct(); - ty.m = 250; % [kg] + %% Y-Translation - Static Properties + % Ty Granite frame + ty.granite_frame.density = 7800; % [kg/m3] + ty.granite_frame.color = [0.753 1 0.753]; + ty.granite_frame.STEP = './STEPS/Ty/Ty_Granite_Frame.STEP'; + % Guide Translation Ty + ty.guide.density = 7800; % [kg/m3] + ty.guide.color = [0.792 0.820 0.933]; + ty.guide.STEP = './STEPS/ty/Ty_Guide.STEP'; + % Ty - Guide_Translation12 + ty.guide12.density = 7800; % [kg/m3] + ty.guide12.color = [0.792 0.820 0.933]; + ty.guide12.STEP = './STEPS/Ty/Ty_Guide_12.STEP'; + % Ty - Guide_Translation11 + ty.guide11.density = 7800; % [kg/m3] + ty.guide11.color = [0.792 0.820 0.933]; + ty.guide11.STEP = './STEPS/ty/Ty_Guide_11.STEP'; + % Ty - Guide_Translation22 + ty.guide22.density = 7800; % [kg/m3] + ty.guide22.color = [0.792 0.820 0.933]; + ty.guide22.STEP = './STEPS/ty/Ty_Guide_22.STEP'; + % Ty - Guide_Translation21 + ty.guide21.density = 7800; % [kg/m3] + ty.guide21.color = [0.792 0.820 0.933]; + ty.guide21.STEP = './STEPS/Ty/Ty_Guide_21.STEP'; + % Ty - Plateau translation + ty.frame.density = 7800; % [kg/m3] + ty.frame.color = [0.792 0.820 0.933]; + ty.frame.STEP = './STEPS/ty/Ty_Stage.STEP'; + % Ty Stator Part + ty.stator.density = 5400; % [kg/m3] + ty.stator.color = [0.792 0.820 0.933]; + ty.stator.STEP = './STEPS/ty/Ty_Motor_Stator.STEP'; + % Ty Rotor Part + ty.rotor.density = 5400; % [kg/m3] + ty.rotor.color = [0.792 0.820 0.933]; + ty.rotor.STEP = './STEPS/ty/Ty_Motor_Rotor.STEP'; + ty.m = 250; % TODO [kg] + + %% Y-Translation - Dynamicals Properties if opts.rigid ty.k.ax = 1e10; % Axial Stiffness for each of the 4 guidance (y) [N/m] else diff --git a/mat/G.mat b/mat/G.mat index aa873cd..4afdfff 100644 Binary files a/mat/G.mat and b/mat/G.mat differ diff --git a/mat/config.mat b/mat/config.mat index 632d562..a8de8e8 100644 Binary files a/mat/config.mat and b/mat/config.mat differ diff --git a/mat/controllers.mat b/mat/controllers.mat index 600a1b3..45d3c6f 100644 Binary files a/mat/controllers.mat and b/mat/controllers.mat differ diff --git a/mat/id_micro_station.mat b/mat/id_micro_station.mat index 6272084..7d57e9f 100644 Binary files a/mat/id_micro_station.mat and b/mat/id_micro_station.mat differ diff --git a/mat/inputs.mat b/mat/inputs.mat index 5aafffa..8b72cd5 100644 Binary files a/mat/inputs.mat and b/mat/inputs.mat differ diff --git a/mat/sim_conf.mat b/mat/sim_conf.mat index a88c60e..6ea886f 100644 Binary files a/mat/sim_conf.mat and b/mat/sim_conf.mat differ diff --git a/mat/solids.mat b/mat/solids.mat index c7e93f7..4a15ffd 100644 Binary files a/mat/solids.mat and b/mat/solids.mat differ diff --git a/mat/stages.mat b/mat/stages.mat index b3633ed..ae52dc8 100644 Binary files a/mat/stages.mat and b/mat/stages.mat differ diff --git a/nass_library/QuaternionToAngles.slx b/nass_library/QuaternionToAngles.slx new file mode 100644 index 0000000..04727b9 Binary files /dev/null and b/nass_library/QuaternionToAngles.slx differ diff --git a/nass_library/RotationMatrixToAngle.slx b/nass_library/RotationMatrixToAngle.slx new file mode 100644 index 0000000..d352ca8 Binary files /dev/null and b/nass_library/RotationMatrixToAngle.slx differ diff --git a/nass_library/inputs.slx b/nass_library/inputs.slx index 2f4699e..5adfbb6 100644 Binary files a/nass_library/inputs.slx and b/nass_library/inputs.slx differ diff --git a/nass_library/nass_library.slx b/nass_library/nass_library.slx index 0becac2..e83c73d 100644 Binary files a/nass_library/nass_library.slx and b/nass_library/nass_library.slx differ diff --git a/nass_library/pos_error_wrt_nass_base.slx b/nass_library/pos_error_wrt_nass_base.slx index 3041017..0002453 100644 Binary files a/nass_library/pos_error_wrt_nass_base.slx and b/nass_library/pos_error_wrt_nass_base.slx differ diff --git a/run_simulations.m b/run_simulations.m index 3a66341..bccd69b 100644 --- a/run_simulations.m +++ b/run_simulations.m @@ -3,17 +3,17 @@ steady_time = 10; initializeSimConf(struct('Tsim', steady_time, 'cl_time', steady_time)); -set_param('Assemblage',... +set_param('sim_nano_station_ctrl',... 'SaveFinalState','on',... 'FinalStateName','myOperPoint',... 'SaveCompleteFinalSimState','on'... ); -sim('Assemblage'); +sim('sim_nano_station_ctrl'); save('./data/myOperPoint.mat', 'myOperPoint'); -set_param('Assemblage',... +set_param('sim_nano_station_ctrl',... 'SaveFinalState','off',... 'SaveCompleteFinalSimState','off'... ); @@ -27,14 +27,14 @@ initializeSimConf(struct('Tsim', steady_time+sim_time, 'cl_time', steady_time)); load('./data/myOperPoint.mat', 'myOperPoint'); -set_param('Assemblage',... +set_param('sim_nano_station_ctrl',... 'LoadInitialState','on',... 'InitialState','myOperPoint'... ); -sim('Assemblage'); +sim('sim_nano_station_ctrl'); -set_param('Assemblage',... +set_param('sim_nano_station_ctrl',... 'LoadInitialState','off' ... ); diff --git a/sim_nano_station_ctrl.slx b/sim_nano_station_ctrl.slx new file mode 100644 index 0000000..a09874b Binary files /dev/null and b/sim_nano_station_ctrl.slx differ diff --git a/src/identifyPlant.m b/src/identifyPlant.m index 99614de..9d1d4de 100644 --- a/src/identifyPlant.m +++ b/src/identifyPlant.m @@ -14,29 +14,36 @@ function [sys] = identifyPlant(opts_param) options.SampleTime = 0; %% Name of the Simulink File - mdl = 'sim_nano_station'; + mdl = 'sim_nano_station_id'; %% Input/Output definition - io(1) = linio([mdl, '/Fn'], 1, 'input'); - io(2) = linio([mdl, '/Gm'], 1, 'input'); - io(3) = linio([mdl, '/Fs_ext'], 1, 'input'); - io(4) = linio([mdl, '/F_legs'], 1, 'input'); - io(5) = linio([mdl, '/Dsample_meas'], 1, 'output'); - io(6) = linio([mdl, '/F_meas'], 1, 'output'); + io(1) = linio([mdl, '/Fn'], 1, 'input'); % Cartesian forces applied by NASS + io(2) = linio([mdl, '/Dw'], 1, 'input'); % Ground Motion + io(3) = linio([mdl, '/Fs'], 1, 'input'); % External forces on the sample + io(4) = linio([mdl, '/Fnl'], 1, 'input'); % Forces applied on the NASS's legs + io(5) = linio([mdl, '/Dsm'], 1, 'output'); % Displacement of the sample + io(6) = linio([mdl, '/Fnlm'], 1, 'output'); % Force sensor in NASS's legs + io(7) = linio([mdl, '/Dnlm'], 1, 'output'); % Displacement of NASS's legs %% Run the linearization G = linearize(mdl, io, 0); G.InputName = {'Fnx', 'Fny', 'Fnz', 'Mnx', 'Mny', 'Mnz', ... 'Dgx', 'Dgy', 'Dgz', ... - 'Fsx', 'Fsy', 'Fsz', ... + 'Fsx', 'Fsy', 'Fsz', 'Msx', 'Msy', 'Msz', ... 'F1', 'F2', 'F3', 'F4', 'F5', 'F6'}; G.OutputName = {'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', ... - 'Fm1', 'Fm2', 'Fm3', 'Fm4', 'Fm5', 'Fm6'}; + 'Fm1', 'Fm2', 'Fm3', 'Fm4', 'Fm5', 'Fm6', ... + 'Dm1', 'Dm2', 'Dm3', 'Dm4', 'Dm5', 'Dm6'}; %% Create the sub transfer functions + % From forces applied in the cartesian frame to displacement of the sample in the cartesian frame sys.G_cart = minreal(G({'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz'}, {'Fnx', 'Fny', 'Fnz', 'Mnx', 'Mny', 'Mnz'})); + % From ground motion to Sample displacement sys.G_gm = minreal(G({'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz'}, {'Dgx', 'Dgy', 'Dgz'})); - sys.G_fs = minreal(G({'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz'}, {'Fsx', 'Fsy', 'Fsz'})); + % From direct forces applied on the sample to displacement of the sample + sys.G_fs = minreal(G({'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz'}, {'Fsx', 'Fsy', 'Fsz', 'Msx', 'Msy', 'Msz'})); + % From forces applied on NASS's legs to force sensor in each leg sys.G_iff = minreal(G({'Fm1', 'Fm2', 'Fm3', 'Fm4', 'Fm5', 'Fm6'}, {'F1', 'F2', 'F3', 'F4', 'F5', 'F6'})); + % From forces applied on NASS's legs to displacement of each leg + sys.G_dleg = minreal(G({'Dm1', 'Dm2', 'Dm3', 'Dm4', 'Dm5', 'Dm6'}, {'F1', 'F2', 'F3', 'F4', 'F5', 'F6'})); end - diff --git a/src/runSimulation.m b/src/runSimulation.m index 7959a28..7d7ffef 100644 --- a/src/runSimulation.m +++ b/src/runSimulation.m @@ -43,7 +43,7 @@ function [] = runSimulation(sys_name, sys_mass, ctrl_type, act_damp) end %% Run the simulation - sim('Assemblage.slx'); + sim('sim_nano_station_ctrl.slx'); %% Split the Dsample matrix into vectors [Dx, Dy, Dz, Rx, Ry, Rz] = matSplit(Dsample.Data, 1); %#ok diff --git a/usefull-simscape-parts/inertial_sensor.slx b/usefull-simscape-parts/inertial_sensor.slx deleted file mode 100644 index 0596a06..0000000 Binary files a/usefull-simscape-parts/inertial_sensor.slx and /dev/null differ