-
Notifications
You must be signed in to change notification settings - Fork 0
/
plot_state.m
65 lines (56 loc) · 1.57 KB
/
plot_state.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
%%
REF_DATA = ref_data.signals.values;
EST_DATA = est_trq.signals.values;
ACT_DATA = act_trq.signals.values;
MOT_TRQ = motor_trq.signals.values;
TEMPO = ref_data.time;
INT_DATA = int_trq.signals.values;
INT_EST_DATA = int_est_trq.signals.values;
%%
figure
hold on
set(gca,'FontSize',25)
plot( TEMPO , REF_DATA , '--k ' ,'LineWidth' , 5);grid;shg
plot( TEMPO , EST_DATA , '-.b' , 'LineWidth' , 5);grid;shg
plot( TEMPO , ACT_DATA , ':r','LineWidth' , 5);grid;shg
xlabel('Time [s]')
ylabel('Torque [Nm]')
legend('Reference Torque' , 'Estimated Torque' , 'Actual Torque ' )
grid on
%%
figure
hold on
set(gca,'FontSize',25)
%plot( TEMPO , ((ACT_DATA - EST_DATA)./ACT_DATA)*100 , 'k','LineWidth' , 5);grid;shg
plot( TEMPO , (ACT_DATA - EST_DATA) , 'k','LineWidth' , 3);grid;shg
xlabel('Time [s]')
%ylabel('Error on \Delta \tau_{h} [%]')
ylabel('Error on \Delta y_{b}')
grid on
%%
figure
hold on
set(gca,'FontSize',25)
plot( TEMPO , MOT_TRQ , 'k','LineWidth' , 3);grid;shg
xlabel('Time [s]')
ylabel('Torque [Nm]')
grid on
%%
figure
hold on
set(gca,'FontSize',25)
plot( TEMPO , INT_EST_DATA , '-.b' , 'LineWidth' , 5);grid;shg
plot( TEMPO , INT_DATA , ':r','LineWidth' , 5);grid;shg
xlabel('Time [s]')
ylabel('Velocity [rad/s]')
legend('Estimated Velocity' , 'Measured Velocity' )
grid on
figure
hold on
set(gca,'FontSize',25)
%plot( TEMPO , ((ACT_DATA - EST_DATA)./ACT_DATA)*100 , 'k','LineWidth' , 5);grid;shg
plot( TEMPO , (INT_DATA -INT_EST_DATA) , 'k','LineWidth' , 3);grid;shg
xlabel('Time [s]')
%ylabel('Error on \Delta \tau_{h} [%]')
ylabel('Error on \Delta \theta^{\cdot}_{m}')
grid on