2019-12-26 09:09:57 +00:00
|
|
|
% ---------------------------------------------------------------------
|
|
|
|
|
% In this script we plot data processing of real data from UR
|
|
|
|
|
% ---------------------------------------------------------------------
|
|
|
|
|
trajectory = unloadedTrajectory; % choose trajectory
|
|
|
|
|
|
|
|
|
|
%% Positions
|
|
|
|
|
% Ploting ideal posititions and obtained ones
|
2019-12-18 11:25:45 +00:00
|
|
|
% %{
|
|
|
|
|
figure
|
|
|
|
|
subplot(2,1,1)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 1:3
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t, trajectory.q(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
2019-12-26 09:09:57 +00:00
|
|
|
legend('$q_1$','$q_2$','$q_3$','interpreter','latex')
|
2019-12-18 11:25:45 +00:00
|
|
|
grid on
|
|
|
|
|
subplot(2,1,2)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 4:6
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t, trajectory.q(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
2019-12-26 09:09:57 +00:00
|
|
|
legend('$q_4$','$q_5$','$q_6$','interpreter','latex')
|
2019-12-18 11:25:45 +00:00
|
|
|
grid on
|
|
|
|
|
%}
|
2019-12-26 09:09:57 +00:00
|
|
|
|
|
|
|
|
%% Velocities
|
|
|
|
|
% %{
|
2019-12-18 11:25:45 +00:00
|
|
|
figure
|
|
|
|
|
subplot(2,1,1)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 1:3
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t, trajectory.qd(:,i))
|
|
|
|
|
plot(trajectory.t, trajectory.qd_fltrd(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
2019-12-26 09:09:57 +00:00
|
|
|
legend('$\dot{q}_1$','$\dot{q}_2$','$\dot{q}_3$',...
|
2019-12-18 11:25:45 +00:00
|
|
|
'interpreter','latex')
|
|
|
|
|
grid on
|
|
|
|
|
subplot(2,1,2)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 4:6
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t, trajectory.qd(:,i))
|
|
|
|
|
plot(trajectory.t, trajectory.qd_fltrd(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
2019-12-26 09:09:57 +00:00
|
|
|
legend('$\dot{q}_4$','$\dot{q}_5$','$\dot{q}_6$',...
|
2019-12-18 11:25:45 +00:00
|
|
|
'interpreter','latex')
|
|
|
|
|
grid on
|
|
|
|
|
%}
|
|
|
|
|
|
2019-12-26 09:09:57 +00:00
|
|
|
%% Accelerations
|
|
|
|
|
% %{
|
2019-12-18 11:25:45 +00:00
|
|
|
figure
|
|
|
|
|
subplot(2,1,1)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 1:3
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t, trajectory.q2d_est(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
|
|
|
|
ylabel('$\ddot{q}$,\ rad','interpreter','latex')
|
2019-12-26 09:09:57 +00:00
|
|
|
legend('$\ddot{q}_1$','$\ddot{q}_2$','$\ddot{q}_3$',...
|
|
|
|
|
'interpreter','latex')
|
2019-12-18 11:25:45 +00:00
|
|
|
ylim([-2.5, 2.5])
|
|
|
|
|
grid on
|
|
|
|
|
subplot(2,1,2)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 4:6
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t, trajectory.q2d_est(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
|
|
|
|
ylabel('$\ddot{q}$,\ rad','interpreter','latex')
|
2019-12-26 09:09:57 +00:00
|
|
|
legend('$\ddot{q}_4$','$\ddot{q}_5$','$\ddot{q}_6$',...
|
|
|
|
|
'interpreter','latex')
|
2019-12-18 11:25:45 +00:00
|
|
|
ylim([-2.5, 2.5])
|
|
|
|
|
grid on
|
|
|
|
|
%}
|
|
|
|
|
|
2019-12-26 09:09:57 +00:00
|
|
|
%% measured currents vs desired currents
|
|
|
|
|
% %{
|
2019-12-18 11:25:45 +00:00
|
|
|
for i = 1:6
|
|
|
|
|
figure
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t,trajectory.i(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
hold on
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t,trajectory.i_des(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
grid on
|
|
|
|
|
legend('msrd','dsrd','interpreter','latex')
|
|
|
|
|
end
|
|
|
|
|
%}
|
|
|
|
|
|
2019-12-26 09:09:57 +00:00
|
|
|
%% currents vs Filteres currents
|
|
|
|
|
% %{
|
2019-12-18 11:25:45 +00:00
|
|
|
figure
|
|
|
|
|
subplot(2,1,1)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 1:3
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t,trajectory.i(:,i))
|
|
|
|
|
plot(trajectory.t,trajectory.i_fltrd(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
|
|
|
|
legend('$i_1$, A','$i_2$, A','$i_3$, A','interpreter','latex')
|
|
|
|
|
grid on
|
|
|
|
|
subplot(2,1,2)
|
|
|
|
|
hold on
|
|
|
|
|
for i = 4:6
|
2019-12-26 09:09:57 +00:00
|
|
|
plot(trajectory.t,trajectory.i(:,i))
|
|
|
|
|
plot(trajectory.t,trajectory.i_fltrd(:,i))
|
2019-12-18 11:25:45 +00:00
|
|
|
end
|
|
|
|
|
xlabel('$t$,\ sec','interpreter','latex')
|
|
|
|
|
legend('$i_4$, A','$i_5$, A','$i_6$, A','interpreter','latex')
|
|
|
|
|
grid on
|
|
|
|
|
|
|
|
|
|
%}
|