root/matlab/pmsm/mpf_u_delta_disp.m @ 367

Revision 230, 1.8 kB (checked in by smidl, 16 years ago)

mpf_delta - estimation of covariance weight

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