From eda325fae2fc4959f349b71ca881469961f11921 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Wed, 11 Dec 2019 14:46:31 +0100 Subject: [PATCH] Remove org comments in tangled matlab functions --- active_damping/index.org | 8 +- disturbances/index.org | 175 +++++++++++++++++++++++++++++++++ metrology/index.org | 5 +- simscape/index.org | 140 ++++++++++---------------- src/computePsdDispl.m | 11 --- src/computeReferencePose.m | 11 --- src/computeSetpoint.m | 11 --- src/converErrorBasis.m | 11 --- src/generateDiagPidControl.m | 11 --- src/identifyPlant.m | 11 --- src/initDisturbances.m | 36 ------- src/initializeAxisc.m | 11 --- src/initializeCedratPiezo.m | 11 --- src/initializeExperiment.m | 11 --- src/initializeGranite.m | 11 --- src/initializeGround.m | 11 --- src/initializeInputs.m | 13 --- src/initializeMicroHexapod.m | 11 --- src/initializeMirror.m | 11 --- src/initializeNanoHexapod.m | 11 --- src/initializeReferences.m | 11 --- src/initializeRy.m | 11 --- src/initializeRz.m | 11 --- src/initializeSample.m | 11 --- src/initializeTy.m | 11 --- src/inverseKinematicsHexapod.m | 11 --- src/runSimulation.m | 11 --- 27 files changed, 235 insertions(+), 373 deletions(-) diff --git a/active_damping/index.org b/active_damping/index.org index 2149264..263fc05 100644 --- a/active_damping/index.org +++ b/active_damping/index.org @@ -61,7 +61,7 @@ The disturbances are: * Undamped System :PROPERTIES: :header-args:matlab+: :tangle matlab/undamped_system.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :END: <> @@ -245,7 +245,7 @@ The "plant" (transfer function from forces applied by the nano-hexapod to the me * Integral Force Feedback :PROPERTIES: :header-args:matlab+: :tangle matlab/iff.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :END: <> @@ -789,7 +789,7 @@ Integral Force Feedback: * Relative Motion Control :PROPERTIES: :header-args:matlab+: :tangle matlab/rmc.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :END: <> @@ -1287,7 +1287,7 @@ Relative Motion Control: * Direct Velocity Feedback :PROPERTIES: :header-args:matlab+: :tangle matlab/dvf.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :END: <> diff --git a/disturbances/index.org b/disturbances/index.org index ae82913..6e56835 100644 --- a/disturbances/index.org +++ b/disturbances/index.org @@ -586,3 +586,178 @@ The PSD of the disturbance force are now saved for further noise budgeting when save('./disturbances/mat/dist_psd.mat', 'dist_f'); #+end_src + +* Function that initialize the disturbances +:PROPERTIES: +:header-args:matlab+: :tangle ../src/initDisturbances.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> + +This Matlab function is accessible [[file:src/initDisturbances.m][here]]. + +#+begin_src matlab + function [] = initDisturbances(opts_param) + % initDisturbances - Initialize the disturbances + % + % Syntax: [] = initDisturbances(opts_param) + % + % Inputs: + % - opts_param - + +#+end_src + +** Default values for the Options +#+begin_src matlab + %% Default values for opts + opts = struct(); + + %% Populate opts with input parameters + if exist('opts_param','var') + for opt = fieldnames(opts_param)' + opts.(opt{1}) = opts_param.(opt{1}); + end + end +#+end_src + +** Load Data +#+begin_src matlab + load('./disturbances/mat/dist_psd.mat', 'dist_f'); +#+end_src + +We remove the first frequency point that usually is very large. +#+begin_src matlab :exports none + dist_f.f = dist_f.f(2:end); + dist_f.psd_gm = dist_f.psd_gm(2:end); + dist_f.psd_ty = dist_f.psd_ty(2:end); + dist_f.psd_rz = dist_f.psd_rz(2:end); +#+end_src + +** Parameters +We define some parameters that will be used in the algorithm. +#+begin_src matlab + Fs = 2*dist_f.f(end); % Sampling Frequency of data is twice the maximum frequency of the PSD vector [Hz] + N = 2*length(dist_f.f); % Number of Samples match the one of the wanted PSD + T0 = N/Fs; % Signal Duration [s] + df = 1/T0; % Frequency resolution of the DFT [Hz] + % Also equal to (dist_f.f(2)-dist_f.f(1)) + t = linspace(0, T0, N+1)'; % Time Vector [s] + Ts = 1/Fs; % Sampling Time [s] +#+end_src + +** Ground Motion +#+begin_src matlab + phi = dist_f.psd_gm; + C = zeros(N/2,1); + for i = 1:N/2 + C(i) = sqrt(phi(i)*df); + end + theta = 2*pi*rand(N/2,1); % Generate random phase [rad] + Cx = [0 ; C.*complex(cos(theta),sin(theta))]; + Cx = [Cx; flipud(conj(Cx(2:end)))];; + u = N/sqrt(2)*ifft(Cx); % Ground Motion - x direction [m] + % Dwx = struct('time', t, 'signals', struct('values', u)); + Dwx = u; + theta = 2*pi*rand(N/2,1); % Generate random phase [rad] + Cx = [0 ; C.*complex(cos(theta),sin(theta))]; + Cx = [Cx; flipud(conj(Cx(2:end)))];; + u = N/sqrt(2)*ifft(Cx); % Ground Motion - y direction [m] + Dwy = u; + theta = 2*pi*rand(N/2,1); % Generate random phase [rad] + Cx = [0 ; C.*complex(cos(theta),sin(theta))]; + Cx = [Cx; flipud(conj(Cx(2:end)))];; + u = N/sqrt(2)*ifft(Cx); % Ground Motion - z direction [m] + Dwz = u; +#+end_src + +** Translation Stage - X direction +#+begin_src matlab + phi = dist_f.psd_ty; % TODO - we take here the vertical direction which is wrong but approximate + C = zeros(N/2,1); + for i = 1:N/2 + C(i) = sqrt(phi(i)*df); + end + theta = 2*pi*rand(N/2,1); % Generate random phase [rad] + Cx = [0 ; C.*complex(cos(theta),sin(theta))]; + Cx = [Cx; flipud(conj(Cx(2:end)))];; + u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty x [N] + Fty_x = u; +#+end_src + +** Translation Stage - Z direction +#+begin_src matlab + phi = dist_f.psd_ty; + C = zeros(N/2,1); + for i = 1:N/2 + C(i) = sqrt(phi(i)*df); + end + theta = 2*pi*rand(N/2,1); % Generate random phase [rad] + Cx = [0 ; C.*complex(cos(theta),sin(theta))]; + Cx = [Cx; flipud(conj(Cx(2:end)))];; + u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty z [N] + Fty_z = u; +#+end_src + +** Spindle - Z direction +#+begin_src matlab + phi = dist_f.psd_rz; + C = zeros(N/2,1); + for i = 1:N/2 + C(i) = sqrt(phi(i)*df); + end + theta = 2*pi*rand(N/2,1); % Generate random phase [rad] + Cx = [0 ; C.*complex(cos(theta),sin(theta))]; + Cx = [Cx; flipud(conj(Cx(2:end)))];; + u = N/sqrt(2)*ifft(Cx); % Disturbance Force Rz z [N] + Frz_z = u; +#+end_src + +** Direct Forces +#+begin_src matlab + u = zeros(length(t), 6); + Fd = u; +#+end_src + +** Set initial value to zero +#+begin_src matlab + Dwx = Dwx - Dwx(1); + Dwy = Dwy - Dwy(1); + Dwz = Dwz - Dwz(1); + Fty_x = Fty_x - Fty_x(1); + Fty_z = Fty_z - Fty_z(1); + Frz_z = Frz_z - Frz_z(1); +#+end_src + +** Save +#+begin_src matlab + save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't'); +#+end_src + +* Display Obtained Disturbances +#+begin_src matlab + initDisturbances(); + load('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't'); +#+end_src + +#+begin_src matlab + figure; + hold on; + plot(t, Dwx, 'DisplayName', 'Dw x'); + plot(t, Dwy, 'DisplayName', 'Dw y'); + plot(t, Dwz, 'DisplayName', 'Dw z'); + hold off; + xlabel('Time [s]'); ylabel('Amplitude [m]'); + legend('location', 'north east'); +#+end_src + +#+begin_src matlab + figure; + hold on; + plot(t, Fty_x, 'DisplayName', 'Ty x'); + plot(t, Fty_z, 'DisplayName', 'Ty z'); + plot(t, Frz_z, 'DisplayName', 'Rz z'); + hold off; + xlabel('Time [s]'); ylabel('Force [N]'); + legend('location', 'north east'); +#+end_src diff --git a/metrology/index.org b/metrology/index.org index 33bc125..5ed36c2 100644 --- a/metrology/index.org +++ b/metrology/index.org @@ -456,12 +456,13 @@ Verify that the pose error is small. Indeed, we are able to convert the position error in the frame of the NASS and then compensate these errors with the NASS. #+end_important -* Verify that we are able to compensate the errors using the nano-hexapod :noexport: +* Verify that we are able to compensate the errors using the nano-hexapod + * Functions ** computeReferencePose :PROPERTIES: :header-args:matlab+: :tangle ../src/computeReferencePose.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> diff --git a/simscape/index.org b/simscape/index.org index ee72cb4..e505724 100644 --- a/simscape/index.org +++ b/simscape/index.org @@ -320,12 +320,12 @@ A simulink library is developed in order to share elements between the different * Functions <> ** computePsdDispl - :PROPERTIES: - :header-args:matlab+: :tangle ../src/computePsdDispl.m - :header-args:matlab+: :comments org :mkdirp yes - :header-args:matlab+: :eval no :results none - :END: - <> +:PROPERTIES: +:header-args:matlab+: :tangle ../src/computePsdDispl.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> This Matlab function is accessible [[file:../src/computePsdDispl.m][here]]. @@ -356,12 +356,12 @@ This Matlab function is accessible [[file:../src/computePsdDispl.m][here]]. #+end_src ** computeSetpoint - :PROPERTIES: - :header-args:matlab+: :tangle ../src/computeSetpoint.m - :header-args:matlab+: :comments org :mkdirp yes - :header-args:matlab+: :eval no :results none - :END: - <> +:PROPERTIES: +:header-args:matlab+: :tangle ../src/computeSetpoint.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> This Matlab function is accessible [[file:../src/computeSetpoint.m][here]]. @@ -428,12 +428,12 @@ This Matlab function is accessible [[file:../src/computeSetpoint.m][here]]. #+end_src ** converErrorBasis - :PROPERTIES: - :header-args:matlab+: :tangle ../src/converErrorBasis.m - :header-args:matlab+: :comments org :mkdirp yes - :header-args:matlab+: :eval no :results none - :END: - <> +:PROPERTIES: +:header-args:matlab+: :tangle ../src/converErrorBasis.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> This Matlab function is accessible [[file:../src/converErrorBasis.m][here]]. @@ -566,12 +566,12 @@ This Matlab function is accessible [[file:../src/converErrorBasis.m][here]]. #+end_src ** generateDiagPidControl - :PROPERTIES: - :header-args:matlab+: :tangle ../src/generateDiagPidControl.m - :header-args:matlab+: :comments org :mkdirp yes - :header-args:matlab+: :eval no :results none - :END: - <> +:PROPERTIES: +:header-args:matlab+: :tangle ../src/generateDiagPidControl.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> This Matlab function is accessible [[file:../src/generateDiagPidControl.m][here]]. @@ -596,12 +596,12 @@ This Matlab function is accessible [[file:../src/generateDiagPidControl.m][here] end #+end_src ** identifyPlant - :PROPERTIES: - :header-args:matlab+: :tangle ../src/identifyPlant.m - :header-args:matlab+: :comments org :mkdirp yes - :header-args:matlab+: :eval no :results none - :END: - <> +:PROPERTIES: +:header-args:matlab+: :tangle ../src/identifyPlant.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> This Matlab function is accessible [[file:../src/identifyPlant.m][here]]. @@ -688,12 +688,12 @@ This Matlab function is accessible [[file:../src/identifyPlant.m][here]]. #+end_src ** runSimulation - :PROPERTIES: - :header-args:matlab+: :tangle ../src/runSimulation.m - :header-args:matlab+: :comments org :mkdirp yes - :header-args:matlab+: :eval no :results none - :END: - <> +:PROPERTIES: +:header-args:matlab+: :tangle ../src/runSimulation.m +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :results none +:END: +<> This Matlab function is accessible [[file:../src/runSimulation.m][here]]. @@ -759,7 +759,7 @@ This Matlab function is accessible [[file:../src/runSimulation.m][here]]. ** Experiment :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeExperiment.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -793,8 +793,8 @@ This Matlab function is accessible [[file:../src/initializeExperiment.m][here]]. ** Generate Reference Signals :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeReferences.m -:header-args:matlab+: :comments org :mkdirp yes -:header-args:matlab+: :eval no :results none +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :END: <> @@ -942,7 +942,7 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]]. ** TODO Inputs :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeInputs.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1132,8 +1132,8 @@ This Matlab function is accessible [[file:../src/initializeInputs.m][here]]. ** Inverse Kinematics of the Hexapod :PROPERTIES: :header-args:matlab+: :tangle ../src/inverseKinematicsHexapod.m -:header-args:matlab+: :comments org :mkdirp yes -:header-args:matlab+: :eval no :results none +:header-args:matlab+: :comments none :mkdirp yes +:header-args:matlab+: :eval no :END: <> @@ -1168,7 +1168,7 @@ This Matlab function is accessible [[file:src/inverseKinematicsHexapod.m][here]] ** Ground :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeGround.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1192,7 +1192,7 @@ end ** Granite :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeGranite.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1258,7 +1258,7 @@ This Matlab function is accessible [[file:../src/initializeGranite.m][here]]. ** Translation Stage :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeTy.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1340,7 +1340,7 @@ This Matlab function is accessible [[file:../src/initializeTy.m][here]]. ** Tilt Stage :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeRy.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1411,7 +1411,7 @@ This Matlab function is accessible [[file:../src/initializeRy.m][here]]. ** Spindle :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeRz.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1475,44 +1475,10 @@ This Matlab function is accessible [[file:../src/initializeRz.m][here]]. end #+end_src -** Initialize Hexapod legs' length -:PROPERTIES: -:header-args:matlab+: :tangle ../src/inverseKinematicsHexapod.m -:header-args:matlab+: :comments org :mkdirp yes -:header-args:matlab+: :eval no :results none -:END: -<> - -This Matlab function is accessible [[file:../src/inverseKinematicsHexapod.m][here]]. - -#+begin_src matlab - function [hexapod] = inverseKinematicsHexapod(hexapod, AP, ARB) - % inverseKinematicsHexapod - - % - % Syntax: inverseKinematicsHexapod(hexapod, AP, ARB) - % - % Inputs: - % - hexapod - Hexapod object containing the geometry of the hexapod - % - AP - Position vector of point OB expressed in frame {A} - % - ARB - Rotation Matrix expressed in frame {A} - - L0 = zeros(6, 1); - - for i = 1:length(L) - Bbi = hexapod.pos_top_tranform(i, :)'; - Aai = hexapod.pos_base(i, :)'; - - L0(i) = sqrt(AP'*AP + Bbi'*Bbi + Aai'*Aai - 2*AP'*Aai + 2*AP'*(ARB*Bbi) - 2*(ARB*Bbi)'*Aai); - end - - hexapod.L0 = L0; - end -#+end_src - ** Micro Hexapod :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeMicroHexapod.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1729,7 +1695,7 @@ This Matlab function is accessible [[file:../src/initializeMicroHexapod.m][here] ** Center of gravity compensation :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeAxisc.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1773,7 +1739,7 @@ This Matlab function is accessible [[file:../src/initializeAxisc.m][here]]. ** Mirror :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeMirror.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -1839,7 +1805,7 @@ This Matlab function is accessible [[file:../src/initializeMirror.m][here]]. ** Nano Hexapod :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeNanoHexapod.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -2056,7 +2022,7 @@ This Matlab function is accessible [[file:../src/initializeNanoHexapod.m][here]] ** Cedrat Actuator :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeCedratPiezo.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> @@ -2096,7 +2062,7 @@ This Matlab function is accessible [[file:../src/initializeCedratPiezo.m][here]] ** Sample :PROPERTIES: :header-args:matlab+: :tangle ../src/initializeSample.m -:header-args:matlab+: :comments org :mkdirp yes +:header-args:matlab+: :comments none :mkdirp yes :header-args:matlab+: :eval no :results none :END: <> diff --git a/src/computePsdDispl.m b/src/computePsdDispl.m index 786f96e..0e41ca5 100644 --- a/src/computePsdDispl.m +++ b/src/computePsdDispl.m @@ -1,14 +1,3 @@ -% computePsdDispl -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/computePsdDispl.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/computePsdDispl.m][here]]. - - function [psd_object] = computePsdDispl(sys_data, t_init, n_av) i_init = find(sys_data.time > t_init, 1); diff --git a/src/computeReferencePose.m b/src/computeReferencePose.m index e040d2a..948a3a4 100644 --- a/src/computeReferencePose.m +++ b/src/computeReferencePose.m @@ -1,14 +1,3 @@ -% computeReferencePose -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/computeReferencePose.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:src/computeReferencePose.m][here]]. - - function [WTr] = computeReferencePose(Dy, Ry, Rz, Dh, Dn) % computeReferencePose - Compute the homogeneous transformation matrix corresponding to the wanted pose of the sample % diff --git a/src/computeSetpoint.m b/src/computeSetpoint.m index 5c0f92e..b845cff 100644 --- a/src/computeSetpoint.m +++ b/src/computeSetpoint.m @@ -1,14 +1,3 @@ -% computeSetpoint -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/computeSetpoint.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/computeSetpoint.m][here]]. - - function setpoint = computeSetpoint(ty, ry, rz) %% setpoint = zeros(6, 1); diff --git a/src/converErrorBasis.m b/src/converErrorBasis.m index b8b6321..848758f 100644 --- a/src/converErrorBasis.m +++ b/src/converErrorBasis.m @@ -1,14 +1,3 @@ -% converErrorBasis -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/converErrorBasis.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/converErrorBasis.m][here]]. - - function error_nass = convertErrorBasis(pos, setpoint, ty, ry, rz) % convertErrorBasis - % diff --git a/src/generateDiagPidControl.m b/src/generateDiagPidControl.m index f2a71fe..47a777a 100644 --- a/src/generateDiagPidControl.m +++ b/src/generateDiagPidControl.m @@ -1,14 +1,3 @@ -% generateDiagPidControl -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/generateDiagPidControl.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/generateDiagPidControl.m][here]]. - - function [K] = generateDiagPidControl(G, fs) %% pid_opts = pidtuneOptions(... diff --git a/src/identifyPlant.m b/src/identifyPlant.m index 2398e9a..6ef885f 100644 --- a/src/identifyPlant.m +++ b/src/identifyPlant.m @@ -1,14 +1,3 @@ -% identifyPlant -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/identifyPlant.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/identifyPlant.m][here]]. - - function [sys] = identifyPlant(opts_param) %% Default values for opts opts = struct(); diff --git a/src/initDisturbances.m b/src/initDisturbances.m index 81d5771..6483080 100644 --- a/src/initDisturbances.m +++ b/src/initDisturbances.m @@ -1,14 +1,3 @@ -% Function that initialize the disturbances -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initDisturbances.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:src/initDisturbances.m][here]]. - - function [] = initDisturbances(opts_param) % initDisturbances - Initialize the disturbances % @@ -17,8 +6,6 @@ function [] = initDisturbances(opts_param) % Inputs: % - opts_param - -% Default values for the Options - %% Default values for opts opts = struct(); @@ -29,22 +16,13 @@ if exist('opts_param','var') end end -% Load Data - load('./disturbances/mat/dist_psd.mat', 'dist_f'); - - -% We remove the first frequency point that usually is very large. - dist_f.f = dist_f.f(2:end); dist_f.psd_gm = dist_f.psd_gm(2:end); dist_f.psd_ty = dist_f.psd_ty(2:end); dist_f.psd_rz = dist_f.psd_rz(2:end); -% Parameters -% We define some parameters that will be used in the algorithm. - Fs = 2*dist_f.f(end); % Sampling Frequency of data is twice the maximum frequency of the PSD vector [Hz] N = 2*length(dist_f.f); % Number of Samples match the one of the wanted PSD T0 = N/Fs; % Signal Duration [s] @@ -53,8 +31,6 @@ df = 1/T0; % Frequency resolution of the DFT [Hz] t = linspace(0, T0, N+1)'; % Time Vector [s] Ts = 1/Fs; % Sampling Time [s] -% Ground Motion - phi = dist_f.psd_gm; C = zeros(N/2,1); for i = 1:N/2 @@ -77,8 +53,6 @@ Cx = [Cx; flipud(conj(Cx(2:end)))];; u = N/sqrt(2)*ifft(Cx); % Ground Motion - z direction [m] Dwz = u; -% Translation Stage - X direction - phi = dist_f.psd_ty; % TODO - we take here the vertical direction which is wrong but approximate C = zeros(N/2,1); for i = 1:N/2 @@ -90,8 +64,6 @@ Cx = [Cx; flipud(conj(Cx(2:end)))];; u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty x [N] Fty_x = u; -% Translation Stage - Z direction - phi = dist_f.psd_ty; C = zeros(N/2,1); for i = 1:N/2 @@ -103,8 +75,6 @@ Cx = [Cx; flipud(conj(Cx(2:end)))];; u = N/sqrt(2)*ifft(Cx); % Disturbance Force Ty z [N] Fty_z = u; -% Spindle - Z direction - phi = dist_f.psd_rz; C = zeros(N/2,1); for i = 1:N/2 @@ -116,13 +86,9 @@ Cx = [Cx; flipud(conj(Cx(2:end)))];; u = N/sqrt(2)*ifft(Cx); % Disturbance Force Rz z [N] Frz_z = u; -% Direct Forces - u = zeros(length(t), 6); Fd = u; -% Set initial value to zero - Dwx = Dwx - Dwx(1); Dwy = Dwy - Dwy(1); Dwz = Dwz - Dwz(1); @@ -130,6 +96,4 @@ Fty_x = Fty_x - Fty_x(1); Fty_z = Fty_z - Fty_z(1); Frz_z = Frz_z - Frz_z(1); -% Save - save('./mat/nass_disturbances.mat', 'Dwx', 'Dwy', 'Dwz', 'Fty_x', 'Fty_z', 'Frz_z', 'Fd', 'Ts', 't'); diff --git a/src/initializeAxisc.m b/src/initializeAxisc.m index 8e1d4b1..34fc04c 100644 --- a/src/initializeAxisc.m +++ b/src/initializeAxisc.m @@ -1,14 +1,3 @@ -% Center of gravity compensation -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeAxisc.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeAxisc.m][here]]. - - function [axisc] = initializeAxisc() %% axisc = struct(); diff --git a/src/initializeCedratPiezo.m b/src/initializeCedratPiezo.m index 6441f1a..b5f3b80 100644 --- a/src/initializeCedratPiezo.m +++ b/src/initializeCedratPiezo.m @@ -1,14 +1,3 @@ -% Cedrat Actuator -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeCedratPiezo.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeCedratPiezo.m][here]]. - - function [cedrat] = initializeCedratPiezo(opts_param) %% Default values for opts opts = struct(); diff --git a/src/initializeExperiment.m b/src/initializeExperiment.m index 1857f4a..3920dd6 100644 --- a/src/initializeExperiment.m +++ b/src/initializeExperiment.m @@ -1,14 +1,3 @@ -% Experiment -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeExperiment.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeExperiment.m][here]]. - - function [] = initializeExperiment(exp_name, sys_mass) if strcmp(exp_name, 'tomography') if strcmp(sys_mass, 'light') diff --git a/src/initializeGranite.m b/src/initializeGranite.m index 0eae77f..fe27760 100644 --- a/src/initializeGranite.m +++ b/src/initializeGranite.m @@ -1,14 +1,3 @@ -% Granite -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeGranite.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeGranite.m][here]]. - - function [granite] = initializeGranite(opts_param) %% Default values for opts opts = struct('rigid', false); diff --git a/src/initializeGround.m b/src/initializeGround.m index a10aac2..3a4e774 100644 --- a/src/initializeGround.m +++ b/src/initializeGround.m @@ -1,14 +1,3 @@ -% Ground -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeGround.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeGround.m][here]]. - - function [ground] = initializeGround() %% ground = struct(); diff --git a/src/initializeInputs.m b/src/initializeInputs.m index 3b7b31e..4459786 100644 --- a/src/initializeInputs.m +++ b/src/initializeInputs.m @@ -1,16 +1,3 @@ -% TODO Inputs -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeInputs.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% - [ ] *This function should not be used anymore*. Now there are two functions to initialize disturbances and references. - -% This Matlab function is accessible [[file:../src/initializeInputs.m][here]]. - - function [inputs] = initializeInputs(opts_param) %% Default values for opts opts = struct( ... diff --git a/src/initializeMicroHexapod.m b/src/initializeMicroHexapod.m index 96df29c..79a5d28 100644 --- a/src/initializeMicroHexapod.m +++ b/src/initializeMicroHexapod.m @@ -1,14 +1,3 @@ -% Micro Hexapod -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeMicroHexapod.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeMicroHexapod.m][here]]. - - function [micro_hexapod] = initializeMicroHexapod(opts_param) %% Default values for opts opts = struct(... diff --git a/src/initializeMirror.m b/src/initializeMirror.m index 4f280ee..10234df 100644 --- a/src/initializeMirror.m +++ b/src/initializeMirror.m @@ -1,14 +1,3 @@ -% Mirror -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeMirror.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeMirror.m][here]]. - - function [] = initializeMirror(opts_param) %% Default values for opts opts = struct(... diff --git a/src/initializeNanoHexapod.m b/src/initializeNanoHexapod.m index 846289e..dc97009 100644 --- a/src/initializeNanoHexapod.m +++ b/src/initializeNanoHexapod.m @@ -1,14 +1,3 @@ -% Nano Hexapod -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeNanoHexapod.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeNanoHexapod.m][here]]. - - function [nano_hexapod] = initializeNanoHexapod(opts_param) %% Default values for opts opts = struct('actuator', 'piezo'); diff --git a/src/initializeReferences.m b/src/initializeReferences.m index 3606c4b..4d9bf7b 100644 --- a/src/initializeReferences.m +++ b/src/initializeReferences.m @@ -1,14 +1,3 @@ -% Generate Reference Signals -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeReferences.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeInputs.m][here]]. - - function [ref] = initializeReferences(opts_param) %% Default values for opts opts = struct( ... diff --git a/src/initializeRy.m b/src/initializeRy.m index eb88acd..720bea6 100644 --- a/src/initializeRy.m +++ b/src/initializeRy.m @@ -1,14 +1,3 @@ -% Tilt Stage -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeRy.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeRy.m][here]]. - - function [ry] = initializeRy(opts_param) %% Default values for opts opts = struct('rigid', false); diff --git a/src/initializeRz.m b/src/initializeRz.m index c33dd8b..6022577 100644 --- a/src/initializeRz.m +++ b/src/initializeRz.m @@ -1,14 +1,3 @@ -% Spindle -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeRz.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeRz.m][here]]. - - function [rz] = initializeRz(opts_param) %% Default values for opts opts = struct('rigid', false); diff --git a/src/initializeSample.m b/src/initializeSample.m index f950007..ddd42d8 100644 --- a/src/initializeSample.m +++ b/src/initializeSample.m @@ -1,14 +1,3 @@ -% Sample -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeSample.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeSample.m][here]]. - - function [sample] = initializeSample(opts_param) %% Default values for opts sample = struct('radius', 100, ... diff --git a/src/initializeTy.m b/src/initializeTy.m index f710994..6ecc7b0 100644 --- a/src/initializeTy.m +++ b/src/initializeTy.m @@ -1,14 +1,3 @@ -% Translation Stage -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/initializeTy.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/initializeTy.m][here]]. - - function [ty] = initializeTy(opts_param) %% Default values for opts opts = struct('rigid', false); diff --git a/src/inverseKinematicsHexapod.m b/src/inverseKinematicsHexapod.m index c607e59..d8b1a90 100644 --- a/src/inverseKinematicsHexapod.m +++ b/src/inverseKinematicsHexapod.m @@ -1,14 +1,3 @@ -% Inverse Kinematics of the Hexapod -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/inverseKinematicsHexapod.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:src/inverseKinematicsHexapod.m][here]]. - - function [L] = inverseKinematicsHexapod(hexapod, AP, ARB) % inverseKinematicsHexapod - Compute the initial position of each leg to have the wanted Hexapod's position % diff --git a/src/runSimulation.m b/src/runSimulation.m index 24737e1..51a1b53 100644 --- a/src/runSimulation.m +++ b/src/runSimulation.m @@ -1,14 +1,3 @@ -% runSimulation -% :PROPERTIES: -% :header-args:matlab+: :tangle ../src/runSimulation.m -% :header-args:matlab+: :comments org :mkdirp yes -% :header-args:matlab+: :eval no :results none -% :END: -% <> - -% This Matlab function is accessible [[file:../src/runSimulation.m][here]]. - - function [] = runSimulation(sys_name, sys_mass, ctrl_type, act_damp) %% Load the controller and save it for the simulation if strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'none')