Code with C | Programming: Projects & Source Codes › Forums › MATLAB › Best practice to get real time data smoothing and prediction
September 25, 2015 at 8:28 pm #7891
Best practice to get real time data smoothing and prediction. i have no control over the d=movement of the object, it is a piece of scenery on stage and it moves when the automation is programmed to move, i have no control over that. I get it’s position data 60 times a second, which would in theory mean that i get the data every 16ms, however sometimes i there may be 20ms between data samples and sometimes there may be 12ms between samples but it averages out to one every 16ms, and each data sample has a time stamp so i know exactkly when the reading was taken.
Effectively what i need to do is , after the first few samples – based on a theoretical curve drawn between those points, be able to forcast the curve to be able top project values that should happen in approx 100ms from now. Of course the curve will change as the object accelerates / deaccelerates so it needs to adjust itself.
I know that this is possible because there are similar systems on the market that can do it but i just don’t know the maths (The programming side i can do).
September 25, 2015 at 8:28 pm #7892
1st – Smoothing results
From what I understood you actually have to act upon the data you just received, not on historical data. So I don’t see how smoothing results will help you here.
If sometimes it takes 100ms and other times it takes 100ms between received messages, you might need to improve the frequency of data.
Let me put it this way, if what you actually had was data received every 10ms and wanted to process it in 100ms chunks then you could smooth it, with lack of data, there’s nothing to smooth.
2nd – The response time
I think the root cause is always the same. Your communication channel is not fast enough for JIT data receive/process/reply.
One “easy” solution could be slowing down the object so that it matches the communication channel capabilities.
Another solution can be to make the object wait for a reply before proceeding to the next move.
Yet another one would be to make the object work with late data instead of live, which means that it would be ok for the object to use data that is 200ms old, and take this in account for whatever that data is used at the object side.
All these and other possible solutions heavily depend on what you’re doing but in your case, unless I’m missing some key bit of information, I thing smoothing data is not the solution.
September 25, 2015 at 8:29 pm #7894
his sounds like a rather classical Kalman filter application. The objective is to aim at the target based on noisy sensor data. The time delays mean there’s a prediction involved.
For example, Google for: “A Simplified Approach to Understanding the Kalman Filter”
You must be logged in to reply to this topic.