add slip-ring-noise measurement

This commit is contained in:
Thomas Dehaeze 2019-04-30 10:38:22 +02:00
parent e96bd46b7c
commit d23d4acfba
7 changed files with 63 additions and 0 deletions

11
slip-ring-test/analysis.m Normal file
View File

@ -0,0 +1,11 @@
data1 = load('mat/data_001.mat', 't', 'x1', 'x2');
data2 = load('mat/data_002.mat', 't', 'x1', 'x2');
figure;
hold on;
plot(data1.t, data1.x1-data1.x2);
plot(data2.t, data2.x1-data2.x2);
hold off
xlabel('Time [s]');
ylabel('Voltage [V]');
legend({'Slip-ring OFF', 'Slip-ring ON'});

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,2 @@
|data_001|slip-ring not turning|
|data_002|slip-ring turning|

49
slip-ring-test/run_test.m Normal file
View File

@ -0,0 +1,49 @@
tg = slrt;
%% TODO - Build this application if updated
%%
if tg.Connected == "Yes"
if tg.Status == "stopped"
%% Load the application
tg.load('slip_ring_test');
%% Run the application
tg.start;
pause(10);
tg.stop;
%% Load the data
f = SimulinkRealTime.openFTP(tg);
cd(f, 'data/slip_ring_test/');
mget(f, 'data_001.dat', 'data');
close(f);
end
end
data = SimulinkRealTime.utils.getFileScopeData('data/data_001.dat').data;
size(data)
t = data(:, end);
x1 = data(:, 1);
x2 = data(:, 2);
save('mat/data_002.mat', 't', 'x1', 'x2');
%% Plot the data
figure;
hold on;
plot(t, x1);
plot(t, x2);
hold off
xlabel('Time [s]');
ylabel('Voltage [V]');
%%
figure;
hold on;
plot(t, x1-x2);
hold off
xlabel('Time [s]');
ylabel('Voltage [V]');

1
slip-ring-test/setup.m Normal file
View File

@ -0,0 +1 @@
Ts = 1e-3; % [s]

Binary file not shown.