Skip to content
Snippets Groups Projects
Commit bda897e7 authored by dawehr's avatar dawehr
Browse files

Updated simplePlots.m file

parent 15948563
No related branches found
No related tags found
No related merge requests found
......@@ -38,22 +38,22 @@ legend('Pitch Error', 'Pitch PID output');
linkaxes([ax1, ax2], 'x');
%%
ax2 = subplot(2,2,1);
plot(time, XSetpointConstant - VRPNXConstant);
plot(expData.Time.data, expData.X_Setpoint_Constant.data - expData.VRPN_X_Constant.data);
title('X error');
ax1 = subplot(2,2,2);
plot(time, XposPIDCorrection);
plot(expData.Time.data, expData.X_pos_PID_Correction.data);
title('x output');
ax3 = subplot(2,2,3);
plot(time, PitchPIDCorrection); hold on;
plot(time, VRPNPitchConstant .* 10);
plot(expData.Time.data, expData.Pitch_PID_Correction.data); hold on;
plot(expData.Time.data, expData.VRPN_Pitch_Constant.data .* 10);
title('pitch output');
legend('output', 'Pitch');
ax4 = subplot(2,2,4);
plot(time, PitchRatePIDCorrection); hold on;
plot(time, gyro_y .* 1044.26);
plot(expData.Time.data, expData.Pitch_Rate_PID_Correction.data); hold on;
plot(expData.Time.data, expData.gyro_y.data .* 1044.26);
legend('output', 'Pitch rate');
title('pitch rate output');
......@@ -67,4 +67,43 @@ plot(time, YawConstant);
ax1 = subplot(2, 1, 2);
plot(time, gyro_z); hold on;
plot(time, YawRatePIDCorrection);
linkaxes([ax1, ax2], 'x');
\ No newline at end of file
linkaxes([ax1, ax2], 'x');
%%
all_motors = expData.Signal_Mixer_PWM_0.data + expData.Signal_Mixer_PWM_1.data + ...
expData.Signal_Mixer_PWM_2.data + expData.Signal_Mixer_PWM_3.data;
ax1 = subplot(1, 2, 1);
plot(expData.Time.data, all_motors ./ 4); hold on;
plot(expData.Time.data, expData.RC_Throttle_Constant.data); hold on;
plot(expData.Time.data, expData.Pitch_Rate_PID_Correction.data); hold on;
plot(expData.Time.data, expData.Roll_Rate_PID_Correction.data); hold on;
plot(expData.Time.data, expData.Yaw_Rate_PID_Correction.data);
legend('average motors', 'throttle', 'pitch', 'roll', 'yaw');
ax2 = subplot(1, 2, 2);
plot(expData.Time.data, -expData.VRPN_Alt_Constant.data);
legend('Z, meters');
linkaxes([ax1, ax2], 'x');
%%
ax1 = subplot(1, 2, 1);
plot(expData.Time.data, expData.Pitch_Constant.data .* (180 / pi)); hold on; grid minor
plot(expData.Time.data, expData.VRPN_Pitch_Constant.data .* (180 / pi));
legend('imu', 'vrpn');
ax2 = subplot(1, 2, 2);
plot(expData.Time.data, expData.Roll_Constant.data .* (180 / pi)); hold on; grid minor
plot(expData.Time.data, expData.VRPN_Roll_Constant.data .* (180 / pi));
legend('imu', 'vrpn');
linkaxes([ax1, ax2], 'x');
%%
vrpn_roll_d = diff(expData.VRPN_Roll_Constant.data) / 0.005;
plot(expData.Time.data, [0; vrpn_roll_d] .* (180 / pi)); hold on; grid minor;
plot(expData.Time.data, expData.gyro_x.data .* (180 / pi));
%%
ax1 = subplot(3, 1, 1);
plot(expData.Time.data, expData.gyro_x.data);
ax2 = subplot(3, 1, 2);
plot(expData.Time.data, expData.gyro_y.data);
ax3 = subplot(3, 1, 3);
plot(expData.Time.data, expData.gyro_z.data);
linkaxes([ax1, ax2, ax3], 'x');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment