diff --git a/active_damping/index.html b/active_damping/index.html index a58e314..9d62bf6 100644 --- a/active_damping/index.html +++ b/active_damping/index.html @@ -4,7 +4,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + Active Damping applied on the Simscape Model @@ -284,101 +284,110 @@ for the JavaScript code in this tag.

Table of Contents

-First, in section 1, we will looked at the undamped system. +First, in section 1, we will looked at the undamped system.

Then, we will compare three active damping techniques:

@@ -417,11 +426,11 @@ The disturbances are:

  • Motion errors of all the stages
  • -
    -

    1 Undamped System

    +
    +

    1 Undamped System

    - +

    @@ -435,12 +444,12 @@ The performance of this undamped system will be compared with the damped system

    -
    -

    1.1 Identification of the dynamics for Active Damping

    +
    +

    1.1 Identification of the dynamics for Active Damping

    -
    -

    1.1.1 Initialize the Simulation

    +
    +

    1.1.1 Initialize the Simulation

    We initialize all the stages with the default parameters. @@ -470,7 +479,7 @@ initializeSample('mass', 50); We set the references to zero.

    -
    initializeReferences();
    +
    initializeReferences('Rz_type', 'rotating', 'Ry_period', 1);
     
    @@ -491,8 +500,8 @@ save('./mat/controllers.mat', -

    1.1.2 Identification

    +
    +

    1.1.2 Identification

    First, we identify the dynamics of the system using the linearize function. @@ -513,7 +522,7 @@ io(io_i) = linio([mdl, '/Micro-Station'], 3, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; %% Run the linearization -G = linearize(mdl, io, options); +G = linearize(mdl, io, 1, options); G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... @@ -541,39 +550,44 @@ And we save them for further analysis.

    -
    -

    1.1.3 Obtained Plants for Active Damping

    +
    +

    1.1.3 Obtained Plants for Active Damping

    +
    +
    load('./active_damping/mat/undamped_plants.mat', 'G_iff', 'G_dvf', 'G_ine');
    +
    +
    -
    + +

    nass_active_damping_iff_plant.png

    Figure 1: G_iff: IFF Plant (png, pdf)

    -
    +

    nass_active_damping_ine_plant.png

    Figure 2: G_dvf: Plant for Direct Velocity Feedback (png, pdf)

    -
    +

    nass_active_damping_inertial_plant.png

    -

    Figure 3: Inertial Feedback Plant (png, pdf)

    +

    Figure 3: G_ine: Inertial Feedback Plant (png, pdf)

    -
    -

    1.2 Tomography Experiment

    +
    +

    1.2 Tomography Experiment

    -
    -

    1.2.1 Simulation

    +
    +

    1.2.1 Simulation

    We initialize elements for the tomography experiment. @@ -610,8 +624,8 @@ Finally, we save the simulation results for further analysis

    -
    -

    1.2.2 Results

    +
    +

    1.2.2 Results

    We load the results of tomography experiments. @@ -623,14 +637,14 @@ t = linspace(0, 3, length(En(:,1)));

    -
    +

    nass_act_damp_undamped_sim_tomo_trans.png

    Figure 4: Position Error during tomography experiment - Translations (png, pdf)

    -
    +

    nass_act_damp_undamped_sim_tomo_rot.png

    Figure 5: Position Error during tomography experiment - Rotations (png, pdf)

    @@ -640,11 +654,11 @@ t = linspace(0, 3, length(En(:,1)));
    -
    -

    2 Integral Force Feedback

    +
    +

    2 Integral Force Feedback

    - +

    @@ -657,12 +671,12 @@ Integral Force Feedback is applied on the simscape model.

    -
    -

    2.1 Control Design

    +
    +

    2.1 Control Design

    -
    -

    2.1.1 Plant

    +
    +

    2.1.1 Plant

    Let’s load the previously indentified undamped plant: @@ -673,11 +687,11 @@ Let’s load the previously indentified undamped plant:

    -Let’s look at the transfer function from actuator forces in the nano-hexapod to the force sensor in the nano-hexapod legs for all 6 pairs of actuator/sensor (figure 6). +Let’s look at the transfer function from actuator forces in the nano-hexapod to the force sensor in the nano-hexapod legs for all 6 pairs of actuator/sensor (figure 6).

    -
    +

    iff_plant.png

    Figure 6: Transfer function from forces applied in the legs to force sensor (png, pdf)

    @@ -685,8 +699,8 @@ Let’s look at the transfer function from actuator forces in the nano-hexap
    -
    -

    2.1.2 Control Design

    +
    +

    2.1.2 Control Design

    The controller for each pair of actuator/sensor is: @@ -697,11 +711,11 @@ The controller for each pair of actuator/sensor is:

    -The corresponding loop gains are shown in figure 7. +The corresponding loop gains are shown in figure 7.

    -
    +

    iff_open_loop.png

    Figure 7: Loop Gain for the Integral Force Feedback (png, pdf)

    @@ -709,8 +723,8 @@ The corresponding loop gains are shown in figure 7.
    -
    -

    2.1.3 Diagonal Controller

    +
    +

    2.1.3 Diagonal Controller

    We create the diagonal controller and we add a minus sign as we have a positive @@ -731,22 +745,21 @@ We save the controller for further analysis.

    -
    -

    2.1.4 IFF with High Pass Filter

    +
    +

    2.1.4 IFF with High Pass Filter

    w_hpf = 2*pi*10; % Cut-off frequency for the high pass filter [rad/s]
    -w_lpf = 2*pi*200; % Cut-off frequency for the low pass filter [rad/s]
     
    -K_iff = 2*pi*200/s * (s/w_hpf)/(s/w_hpf + 1) * 1/(s/w_lpf + 1);
    +K_iff = 2*pi*200/s * (s/w_hpf)/(s/w_hpf + 1);
     

    -The corresponding loop gains are shown in figure 8. +The corresponding loop gains are shown in figure 8.

    -
    +

    iff_hpf_open_loop.png

    Figure 8: Loop Gain for the Integral Force Feedback with an High pass filter (png, pdf)

    @@ -772,12 +785,12 @@ We save the controller for further analysis.
    -
    -

    2.2 Tomography Experiment

    +
    +

    2.2 Tomography Experiment

    -
    -

    2.2.1 Simulation with IFF Controller

    +
    +

    2.2.1 Simulation with IFF Controller

    We initialize elements for the tomography experiment. @@ -825,8 +838,8 @@ save('./active_damping/mat/tomo_exp.mat',

    -
    -

    2.2.2 Simulation with IFF Controller with added High Pass Filter

    +
    +

    2.2.2 Simulation with IFF Controller with added High Pass Filter

    We initialize elements for the tomography experiment. @@ -874,8 +887,8 @@ save('./active_damping/mat/tomo_exp.mat',

    -
    -

    2.2.3 Compare with Undamped system

    +
    +

    2.2.3 Compare with Undamped system

    We load the results of tomography experiments. @@ -887,21 +900,21 @@ t = linspace(0, 3, length(En(:,1)));

    -
    +

    nass_act_damp_iff_sim_tomo_xy.png

    Figure 9: Position Error during tomography experiment - XY Motion (png, pdf)

    -
    +

    nass_act_damp_iff_sim_tomo_trans.png

    Figure 10: Position Error during tomography experiment - Translations (png, pdf)

    -
    +

    nass_act_damp_iff_sim_tomo_rot.png

    Figure 11: Position Error during tomography experiment - Rotations (png, pdf)

    @@ -910,8 +923,8 @@ t = linspace(0, 3, length(En(:,1)));
    -
    -

    2.3 Conclusion

    +
    +

    2.3 Conclusion

    @@ -928,11 +941,11 @@ Integral Force Feedback:

    -
    -

    3 Direct Velocity Feedback

    +
    +

    3 Direct Velocity Feedback

    - +

    @@ -946,12 +959,12 @@ The actuator displacement can be measured with a capacitive sensor for instance.

    -
    -

    3.1 Control Design

    +
    +

    3.1 Control Design

    -
    -

    3.1.1 Plant

    +
    +

    3.1.1 Plant

    Let’s load the undamped plant: @@ -962,11 +975,11 @@ Let’s load the undamped plant:

    -Let’s look at the transfer function from actuator forces in the nano-hexapod to the measured displacement of the actuator for all 6 pairs of actuator/sensor (figure 12). +Let’s look at the transfer function from actuator forces in the nano-hexapod to the measured displacement of the actuator for all 6 pairs of actuator/sensor (figure 12).

    -
    +

    dvf_plant.png

    Figure 12: Transfer function from forces applied in the legs to leg displacement sensor (png, pdf)

    @@ -974,8 +987,8 @@ Let’s look at the transfer function from actuator forces in the nano-hexap
    -
    -

    3.1.2 Control Design

    +
    +

    3.1.2 Control Design

    The Direct Velocity Feedback is defined below. @@ -987,11 +1000,11 @@ A Low pass Filter is added to make the controller transfer function proper.

    -The obtained loop gains are shown in figure 13. +The obtained loop gains are shown in figure 13.

    -
    +

    dvf_open_loop.png

    Figure 13: Loop Gain for the Integral Force Feedback (png, pdf)

    @@ -999,8 +1012,8 @@ The obtained loop gains are shown in figure 13.
    -
    -

    3.1.3 Diagonal Controller

    +
    +

    3.1.3 Diagonal Controller

    We create the diagonal controller and we add a minus sign as we have a positive feedback architecture. @@ -1021,12 +1034,12 @@ We save the controller for further analysis.

    -
    -

    3.2 Tomography Experiment

    +
    +

    3.2 Tomography Experiment

    -
    -

    3.2.1 Initialize the Simulation

    +
    +

    3.2.1 Initialize the Simulation

    We initialize elements for the tomography experiment. @@ -1047,8 +1060,8 @@ save('./mat/controllers.mat', -

    3.2.2 Simulation

    +
    +

    3.2.2 Simulation

    We change the simulation stop time. @@ -1079,8 +1092,8 @@ save('./active_damping/mat/tomo_exp.mat',

    -
    -

    3.2.3 Compare with Undamped system

    +
    +

    3.2.3 Compare with Undamped system

    We load the results of tomography experiments. @@ -1092,21 +1105,21 @@ t = linspace(0, 3, length(En(:,1)));

    -
    +

    nass_act_damp_dvf_sim_tomo_xy.png

    Figure 14: Position Error during tomography experiment - XY Motion (png, pdf)

    -
    +

    nass_act_damp_dvf_sim_tomo_trans.png

    Figure 15: Position Error during tomography experiment - Translations (png, pdf)

    -
    +

    nass_act_damp_dvf_sim_tomo_rot.png

    Figure 16: Position Error during tomography experiment - Rotations (png, pdf)

    @@ -1115,8 +1128,8 @@ t = linspace(0, 3, length(En(:,1)));
    -
    -

    3.3 Conclusion

    +
    +

    3.3 Conclusion

    @@ -1131,11 +1144,11 @@ Direct Velocity Feedback:

    -
    -

    4 Inertial Control

    +
    +

    4 Inertial Control

    - +

    @@ -1148,12 +1161,12 @@ In Inertial Control, a feedback is applied between the measured absolute

    -
    -

    4.1 Control Design

    +
    +

    4.1 Control Design

    -
    -

    4.1.1 Plant

    +
    +

    4.1.1 Plant

    Let’s load the undamped plant: @@ -1164,11 +1177,11 @@ Let’s load the undamped plant:

    -Let’s look at the transfer function from actuator forces in the nano-hexapod to the measured velocity of the nano-hexapod platform in the direction of the corresponding actuator for all 6 pairs of actuator/sensor (figure 17). +Let’s look at the transfer function from actuator forces in the nano-hexapod to the measured velocity of the nano-hexapod platform in the direction of the corresponding actuator for all 6 pairs of actuator/sensor (figure 17).

    -
    +

    ine_plant.png

    Figure 17: Transfer function from forces applied in the legs to leg velocity sensor (png, pdf)

    @@ -1176,11 +1189,11 @@ Let’s look at the transfer function from actuator forces in the nano-hexap
    -
    -

    4.1.2 Control Design

    +
    +

    4.1.2 Control Design

    -The controller is defined below and the obtained loop gain is shown in figure 18. +The controller is defined below and the obtained loop gain is shown in figure 18.

    @@ -1189,7 +1202,7 @@ The controller is defined below and the obtained loop gain is shown in figure -
    +

    ine_open_loop_gain.png

    Figure 18: Loop Gain for Inertial Control (png, pdf)

    @@ -1197,8 +1210,8 @@ The controller is defined below and the obtained loop gain is shown in figure
    -
    -

    4.1.3 Diagonal Controller

    +
    +

    4.1.3 Diagonal Controller

    We create the diagonal controller and we add a minus sign as we have a positive feedback architecture. @@ -1219,12 +1232,12 @@ We save the controller for further analysis.

    -
    -

    4.2 Tomography Experiment

    +
    +

    4.2 Tomography Experiment

    -
    -

    4.2.1 Initialize the Simulation

    +
    +

    4.2.1 Initialize the Simulation

    We initialize elements for the tomography experiment. @@ -1245,8 +1258,8 @@ save('./mat/controllers.mat', -

    4.2.2 Simulation

    +
    +

    4.2.2 Simulation

    We change the simulation stop time. @@ -1277,8 +1290,8 @@ save('./active_damping/mat/tomo_exp.mat',

    -
    -

    4.2.3 Compare with Undamped system

    +
    +

    4.2.3 Compare with Undamped system

    We load the results of tomography experiments. @@ -1290,21 +1303,21 @@ t = linspace(0, 3, length(En_ine(:,1)));

    -
    + -
    +

    nass_act_damp_ine_sim_tomo_trans.png

    Figure 20: Position Error during tomography experiment - Translations (png, pdf)

    -
    +

    nass_act_damp_ine_sim_tomo_rot.png

    Figure 21: Position Error during tomography experiment - Rotations (png, pdf)

    @@ -1313,8 +1326,8 @@ t = linspace(0, 3, length(En_ine(:,1)));
    -
    -

    4.3 Conclusion

    +
    +

    4.3 Conclusion

    @@ -1326,16 +1339,191 @@ Inertial Control:

    -
    -

    5 Comparison

    +
    +

    5 Variability of the system dynamics for Active Damping

    - + +

    +
    +

    +All the files (data and Matlab scripts) are accessible here. +

    + +
    +
    + +
    +

    5.1 Variation of the Sample Mass

    +
    +

    +For all the identifications, the disturbances are disabled and no controller are used. +

    +

    +We identify the dynamics for the following sample mass. +

    +
    +
    masses = [1, 10, 50]; % [kg]
    +
    +
    + +
    +

    act_damp_variability_iff_sample_mass.png +

    +

    Figure 22: Variability of the IFF plant with the Sample Mass (png, pdf)

    +
    + + +
    +

    act_damp_variability_dvf_sample_mass.png +

    +

    Figure 23: Variability of the DVF plant with the Sample Mass (png, pdf)

    +
    + + +
    +

    act_damp_variability_ine_sample_mass.png +

    +

    Figure 24: Variability of the Inertial plant with the Sample Mass (png, pdf)

    +
    +
    +
    + +
    +

    5.2 Variation of the Spindle Angle

    +
    +

    +We identify the dynamics for the following Spindle angles. +

    +
    +
    Rz_amplitudes = [0, pi/4, pi/2, pi]; % [rad]
    +
    +
    + +
    +

    act_damp_variability_iff_spindle_angle.png +

    +

    Figure 25: Variability of the IFF plant with the Spindle Angle (png, pdf)

    +
    + + +
    +

    act_damp_variability_dvf_spindle_angle.png +

    +

    Figure 26: Variability of the DVF plant with the Spindle Angle (png, pdf)

    +
    + + +
    +

    act_damp_variability_ine_spindle_angle.png +

    +

    Figure 27: Variability of the Inertial plant with the Spindle Angle (png, pdf)

    +
    +
    +
    + +
    +

    5.3 Variation of the Spindle Rotation Speed

    +
    +

    +We identify the dynamics for the following Spindle rotation periods. +

    +
    +
    Rz_periods = [60, 10, 1]; % [s]
    +
    +
    + +
    +

    act_damp_variability_iff_spindle_speed.png +

    +

    Figure 28: Variability of the IFF plant with the Spindle rotation speed (png, pdf)

    +
    + + +
    +

    act_damp_variability_iff_spindle_speed_zoom.png +

    +

    Figure 29: Variability of the IFF plant with the Spindle rotation speed (png, pdf)

    +
    + + +
    +

    act_damp_variability_dvf_spindle_speed.png +

    +

    Figure 30: Variability of the DVF plant with the Spindle rotation speed (png, pdf)

    +
    + + +
    +

    act_damp_variability_dvf_spindle_speed_zoom.png +

    +

    Figure 31: Variability of the DVF plant with the Spindle rotation speed (png, pdf)

    +
    + + +
    +

    act_damp_variability_ine_spindle_speed.png +

    +

    Figure 32: Variability of the Inertial plant with the Spindle rotation speed (png, pdf)

    +
    + + +
    +

    act_damp_variability_ine_spindle_speed_zoom.png +

    +

    Figure 33: Variability of the Inertial plant with the Spindle rotation speed (png, pdf)

    +
    +
    +
    + +
    +

    5.4 Variation of the Tilt Angle

    +
    +

    +We identify the dynamics for the following Tilt stage angles. +

    +
    +
    Ry_amplitudes = [0, 3*pi/180]; % [rad]
    +
    +
    + +
    +

    act_damp_variability_iff_tilt_angle.png +

    +

    Figure 34: Variability of the IFF plant with the Spindle Angle (png, pdf)

    +
    + + +
    +

    act_damp_variability_dvf_tilt_angle.png +

    +

    Figure 35: Variability of the DVF plant with the Spindle Angle (png, pdf)

    +
    + + +
    +

    act_damp_variability_ine_tilt_angle.png +

    +

    Figure 36: Variability of the Inertial plant with the Spindle Angle (png, pdf)

    +
    +
    +
    + +
    +

    5.5 Conclusion

    +
    +
    + +
    +

    6 Comparison

    +
    +

    +

    -
    -

    5.1 Load the plants

    -
    +
    +

    6.1 Load the plants

    +
    load('./active_damping/mat/plants.mat', 'G', 'G_iff', 'G_ine', 'G_dvf');
     
    @@ -1343,81 +1531,81 @@ Inertial Control:
    -
    -

    5.2 Sensitivity to Disturbance

    -
    +
    +

    6.2 Sensitivity to Disturbance

    +
    -
    +

    sensitivity_comp_ground_motion_z.png

    -

    Figure 22: Sensitivity to ground motion in the Z direction on the Z motion error (png, pdf)

    +

    Figure 37: Sensitivity to ground motion in the Z direction on the Z motion error (png, pdf)

    -
    +

    sensitivity_comp_direct_forces_z.png

    -

    Figure 23: Compliance in the Z direction: Sensitivity of direct forces applied on the sample in the Z direction on the Z motion error (png, pdf)

    +

    Figure 38: Compliance in the Z direction: Sensitivity of direct forces applied on the sample in the Z direction on the Z motion error (png, pdf)

    -
    +

    sensitivity_comp_spindle_z.png

    -

    Figure 24: Sensitivity to forces applied in the Z direction by the Spindle on the Z motion error (png, pdf)

    +

    Figure 39: Sensitivity to forces applied in the Z direction by the Spindle on the Z motion error (png, pdf)

    -
    +

    sensitivity_comp_ty_z.png

    -

    Figure 25: Sensitivity to forces applied in the Z direction by the Y translation stage on the Z motion error (png, pdf)

    +

    Figure 40: Sensitivity to forces applied in the Z direction by the Y translation stage on the Z motion error (png, pdf)

    -
    +

    sensitivity_comp_ty_x.png

    -

    Figure 26: Sensitivity to forces applied in the X direction by the Y translation stage on the X motion error (png, pdf)

    +

    Figure 41: Sensitivity to forces applied in the X direction by the Y translation stage on the X motion error (png, pdf)

    -
    -

    5.3 Damped Plant

    -
    +
    +

    6.3 Damped Plant

    +
    -
    +

    plant_comp_damping_z.png

    -

    Figure 27: Plant for the \(z\) direction for different active damping technique used (png, pdf)

    +

    Figure 42: Plant for the \(z\) direction for different active damping technique used (png, pdf)

    -
    +

    plant_comp_damping_x.png

    -

    Figure 28: Plant for the \(x\) direction for different active damping technique used (png, pdf)

    +

    Figure 43: Plant for the \(x\) direction for different active damping technique used (png, pdf)

    -
    +

    plant_comp_damping_coupling.png

    -

    Figure 29: Comparison of one off-diagonal plant for different damping technique applied (png, pdf)

    +

    Figure 44: Comparison of one off-diagonal plant for different damping technique applied (png, pdf)

    -
    -

    5.4 Tomography Experiment

    -
    +
    +

    6.4 Tomography Experiment

    +
    -
    -

    5.4.1 Load the Simulation Data

    -
    +
    +

    6.4.1 Load the Simulation Data

    +
    load('./active_damping/mat/tomo_exp.mat', 'En', 'En_iff_hpf', 'En_dvf', 'En_ine');
     En_iff = En_iff_hpf;
    @@ -1427,9 +1615,9 @@ t = linspace(0, 3, length(En(:,1)));
     
    -
    -

    5.4.2 Frequency Domain Analysis

    -
    +
    +

    6.4.2 Frequency Domain Analysis

    +

    Window used for pwelch function.

    @@ -1440,46 +1628,46 @@ han_win = hanning(ceil(length(En(:, 1)) -
    +

    act_damp_tomo_exp_comp_psd_trans.png

    -

    Figure 30: PSD of the translation errors for applied Active Damping techniques (png, pdf)

    +

    Figure 45: PSD of the translation errors in the X direction for applied Active Damping techniques (png, pdf)

    -
    +

    act_damp_tomo_exp_comp_psd_rot.png

    -

    Figure 31: PSD of the rotation errors for applied Active Damping techniques (png, pdf)

    +

    Figure 46: PSD of the rotation errors in the X direction for applied Active Damping techniques (png, pdf)

    -
    +

    act_damp_tomo_exp_comp_cps_trans.png

    -

    Figure 32: CPS of the translation errors for applied Active Damping techniques (png, pdf)

    +

    Figure 47: CPS of the translation errors in the X direction for applied Active Damping techniques (png, pdf)

    -
    +

    act_damp_tomo_exp_comp_cps_rot.png

    -

    Figure 33: CPS of the rotation errors for applied Active Damping techniques (png, pdf)

    +

    Figure 48: CPS of the rotation errors in the X direction for applied Active Damping techniques (png, pdf)

    -
    -

    6 Useful Functions

    -
    +
    +

    7 Useful Functions

    +
    -
    -

    6.1 prepareTomographyExperiment

    -
    +
    +

    7.1 prepareTomographyExperiment

    +

    - +

    @@ -1487,9 +1675,9 @@ This Matlab function is accessible h

    -
    -

    Function Description

    -
    +
    +

    Function Description

    +
    -
    -

    Optional Parameters

    -
    +
    +

    Optional Parameters

    +
    -
    -

    Initialize the Simulation

    -
    +
    +

    Initialize the Simulation

    +

    We initialize all the stages with the default parameters.

    @@ -1567,7 +1755,7 @@ save('./mat/controllers.mat',

    Author: Dehaeze Thomas

    -

    Created: 2020-01-20 lun. 17:45

    +

    Created: 2020-01-21 mar. 17:28

    diff --git a/active_damping/index.org b/active_damping/index.org index 544e4cd..79ca465 100644 --- a/active_damping/index.org +++ b/active_damping/index.org @@ -126,7 +126,7 @@ The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg. We set the references to zero. #+begin_src matlab - initializeReferences(); + initializeReferences('Rz_type', 'rotating', 'Ry_period', 1); #+end_src And all the controllers are set to 0. @@ -159,7 +159,7 @@ First, we identify the dynamics of the system using the =linearize= function. io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; %% Run the linearization - G = linearize(mdl, io, options); + G = linearize(mdl, io, 1, options); G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... @@ -179,6 +179,10 @@ And we save them for further analysis. #+end_src *** Obtained Plants for Active Damping +#+begin_src matlab + load('./active_damping/mat/undamped_plants.mat', 'G_iff', 'G_dvf', 'G_ine'); +#+end_src + #+begin_src matlab :exports none freqs = logspace(0, 3, 1000); @@ -191,7 +195,7 @@ And we save them for further analysis. end hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); - ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); ax2 = subplot(2, 1, 2); hold on; @@ -287,7 +291,7 @@ And we save them for further analysis. #+end_src #+NAME: fig:nass_active_damping_inertial_plant -#+CAPTION: Inertial Feedback Plant ([[./figs/nass_active_damping_inertial_plant.png][png]], [[./figs/nass_active_damping_inertial_plant.pdf][pdf]]) +#+CAPTION: =G_ine=: Inertial Feedback Plant ([[./figs/nass_active_damping_inertial_plant.png][png]], [[./figs/nass_active_damping_inertial_plant.pdf][pdf]]) [[file:figs/nass_active_damping_inertial_plant.png]] ** Tomography Experiment @@ -513,9 +517,8 @@ We save the controller for further analysis. *** IFF with High Pass Filter #+begin_src matlab w_hpf = 2*pi*10; % Cut-off frequency for the high pass filter [rad/s] - w_lpf = 2*pi*200; % Cut-off frequency for the low pass filter [rad/s] - K_iff = 2*pi*200/s * (s/w_hpf)/(s/w_hpf + 1) * 1/(s/w_lpf + 1); + K_iff = 2*pi*200/s * (s/w_hpf)/(s/w_hpf + 1); #+end_src The corresponding loop gains are shown in figure [[fig:iff_hpf_open_loop]]. @@ -1934,6 +1937,930 @@ We load the results of tomography experiments. Inertial Control: #+end_important +* Variability of the system dynamics for Active Damping +:PROPERTIES: +:header-args:matlab+: :tangle matlab/act_damp_variability_plant.m +:header-args:matlab+: :comments org :mkdirp yes +:END: +<> + +** ZIP file containing the data and matlab files :ignore: +#+begin_src bash :exports none :results none +if [ matlab/act_damp_variability_plant.m -nt data/act_damp_variability_plant.zip ]; then +cp matlab/act_damp_variability_plant.m act_damp_variability_plant.m; +zip data/act_damp_variability_plant \ +act_damp_variability_plant.m +rm act_damp_variability_plant.m; +fi +#+end_src + +#+begin_note +All the files (data and Matlab scripts) are accessible [[file:data/act_damp_variability_plant.zip][here]]. +#+end_note + +** Introduction :ignore: +** Matlab Init :noexport:ignore: +#+begin_src matlab :tangle no :exports none :results silent :noweb yes :var current_dir=(file-name-directory buffer-file-name) + <> +#+end_src + +#+begin_src matlab :exports none :results silent :noweb yes + <> +#+end_src + +#+begin_src matlab :tangle no + simulinkproject('../'); + addpath('active_damping/src/'); +#+end_src + +#+begin_src matlab + open('active_damping/matlab/sim_nass_active_damping.slx') + load('mat/conf_simscape.mat'); +#+end_src + +** Variation of the Sample Mass +*** Introduction :ignore: +For all the identifications, the disturbances are disabled and no controller are used. + +*** Initialize the Simulation :noexport: +We initialize all the stages with the default parameters. +#+begin_src matlab + initializeGround(); + initializeGranite(); + initializeTy(); + initializeRy(); + initializeRz(); + initializeMicroHexapod(); + initializeAxisc(); + initializeMirror(); +#+end_src + +No disturbances. +#+begin_src matlab + initializeDisturbances('enable', false); +#+end_src + +The nano-hexapod is a piezoelectric hexapod. +#+begin_src matlab + initializeNanoHexapod('actuator', 'piezo'); +#+end_src + +We set the references to zero. +#+begin_src matlab + initializeReferences(); +#+end_src + +And all the controllers are set to 0. +#+begin_src matlab + K = tf(zeros(6)); + save('./mat/controllers.mat', 'K', '-append'); + K_ine = tf(zeros(6)); + save('./mat/controllers.mat', 'K_ine', '-append'); + K_iff = tf(zeros(6)); + save('./mat/controllers.mat', 'K_iff', '-append'); + K_dvf = tf(zeros(6)); + save('./mat/controllers.mat', 'K_dvf', '-append'); +#+end_src + +*** Identification :ignore: +#+begin_src matlab :exports none + %% Options for Linearized + options = linearizeOptions; + options.SampleTime = 0; + + %% Name of the Simulink File + mdl = 'sim_nass_active_damping'; + + %% Input/Output definition + clear io; io_i = 1; + io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; +#+end_src + +We identify the dynamics for the following sample mass. +#+begin_src matlab + masses = [1, 10, 50]; % [kg] +#+end_src + +#+begin_src matlab :exports none + Gm = {zeros(length(masses))}; + Gm_iff = {zeros(length(masses))}; + Gm_dvf = {zeros(length(masses))}; + Gm_ine = {zeros(length(masses))}; + + for i = 1:length(masses) + initializeSample('mass', masses(i)); + + %% Run the linearization + G = linearize(mdl, io, 0.1, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Gm(i) = {G}; + Gm_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gm_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gm_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + end +#+end_src + +#+begin_src matlab :exports none + save('./active_damping/mat/plants_variable.mat', 'masses', 'Gm_iff', 'Gm_dvf', 'Gm_ine', '-append'); +#+end_src + +*** Plots :ignore: +#+begin_src matlab :exports none + load('./active_damping/mat/plants_variable.mat', 'masses', 'Gm_iff', 'Gm_dvf', 'Gm_ine'); +#+end_src + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Gm_iff) + plot(freqs, abs(squeeze(freqresp(Gm_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gm_iff) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$M = %.0f$ [kg]', masses(i))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_iff_sample_mass.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_iff_sample_mass +#+CAPTION: Variability of the IFF plant with the Sample Mass ([[./figs/act_damp_variability_iff_sample_mass.png][png]], [[./figs/act_damp_variability_iff_sample_mass.pdf][pdf]]) +[[file:figs/act_damp_variability_iff_sample_mass.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + + for i = 1:length(Gm_dvf) + plot(freqs, abs(squeeze(freqresp(Gm_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gm_dvf) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$M = %.0f$ [kg]', masses(i))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_dvf_sample_mass.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_dvf_sample_mass +#+CAPTION: Variability of the DVF plant with the Sample Mass ([[./figs/act_damp_variability_dvf_sample_mass.png][png]], [[./figs/act_damp_variability_dvf_sample_mass.pdf][pdf]]) +[[file:figs/act_damp_variability_dvf_sample_mass.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Gm_ine) + plot(freqs, abs(squeeze(freqresp(Gm_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gm_ine) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$M = %.0f$ [kg]', masses(i))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_ine_sample_mass.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_ine_sample_mass +#+CAPTION: Variability of the Inertial plant with the Sample Mass ([[./figs/act_damp_variability_ine_sample_mass.png][png]], [[./figs/act_damp_variability_ine_sample_mass.pdf][pdf]]) +[[file:figs/act_damp_variability_ine_sample_mass.png]] + +** Variation of the Spindle Angle +*** Introduction :ignore: +*** Initialize the Simulation :noexport: +We initialize all the stages with the default parameters. +#+begin_src matlab + initializeGround(); + initializeGranite(); + initializeTy(); + initializeRy(); + initializeRz(); + initializeMicroHexapod(); + initializeAxisc(); + initializeMirror(); +#+end_src + +No disturbances. +#+begin_src matlab + initializeDisturbances('enable', false); +#+end_src + +The nano-hexapod is a piezoelectric hexapod. +#+begin_src matlab + initializeNanoHexapod('actuator', 'piezo'); + initializeSample('mass', 50); +#+end_src + +And all the controllers are set to 0. +#+begin_src matlab + K = tf(zeros(6)); + save('./mat/controllers.mat', 'K', '-append'); + K_ine = tf(zeros(6)); + save('./mat/controllers.mat', 'K_ine', '-append'); + K_iff = tf(zeros(6)); + save('./mat/controllers.mat', 'K_iff', '-append'); + K_dvf = tf(zeros(6)); + save('./mat/controllers.mat', 'K_dvf', '-append'); +#+end_src + +*** Identification :ignore: +#+begin_src matlab :exports none + %% Options for Linearized + options = linearizeOptions; + options.SampleTime = 0; + + %% Name of the Simulink File + mdl = 'sim_nass_active_damping'; + + %% Input/Output definition + clear io; io_i = 1; + io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; +#+end_src + +We identify the dynamics for the following Spindle angles. +#+begin_src matlab + Rz_amplitudes = [0, pi/4, pi/2, pi]; % [rad] +#+end_src + +#+begin_src matlab :exports none + Ga = {zeros(length(Rz_amplitudes))}; + Ga_iff = {zeros(length(Rz_amplitudes))}; + Ga_dvf = {zeros(length(Rz_amplitudes))}; + Ga_ine = {zeros(length(Rz_amplitudes))}; + + for i = 1:length(Rz_amplitudes) + initializeReferences('Rz_type', 'constant', 'Rz_amplitude', Rz_amplitudes(i)) + + %% Run the linearization + G = linearize(mdl, io, 0.1, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Ga(i) = {G}; + Ga_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Ga_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Ga_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + end +#+end_src + +#+begin_src matlab :exports none + save('./active_damping/mat/plants_variable.mat', 'Rz_amplitudes', 'Ga_iff', 'Ga_dvf', 'Ga_ine', '-append'); +#+end_src + +*** Plots :ignore: +#+begin_src matlab :exports none + load('./active_damping/mat/plants_variable.mat', 'Rz_amplitudes', 'Ga_iff', 'Ga_dvf', 'Ga_ine'); +#+end_src + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Ga_iff) + plot(freqs, abs(squeeze(freqresp(Ga_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Ga_iff) + plot(freqs, 180/pi*angle(squeeze(freqresp(Ga_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [deg]', Rz_amplitudes(i)*180/pi)); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_iff_spindle_angle.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_iff_spindle_angle +#+CAPTION: Variability of the IFF plant with the Spindle Angle ([[./figs/act_damp_variability_iff_spindle_angle.png][png]], [[./figs/act_damp_variability_iff_spindle_angle.pdf][pdf]]) +[[file:figs/act_damp_variability_iff_spindle_angle.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + + for i = 1:length(Ga_dvf) + plot(freqs, abs(squeeze(freqresp(Ga_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Ga_dvf) + plot(freqs, 180/pi*angle(squeeze(freqresp(Ga_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [deg]', Rz_amplitudes(i)*180/pi)); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_dvf_spindle_angle.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_dvf_spindle_angle +#+CAPTION: Variability of the DVF plant with the Spindle Angle ([[./figs/act_damp_variability_dvf_spindle_angle.png][png]], [[./figs/act_damp_variability_dvf_spindle_angle.pdf][pdf]]) +[[file:figs/act_damp_variability_dvf_spindle_angle.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Ga_ine) + plot(freqs, abs(squeeze(freqresp(Ga_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Ga_ine) + plot(freqs, 180/pi*angle(squeeze(freqresp(Ga_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [deg]', Rz_amplitudes(i)*180/pi)); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_ine_spindle_angle.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_ine_spindle_angle +#+CAPTION: Variability of the Inertial plant with the Spindle Angle ([[./figs/act_damp_variability_ine_spindle_angle.png][png]], [[./figs/act_damp_variability_ine_spindle_angle.pdf][pdf]]) +[[file:figs/act_damp_variability_ine_spindle_angle.png]] + +** Variation of the Spindle Rotation Speed +*** Introduction :ignore: +*** Initialize the Simulation :noexport: +We initialize all the stages with the default parameters. +#+begin_src matlab + initializeGround(); + initializeGranite(); + initializeTy(); + initializeRy(); + initializeRz(); + initializeMicroHexapod(); + initializeAxisc(); + initializeMirror(); +#+end_src + +No disturbances. +#+begin_src matlab + initializeDisturbances('enable', false); +#+end_src + +The nano-hexapod is a piezoelectric hexapod. +#+begin_src matlab + initializeNanoHexapod('actuator', 'piezo'); + initializeSample('mass', 50); +#+end_src + +And all the controllers are set to 0. +#+begin_src matlab + K = tf(zeros(6)); + save('./mat/controllers.mat', 'K', '-append'); + K_ine = tf(zeros(6)); + save('./mat/controllers.mat', 'K_ine', '-append'); + K_iff = tf(zeros(6)); + save('./mat/controllers.mat', 'K_iff', '-append'); + K_dvf = tf(zeros(6)); + save('./mat/controllers.mat', 'K_dvf', '-append'); +#+end_src + +*** Identification :ignore: +#+begin_src matlab :exports none + %% Options for Linearized + options = linearizeOptions; + options.SampleTime = 0; + + %% Name of the Simulink File + mdl = 'sim_nass_active_damping'; + + %% Input/Output definition + clear io; io_i = 1; + io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; +#+end_src + +We identify the dynamics for the following Spindle rotation periods. +#+begin_src matlab + Rz_periods = [60, 10, 1]; % [s] +#+end_src + +#+begin_src matlab :exports none + Gw = {zeros(length(Rz_periods))}; + Gw_iff = {zeros(length(Rz_periods))}; + Gw_dvf = {zeros(length(Rz_periods))}; + Gw_ine = {zeros(length(Rz_periods))}; + + for i = 1:length(Rz_periods) + initializeReferences('Rz_type', 'rotating', 'Rz_period', Rz_periods(i)); + + %% Run the linearization + G = linearize(mdl, io, 0.5, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Gw(i) = {G}; + Gw_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gw_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gw_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + end +#+end_src + +#+begin_src matlab :exports none + save('./active_damping/mat/plants_variable.mat', 'Rz_periods', 'Gw_iff', 'Gw_dvf', 'Gw_ine', '-append'); +#+end_src + +*** Plots :ignore: +#+begin_src matlab :exports none + load('./active_damping/mat/plants_variable.mat', 'Rz_periods', 'Gw_iff', 'Gw_dvf', 'Gw_ine'); +#+end_src + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 5000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Gw_iff) + plot(freqs, abs(squeeze(freqresp(Gw_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gw_iff) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gw_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [rpm]', 60/Rz_periods(i))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_iff_spindle_speed.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_iff_spindle_speed +#+CAPTION: Variability of the IFF plant with the Spindle rotation speed ([[./figs/act_damp_variability_iff_spindle_speed.png][png]], [[./figs/act_damp_variability_iff_spindle_speed.pdf][pdf]]) +[[file:figs/act_damp_variability_iff_spindle_speed.png]] + +#+begin_src matlab :exports none + xlim([10, 30]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_iff_spindle_speed_zoom.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_iff_spindle_speed_zoom +#+CAPTION: Variability of the IFF plant with the Spindle rotation speed ([[./figs/act_damp_variability_iff_spindle_speed_zoom.png][png]], [[./figs/act_damp_variability_iff_spindle_speed_zoom.pdf][pdf]]) +[[file:figs/act_damp_variability_iff_spindle_speed_zoom.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 5000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + + for i = 1:length(Gw_dvf) + plot(freqs, abs(squeeze(freqresp(Gw_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gw_dvf) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gw_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [rpm]', 60/Rz_periods(i))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_dvf_spindle_speed.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_dvf_spindle_speed +#+CAPTION: Variability of the DVF plant with the Spindle rotation speed ([[./figs/act_damp_variability_dvf_spindle_speed.png][png]], [[./figs/act_damp_variability_dvf_spindle_speed.pdf][pdf]]) +[[file:figs/act_damp_variability_dvf_spindle_speed.png]] + +#+begin_src matlab :exports none + xlim([10, 30]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_dvf_spindle_speed_zoom.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_dvf_spindle_speed_zoom +#+CAPTION: Variability of the DVF plant with the Spindle rotation speed ([[./figs/act_damp_variability_dvf_spindle_speed_zoom.png][png]], [[./figs/act_damp_variability_dvf_spindle_speed_zoom.pdf][pdf]]) +[[file:figs/act_damp_variability_dvf_spindle_speed_zoom.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 5000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Gw_ine) + plot(freqs, abs(squeeze(freqresp(Gw_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gw_ine) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gw_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [rpm]', 60/Rz_periods(i))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_ine_spindle_speed.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_ine_spindle_speed +#+CAPTION: Variability of the Inertial plant with the Spindle rotation speed ([[./figs/act_damp_variability_ine_spindle_speed.png][png]], [[./figs/act_damp_variability_ine_spindle_speed.pdf][pdf]]) +[[file:figs/act_damp_variability_ine_spindle_speed.png]] + +#+begin_src matlab :exports none + xlim([10, 30]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_ine_spindle_speed_zoom.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_ine_spindle_speed_zoom +#+CAPTION: Variability of the Inertial plant with the Spindle rotation speed ([[./figs/act_damp_variability_ine_spindle_speed_zoom.png][png]], [[./figs/act_damp_variability_ine_spindle_speed_zoom.pdf][pdf]]) +[[file:figs/act_damp_variability_ine_spindle_speed_zoom.png]] + +** Variation of the Tilt Angle +*** Introduction :ignore: +*** Initialize the Simulation :noexport: +We initialize all the stages with the default parameters. +#+begin_src matlab + initializeGround(); + initializeGranite(); + initializeTy(); + initializeRy(); + initializeRz(); + initializeMicroHexapod(); + initializeAxisc(); + initializeMirror(); +#+end_src + +No disturbances. +#+begin_src matlab + initializeDisturbances('enable', false); +#+end_src + +The nano-hexapod is a piezoelectric hexapod. +#+begin_src matlab + initializeNanoHexapod('actuator', 'piezo'); + initializeSample('mass', 50); +#+end_src + +And all the controllers are set to 0. +#+begin_src matlab + K = tf(zeros(6)); + save('./mat/controllers.mat', 'K', '-append'); + K_ine = tf(zeros(6)); + save('./mat/controllers.mat', 'K_ine', '-append'); + K_iff = tf(zeros(6)); + save('./mat/controllers.mat', 'K_iff', '-append'); + K_dvf = tf(zeros(6)); + save('./mat/controllers.mat', 'K_dvf', '-append'); +#+end_src + +*** Identification :ignore: +#+begin_src matlab :exports none + %% Options for Linearized + options = linearizeOptions; + options.SampleTime = 0; + + %% Name of the Simulink File + mdl = 'sim_nass_active_damping'; + + %% Input/Output definition + clear io; io_i = 1; + io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; + io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; +#+end_src + +We identify the dynamics for the following Tilt stage angles. +#+begin_src matlab + Ry_amplitudes = [0, 3*pi/180]; % [rad] +#+end_src + +#+begin_src matlab :exports none + Gy = {zeros(length(Ry_amplitudes))}; + Gy_iff = {zeros(length(Ry_amplitudes))}; + Gy_dvf = {zeros(length(Ry_amplitudes))}; + Gy_ine = {zeros(length(Ry_amplitudes))}; + + for i = 1:length(Ry_amplitudes) + initializeReferences('Ry_type', 'constant', 'Ry_amplitude', Ry_amplitudes(i)) + + %% Run the linearization + G = linearize(mdl, io, 0.1, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Gy(i) = {G}; + Gy_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gy_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gy_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + end +#+end_src + +#+begin_src matlab :exports none + save('./active_damping/mat/plants_variable.mat', 'Ry_amplitudes', 'Gy_iff', 'Gy_dvf', 'Gy_ine', '-append'); +#+end_src + +*** Plots :ignore: +#+begin_src matlab :exports none + load('./active_damping/mat/plants_variable.mat', 'Ry_amplitudes', 'Gy_iff', 'Gy_dvf', 'Gy_ine'); +#+end_src + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Gy_iff) + plot(freqs, abs(squeeze(freqresp(Gy_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gy_iff) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gy_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Ry = %.0f$ [deg]', Ry_amplitudes(i)*180/pi)); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_iff_tilt_angle.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_iff_tilt_angle +#+CAPTION: Variability of the IFF plant with the Spindle Angle ([[./figs/act_damp_variability_iff_tilt_angle.png][png]], [[./figs/act_damp_variability_iff_tilt_angle.pdf][pdf]]) +[[file:figs/act_damp_variability_iff_tilt_angle.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + + for i = 1:length(Gy_dvf) + plot(freqs, abs(squeeze(freqresp(Gy_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gy_dvf) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gy_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Ry = %.0f$ [deg]', Ry_amplitudes(i)*180/pi)); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_dvf_tilt_angle.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_dvf_tilt_angle +#+CAPTION: Variability of the DVF plant with the Spindle Angle ([[./figs/act_damp_variability_dvf_tilt_angle.png][png]], [[./figs/act_damp_variability_dvf_tilt_angle.pdf][pdf]]) +[[file:figs/act_damp_variability_dvf_tilt_angle.png]] + +#+begin_src matlab :exports none + freqs = logspace(0, 3, 1000); + + figure; + + ax1 = subplot(2, 1, 1); + hold on; + for i = 1:length(Gy_ine) + plot(freqs, abs(squeeze(freqresp(Gy_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); + ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + + ax2 = subplot(2, 1, 2); + hold on; + for i = 1:length(Gy_ine) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gy_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Ry = %.0f$ [deg]', Ry_amplitudes(i)*180/pi)); + end + hold off; + set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); + ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); + ylim([-180, 180]); + yticks([-180, -90, 0, 90, 180]); + legend('location', 'southwest'); + + linkaxes([ax1,ax2],'x'); + xlim([freqs(1), freqs(end)]); +#+end_src + +#+HEADER: :tangle no :exports results :results none :noweb yes +#+begin_src matlab :var filepath="figs/act_damp_variability_ine_tilt_angle.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png") +<> +#+end_src + +#+NAME: fig:act_damp_variability_ine_tilt_angle +#+CAPTION: Variability of the Inertial plant with the Spindle Angle ([[./figs/act_damp_variability_ine_tilt_angle.png][png]], [[./figs/act_damp_variability_ine_tilt_angle.pdf][pdf]]) +[[file:figs/act_damp_variability_ine_tilt_angle.png]] + +** Conclusion + * Comparison <> ** Introduction :ignore: @@ -2269,7 +3196,7 @@ Window used for =pwelch= function. #+end_src #+NAME: fig:act_damp_tomo_exp_comp_psd_trans -#+CAPTION: PSD of the translation errors for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_psd_trans.png][png]], [[./figs/act_damp_tomo_exp_comp_psd_trans.pdf][pdf]]) +#+CAPTION: PSD of the translation errors in the X direction for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_psd_trans.png][png]], [[./figs/act_damp_tomo_exp_comp_psd_trans.pdf][pdf]]) [[file:figs/act_damp_tomo_exp_comp_psd_trans.png]] #+begin_src matlab :exports none @@ -2281,7 +3208,7 @@ Window used for =pwelch= function. plot(f, prx, 'k--', 'DisplayName', 'Undamped') hold off; xlabel('Frequency [Hz]'); - ylabel('Power Spectral Density [$m^2/Hz$]'); + ylabel('Power Spectral Density [$rad^2/Hz$]'); set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); legend('location', 'northeast'); xlim([2, 500]); @@ -2293,7 +3220,7 @@ Window used for =pwelch= function. #+end_src #+NAME: fig:act_damp_tomo_exp_comp_psd_rot -#+CAPTION: PSD of the rotation errors for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_psd_rot.png][png]], [[./figs/act_damp_tomo_exp_comp_psd_rot.pdf][pdf]]) +#+CAPTION: PSD of the rotation errors in the X direction for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_psd_rot.png][png]], [[./figs/act_damp_tomo_exp_comp_psd_rot.pdf][pdf]]) [[file:figs/act_damp_tomo_exp_comp_psd_rot.png]] #+begin_src matlab :exports none @@ -2305,7 +3232,7 @@ Window used for =pwelch= function. plot(f, flip(-cumtrapz(flip(f), flip(pxx))), 'k--', 'DisplayName', 'Undamped') hold off; xlabel('Frequency [Hz]'); - ylabel('Power Spectral Density [$m^2/Hz$]'); + ylabel('Cumulative Power Spectrum [$m^2$]'); set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); legend('location', 'northeast'); xlim([2, 500]); @@ -2317,7 +3244,7 @@ Window used for =pwelch= function. #+end_src #+NAME: fig:act_damp_tomo_exp_comp_cps_trans -#+CAPTION: CPS of the translation errors for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_cps_trans.png][png]], [[./figs/act_damp_tomo_exp_comp_cps_trans.pdf][pdf]]) +#+CAPTION: CPS of the translation errors in the X direction for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_cps_trans.png][png]], [[./figs/act_damp_tomo_exp_comp_cps_trans.pdf][pdf]]) [[file:figs/act_damp_tomo_exp_comp_cps_trans.png]] #+begin_src matlab :exports none @@ -2329,7 +3256,7 @@ Window used for =pwelch= function. plot(f, flip(-cumtrapz(flip(f), flip(prx))), 'k--', 'DisplayName', 'Undamped') hold off; xlabel('Frequency [Hz]'); - ylabel('Power Spectral Density [$m^2/Hz$]'); + ylabel('Cumulative Power Spectrum [$rad^2$]'); set(gca, 'xscale', 'log'); set(gca, 'yscale', 'log'); legend('location', 'northeast'); xlim([2, 500]); @@ -2341,7 +3268,7 @@ Window used for =pwelch= function. #+end_src #+NAME: fig:act_damp_tomo_exp_comp_cps_rot -#+CAPTION: CPS of the rotation errors for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_cps_rot.png][png]], [[./figs/act_damp_tomo_exp_comp_cps_rot.pdf][pdf]]) +#+CAPTION: CPS of the rotation errors in the X direction for applied Active Damping techniques ([[./figs/act_damp_tomo_exp_comp_cps_rot.png][png]], [[./figs/act_damp_tomo_exp_comp_cps_rot.pdf][pdf]]) [[file:figs/act_damp_tomo_exp_comp_cps_rot.png]] * Useful Functions diff --git a/active_damping/mat/plants_variable.mat b/active_damping/mat/plants_variable.mat new file mode 100644 index 0000000..c11bd0b Binary files /dev/null and b/active_damping/mat/plants_variable.mat differ diff --git a/active_damping/matlab/act_damp_variability_plant.m b/active_damping/matlab/act_damp_variability_plant.m new file mode 100644 index 0000000..6152d4d --- /dev/null +++ b/active_damping/matlab/act_damp_variability_plant.m @@ -0,0 +1,759 @@ +%% Clear Workspace and Close figures +clear; close all; clc; + +%% Intialize Laplace variable +s = zpk('s'); + +open('active_damping/matlab/sim_nass_active_damping.slx') +load('mat/conf_simscape.mat'); + +% Initialize the Simulation +% We initialize all the stages with the default parameters. + +initializeGround(); +initializeGranite(); +initializeTy(); +initializeRy(); +initializeRz(); +initializeMicroHexapod(); +initializeAxisc(); +initializeMirror(); + + + +% No disturbances. + +initializeDisturbances('enable', false); + + + +% The nano-hexapod is a piezoelectric hexapod. + +initializeNanoHexapod('actuator', 'piezo'); + + + +% We set the references to zero. + +initializeReferences(); + + + +% And all the controllers are set to 0. + +K = tf(zeros(6)); +save('./mat/controllers.mat', 'K', '-append'); +K_ine = tf(zeros(6)); +save('./mat/controllers.mat', 'K_ine', '-append'); +K_iff = tf(zeros(6)); +save('./mat/controllers.mat', 'K_iff', '-append'); +K_dvf = tf(zeros(6)); +save('./mat/controllers.mat', 'K_dvf', '-append'); + +% Identification +% First, we identify the dynamics of the system using the =linearize= function. + +%% Options for Linearized +options = linearizeOptions; +options.SampleTime = 0; + +%% Name of the Simulink File +mdl = 'sim_nass_active_damping'; + +%% Input/Output definition +clear io; io_i = 1; +io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; + +masses = [1, 10, 50]; + +Gm = {zeros(length(masses))}; +Gm_iff = {zeros(length(masses))}; +Gm_dvf = {zeros(length(masses))}; +Gm_ine = {zeros(length(masses))}; + +for i = 1:length(masses) + initializeSample('mass', masses(i)); + + %% Run the linearization + G = linearize(mdl, io, 0.1, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Gm(i) = {G}; + Gm_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gm_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gm_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; +end + +save('./active_damping/mat/plants_variable.mat', 'Gm_iff', 'Gm_dvf', 'Gm_ine', '-append'); + +% Plots + +load('./active_damping/mat/plants_variable.mat', 'Gm_iff', 'Gm_dvf', 'Gm_ine'); + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Gm) + set(gca,'ColorOrderIndex',i); + plot(freqs, abs(squeeze(freqresp(Gm_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); + for j = 2:6 + set(gca,'ColorOrderIndex',i); + plot(freqs, abs(squeeze(freqresp(Gm_iff{i}(['Fnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz')))); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gm) + set(gca,'ColorOrderIndex',i); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$M = %.0f$ [kg]', masses(i))); + for j = 2:6 + set(gca,'ColorOrderIndex',i); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_iff{i}(['Fnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz'))), 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_iff_sample_mass +% #+CAPTION: Variability of the IFF plant with the Spindle Angle ([[./figs/act_damp_variability_iff_sample_mass.png][png]], [[./figs/act_damp_variability_iff_sample_mass.pdf][pdf]]) +% [[file:figs/act_damp_variability_iff_sample_mass.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; + +for i = 1:length(Gm) + set(gca,'ColorOrderIndex',i); + plot(freqs, abs(squeeze(freqresp(Gm_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); + for j = 2:6 + set(gca,'ColorOrderIndex',i); + plot(freqs, abs(squeeze(freqresp(Gm_dvf{i}(['Dnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz')))); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gm) + set(gca,'ColorOrderIndex',i); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$M = %.0f$ [kg]', masses(i))); + for j = 2:6 + set(gca,'ColorOrderIndex',i); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_dvf{i}(['Dnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz'))), 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_dvf_sample_mass +% #+CAPTION: Variability of the DVF plant with the Spindle Angle ([[./figs/act_damp_variability_dvf_sample_mass.png][png]], [[./figs/act_damp_variability_dvf_sample_mass.pdf][pdf]]) +% [[file:figs/act_damp_variability_dvf_sample_mass.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Gm) + set(gca,'ColorOrderIndex',i); + plot(freqs, abs(squeeze(freqresp(Gm_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); + for j = 2:6 + set(gca,'ColorOrderIndex',i); + plot(freqs, abs(squeeze(freqresp(Gm_ine{i}(['Vnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz')))); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gm) + set(gca,'ColorOrderIndex',i); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$M = %.0f$ [kg]', masses(i))); + for j = 2:6 + set(gca,'ColorOrderIndex',i); + plot(freqs, 180/pi*angle(squeeze(freqresp(Gm_ine{i}(['Vnlm', num2str(i)], ['Fnl', num2str(i)]), freqs, 'Hz'))), 'HandleVisibility', 'off'); + end +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + +% Initialize the Simulation +% We initialize all the stages with the default parameters. + +initializeGround(); +initializeGranite(); +initializeTy(); +initializeRy(); +initializeRz(); +initializeMicroHexapod(); +initializeAxisc(); +initializeMirror(); + + + +% No disturbances. + +initializeDisturbances('enable', false); + + + +% The nano-hexapod is a piezoelectric hexapod. + +initializeNanoHexapod('actuator', 'piezo'); +initializeSample('mass', 50); + + + +% And all the controllers are set to 0. + +K = tf(zeros(6)); +save('./mat/controllers.mat', 'K', '-append'); +K_ine = tf(zeros(6)); +save('./mat/controllers.mat', 'K_ine', '-append'); +K_iff = tf(zeros(6)); +save('./mat/controllers.mat', 'K_iff', '-append'); +K_dvf = tf(zeros(6)); +save('./mat/controllers.mat', 'K_dvf', '-append'); + +% Identification +% First, we identify the dynamics of the system using the =linearize= function. + +%% Options for Linearized +options = linearizeOptions; +options.SampleTime = 0; + +%% Name of the Simulink File +mdl = 'sim_nass_active_damping'; + +%% Input/Output definition +clear io; io_i = 1; +io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; + +Rz_amplitudes = [0, pi/4, pi/2, pi]; % [rad] + +Ga = {zeros(length(Rz_amplitudes))}; +Ga_iff = {zeros(length(Rz_amplitudes))}; +Ga_dvf = {zeros(length(Rz_amplitudes))}; +Ga_ine = {zeros(length(Rz_amplitudes))}; + +for i = 1:length(Rz_amplitudes) +initializeReferences('Rz_type', 'constant', 'Rz_amplitude', Rz_amplitudes(i)) + + %% Run the linearization + G = linearize(mdl, io, 0.1, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Ga(i) = {G}; + Ga_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Ga_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Ga_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; +end + +save('./active_damping/mat/plants_variable.mat', 'Ga_iff', 'Ga_dvf', 'Ga_ine', '-append'); + +% Plots + +load('./active_damping/mat/plants_variable.mat', 'Ga_iff', 'Ga_dvf', 'Ga_ine'); + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Ga) + plot(freqs, abs(squeeze(freqresp(Ga_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Ga) + plot(freqs, 180/pi*angle(squeeze(freqresp(Ga_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [deg]', Rz_amplitudes(i)*180/pi)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_iff_spindle_angle +% #+CAPTION: Variability of the IFF plant with the Spindle Angle ([[./figs/act_damp_variability_iff_spindle_angle.png][png]], [[./figs/act_damp_variability_iff_spindle_angle.pdf][pdf]]) +% [[file:figs/act_damp_variability_iff_spindle_angle.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; + +for i = 1:length(Ga) + plot(freqs, abs(squeeze(freqresp(Ga_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Ga) + plot(freqs, 180/pi*angle(squeeze(freqresp(Ga_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [deg]', Rz_amplitudes(i)*180/pi)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_dvf_spindle_angle +% #+CAPTION: Variability of the DVF plant with the Spindle Angle ([[./figs/act_damp_variability_dvf_spindle_angle.png][png]], [[./figs/act_damp_variability_dvf_spindle_angle.pdf][pdf]]) +% [[file:figs/act_damp_variability_dvf_spindle_angle.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Ga) + plot(freqs, abs(squeeze(freqresp(Ga_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Ga) + plot(freqs, 180/pi*angle(squeeze(freqresp(Ga_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [deg]', Rz_amplitudes(i)*180/pi)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + +% Initialize the Simulation +% We initialize all the stages with the default parameters. + +initializeGround(); +initializeGranite(); +initializeTy(); +initializeRy(); +initializeRz(); +initializeMicroHexapod(); +initializeAxisc(); +initializeMirror(); + + + +% No disturbances. + +initializeDisturbances('enable', false); + + + +% The nano-hexapod is a piezoelectric hexapod. + +initializeNanoHexapod('actuator', 'piezo'); +initializeSample('mass', 50); + + + +% And all the controllers are set to 0. + +K = tf(zeros(6)); +save('./mat/controllers.mat', 'K', '-append'); +K_ine = tf(zeros(6)); +save('./mat/controllers.mat', 'K_ine', '-append'); +K_iff = tf(zeros(6)); +save('./mat/controllers.mat', 'K_iff', '-append'); +K_dvf = tf(zeros(6)); +save('./mat/controllers.mat', 'K_dvf', '-append'); + +% Identification +% First, we identify the dynamics of the system using the =linearize= function. + +%% Options for Linearized +options = linearizeOptions; +options.SampleTime = 0; + +%% Name of the Simulink File +mdl = 'sim_nass_active_damping'; + +%% Input/Output definition +clear io; io_i = 1; +io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; + +Rz_periods = [60, 10, 1]; % [s] + +Gw = {zeros(length(Rz_periods))}; +Gw_iff = {zeros(length(Rz_periods))}; +Gw_dvf = {zeros(length(Rz_periods))}; +Gw_ine = {zeros(length(Rz_periods))}; + +for i = 1:length(Rz_periods) + initializeReferences('Rz_type', 'rotating', 'Rz_period', Rz_periods(i)); + + %% Run the linearization + G = linearize(mdl, io, 0.5, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Gw(i) = {G}; + Gw_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gw_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gw_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; +end + +save('./active_damping/mat/plants_variable.mat', 'Gw_iff', 'Gw_dvf', 'Gw_ine', '-append'); + +% Plots + +load('./active_damping/mat/plants_variable.mat', 'Gw_iff', 'Gw_dvf', 'Gw_ine'); + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Gw) + plot(freqs, abs(squeeze(freqresp(Gw_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gw) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gw_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [rpm]', 60/Rz_periods(i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_iff_spindle_speed +% #+CAPTION: Variability of the IFF plant with the Spindle Angle ([[./figs/act_damp_variability_iff_spindle_speed.png][png]], [[./figs/act_damp_variability_iff_spindle_speed.pdf][pdf]]) +% [[file:figs/act_damp_variability_iff_spindle_speed.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; + +for i = 1:length(Gw) + plot(freqs, abs(squeeze(freqresp(Gw_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gw) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gw_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [rpm]', 60/Rz_periods(i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_dvf_spindle_speed +% #+CAPTION: Variability of the DVF plant with the Spindle Angle ([[./figs/act_damp_variability_dvf_spindle_speed.png][png]], [[./figs/act_damp_variability_dvf_spindle_speed.pdf][pdf]]) +% [[file:figs/act_damp_variability_dvf_spindle_speed.png]] + + +freqs = logspace(0, 2, 5000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Gw) + plot(freqs, abs(squeeze(freqresp(Gw_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gw) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gw_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Rz = %.0f$ [rpm]', 60/Rz_periods(i))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + +% Initialize the Simulation +% We initialize all the stages with the default parameters. + +initializeGround(); +initializeGranite(); +initializeTy(); +initializeRy(); +initializeRz(); +initializeMicroHexapod(); +initializeAxisc(); +initializeMirror(); + + + +% No disturbances. + +initializeDisturbances('enable', false); + + + +% The nano-hexapod is a piezoelectric hexapod. + +initializeNanoHexapod('actuator', 'piezo'); +initializeSample('mass', 50); + + + +% And all the controllers are set to 0. + +K = tf(zeros(6)); +save('./mat/controllers.mat', 'K', '-append'); +K_ine = tf(zeros(6)); +save('./mat/controllers.mat', 'K_ine', '-append'); +K_iff = tf(zeros(6)); +save('./mat/controllers.mat', 'K_iff', '-append'); +K_dvf = tf(zeros(6)); +save('./mat/controllers.mat', 'K_dvf', '-append'); + +% Identification +% First, we identify the dynamics of the system using the =linearize= function. + +%% Options for Linearized +options = linearizeOptions; +options.SampleTime = 0; + +%% Name of the Simulink File +mdl = 'sim_nass_active_damping'; + +%% Input/Output definition +clear io; io_i = 1; +io(io_i) = linio([mdl, '/Fnl'], 1, 'openinput'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Dnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Fnlm'); io_i = io_i + 1; +io(io_i) = linio([mdl, '/Micro-Station'], 3, 'openoutput', [], 'Vlm'); io_i = io_i + 1; + +Ry_amplitudes = [0, 3*pi/180]; % [rad] + +Gy = {zeros(length(Ry_amplitudes))}; +Gy_iff = {zeros(length(Ry_amplitudes))}; +Gy_dvf = {zeros(length(Ry_amplitudes))}; +Gy_ine = {zeros(length(Ry_amplitudes))}; + +for i = 1:length(Ry_amplitudes) + initializeReferences('Ry_type', 'constant', 'Ry_amplitude', Ry_amplitudes(i)) + + %% Run the linearization + G = linearize(mdl, io, 0.1, options); + G.InputName = {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}; + G.OutputName = {'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6', ... + 'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6', ... + 'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}; + Gy(i) = {G}; + Gy_iff(i) = {minreal(G({'Fnlm1', 'Fnlm2', 'Fnlm3', 'Fnlm4', 'Fnlm5', 'Fnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gy_dvf(i) = {minreal(G({'Dnlm1', 'Dnlm2', 'Dnlm3', 'Dnlm4', 'Dnlm5', 'Dnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; + Gy_ine(i) = {minreal(G({'Vnlm1', 'Vnlm2', 'Vnlm3', 'Vnlm4', 'Vnlm5', 'Vnlm6'}, {'Fnl1', 'Fnl2', 'Fnl3', 'Fnl4', 'Fnl5', 'Fnl6'}))}; +end + +save('./active_damping/mat/plants_variable.mat', 'Gy_iff', 'Gy_dvf', 'Gy_ine', '-append'); + +% Plots + +load('./active_damping/mat/plants_variable.mat', 'Gy_iff', 'Gy_dvf', 'Gy_ine'); + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Gy) + plot(freqs, abs(squeeze(freqresp(Gy_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [N/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gy) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gy_iff{i}('Fnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Ry = %.0f$ [deg]', Ry_amplitudes(i)*180/pi)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_iff_tilt_angle +% #+CAPTION: Variability of the IFF plant with the Spindle Angle ([[./figs/act_damp_variability_iff_tilt_angle.png][png]], [[./figs/act_damp_variability_iff_tilt_angle.pdf][pdf]]) +% [[file:figs/act_damp_variability_iff_tilt_angle.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; + +for i = 1:length(Gy) + plot(freqs, abs(squeeze(freqresp(Gy_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [m/N]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gy) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gy_dvf{i}('Dnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Ry = %.0f$ [deg]', Ry_amplitudes(i)*180/pi)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); + + + +% #+NAME: fig:act_damp_variability_dvf_tilt_angle +% #+CAPTION: Variability of the DVF plant with the Spindle Angle ([[./figs/act_damp_variability_dvf_tilt_angle.png][png]], [[./figs/act_damp_variability_dvf_tilt_angle.pdf][pdf]]) +% [[file:figs/act_damp_variability_dvf_tilt_angle.png]] + + +freqs = logspace(0, 3, 1000); + +figure; + +ax1 = subplot(2, 1, 1); +hold on; +for i = 1:length(Gy) + plot(freqs, abs(squeeze(freqresp(Gy_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz')))); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); +ylabel('Amplitude [$\frac{m/s}{N}$]'); set(gca, 'XTickLabel',[]); + +ax2 = subplot(2, 1, 2); +hold on; +for i = 1:length(Gy) + plot(freqs, 180/pi*angle(squeeze(freqresp(Gy_ine{i}('Vnlm1', 'Fnl1'), freqs, 'Hz'))), 'DisplayName', sprintf('$Ry = %.0f$ [deg]', Ry_amplitudes(i)*180/pi)); +end +hold off; +set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); +ylabel('Phase [deg]'); xlabel('Frequency [Hz]'); +ylim([-180, 180]); +yticks([-180, -90, 0, 90, 180]); +legend('location', 'southwest'); + +linkaxes([ax1,ax2],'x'); diff --git a/active_damping/matlab/sim_nass_active_damping.slx b/active_damping/matlab/sim_nass_active_damping.slx index c5fdd3a..b719702 100644 Binary files a/active_damping/matlab/sim_nass_active_damping.slx and b/active_damping/matlab/sim_nass_active_damping.slx differ diff --git a/figs/act_damp_variability_dvf_sample_mass.pdf b/figs/act_damp_variability_dvf_sample_mass.pdf new file mode 100644 index 0000000..38fa88d Binary files /dev/null and b/figs/act_damp_variability_dvf_sample_mass.pdf differ diff --git a/figs/act_damp_variability_dvf_sample_mass.png b/figs/act_damp_variability_dvf_sample_mass.png new file mode 100644 index 0000000..4a94492 Binary files /dev/null and b/figs/act_damp_variability_dvf_sample_mass.png differ diff --git a/figs/act_damp_variability_dvf_spindle_angle.pdf b/figs/act_damp_variability_dvf_spindle_angle.pdf new file mode 100644 index 0000000..7010429 Binary files /dev/null and b/figs/act_damp_variability_dvf_spindle_angle.pdf differ diff --git a/figs/act_damp_variability_dvf_spindle_angle.png b/figs/act_damp_variability_dvf_spindle_angle.png new file mode 100644 index 0000000..009a67b Binary files /dev/null and b/figs/act_damp_variability_dvf_spindle_angle.png differ diff --git a/figs/act_damp_variability_dvf_spindle_speed.pdf b/figs/act_damp_variability_dvf_spindle_speed.pdf new file mode 100644 index 0000000..b8679ad Binary files /dev/null and b/figs/act_damp_variability_dvf_spindle_speed.pdf differ diff --git a/figs/act_damp_variability_dvf_spindle_speed.png b/figs/act_damp_variability_dvf_spindle_speed.png new file mode 100644 index 0000000..eaa0ef9 Binary files /dev/null and b/figs/act_damp_variability_dvf_spindle_speed.png differ diff --git a/figs/act_damp_variability_dvf_spindle_speed_zoom.pdf b/figs/act_damp_variability_dvf_spindle_speed_zoom.pdf new file mode 100644 index 0000000..4c99e1a Binary files /dev/null and b/figs/act_damp_variability_dvf_spindle_speed_zoom.pdf differ diff --git a/figs/act_damp_variability_dvf_spindle_speed_zoom.png b/figs/act_damp_variability_dvf_spindle_speed_zoom.png new file mode 100644 index 0000000..cd48a16 Binary files /dev/null and b/figs/act_damp_variability_dvf_spindle_speed_zoom.png differ diff --git a/figs/act_damp_variability_dvf_tilt_angle.pdf b/figs/act_damp_variability_dvf_tilt_angle.pdf new file mode 100644 index 0000000..9605959 Binary files /dev/null and b/figs/act_damp_variability_dvf_tilt_angle.pdf differ diff --git a/figs/act_damp_variability_dvf_tilt_angle.png b/figs/act_damp_variability_dvf_tilt_angle.png new file mode 100644 index 0000000..c20df2d Binary files /dev/null and b/figs/act_damp_variability_dvf_tilt_angle.png differ diff --git a/figs/act_damp_variability_iff_sample_mass.pdf b/figs/act_damp_variability_iff_sample_mass.pdf new file mode 100644 index 0000000..503bf8e Binary files /dev/null and b/figs/act_damp_variability_iff_sample_mass.pdf differ diff --git a/figs/act_damp_variability_iff_sample_mass.png b/figs/act_damp_variability_iff_sample_mass.png new file mode 100644 index 0000000..9905752 Binary files /dev/null and b/figs/act_damp_variability_iff_sample_mass.png differ diff --git a/figs/act_damp_variability_iff_spindle_angle.pdf b/figs/act_damp_variability_iff_spindle_angle.pdf new file mode 100644 index 0000000..b41fca4 Binary files /dev/null and b/figs/act_damp_variability_iff_spindle_angle.pdf differ diff --git a/figs/act_damp_variability_iff_spindle_angle.png b/figs/act_damp_variability_iff_spindle_angle.png new file mode 100644 index 0000000..466752e Binary files /dev/null and b/figs/act_damp_variability_iff_spindle_angle.png differ diff --git a/figs/act_damp_variability_iff_spindle_speed.pdf b/figs/act_damp_variability_iff_spindle_speed.pdf new file mode 100644 index 0000000..2f03361 Binary files /dev/null and b/figs/act_damp_variability_iff_spindle_speed.pdf differ diff --git a/figs/act_damp_variability_iff_spindle_speed.png b/figs/act_damp_variability_iff_spindle_speed.png new file mode 100644 index 0000000..35b380c Binary files /dev/null and b/figs/act_damp_variability_iff_spindle_speed.png differ diff --git a/figs/act_damp_variability_iff_spindle_speed_zoom.pdf b/figs/act_damp_variability_iff_spindle_speed_zoom.pdf new file mode 100644 index 0000000..14b3c54 Binary files /dev/null and b/figs/act_damp_variability_iff_spindle_speed_zoom.pdf differ diff --git a/figs/act_damp_variability_iff_spindle_speed_zoom.png b/figs/act_damp_variability_iff_spindle_speed_zoom.png new file mode 100644 index 0000000..ac01517 Binary files /dev/null and b/figs/act_damp_variability_iff_spindle_speed_zoom.png differ diff --git a/figs/act_damp_variability_iff_tilt_angle.pdf b/figs/act_damp_variability_iff_tilt_angle.pdf new file mode 100644 index 0000000..1b5cf47 Binary files /dev/null and b/figs/act_damp_variability_iff_tilt_angle.pdf differ diff --git a/figs/act_damp_variability_iff_tilt_angle.png b/figs/act_damp_variability_iff_tilt_angle.png new file mode 100644 index 0000000..fff553c Binary files /dev/null and b/figs/act_damp_variability_iff_tilt_angle.png differ diff --git a/figs/act_damp_variability_ine_sample_mass.pdf b/figs/act_damp_variability_ine_sample_mass.pdf new file mode 100644 index 0000000..5c352f5 Binary files /dev/null and b/figs/act_damp_variability_ine_sample_mass.pdf differ diff --git a/figs/act_damp_variability_ine_sample_mass.png b/figs/act_damp_variability_ine_sample_mass.png new file mode 100644 index 0000000..3b94f44 Binary files /dev/null and b/figs/act_damp_variability_ine_sample_mass.png differ diff --git a/figs/act_damp_variability_ine_spindle_angle.pdf b/figs/act_damp_variability_ine_spindle_angle.pdf new file mode 100644 index 0000000..0219d64 Binary files /dev/null and b/figs/act_damp_variability_ine_spindle_angle.pdf differ diff --git a/figs/act_damp_variability_ine_spindle_angle.png b/figs/act_damp_variability_ine_spindle_angle.png new file mode 100644 index 0000000..f54aeef Binary files /dev/null and b/figs/act_damp_variability_ine_spindle_angle.png differ diff --git a/figs/act_damp_variability_ine_spindle_speed.pdf b/figs/act_damp_variability_ine_spindle_speed.pdf new file mode 100644 index 0000000..3e2754c Binary files /dev/null and b/figs/act_damp_variability_ine_spindle_speed.pdf differ diff --git a/figs/act_damp_variability_ine_spindle_speed.png b/figs/act_damp_variability_ine_spindle_speed.png new file mode 100644 index 0000000..65872ea Binary files /dev/null and b/figs/act_damp_variability_ine_spindle_speed.png differ diff --git a/figs/act_damp_variability_ine_spindle_speed_zoom.pdf b/figs/act_damp_variability_ine_spindle_speed_zoom.pdf new file mode 100644 index 0000000..204f262 Binary files /dev/null and b/figs/act_damp_variability_ine_spindle_speed_zoom.pdf differ diff --git a/figs/act_damp_variability_ine_spindle_speed_zoom.png b/figs/act_damp_variability_ine_spindle_speed_zoom.png new file mode 100644 index 0000000..3c87393 Binary files /dev/null and b/figs/act_damp_variability_ine_spindle_speed_zoom.png differ diff --git a/figs/act_damp_variability_ine_tilt_angle.pdf b/figs/act_damp_variability_ine_tilt_angle.pdf new file mode 100644 index 0000000..ae3a9b4 Binary files /dev/null and b/figs/act_damp_variability_ine_tilt_angle.pdf differ diff --git a/figs/act_damp_variability_ine_tilt_angle.png b/figs/act_damp_variability_ine_tilt_angle.png new file mode 100644 index 0000000..b49f953 Binary files /dev/null and b/figs/act_damp_variability_ine_tilt_angle.png differ diff --git a/simscape_subsystems/nass_disturbances.slx b/simscape_subsystems/nass_disturbances.slx index e61c317..1f423aa 100644 Binary files a/simscape_subsystems/nass_disturbances.slx and b/simscape_subsystems/nass_disturbances.slx differ