Discrete Time Sample Block not giving the expected integrated results?

2 views (last 30 days)
Hi all,
My aim is to be able to visualise flight data in FlightGear. I am feeding into FlightGear via the FlightGear 6DOF preconfigured block a set of parameters (roll rate, pitch rate, yaw rate, horizontal velocity (u,v), vertical rate(w) ).
I am using discrete timing block to integrate my result into position coordinates and aircraft attitude. I realised that I was able to adjust the gains of the blocks to match the desired amplitude for aircraft yaw. However, I was unable to obtain explainable results when I do this for both pitch and roll rates. If anyone has insights to why there was an incomprehensible dip in the output for integrated roll attitude that would be great. I have tried using different solvers and rules to no avail.
Data Read in model:
Expected Yaw:
Simulink Output yaw (Note that each time step is 0.23 seconds, scope read is from the output of the subsystem block which relates to the aircraft attitude)
Expected Pitch:
Simulink Output Pitch:
Expected Roll:
Simulink Output Roll:
Simulated Input Pitch Rate, Roll Rate and Yaw Rate all matches my original flight data:
Pitch Rate Input:

Accepted Answer

Sebastian Kammer
Sebastian Kammer on 23 Nov 2016
There are many unknowns here that might be related to the issue you are encountering.
I am assuming that you are loading sampled pre-recorded data from the workspace. Is the workspace data a timeseries object or is it a matrix with time and data components?
One important parameter here is the sampling rate at which your data was recorded. At one point in your post you mention that each time step is 0.23 seconds. Is this the sampling period at which the data is recorded?
There are several things that you could try here:
1) Make sure that the sampling time of the Simulink model is either smaller than or equal to the sampling time of your data.
2) Try using a continuous-time integrator block. If the output still looks wrong to you, try decreasing the sampling time of the model.
3) If you are able to obtain a better response with the continuous integrator, but still need to use a discrete integrator, then decreasing the sampling time of the integrator block might be helpful.
If none of these approaches help with this issue, you might try to contact the MathWorks Technical Support group.
Ted Yang
Ted Yang on 24 Nov 2016
Edited: Ted Yang on 24 Nov 2016
One of my colleague a senior Matlab expert mentioned that the result of discrepancy is due to error/noise been integrated cumulatively to have caused the shift. It is said that the sampled results require further signal conditioning or filtering. Thanks to all that replied. It is said that the results of pitch rate or roll rate integrated would not give the accurate pitch or roll ever due to noise in the data.

Sign in to comment.

More Answers (0)


Find more on Simulink in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!