diff --git a/active_damping/index.html b/active_damping/index.html index 6611a2f..32bd328 100644 --- a/active_damping/index.html +++ b/active_damping/index.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +-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:
@@ -375,11 +378,11 @@ The disturbances are:
@@ -393,8 +396,8 @@ The performance of this undamped system will be compared with the damped system
We initialize all the stages with the default parameters. @@ -402,7 +405,7 @@ The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg.
initializeInputs(); +initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -433,8 +436,8 @@ save( -1.2 Identification
++-1.2 Identification
We identify the various transfer functions of the system @@ -454,22 +457,22 @@ And we save it for further analysis.
-1.3 Sensitivity to disturbances
++1.3 Sensitivity to disturbances
-The sensitivity to disturbances are shown on figure 1. +The sensitivity to disturbances are shown on figure 1.
-+ -+--1.4 Undamped Plant
++1.4 Undamped Plant
-The "plant" (transfer function from forces applied by the nano-hexapod to the measured displacement of the sample with respect to the granite) bode plot is shown on figure 1. +The "plant" (transfer function from forces applied by the nano-hexapod to the measured displacement of the sample with respect to the granite) bode plot is shown on figure 1.
-+--2 Integral Force Feedback
++2 Integral Force Feedback
-@@ -508,23 +511,23 @@ All the files (data and Matlab scripts) are accessible he
Integral Force Feedback is applied. -In section 2.1, IFF is applied on a uni-axial system to understand its behavior. +In section 2.1, IFF is applied on a uni-axial system to understand its behavior. Then, it is applied on the simscape model.
-2.1 One degree-of-freedom example
++2.1 One degree-of-freedom example
--2.1.1 Equations
++2.1.1 Equations
-+-
Figure 4: Integral Force Feedback applied to a 1dof system
@@ -587,8 +590,8 @@ This is attainable if we have:-2.1.2 Matlab Example
++2.1.2 Matlab Example
-Let define the system parameters. @@ -642,7 +645,7 @@ And the closed loop system is computed below.
+--2.2 Control Design
++2.2 Control Design
Let's load the undamped plant: @@ -663,11 +666,11 @@ Let's load the 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).
-+
Figure 6: Transfer function from forces applied in the legs to force sensor (png, pdf)
@@ -682,11 +685,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.
-+--2.3 Identification of the damped plant
++2.3 Identification of the damped plant
-Let's initialize the system prior to identification.
-initializeInputs(); +initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -748,11 +751,11 @@ And we save the damped plant for further analysis-2.4 Sensitivity to disturbances
++2.4 Sensitivity to disturbances
-As shown on figure 8: +As shown on figure 8:
-
- The top platform of the nano-hexapod how behaves as a "free-mass".
@@ -762,7 +765,7 @@ However, as the goal is to make the relative displacement \(D\) as small as poss+-
Figure 8: Sensitivity to disturbance once the IFF controller is applied to the system (png, pdf)
@@ -777,7 +780,7 @@ For instance, the plots are not the same when usingminreal
.+--2.5 Damped Plant
++2.5 Damped Plant
Now, look at the new damped plant to control.
-It damps the plant (resonance of the nano hexapod as well as other resonances) as shown in figure 10. +It damps the plant (resonance of the nano hexapod as well as other resonances) as shown in figure 10.
-+-However, it increases coupling at low frequency (figure 11). +However, it increases coupling at low frequency (figure 11).
-+--2.6 Conclusion
++2.6 Conclusion
-@@ -833,11 +836,11 @@ Integral Force Feedback:
-3 Relative Motion Control
++3 Relative Motion Control
-@@ -850,18 +853,18 @@ In the Relative Motion Control (RMC), a derivative feedback is applied between t
-3.1 One degree-of-freedom example
++3.1 One degree-of-freedom example
--3.1.1 Equations
++3.1.1 Equations
-+-
Figure 12: Relative Motion Control applied to a 1dof system
@@ -917,8 +920,8 @@ This corresponds to a gain:-3.1.2 Matlab Example
++3.1.2 Matlab Example
-Let define the system parameters. @@ -972,7 +975,7 @@ And the closed loop system is computed below.
+--3.2 Control Design
++3.2 Control Design
Let's load the undamped plant: @@ -993,11 +996,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 14). +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 14).
-+
Figure 14: Transfer function from forces applied in the legs to leg displacement sensor (png, pdf)
@@ -1013,11 +1016,11 @@ A Low pass Filter is added to make the controller transfer function proper.-The obtained loop gains are shown in figure 15. +The obtained loop gains are shown in figure 15.
-+--3.3 Identification of the damped plant
++3.3 Identification of the damped plant
-Let's initialize the system prior to identification.
-initializeInputs(); +initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -1079,22 +1082,22 @@ And we save the damped plant for further analysis.-3.4 Sensitivity to disturbances
++3.4 Sensitivity to disturbances
-As shown in figure 16, RMC control succeed in lowering the sensitivity to disturbances near resonance of the system. +As shown in figure 16, RMC control succeed in lowering the sensitivity to disturbances near resonance of the system.
-+ -+--3.5 Damped Plant
++3.5 Damped Plant
-+--3.6 Conclusion
++3.6 Conclusion
-@@ -1130,11 +1133,11 @@ Relative Motion Control:
-4 Direct Velocity Feedback
++4 Direct Velocity Feedback
-@@ -1147,18 +1150,18 @@ In the Relative Motion Control (RMC), a feedback is applied between the measured
-4.1 One degree-of-freedom example
++4.1 One degree-of-freedom example
--4.1.1 Equations
++4.1.1 Equations
-+-
Figure 19: Direct Velocity Feedback applied to a 1dof system
@@ -1177,7 +1180,7 @@ In terms of the stage deformation \(d = x - w\): (ms^2 + cs + k) d = -ms^2 w + F_d + F \end{equation}-The direct velocity feedback law shown in figure 19 is: +The direct velocity feedback law shown in figure 19 is:
\begin{equation} K = -g @@ -1214,8 +1217,8 @@ This corresponds to a gain:-4.1.2 Matlab Example
++4.1.2 Matlab Example
Let define the system parameters. @@ -1290,10 +1293,10 @@ And the closed loop system is computed below.
-The obtained sensitivity to disturbances is shown in figure 20. +The obtained sensitivity to disturbances is shown in figure 20.
-+
Figure 20: Sensitivity to disturbance when DVF is applied on the 1dof system (png, pdf)
@@ -1302,8 +1305,8 @@ The obtained sensitivity to disturbances is shown in figure -4.2 Control Design
++4.2 Control Design
Let's load the undamped plant: @@ -1314,18 +1317,18 @@ 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 21). +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 21).
-+-The controller is defined below and the obtained loop gain is shown in figure 22. +The controller is defined below and the obtained loop gain is shown in figure 22.
@@ -1334,7 +1337,7 @@ The controller is defined below and the obtained loop gain is shown in figure -+-
Figure 22: Loop Gain for DVF (png, pdf)
@@ -1342,14 +1345,14 @@ The controller is defined below and the obtained loop gain is shown in figure-4.3 Identification of the damped plant
++4.3 Identification of the damped plant
-Let's initialize the system prior to identification.
-initializeInputs(); +initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -1396,11 +1399,11 @@ And we save the damped plant for further analysis.-4.4 Sensitivity to disturbances
++4.4 Sensitivity to disturbances
-+
Figure 23: Sensitivity to disturbance once the DVF controller is applied to the system (png, pdf)
@@ -1408,7 +1411,7 @@ And we save the damped plant for further analysis. -+--4.5 Damped Plant
++4.5 Damped Plant
-+--4.6 Conclusion
++4.6 Conclusion
-@@ -1441,15 +1444,15 @@ Direct Velocity Feedback:
-5 Comparison
++5 Comparison
--5.1 Load the plants
++5.1 Load the plants
-load('./active_damping/mat/plants.mat', 'G', 'G_iff', 'G_rmc', 'G_dvf'); @@ -1458,11 +1461,11 @@ Direct Velocity Feedback:-5.2 Sensitivity to Disturbance
++5.2 Sensitivity to Disturbance
-+@@ -1470,21 +1473,21 @@ Direct Velocity Feedback: -
+ -+ -+@@ -1492,7 +1495,7 @@ Direct Velocity Feedback: - -
-5.3 Damped Plant
++5.3 Damped Plant
-+ -+ -+- diff --git a/active_damping/index.org b/active_damping/index.org index 263fc05..3b541de 100644 --- a/active_damping/index.org +++ b/active_damping/index.org @@ -105,7 +105,7 @@ We initialize all the stages with the default parameters. The nano-hexapod is a piezoelectric hexapod and the sample has a mass of 50kg. #+begin_src matlab - initializeInputs(); + initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -557,7 +557,7 @@ The corresponding loop gains are shown in figure [[fig:iff_open_loop]]. ** Identification of the damped plant Let's initialize the system prior to identification. #+begin_src matlab - initializeInputs(); + initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -1097,7 +1097,7 @@ The obtained loop gains are shown in figure [[fig:rmc_open_loop]]. ** Identification of the damped plant Let's initialize the system prior to identification. #+begin_src matlab - initializeInputs(); + initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); @@ -1608,7 +1608,7 @@ The controller is defined below and the obtained loop gain is shown in figure [[ ** Identification of the damped plant Let's initialize the system prior to identification. #+begin_src matlab - initializeInputs(); + initializeReferences(); initializeGround(); initializeGranite(); initializeTy(); diff --git a/src/initializeExperiment.m b/src/initializeExperiment.m deleted file mode 100644 index 3920dd6..0000000 --- a/src/initializeExperiment.m +++ /dev/null @@ -1,21 +0,0 @@ -function [] = initializeExperiment(exp_name, sys_mass) - if strcmp(exp_name, 'tomography') - if strcmp(sys_mass, 'light') - opts_inputs = struct(... - 'Dw', true, ... - 'Rz', 60 ... % rpm - ); - elseif strcpm(sys_mass, 'heavy') - opts_inputs = struct(... - 'Dw', true, ... - 'Rz', 1 ... % rpm - ); - else - error('sys_mass should be light or heavy'); - end - - initializeInputs(opts_inputs); - else - error('exp_name is only configured for tomography'); - end -end diff --git a/src/initializeInputs.m b/src/initializeInputs.m deleted file mode 100644 index 4459786..0000000 --- a/src/initializeInputs.m +++ /dev/null @@ -1,175 +0,0 @@ -function [inputs] = initializeInputs(opts_param) - %% Default values for opts - opts = struct( ... - 'Dw', false, ... - 'Dy', false, ... - 'Ry', false, ... - 'Rz', false, ... - 'Dh', false, ... - 'Rm', false, ... - 'Dn', false ... - ); - - %% Populate opts with input parameters - if exist('opts_param','var') - for opt = fieldnames(opts_param)' - opts.(opt{1}) = opts_param.(opt{1}); - end - end - - %% Load Sampling Time and Simulation Time - load('./mat/sim_conf.mat', 'sim_conf'); - - %% Define the time vector - t = 0:sim_conf.Ts:sim_conf.Tsim; - - %% Ground motion - Dw - if islogical(opts.Dw) && opts.Dw == true - load('./mat/perturbations.mat', 'Wxg'); - Dw = 1/sqrt(2)*100*random('norm', 0, 1, length(t), 3); - Dw(:, 1) = lsim(Wxg, Dw(:, 1), t); - Dw(:, 2) = lsim(Wxg, Dw(:, 2), t); - Dw(:, 3) = lsim(Wxg, Dw(:, 3), t); - elseif islogical(opts.Dw) && opts.Dw == false - Dw = zeros(length(t), 3); - else - Dw = opts.Dw; - end - - %% Translation stage - Dy - if islogical(opts.Dy) && opts.Dy == true - Dy = zeros(length(t), 1); - elseif islogical(opts.Dy) && opts.Dy == false - Dy = zeros(length(t), 1); - else - Dy = opts.Dy; - end - - %% Tilt Stage - Ry - if islogical(opts.Ry) && opts.Ry == true - Ry = 3*(2*pi/360)*sin(2*pi*0.2*t); - elseif islogical(opts.Ry) && opts.Ry == false - Ry = zeros(length(t), 1); - elseif isnumeric(opts.Ry) && length(opts.Ry) == 1 - Ry = opts.Ry*(2*pi/360)*ones(length(t), 1); - else - Ry = opts.Ry; - end - - %% Spindle - Rz - if islogical(opts.Rz) && opts.Rz == true - Rz = 2*pi*0.5*t; - elseif islogical(opts.Rz) && opts.Rz == false - Rz = zeros(length(t), 1); - elseif isnumeric(opts.Rz) && length(opts.Rz) == 1 - Rz = opts.Rz*(2*pi/60)*t; - else - Rz = opts.Rz; - end - - %% Micro Hexapod - Dh - if islogical(opts.Dh) && opts.Dh == true - Dh = zeros(length(t), 6); - elseif islogical(opts.Dh) && opts.Dh == false - Dh = zeros(length(t), 6); - else - Dh = opts.Dh; - end - - %% Axis Compensation - Rm - if islogical(opts.Rm) - Rm = zeros(length(t), 2); - Rm(:, 2) = pi*ones(length(t), 1); - else - Rm = opts.Rm; - end - - %% Nano Hexapod - Dn - if islogical(opts.Dn) && opts.Dn == true - Dn = zeros(length(t), 6); - elseif islogical(opts.Dn) && opts.Dn == false - Dn = zeros(length(t), 6); - else - Dn = opts.Dn; - end - - %% Setpoint - Ds - Ds = zeros(length(t), 6); - for i = 1:length(t) - Ds(i, :) = computeSetpoint(Dy(i), Ry(i), Rz(i)); - end - - %% External Forces applied on the Granite - Fg = zeros(length(t), 3); - - %% External Forces applied on the Sample - Fs = zeros(length(t), 6); - - %% Create the input Structure that will contain all the inputs - inputs = struct( ... - 'Ts', sim_conf.Ts, ... - 'Dw', timeseries(Dw, t), ... - 'Dy', timeseries(Dy, t), ... - 'Ry', timeseries(Ry, t), ... - 'Rz', timeseries(Rz, t), ... - 'Dh', timeseries(Dh, t), ... - 'Rm', timeseries(Rm, t), ... - 'Dn', timeseries(Dn, t), ... - 'Ds', timeseries(Ds, t), ... - 'Fg', timeseries(Fg, t), ... - 'Fs', timeseries(Fs, t) ... - ); - - %% Save - save('./mat/inputs.mat', 'inputs'); - - %% Custom Functions - function setpoint = computeSetpoint(ty, ry, rz) - %% - setpoint = zeros(6, 1); - - %% Ty - TMTy = [1 0 0 0 ; - 0 1 0 ty ; - 0 0 1 0 ; - 0 0 0 1 ]; - - %% Ry - TMRy = [ cos(ry) 0 sin(ry) 0 ; - 0 1 0 0 ; - -sin(ry) 0 cos(ry) 0 ; - 0 0 0 1 ]; - - %% Rz - TMRz = [cos(rz) -sin(rz) 0 0 ; - sin(rz) cos(rz) 0 0 ; - 0 0 1 0 ; - 0 0 0 1 ]; - - %% All stages - TM = TMTy*TMRy*TMRz; - - [thetax, thetay, thetaz] = RM2angle(TM(1:3, 1:3)); - - setpoint(1:3) = TM(1:3, 4); - setpoint(4:6) = [thetax, thetay, thetaz]; - - %% Custom Functions - function [thetax, thetay, thetaz] = RM2angle(R) - if abs(abs(R(3, 1)) - 1) > 1e-6 % R31 != 1 and R31 != -1 - thetay = -asin(R(3, 1)); - thetax = atan2(R(3, 2)/cos(thetay), R(3, 3)/cos(thetay)); - thetaz = atan2(R(2, 1)/cos(thetay), R(1, 1)/cos(thetay)); - else - thetaz = 0; - if abs(R(3, 1)+1) < 1e-6 % R31 = -1 - thetay = pi/2; - thetax = thetaz + atan2(R(1, 2), R(1, 3)); - else - thetay = -pi/2; - thetax = -thetaz + atan2(-R(1, 2), -R(1, 3)); - end - end - end - end -end -