<< Chapter < Page | Chapter >> Page > |
In order to ensure that the apogee detecting filter works, we needed to test the filter with flight data. While we were able to get altimeter and barometer data from one rocket launch, we quickly realized the infeasibility of launching a model rocket multiple times in order to gather data. Our solution to this problem was to use the measured data from the one rocket launch to create an accurate simulation in MATLAB that would save both time and money.
Because we knew the specifications of the rocket engine and the A/D quantization error of our sensors, we were able to easily create a simulation of rocket flight in MATLAB. The default measured values from the rocket data are as follows:
Although the default parameters are listed above, the code below shows that parameters such as peak acceleration and length of rocket flight can be set externally. We used a parameterized model so that flights could be varied based on dynamics affecting flight, to avoid accidentally fitting overfitting our filter to the data.
------------------------------------------------------------------------------------------------------------------------------------------------------------
function rocket_sim(t_length,t_accmax,hold_a_max,t_g,a_peak)
close all; % Close existing figuresdt = 10^-3; % Time steps of 1ms
% Default parameters that match conditions of measured rocket datat_length = 15;
t_accmax = 0.05;hold_a_max = 0.35;
t_g = 0.5;a_peak = 160;
t = linspace(0,t_length,t_length*(1/dt)); % Create Time vectorg = -9.81; % Acceleration due to gravity
Acc_t = zeros(1,length(t)); % Initialize Acceleration vectorAcc_t(1:round(t_accmax*(dt^-1))) = ... % Linear rise to peak acceleration
linspace(g,a_peak,round(t_accmax*(dt^-1)));Acc_t(round(t_accmax*(dt^-1))+1:round(hold_a_max*(dt^-1))) = a_peak;
% Hold peak acceleration for set amount of timeAcc_t(round(hold_a_max*(dt^-1))+1:round(t_g*(dt^-1)))=...
linspace(a_peak,g,round((t_g-hold_a_max)*(dt^-1))); % Linear decay to gAcc_t(round(t_g*(dt^-1))+1:end) = g; % Hold acceleration of g for remainder
% of flightfigure;
plot(t,Acc_t) % Show plot of simulated accelerationtitle('Simulated Acceleration of Rocket')
------------------------------------------------------------------------------------------------------------------------------------------------------------
Once an acceleration vector is created, a state transition matrix is created in order to derive velocity and position states and graphs are created. Using the position graph, we can determine the true time of apogee and use this time as a baseline for the effectiveness of various filters (see [link] , [link] , [link] ).
Notification Switch
Would you like to follow the 'Digital detection of rocket apogee' conversation and receive update notifications?