1 | %close all |
---|
2 | itload('../../mpf_u_delta.it') |
---|
3 | figure(1); |
---|
4 | for i =1:4 |
---|
5 | subplot(4,1,i) |
---|
6 | hold off |
---|
7 | plot(xth(:,i)') |
---|
8 | end |
---|
9 | |
---|
10 | figure(2) |
---|
11 | for i=1:4 |
---|
12 | subplot(4,1,i) |
---|
13 | hold off |
---|
14 | plot(xth(:,i)') |
---|
15 | hold on; |
---|
16 | plot(xthE(:,i)','r') |
---|
17 | plot(xthM(:,i+3)','g') |
---|
18 | % plot(xthV(i,:)','m'); |
---|
19 | grid on |
---|
20 | end |
---|
21 | |
---|
22 | figure(7); plot(abs(xthM(:,3))); |
---|
23 | |
---|
24 | figure(3) |
---|
25 | tm=[1:9000]*125e-6; |
---|
26 | subplot(2,1,1) |
---|
27 | hold off |
---|
28 | plot(tm,xthM(:,1),':') |
---|
29 | hold on |
---|
30 | plot(tm,xthM(:,2),'-') |
---|
31 | set(gca,'XLim',[0,1.2]); |
---|
32 | set(gca,'YLim',[-5,5]); |
---|
33 | set(gca,'XTick',[]); |
---|
34 | ylabel(['Estimated \Delta u [V]']); |
---|
35 | legend('\Delta u_{\alpha s}', '\Delta u_{\beta s}') |
---|
36 | |
---|
37 | subplot(2,1,2) |
---|
38 | hold off |
---|
39 | plot(tm,-Dt(:,3)+Dt(:,5),':') |
---|
40 | hold on |
---|
41 | plot(tm,-Dt(:,4)+Dt(:,6),'-') |
---|
42 | set(gca,'XLim',[0,1.2]); |
---|
43 | set(gca,'YLim',[-5,5]); |
---|
44 | legend('\Delta u_{\alpha s}', '\Delta u_{\beta s}') |
---|
45 | ylabel(['Simulated \Delta u [V]']); |
---|
46 | xlabel(['time [s]']); |
---|
47 | % plot(Qtr(:,i)','--') |
---|
48 | |
---|
49 | |
---|
50 | figure(4) |
---|
51 | subplot(2,1,1) |
---|
52 | hold off |
---|
53 | di =xthE(:,1+2)'-xth(:,1+2)'; |
---|
54 | plot(tm,di,'--') |
---|
55 | MSE_E=di*di'/9000 |
---|
56 | |
---|
57 | hold on; |
---|
58 | di = xthM(:,3+3)'-xth(:,1+2)'; |
---|
59 | plot(tm,di,'-') |
---|
60 | MSE_M=di*di'/9000 |
---|
61 | plot(tm, zeros(1,9000),':') |
---|
62 | set(gca,'XLim',[0,1.2]); |
---|
63 | title ('Estimate deviation') |
---|
64 | ylabel('Rotor speed \omega') |
---|
65 | legend('EKF', 'EKF with estimated voltage drops') |
---|
66 | |
---|
67 | subplot(2,1,2) |
---|
68 | hold off |
---|
69 | di = xthE(:,2+2)'-xth(:,2+2)'; |
---|
70 | i2=find(di>1.5*pi); |
---|
71 | di(i2)=di(i2)-2*pi; |
---|
72 | i2=find(di<-1.5*pi); |
---|
73 | di(i2)=di(i2)+2*pi; |
---|
74 | plot(tm,di,'--') |
---|
75 | MSE_E=di*di'/9000 |
---|
76 | |
---|
77 | hold on; |
---|
78 | di =xthMTh' - xth(:,2+2)'; |
---|
79 | i2=find(di>1.5*pi); |
---|
80 | di(i2)=di(i2)-2*pi; |
---|
81 | i2=find(di<-1.5*pi); |
---|
82 | di(i2)=di(i2)+2*pi; |
---|
83 | plot(tm,di,'-') |
---|
84 | MSE_M=di*di'/9000 |
---|
85 | plot(tm,zeros(size(tm)),':') |
---|
86 | title ('Estimate deviation') |
---|
87 | ylabel('Rotor position \vartheta') |
---|
88 | set(gca,'XLim',[0,1.2]); |
---|
89 | %set(gca,'YLim',[-0.5 0.5]) |
---|
90 | legend('EKF', 'EKF with estimated voltage drops') |
---|
91 | |
---|
92 | % figure(3) |
---|
93 | % ndat = size(ll,2); |
---|
94 | % hold off |
---|
95 | % plot(llgrid,ll(:,floor(ndat/3)),':'); |
---|
96 | % hold on |
---|
97 | % plot(llgrid,ll(:,floor(2*ndat/3)),'--'); |
---|
98 | % plot(llgrid,ll(:,ndat)); |
---|