Add first analysis
This commit is contained in:
parent
e3c4c655ba
commit
5e11e49474
70
readme.org
70
readme.org
@ -9,7 +9,7 @@ We first copy the =dat= file from the target computer to the host computer:
|
||||
tg=slrt;
|
||||
f=SimulinkRealTime.openFTP(tg);
|
||||
mget(f, 'DATA_001.dat', 'local_folder');
|
||||
close(f);
|
||||
close(f);
|
||||
#+end_src
|
||||
|
||||
We then import the =dat= file to the workspace:
|
||||
@ -21,42 +21,42 @@ We then import the =dat= file to the workspace:
|
||||
* Commands with the target object
|
||||
https://fr.mathworks.com/help/xpc/api/simulinkrealtime.target.html
|
||||
|
||||
| Connect | No Yes |
|
||||
| Status | stopped runing |
|
||||
| Connect | No Yes |
|
||||
| Status | stopped runing |
|
||||
| start | Start execution of real-time application on target computer |
|
||||
| stop | Stop execution of real-time application on target computer |
|
||||
|
||||
|
||||
| tg.viewTargetScreen | Show target computer screen |
|
||||
|
||||
| ping | Test communication between development and target computers |
|
||||
| reboot | Restart target computer |
|
||||
| close | Close connection between development and target computers |
|
||||
| ping | Test communication between development and target computers |
|
||||
| reboot | Restart target computer |
|
||||
| close | Close connection between development and target computers |
|
||||
|
||||
| load | Download real-time application to target computer |
|
||||
| load | Download real-time application to target computer |
|
||||
| unload | Remove real-time application from target computer |
|
||||
|
||||
| addscope | Create a scope of specified type |
|
||||
| getscope | Return scope identified by scope number |
|
||||
| remscope | Remove scope from target computer |
|
||||
| getlog | Portion of output logs from target object |
|
||||
| importLogData | Import buffered logging data to the active session of the Simulation Data Inspector |
|
||||
| getsignal | Value of signal |
|
||||
| getsignalid | Signal index from signal hierarchical name |
|
||||
| getsignalidsfromlabel | Vector of signal indices |
|
||||
| getsignallabel | Signal label for signal index |
|
||||
| getsignalname | Signal name from index list |
|
||||
| getparam | Read value of observable parameter in real-time application |
|
||||
| setparam | Change value of tunable parameter in real-time application |
|
||||
| getparamid | Parameter index from parameter hierarchical name |
|
||||
| getparamname | Block path and parameter name from parameter index |
|
||||
| loadparamset | Restore parameter values saved in specified file |
|
||||
| saveparamset | Save real-time application parameter values |
|
||||
| startProfiler | Start profiling service on target computer |
|
||||
| stopProfiler | Stop profiling service on target computer |
|
||||
| getProfilerData | Retrieve profile data object |
|
||||
| resetProfiler | Reset profiling service state to Ready |
|
||||
| getDiskSpace | Return free space and total space on the drive, in bytes |
|
||||
| addscope | Create a scope of specified type |
|
||||
| getscope | Return scope identified by scope number |
|
||||
| remscope | Remove scope from target computer |
|
||||
| getlog | Portion of output logs from target object |
|
||||
| importLogData | Import buffered logging data to the active session of the Simulation Data Inspector |
|
||||
| getsignal | Value of signal |
|
||||
| getsignalid | Signal index from signal hierarchical name |
|
||||
| getsignalidsfromlabel | Vector of signal indices |
|
||||
| getsignallabel | Signal label for signal index |
|
||||
| getsignalname | Signal name from index list |
|
||||
| getparam | Read value of observable parameter in real-time application |
|
||||
| setparam | Change value of tunable parameter in real-time application |
|
||||
| getparamid | Parameter index from parameter hierarchical name |
|
||||
| getparamname | Block path and parameter name from parameter index |
|
||||
| loadparamset | Restore parameter values saved in specified file |
|
||||
| saveparamset | Save real-time application parameter values |
|
||||
| startProfiler | Start profiling service on target computer |
|
||||
| stopProfiler | Stop profiling service on target computer |
|
||||
| getProfilerData | Retrieve profile data object |
|
||||
| resetProfiler | Reset profiling service state to Ready |
|
||||
| getDiskSpace | Return free space and total space on the drive, in bytes |
|
||||
|
||||
* FTP access to the target computer
|
||||
https://fr.mathworks.com/help/xpc/api/simulinkrealtime.openftp.html?s_tid=doc_ta
|
||||
@ -68,11 +68,11 @@ First run the following commands to have the =FTP= Object:
|
||||
#+end_src
|
||||
|
||||
Then, the =f= object can be used to access the filesystem on the target computer.
|
||||
| cd | | |
|
||||
| dir | | |
|
||||
| cd | | |
|
||||
| dir | | |
|
||||
| mget | Used to download data from the target host | =f.mget('data.dat', 'local_folder')= |
|
||||
| mkdir | | |
|
||||
| mput | | |
|
||||
| rename | | |
|
||||
| rmdir | | |
|
||||
| close | | |
|
||||
| mkdir | | |
|
||||
| mput | | |
|
||||
| rename | | |
|
||||
| rmdir | | |
|
||||
| close | | |
|
||||
|
3
slip-ring-test/figs/.gitignore
vendored
Normal file
3
slip-ring-test/figs/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*.svg
|
||||
*.pdf
|
||||
*.tex
|
BIN
slip-ring-test/figs/data_time_domain.png
Normal file
BIN
slip-ring-test/figs/data_time_domain.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 39 KiB |
BIN
slip-ring-test/figs/data_time_domain_zoom.png
Normal file
BIN
slip-ring-test/figs/data_time_domain_zoom.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 73 KiB |
BIN
slip-ring-test/figs/geophone_sensibility.png
Normal file
BIN
slip-ring-test/figs/geophone_sensibility.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 60 KiB |
BIN
slip-ring-test/figs/psd_velocity.png
Normal file
BIN
slip-ring-test/figs/psd_velocity.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 139 KiB |
148
slip-ring-test/index.org
Normal file
148
slip-ring-test/index.org
Normal file
@ -0,0 +1,148 @@
|
||||
#+TITLE:SpeedGoat
|
||||
:DRAWER:
|
||||
#+STARTUP: overview
|
||||
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/htmlize.css"/>
|
||||
#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/readtheorg.css"/>
|
||||
#+HTML_HEAD: <script src="js/jquery.min.js"></script>
|
||||
#+HTML_HEAD: <script src="js/bootstrap.min.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="js/jquery.stickytableheaders.min.js"></script>
|
||||
#+HTML_HEAD: <script type="text/javascript" src="js/readtheorg.js"></script>
|
||||
|
||||
#+LATEX_CLASS: cleanreport
|
||||
#+LaTeX_CLASS_OPTIONS: [tocnp, secbreak, minted]
|
||||
#+LaTeX_HEADER: \usepackage{svg}
|
||||
#+LaTeX_HEADER: \newcommand{\authorFirstName}{Thomas}
|
||||
#+LaTeX_HEADER: \newcommand{\authorLastName}{Dehaeze}
|
||||
#+LaTeX_HEADER: \newcommand{\authorEmail}{dehaeze.thomas@gmail.com}
|
||||
|
||||
#+PROPERTY: header-args:matlab :session *MATLAB*
|
||||
#+PROPERTY: header-args:matlab+ :comments org
|
||||
#+PROPERTY: header-args:matlab+ :exports both
|
||||
#+PROPERTY: header-args:matlab+ :eval no-export
|
||||
#+PROPERTY: header-args:matlab+ :output-dir figs
|
||||
#+PROPERTY: header-args:matlab+ :mkdirp yes
|
||||
:END:
|
||||
|
||||
* Matlab Init :noexport:ignore:
|
||||
#+begin_src matlab :exports none :results silent :noweb yes
|
||||
<<matlab-init>>
|
||||
#+end_src
|
||||
|
||||
* Load data
|
||||
#+begin_src matlab :results none
|
||||
load('mat/data_001.mat', 't', 'x1', 'x2');
|
||||
dt = t(2) - t(1);
|
||||
#+end_src
|
||||
|
||||
* Time Domain Data
|
||||
#+begin_src matlab :results none
|
||||
figure;
|
||||
hold on;
|
||||
plot(t, x1);
|
||||
plot(t, x2);
|
||||
hold off;
|
||||
xlabel('Time [s]');
|
||||
ylabel('Voltage [V]');
|
||||
xlim([t(1), t(end)]);
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:data_time_domain
|
||||
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
||||
#+begin_src matlab :var filepath="figs/data_time_domain.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
||||
<<plt-matlab>>
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:data_time_domain
|
||||
#+CAPTION: Time domain Data
|
||||
#+RESULTS: fig:data_time_domain
|
||||
[[file:figs/data_time_domain.png]]
|
||||
|
||||
|
||||
#+begin_src matlab :results none
|
||||
figure;
|
||||
hold on;
|
||||
plot(t, x1);
|
||||
plot(t, x2);
|
||||
hold off;
|
||||
xlabel('Time [s]');
|
||||
ylabel('Voltage [V]');
|
||||
xlim([0 1]);
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:data_time_domain_zoom
|
||||
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
||||
#+begin_src matlab :var filepath="figs/data_time_domain_zoom.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
||||
<<plt-matlab>>
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:data_time_domain_zoom
|
||||
#+CAPTION: Time domain Data - Zoom
|
||||
#+RESULTS: fig:data_time_domain_zoom
|
||||
[[file:figs/data_time_domain_zoom.png]]
|
||||
|
||||
* Compute PSD
|
||||
#+begin_src matlab :results none
|
||||
[pxx1, f1] = pwelch(x1, hanning(ceil(length(t)/100)), 0, [], 1/dt);
|
||||
[pxx2, f2] = pwelch(x2, hanning(ceil(length(t)/100)), 0, [], 1/dt);
|
||||
#+end_src
|
||||
|
||||
* Take into account sensibility of Geophone
|
||||
The Geophone used are L22.
|
||||
#+begin_src matlab :results none
|
||||
S0 = 88; % Sensitivity [V/(m/s)]
|
||||
f0 = 2; % Cut-off frequnecy [Hz]
|
||||
S = (s/2/pi/f0)/(1+s/2/pi/f0);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :results none
|
||||
figure;
|
||||
bodeFig({S});
|
||||
ylabel('Amplitude [V/(m/s)]')
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:geophone_sensibility
|
||||
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
||||
#+begin_src matlab :var filepath="figs/geophone_sensibility.pdf" :var figsize="wide-normal" :post pdf2svg(file=*this*, ext="png")
|
||||
<<plt-matlab>>
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:geophone_sensibility
|
||||
#+CAPTION: Sensibility of the Geophone
|
||||
#+RESULTS: fig:geophone_sensibility
|
||||
[[file:figs/geophone_sensibility.png]]
|
||||
|
||||
|
||||
We take into account the gain of the electronics.
|
||||
The cut-off frequency is set at 1kHz.
|
||||
|
||||
- [ ] Check what is the order of the filter
|
||||
- [ ] Maybe I should not use this filter as there is no high frequencies anyway?
|
||||
|
||||
#+begin_src matlab :results none
|
||||
G0 = 60; % [dB]
|
||||
|
||||
G = G0/(1+s/2/pi/1000);
|
||||
#+end_src
|
||||
|
||||
#+begin_src matlab :results none
|
||||
figure;
|
||||
hold on;
|
||||
plot(f1, sqrt(pxx1)./squeeze(abs(freqresp(G, f1, 'Hz')))./squeeze(abs(freqresp(S, f1, 'Hz'))));
|
||||
plot(f2, sqrt(pxx2)./squeeze(abs(freqresp(G, f2, 'Hz')))./squeeze(abs(freqresp(S, f2, 'Hz'))));
|
||||
hold off;
|
||||
set(gca, 'xscale', 'log');
|
||||
set(gca, 'yscale', 'log');
|
||||
xlabel('Frequency [Hz]'); ylabel('PSD [m/s/sqrt(Hz)]')
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:psd_velocity
|
||||
#+HEADER: :tangle no :exports results :results value raw replace :noweb yes
|
||||
#+begin_src matlab :var filepath="figs/psd_velocity.pdf" :var figsize="full-tall" :post pdf2svg(file=*this*, ext="png")
|
||||
<<plt-matlab>>
|
||||
#+end_src
|
||||
|
||||
#+NAME: fig:psd_velocity
|
||||
#+CAPTION: Spectral density of the velocity
|
||||
#+RESULTS: fig:psd_velocity
|
||||
[[file:figs/psd_velocity.png]]
|
@ -1 +1,2 @@
|
||||
* TODO Register data on the computer
|
||||
* DONE Register data on the computer
|
||||
CLOSED: [2019-04-17 mer. 17:26]
|
||||
|
@ -12,7 +12,7 @@ if tg.Connected == "Yes"
|
||||
tg.start;
|
||||
pause(10);
|
||||
tg.stop;
|
||||
|
||||
|
||||
%% Load the data
|
||||
f = SimulinkRealTime.openFTP(tg);
|
||||
mget(f, 'data/data_001.dat');
|
||||
@ -45,4 +45,3 @@ window_L = ceil(length(x1)/10);
|
||||
window_han = .5*(1 - cos(2*pi*(1:window_L)'/(window_L+1)));
|
||||
|
||||
[pxx, f] = pwelch(x1, window_han, 0, [], 1/dt);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user