Step Fit and Frequency Decomposition.
Whether simulation or on road testing, Matlab tools require only the simplest scripting to reduce your raw data to Engineering results. You should not be 'programming in Matlab the way you would in BASIC, FORTRAN, or PL/1. The Matlab functions are already written, debugged and waiting for you to select them.
For example:
Step steer processing. You can either paw through the data segments to get steady state averaged values and run backwards through the segment to determine the time for 90% or 67% or 50% of the steady state value to be reached. Whoopie.
Or, you can fit your channels (including steer BTW) to this function using one of several parameter ftting routines (like LSQCURVEFIT):
function f=cr_fit(x,time)
% step response function solutionn model.
% might want to consider using abs(x(4)) to keep the fit consistent.
% Matlab will try using + and - parameters.
f=x(1) + x(2).*exp(-x(3).*time).*cos(2*pi.*x(4).*time + pi/180*x(5));
This equation contains the Systems Engineering traits of your signals (the X values, silly), including the steady state, phase, and damping factors. After a series of runs in a linear or nonlinear mode, you will have run results suitable to process for gains (steering sensitivity, sideslip, roll, yawrate, cornering compliances) and the responcs times, damping, phase angle vs. Ay, or Steer, whatever you pick. It's that simple.
Frequency Response processing. With a simulation, just a single run is needed. I use a 40.96 second chirp at 100 Hz. sample rate with an initial and final zero steer angle to produce a marvelouse FFT array. On the road we use multiple identical steer attempts and use a process to average the real and imaginary components of the FFT so we get a 'Coherence' calculation. Coherence = consistency, confidence level, repeatability, whatever you want to call it. High coherence = high believeability. It's like an R^2 at each frequency point.
Same input channels now processed in pairs.
warning off
YAWACC = gradient(YAWVEL)./gradient(TIME); % Math channel
warning on
nfft = pow2(round(log2(length(STEER)))) ;
nseg=1
[sstxy,f] = tfe(STEER(:,nseg),LATACC(:,nseg),nfft,sps,hamming( nfft),nfft/2); % ayg by steer transfer function
[rolltxy,f] = tfe(LATACC(:,nseg),ROLL(:,nseg),nfft,sps,hamming(n fft),nfft/2); % roll by ay transfer function
[betatxy,f] = tfe(LATACC(:,nseg),SIDSLP(:,nseg),nfft,sps,hamming (nfft),nfft/2); % beta by ay transfer function
[yawvtxy,f] = tfe(STEER(:,nseg),YAWVEL(:,nseg),nfft,sps,hamming( nfft),nfft/2); % yawv by steer transfer function
[yawatxy,f] = tfe(STEER(:,nseg),YAWACC(:,nseg),nfft,sps,hamming( nfft),nfft/2); % yaw accel by steer transfer function
[rollyawvtxy,f] = tfe(YAWVEL(:,nseg),ROLL(:,nseg),nfft,sps,hamming(n fft),nfft/2); % roll by yawvel transfer function
[rollswatxy,f] = tfe(STEER(:,nseg),ROLL(:,nseg),nfft,sps,hamming(nf ft),nfft/2); % roll by steer transfer function
inx=find(f > 4 | f < .10); % The reality of Bandpass
f(inx)=[];
sstxy(inx)=[];
rolltxy(inx)=[];
betatxy(inx)=[];
yawvtxy(inx)=[];
yawatxy(inx)=[];
rollyawvtxy(inx)=[];
rollswatxy(inx)=[];
ss_gain = 100.*abs(sstxy); % convert to Bode form for gain
ss_phase = angle(sstxy).*180/pi;
yawv_gain = 100.*abs(yawvtxy);
yawv_phase = angle(yawvtxy).*180/pi;
yawa_gain = 100.*abs(yawatxy);
yawa_phase = angle(yawatxy).*180/pi;
roll_gain = abs(rolltxy);
roll_phase = angle(rolltxy).*180/pi;
beta_gain = abs(betatxy);
beta_phase = angle(betatxy).*180/pi;
rollswa_gain = 100*abs(rollswatxy);
rollswa_phase = angle(rollswatxy).*180/pi;
plot(f,ss_gain),%ylim([0 2])
grid
pause
plot(f,yawv_gain),%ylim([0 30])
grid
pause
plot(f,yawa_gain),%ylim([0 300])
grid
etc.
Yes, you need LSQCURVEFIT and TFE tools to do this job professionally. If you didn't know it already, you can buy a killer version of Matlab for home use if you promise you won't show up on Shark Tank to sell your analysis product. If you really need an extra Toolbox, its $50. Your iPhone bill per month is higher than that. Go search for "Hobby version of Matlab"
All the same parameter metrics mentioned in the step response processing are easily produced from your FR results. Now all you need to do is resolve the discrepancy between what you built and what you intended to build in Math or Material. Don't worry about the nonlinearities. The effects of them are actually very disappointing (like miniscule in the Big Picture of things). Keep your max Ay value below 0.4 and you will live to test another day.
C-Speed Test using your Android Phone
The heck with a VBOX, Use this app (or the free version) and use your phone to compute your FSAE cars understeer !
http://www.rotoview.com/sensor_kinetics_pro_android.htm
In Godd we trust, all others will need to brings some data.
Thanks to all for your interest. Let's see some results. Don't have to wait for better weather, do some indoor tests of steering compliance and overall steer ratio. The compliance results will guide you when it's correlation time. The ratio tests will tell you how good your as-built steering geometry is. Build a 'side-pull rig' to evaluate calculated vs. actual lateral load transfer distributions with the car stationary. Do this at several steer angles and see how it changes.
Then prep with a simple but elegant simulation of the on-track tests you intend to run. Take the sim data and post-process it to have a good idea what to expect from your test results: signs, order of magnitude, units, data volume, data editor/extractor, toolbox functions (Matlab kinda stuff), GUIs, summary data metrics, metrics database and graphs.
Then the testing will hit the ground running and you will be pleased with your preparations and be able to run a predetermined set of conditions valuable to your team: tire pressures, springs and bars, reinforcement braces, wheel rim effects, tire temps, static caster/camber settings, etc.
'Knowing' what to expect will allow you to prioritize test conditions. A high volume of outdoor testing will also tax your powertrain and result in valuable durability confidence levels.