Speed Drop and Spike in Video Overlay

Help on issues you run into with LapTimer; in case you have a question on how to use LapTimer, use the forum "Using LapTimer" instead
User avatar
Harry
Site Admin
Site Admin
Posts: 10642
Joined: Sun Sep 12, 2010 10:32 am
Location: Siegum, Germany
Contact:

Re: Speed Drop and Spike in Video Overlay

Post by Harry »

Speed calculated from positions is extremely affected by inaccuracies in GPS positions. The higher the GPS update rate, the worse it gets. For a 10 Hz device, I found it extremely difficult to calculate speed from positions at all - sophisticated smoothing is required.

- Harry
Image Image Image Image
rmeroda
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 73
Joined: Mon Feb 04, 2013 3:48 am

Re: Speed Drop and Spike in Video Overlay

Post by rmeroda »

Yeah, normally I export all the laps after a track day. For some reason I played around with my fastest lap of the day before I exported everything :/

I don't have the gps at work but I remember checking over the weekend after reading some of the other threads to make sure the firmware was up to date. I think it was at least 1.3.x. Maybe 1.3.5? The SkyPro app said the firmware was "up to date".

Harry, are you saying inherent gps inaccuracies make it difficult to calculate speed from position? Or that my gps happens to be more inaccurate which makes it even more difficult?
User avatar
Harry
Site Admin
Site Admin
Posts: 10642
Joined: Sun Sep 12, 2010 10:32 am
Location: Siegum, Germany
Contact:

Re: Speed Drop and Spike in Video Overlay

Post by Harry »

There are two options to derive speed from GPS: 1) calculate speed from distance and time between two consecutive fixes (i.e. 0.1 seconds for the SkyPro) and 2) calculation using the Doppler effect (http://en.wikipedia.org/wiki/Doppler_effect).

Modern GPS chip sets deliver speed using Doppler measurements and it seems to be the better approach. The speed values calculated are added to GPS fix positions and transferred to apps using that data (like LapTimer). For the internal (1 Hz) GPS sensor, LapTimer comes with an expert setting to use calculated instead of measured values. If I remember correct, I added this feature to work around some issues or for testing.

While deriving speed from positions is fine when applied for longer time ranges (1 second or beyond), it is getting pretty noisy once the distance between two consecutive fixes is becoming short: e.g. at 100km/h, you drive a distance of approximately 27 meters each second. Now think of "position noise" of e.g. 2.7 meters - you get a speed calculated with an error of 10%. Shortening the distance to a 5th of a second (5 Hz chip) with the same accuracy, you get an error of 50%. This is just a sample to show the magnitude of the error introduced when not using Doppler. The only work around is to smooth speed values calculated or apply the speed distance calculation for a longer time range. Ranges you need to apply are pretty long - which in turn means you will lose any peak speed.

Using the change in frequency due to movements (Doppler) seems to do a lot better job here. Nevertheless, speed measurements for changing speeds seems to be a challenge just like achieving very high GPS accuracies is.

- Harry
Image Image Image Image
rmeroda
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 73
Joined: Mon Feb 04, 2013 3:48 am

Re: Speed Drop and Spike in Video Overlay

Post by rmeroda »

Thank you, that was very clear. I'm guessing the 5hz error would actually be something like 1 - (.9)^5 = 41% (?). But I understand your main point that a higher hz compounds the problem.

The odd thing that I'm trying to come to terms with is that I originally experienced the speed drops and sudden correction increase using the internal 1hz gps. I tried to solve that by getting the SkyPro 10hz which does the same thing. But a friends SkyPro 5hz doesn't seem to have that problem.

I guess it comes back to contacting Dual and asking them what the difference is or getting an OBDII track car so I can just use wheel speed :)

I just realized my friends car is OBDII (e46 M3) but I'm not sure if he has a dongle. I'll have to ask if he has a dongle but isn't overlaying the OBDII data in his videos. Doesn't HLT preferentially use the wheel speed over gps speed. If so, maybe that's making it look like the SkyPro 5hz is giving smoother speed values.
User avatar
Harry
Site Admin
Site Admin
Posts: 10642
Joined: Sun Sep 12, 2010 10:32 am
Location: Siegum, Germany
Contact:

Re: Speed Drop and Spike in Video Overlay

Post by Harry »

Yes, in video overlays, wheel speed it used if available.

- Harry
Image Image Image Image
gplracerx
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 836
Joined: Thu May 03, 2012 5:26 am
Location: Kingsport, TN USA

Re: Speed Drop and Spike in Video Overlay

Post by gplracerx »

Here's a plot of speed vs time. The GPS trace is the speed reported by the XGPS160. The other two traces were calculated from distance vs time data as calculated by HLT and by me from the latitude and longitude vs time series.

Image

I can't see anything in the data flags that would explain this. If there were a problem with location of the XGPS160, I would expect to see things like a reduction in the number of satellites or something. It's possible your firmware is corrupted somehow. Unfortunately, I don't think there's an option to reinstall if you have the latest version. I would file a problem report with Dual.

By the way, you wildly over smoothed the lateral acceleration data when you recalculated. The red points were calculated from speed and calculated yaw rate and then smoothed some, possibly not quite enough, but a lot closer to reality. The last time I checked, the yaw rate plot in HLT is also over smoothed. That also means that anywhere the speed was wrong, the lateral acceleration is wrong.

