root/matlab/pmsm/mpf_u_delta_real_disp.m @ 264

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

SanJose? submission

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