-
+
@@ -397,11 +396,11 @@ setpoint(
-1.3 converErrorBasis
+
+
1.3 converErrorBasis
-
+
@@ -539,11 +538,11 @@ error_nass = [dx; dy; dz; th
-
-
1.4 generateDiagPidControl
+
+
1.4 generateDiagPidControl
-
+
@@ -574,11 +573,11 @@ This Matlab function is accessible her
-
-
1.5 identifyPlant
+
+
1.5 identifyPlant
-
+
@@ -670,84 +669,11 @@ This Matlab function is accessible here.
-
-
1.6 runSimulation
+
+
1.6 Inverse Kinematics of the Hexapod
-
-
-
-
-This Matlab function is accessible here.
-
-
-
-
function [] = runSimulation(sys_name, sys_mass, ctrl_type, act_damp)
-
- if strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'none')
- K_obj = load('./mat/K_fb.mat');
- K = K_obj.(sprintf('K_%s_%s', sys_mass, sys_name));
- save('./mat/controllers.mat', 'K');
- elseif strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'iff')
- K_obj = load('./mat/K_fb_iff.mat');
- K = K_obj.(sprintf('K_%s_%s_iff', sys_mass, sys_name));
- save('./mat/controllers.mat', 'K');
- elseif strcmp(ctrl_type, 'ol')
- K = tf(zeros(6));
- save('./mat/controllers.mat', 'K');
- else
- error('ctrl_type should be cl or ol');
- end
-
-
- if strcmp(act_damp, 'iff')
- K_iff_crit = load('./mat/K_iff_crit.mat');
- K_iff = K_iff_crit.(sprintf('K_iff_%s_%s', sys_mass, sys_name));
- save('./mat/controllers.mat', 'K_iff', '-append');
- elseif strcmp(act_damp, 'none')
- K_iff = tf(zeros(6));
- save('./mat/controllers.mat', 'K_iff', '-append');
- end
-
-
- if strcmp(sys_name, 'pz')
- initializeNanoHexapod(struct('actuator', 'piezo'));
- elseif strcmp(sys_name, 'vc')
- initializeNanoHexapod(struct('actuator', 'lorentz'));
- else
- error('sys_name should be pz or vc');
- end
-
- if strcmp(sys_mass, 'light')
- initializeSample(struct('mass', 1));
- elseif strcmp(sys_mass, 'heavy')
- initializeSample(struct('mass', 50));
- else
- error('sys_mass should be light or heavy');
- end
-
-
- sim('sim_nano_station_ctrl.slx');
-
-
- [Dx, Dy, Dz, Rx, Ry, Rz] = matSplit(Es.Data, 1);
- time = Dsample.Time;
-
-
- filename = sprintf('sim_%s_%s_%s_%s', sys_mass, sys_name, ctrl_type, act_damp);
- save(sprintf('./mat/%s.mat', filename), ...
- 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
-end
-
-
-
-
-
-
-
1.7 Inverse Kinematics of the Hexapod
-
-
-
+
@@ -779,11 +705,11 @@ This Matlab function is accessible here
-
-
1.8 computeReferencePose
-
+
+
1.7 computeReferencePose
+
-
+
@@ -876,7 +802,7 @@ This Matlab function is accessible here
Author: Dehaeze Thomas
-
Created: 2019-12-11 mer. 17:33
+
Created: 2019-12-12 jeu. 11:25
Validate
diff --git a/functions/index.org b/functions/index.org
index 93f7dc7..07299a0 100644
--- a/functions/index.org
+++ b/functions/index.org
@@ -407,74 +407,6 @@ This Matlab function is accessible [[file:../src/identifyPlant.m][here]].
end
#+end_src
-** runSimulation
-:PROPERTIES:
-:header-args:matlab+: :tangle ../src/runSimulation.m
-:header-args:matlab+: :comments none :mkdirp yes :eval no
-:END:
-<
>
-
-This Matlab function is accessible [[file:../src/runSimulation.m][here]].
-
-#+begin_src matlab
- 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')
- K_obj = load('./mat/K_fb.mat');
- K = K_obj.(sprintf('K_%s_%s', sys_mass, sys_name)); %#ok
- save('./mat/controllers.mat', 'K');
- elseif strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'iff')
- K_obj = load('./mat/K_fb_iff.mat');
- K = K_obj.(sprintf('K_%s_%s_iff', sys_mass, sys_name)); %#ok
- save('./mat/controllers.mat', 'K');
- elseif strcmp(ctrl_type, 'ol')
- K = tf(zeros(6)); %#ok
- save('./mat/controllers.mat', 'K');
- else
- error('ctrl_type should be cl or ol');
- end
-
- %% Active Damping
- if strcmp(act_damp, 'iff')
- K_iff_crit = load('./mat/K_iff_crit.mat');
- K_iff = K_iff_crit.(sprintf('K_iff_%s_%s', sys_mass, sys_name)); %#ok
- save('./mat/controllers.mat', 'K_iff', '-append');
- elseif strcmp(act_damp, 'none')
- K_iff = tf(zeros(6)); %#ok
- save('./mat/controllers.mat', 'K_iff', '-append');
- end
-
- %%
- if strcmp(sys_name, 'pz')
- initializeNanoHexapod(struct('actuator', 'piezo'));
- elseif strcmp(sys_name, 'vc')
- initializeNanoHexapod(struct('actuator', 'lorentz'));
- else
- error('sys_name should be pz or vc');
- end
-
- if strcmp(sys_mass, 'light')
- initializeSample(struct('mass', 1));
- elseif strcmp(sys_mass, 'heavy')
- initializeSample(struct('mass', 50));
- else
- error('sys_mass should be light or heavy');
- end
-
- %% Run the simulation
- sim('sim_nano_station_ctrl.slx');
-
- %% Split the Dsample matrix into vectors
- [Dx, Dy, Dz, Rx, Ry, Rz] = matSplit(Es.Data, 1); %#ok
- time = Dsample.Time; %#ok
-
- %% Save the result
- filename = sprintf('sim_%s_%s_%s_%s', sys_mass, sys_name, ctrl_type, act_damp);
- save(sprintf('./mat/%s.mat', filename), ...
- 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
- end
-#+end_src
-
** Inverse Kinematics of the Hexapod
:PROPERTIES:
:header-args:matlab+: :tangle ../src/inverseKinematicsHexapod.m
diff --git a/identification/index.org b/identification/index.org
index 6f047c9..3f5a0ac 100644
--- a/identification/index.org
+++ b/identification/index.org
@@ -77,7 +77,7 @@ We first define some parameters for the identification.
The simulink file for the identification is =sim_micro_station_id.slx=.
#+begin_src matlab
- open 'simscape/sim_micro_station_id.slx'
+ open('identification/matlab/sim_micro_station_id.slx')
#+end_src
#+begin_src matlab
@@ -140,7 +140,7 @@ save('./mat/id_micro_station.mat', 'G_ms');
** Simscape Model
#+begin_src matlab
- open 'simscape/sim_micro_station_modal_analysis.slx'
+ open('identification/matlab/sim_micro_station_modal_analysis.slx')
#+end_src
#+begin_src matlab
@@ -230,7 +230,9 @@ hold off;
initializeAxisc();
#+end_src
-** Center of Mass of each solid body
+** TODO Center of Mass of each solid body
+- [ ] Verify that this is coherent with the simscape and with the measurements
+
| | granite bot | granite top | ty | ry | rz | hexa |
|--------+-------------+-------------+------+------+------+------|
@@ -239,7 +241,7 @@ hold off;
| Z [mm] | -1251 | -778 | -600 | -628 | -580 | -319 |
#+begin_src matlab
- open 'simscape/sim_micro_station_modal_analysis_com.slx'
+ open('identification/matlab/sim_micro_station_modal_analysis_com.slx')
#+end_src
** Simscape Model
@@ -409,22 +411,8 @@ hold off;
#+CAPTION: caption ([[./figs/identification_comp_top_stages.png][png]], [[./figs/identification_comp_top_stages.pdf][pdf]])
[[file:figs/identification_comp_top_stages.png]]
-* ZIP file containing the data and matlab files :ignore:
-#+begin_src bash :exports none :results none
- if [ matlab/identification_micro_station.m -nt data/identification_micro_station.zip ]; then
- cp matlab/identification_micro_station.m identification_micro_station.m;
- zip data/identification_micro_station \
- mat/data.mat \
- identification_micro_station.m
- rm identification_micro_station.m;
- fi
-#+end_src
-
-#+begin_note
- All the files (data and Matlab scripts) are accessible [[file:data/identification_micro_station.zip][here]].
-#+end_note
-
-* Matlab Init :noexport:ignore:
+* Other analysis
+** 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
@@ -433,15 +421,14 @@ hold off;
<>
#+end_src
-* Identification of the micro-station
#+begin_src matlab
simulinkproject('../');
#+end_src
#+begin_src matlab
- open sim_micro_station_id.slx
+ open('identification/matlab/sim_micro_station_id.slx')
#+end_src
-* Plot the obtained transfer functions
-* Compare with the modal measurements
-* Modal Identification of the micro station
+** Plot the obtained transfer functions
+** Compare with the modal measurements
+** Modal Identification of the micro station
diff --git a/simscape/sim_micro_station_id.slx b/identification/matlab/sim_micro_station_id.slx
similarity index 100%
rename from simscape/sim_micro_station_id.slx
rename to identification/matlab/sim_micro_station_id.slx
diff --git a/simscape/sim_micro_station_modal_analysis.slx b/identification/matlab/sim_micro_station_modal_analysis.slx
similarity index 100%
rename from simscape/sim_micro_station_modal_analysis.slx
rename to identification/matlab/sim_micro_station_modal_analysis.slx
diff --git a/simscape/sim_micro_station_modal_analysis_com.slx b/identification/matlab/sim_micro_station_modal_analysis_com.slx
similarity index 100%
rename from simscape/sim_micro_station_modal_analysis_com.slx
rename to identification/matlab/sim_micro_station_modal_analysis_com.slx
diff --git a/kinematics/index.org b/kinematics/index.org
index f94096a..30baca8 100644
--- a/kinematics/index.org
+++ b/kinematics/index.org
@@ -147,7 +147,7 @@ Otherwise, when the limbs' lengths derived yield complex numbers, then the posit
**** Matlab Implementation
We open the Simulink file.
#+begin_src matlab
- open 'simscape/hexapod_tests.slx'
+ open('kinematics/matlab/hexapod_tests.slx')
#+end_src
We load the configuration and set a small =StopTime=.
@@ -182,7 +182,7 @@ We define the wanted position/orientation of the Hexapod under study.
We run the simulation.
#+begin_src matlab
- sim('simscape/hexapod_tests.slx')
+ sim('hexapod_tests.slx')
#+end_src
And we verify that we indeed succeed to go to the wanted position.
diff --git a/simscape/hexapod_tests.slx b/kinematics/matlab/hexapod_tests.slx
similarity index 100%
rename from simscape/hexapod_tests.slx
rename to kinematics/matlab/hexapod_tests.slx
diff --git a/positioning_error/index.org b/positioning_error/index.org
index 4b4efb1..2192af8 100644
--- a/positioning_error/index.org
+++ b/positioning_error/index.org
@@ -96,7 +96,7 @@ The goal here is to perfectly move the station and verify that there is no misma
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_metrology.slx'
+ open('positioning_error/matlab/sim_nano_station_metrology.slx')
#+end_src
** Prepare the Simulation
@@ -160,7 +160,7 @@ No position error for now (perfect positioning).
And we run the simulation.
#+begin_src matlab
- sim('simscape/sim_nano_station_metrology.slx');
+ sim('sim_nano_station_metrology.slx');
#+end_src
** Verify that the pose of the sample is the same as the computed one
@@ -246,7 +246,7 @@ We want to verify that we are able to measure this positioning error and convert
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_metrology.slx'
+ open('positioning_error/matlab/sim_nano_station_metrology.slx')
#+end_src
** Prepare the Simulation
@@ -308,7 +308,7 @@ Now we introduce some positioning error.
And we run the simulation.
#+begin_src matlab
- sim('simscape/sim_nano_station_metrology.slx');
+ sim('sim_nano_station_metrology.slx');
#+end_src
** Compute the wanted pose of the sample in the NASS Base from the metrology and the reference
@@ -407,7 +407,7 @@ We now keep the wanted pose but we impose a displacement of the nano hexapod cor
And we run the simulation.
#+begin_src matlab
- sim('simscape/sim_nano_station_metrology.slx');
+ sim('sim_nano_station_metrology.slx');
#+end_src
We keep the old computed computed reference pose ${}^W\bm{T}_r$ even though we have change the nano hexapod reference, but this is not a real wanted reference but rather a adaptation to reject the positioning errors.
@@ -497,7 +497,7 @@ Thus:
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_metrology.slx'
+ open('positioning_error/matlab/sim_nano_station_metrology.slx')
#+end_src
** Wanted Position of the Sample with respect to the Granite
diff --git a/simscape/sim_nano_station_metrology.slx b/positioning_error/matlab/sim_nano_station_metrology.slx
similarity index 100%
rename from simscape/sim_nano_station_metrology.slx
rename to positioning_error/matlab/sim_nano_station_metrology.slx
diff --git a/src/runSimulation.m b/src/runSimulation.m
deleted file mode 100644
index 51a1b53..0000000
--- a/src/runSimulation.m
+++ /dev/null
@@ -1,56 +0,0 @@
-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')
- K_obj = load('./mat/K_fb.mat');
- K = K_obj.(sprintf('K_%s_%s', sys_mass, sys_name)); %#ok
- save('./mat/controllers.mat', 'K');
- elseif strcmp(ctrl_type, 'cl') && strcmp(act_damp, 'iff')
- K_obj = load('./mat/K_fb_iff.mat');
- K = K_obj.(sprintf('K_%s_%s_iff', sys_mass, sys_name)); %#ok
- save('./mat/controllers.mat', 'K');
- elseif strcmp(ctrl_type, 'ol')
- K = tf(zeros(6)); %#ok
- save('./mat/controllers.mat', 'K');
- else
- error('ctrl_type should be cl or ol');
- end
-
- %% Active Damping
- if strcmp(act_damp, 'iff')
- K_iff_crit = load('./mat/K_iff_crit.mat');
- K_iff = K_iff_crit.(sprintf('K_iff_%s_%s', sys_mass, sys_name)); %#ok
- save('./mat/controllers.mat', 'K_iff', '-append');
- elseif strcmp(act_damp, 'none')
- K_iff = tf(zeros(6)); %#ok
- save('./mat/controllers.mat', 'K_iff', '-append');
- end
-
- %%
- if strcmp(sys_name, 'pz')
- initializeNanoHexapod(struct('actuator', 'piezo'));
- elseif strcmp(sys_name, 'vc')
- initializeNanoHexapod(struct('actuator', 'lorentz'));
- else
- error('sys_name should be pz or vc');
- end
-
- if strcmp(sys_mass, 'light')
- initializeSample(struct('mass', 1));
- elseif strcmp(sys_mass, 'heavy')
- initializeSample(struct('mass', 50));
- else
- error('sys_mass should be light or heavy');
- end
-
- %% Run the simulation
- sim('sim_nano_station_ctrl.slx');
-
- %% Split the Dsample matrix into vectors
- [Dx, Dy, Dz, Rx, Ry, Rz] = matSplit(Es.Data, 1); %#ok
- time = Dsample.Time; %#ok
-
- %% Save the result
- filename = sprintf('sim_%s_%s_%s_%s', sys_mass, sys_name, ctrl_type, act_damp);
- save(sprintf('./mat/%s.mat', filename), ...
- 'time', 'Dx', 'Dy', 'Dz', 'Rx', 'Ry', 'Rz', 'K');
-end
diff --git a/uniaxial/index.org b/uniaxial/index.org
index 074d1c3..b8e0551 100644
--- a/uniaxial/index.org
+++ b/uniaxial/index.org
@@ -643,7 +643,7 @@ Let's start by study the undamped system.
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
#+end_src
** Init
@@ -1075,7 +1075,7 @@ It corresponds to the plant to control.
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
#+end_src
** Control Design
@@ -1501,7 +1501,7 @@ In the Relative Motion Control (RMC), a derivative feedback is applied between t
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
#+end_src
** Control Design
@@ -1936,7 +1936,7 @@ In the Relative Motion Control (RMC), a feedback is applied between the measured
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
#+end_src
** Control Design
@@ -2236,7 +2236,7 @@ The model used for the Cedrat actuator is shown in figure [[fig:cedrat_schematic
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial_cedrat.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial_cedrat.slx')
#+end_src
** Identification
@@ -2573,7 +2573,7 @@ All the controllers are set to 0.
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
#+end_src
** Load the plants
@@ -2831,7 +2831,7 @@ It is important to note that the effect of direct forces applied to the sample a
#+end_src
#+begin_src matlab
- open 'simscape/sim_nano_station_uniaxial.slx'
+ open('uniaxial/matlab/sim_nano_station_uniaxial.slx')
#+end_src
** Init
diff --git a/simscape/sim_nano_station_uniaxial.slx b/uniaxial/matlab/sim_nano_station_uniaxial.slx
similarity index 100%
rename from simscape/sim_nano_station_uniaxial.slx
rename to uniaxial/matlab/sim_nano_station_uniaxial.slx
diff --git a/simscape/sim_nano_station_uniaxial_cedrat.slx b/uniaxial/matlab/sim_nano_station_uniaxial_cedrat.slx
similarity index 100%
rename from simscape/sim_nano_station_uniaxial_cedrat.slx
rename to uniaxial/matlab/sim_nano_station_uniaxial_cedrat.slx
diff --git a/simscape/sim_nano_station_uniaxial_cedrat_bis.slx b/uniaxial/matlab/sim_nano_station_uniaxial_cedrat_bis.slx
similarity index 100%
rename from simscape/sim_nano_station_uniaxial_cedrat_bis.slx
rename to uniaxial/matlab/sim_nano_station_uniaxial_cedrat_bis.slx