root/matlab/pmsm/mpf_u_delta_disp.m @ 228

Revision 228, 1.8 kB (checked in by smidl, 15 years ago)

chybejici soubory

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