| 1 | M=pmsm_estim_mex('real_mx.cfg'); |
|---|
| 2 | |
|---|
| 3 | ids = [1:size(M.mean_EKFMz,1)]; |
|---|
| 4 | kftime=[ids-ids(1)]*0.000125; |
|---|
| 5 | |
|---|
| 6 | figure(1); |
|---|
| 7 | subplot(2,1,1); |
|---|
| 8 | hold off |
|---|
| 9 | plot(kftime,M.mean_EKFMz(ids,3)/2/pi,'-.'); |
|---|
| 10 | hold on |
|---|
| 11 | plot(kftime,M.mean_EKF(ids,3)/2/pi,'r'); |
|---|
| 12 | |
|---|
| 13 | title('Measured and estimated \omega_{me}'); |
|---|
| 14 | xlabel('time [s]') |
|---|
| 15 | |
|---|
| 16 | subplot(2,1,2); |
|---|
| 17 | plot(kftime, M.mean_EKFMz(ids,5)); |
|---|
| 18 | title('Estimated load T_L'); |
|---|
| 19 | |
|---|
| 20 | |
|---|
| 21 | % ----- |
|---|
| 22 | |
|---|
| 23 | load ~/work/vs/Pohony/DATA_MERENI/DATA_MCU/data9.dat -ascii |
|---|
| 24 | |
|---|
| 25 | data=data9; |
|---|
| 26 | |
|---|
| 27 | subplot(2,1,1); |
|---|
| 28 | setime=[0:799]*0.004666; % fitted on currents |
|---|
| 29 | plot(setime,data([0:799]+711,6),'--k','LineWidth',3); |
|---|
| 30 | %plot(setime,data([0:799]+711,11),'--g','LineWidth',3); |
|---|
| 31 | %plot(setime,2*pi*data1([0:799]+620,6),'--k','LineWidth',3); |
|---|
| 32 | |
|---|
| 33 | legend('EKF T_L estimate','EKF estimate','Sensor readings') |
|---|
| 34 | |
|---|
| 35 | set(gca,'XLim',[0,kftime(end)]) |
|---|