clc
clear all
close all

load('02_Uq_25V_timeBase_mult3_TL0280.mat');

Tvz = 62.5e-6;

t = data(:,1);
t2 = (0:3*Tvz:(length(data(:,1))-1)*3*Tvz)';
Iq = data(:,2);
Id = data(:,3);
Uq = data(:,4);
Ud = 0*Uq;
w_r = data(:,5)/60*2*pi;
theta = data(:,6);
input = [t2 Uq];
y_orig = [Id Iq w_r];

figure;
subplot(3,1,1)
plot(t2,Iq,'r');
hold on;
plot(t2,Id,'b');
title('Id,Iq [mA]');
grid on;

subplot(3,1,2)
plot(t2,Uq,'r');
hold on;
plot(t2,Ud,'b');
title('Ud,Uq [V]');
grid on;

subplot(3,1,3)
plot(t2,w_r,'b');
title('w_r [rpm]');
grid on;