<< Chapter < Page Chapter >> Page >
This section details the creation of the rocket simulation used to test the Kalman filter implementation.

Introduction

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.

Simulation synthesis

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:

  • The total length of rocket flight is 15s
  • Acceleration of the rocket while in flight rises linearly from g = -9.81m/s 2 to a peak value 160 m/s 2 in the span of 0.05s
  • This peak value is maintained for 0.35s
  • Acceleration decreases linearly from 160 m/s 2 to g in 0.5s
  • An acceleration of g is maintained for the rest of the rocket flight

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] ).

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Digital detection of rocket apogee. OpenStax CNX. Dec 18, 2013 Download for free at http://cnx.org/content/col11599/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Digital detection of rocket apogee' conversation and receive update notifications?

Ask