Image

Also, lineal g was in the lateral g column and vice versa in the .csv file.
gplracerx
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 836
Joined: Thu May 03, 2012 5:26 am
Location: Kingsport, TN USA

Re: Speed Drop and Spike in Video Overlay

Post by gplracerx »

The odd thing that I'm trying to come to terms with is that I originally experienced the speed drops and sudden correction increase using the internal 1hz gps. I tried to solve that by getting the SkyPro 10hz which does the same thing. But a friends SkyPro 5hz doesn't seem to have that problem.
It doesn't have a problem with your phone or his phone? I used to turn location services off when collecting data because it seemed that iOS was 'adjusting' the data even though that wasn't supposed to be possible. That hasn't been a problem lately, but then I'm still running version 7.1.2.
gplracerx
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 836
Joined: Thu May 03, 2012 5:26 am
Location: Kingsport, TN USA

Re: Speed Drop and Spike in Video Overlay

Post by gplracerx »

While deriving speed from positions is fine when applied for longer time ranges (1 second or beyond), it is getting pretty noisy once the distance between two consecutive fixes is becoming short: e.g. at 100km/h, you drive a distance of approximately 27 meters each second. Now think of "position noise" of e.g. 2.7 meters - you get a speed calculated with an error of 10%. Shortening the distance to a 5th of a second (5 Hz chip) with the same accuracy, you get an error of 50%. This is just a sample to show the magnitude of the error introduced when not using Doppler. The only work around is to smooth speed values calculated or apply the speed distance calculation for a longer time range. Ranges you need to apply are pretty long - which in turn means you will lose any peak speed.
You're being overly pessimistic. The absolute position error may be ~2m, but that doesn't mean that the standard deviation between two readings 0.1 seconds apart is anywhere near as high as 2m. The speed plot above was calculated with a simple exponentially weighted moving average with an alpha of 0.3 (or 0.7 depending on how you define alpha). That corresponds to an RC filter with a time constant of ~0.2 seconds or 5Hz. In my experience, the higher the update rate, the less noisy is the calculated speed. I.e. the VBOX Sport at 20Hz is better than the XGPS160, which is better than the Emprum Ultimate at 5Hz. All are vastly better than the internal iPhone GPS at 1 Hz.

For the VBOX Sport, for example, the standard deviation of the difference between consecutive readings is less than 0.03m NS and EW with 8 satellites locked. That's logged on the device itself so iOS is not a factor. That would be ~20% at 100kph, but a 5 or 10Hz low pass filter will get rid of most of that noise while having minimal effect on the signal.
gplracerx
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 836
Joined: Thu May 03, 2012 5:26 am
Location: Kingsport, TN USA

Re: Speed Drop and Spike in Video Overlay

Post by gplracerx »

The other problem with low GPS update rate is that distance calculation becomes less accurate. The assumption that the vehicle is traveling in a straight line between two fix points is less and less accurate as the time between fixes increases. Distance traveled will always be underestimated.

I do agree that GPS Doppler speed is better than calculating from point to point, when it works. That's one of my major problems with Circuit Tools. It doesn't use the Doppler speed data.
rmeroda
20 or more Posts ★★★
20 or more Posts ★★★
Posts: 73
Joined: Mon Feb 04, 2013 3:48 am

Re: Speed Drop and Spike in Video Overlay

Post by rmeroda »

gplracerx wrote:By the way, you wildly over smoothed the lateral acceleration data when you recalculated. The red points were calculated from speed and calculated yaw rate and then smoothed some, possibly not quite enough, but a lot closer to reality. The last time I checked, the yaw rate plot in HLT is also over smoothed. That also means that anywhere the speed was wrong, the lateral acceleration is wrong.
Applying a light filter in the recalculate function of HLT didn't seem to provide any meaningful data. Here's a pic of what I mean

Image

So I ended up applying a strong filter so the g-indicator wouldn't bounce around sporadically on the video overlay. I think it's primarily a result me not knowing how to fully utilize the functionality of HLT. I would be interested to learn how you recalculated the acceleration data so I could correct my mistake if/when it happens again. My understanding is that the next time I don't calibrate my phone properly I should adjust the g-g plot (as you previously described) prior to overlaying the video and recalculating the acceleration shouldn't be necessary.
gplracerx wrote:It doesn't have a problem with your phone or his phone? I used to turn location services off when collecting data because it seemed that iOS was 'adjusting' the data even though that wasn't supposed to be possible. That hasn't been a problem lately, but then I'm still running version 7.1.2.
I'm not sure how I would tell if it was a problem with the phone. I do have a iPhone4s I haven't tried yet, but both the 4s and 5 are running iOS8. Since I got the Skypro, I was actually running the phone in airplane mode with only bluetooth turned on.

Turns out the friend with the SkyPro 150 is only using his phone and SkyPro, no OBDII dongle. Hopefully, the issue I'm having could be resolved with a firmware update.

Thanks for your help in looking at the data. Would you mind sharing your spreadsheet with the speed calculations, maybe I could send that to dual to exemplify the problem I'm having. Do you have any experience or suggestions about contacting Dual to report a problem? From what I read, they don't seem to respond to emails.
Last edited by rmeroda on Thu Jan 08, 2015 7:25 pm, edited 1 time in total.
Post Reply