Monday, September 26, 2016

Truths and lies of your basic racing data logger.




Your most basic racing data logger has 2 main components: GPS unit and accelerometer. It is helpful to understand what each does, what are the limitations of their signals, and how accurate are the measurements which are derived from their signals.


To simplify things somewhat, GPS unit records current time (as received from the satellites above you), as well as your location in reference to some satellites above you, while accelerometer records forces acting on your car in 1, 2 or 3 dimensions.

Most useful pieces of information that GPS unit will record, will be your position on the track, as well as your speed along the track's direction, calculated from 2 or more of your positions and associated times (first order derivative). If your data analysis software has some level of sophistication, it could also calculate your accelerations as derivatives of such speeds (second order derivative). We'll refer to such measurements as "GPS Acceleration".

Accelerometer will record "Proper Acceleration" - yes - that's the actual term for that, specifically "instantaneous" effects of forces acting on the car, along up to 3 axis. Of these, most interesting are Longitudinal acceleration (acceleration along rear-to-front axis of your car) and Lateral acceleration (acceleration along left-to-right axis of your car). Longitudinal acceleration is a measure of how hard you brake and, well, accelerate, while Longitudinal acceleration reflects how hard you are cornering. This is somewhat of simplification, but it'll do. For now.

If I already lost you at this point, sorry. Didn't I say this will be tedious and boring?

GPS uses antenna and mini-microprocessor. Cool! Accelerometers use variety of technologies, most basic being a weight suspended on some springs. Leonardo Da Vinci would had been proud. Modern ones use piezoceramics and quantum tunneling. Now we're talking.

Here's an example:
Red line is speed recorded by a wheel sensor. Purple line is speed recorded by GPS microchip. Notice that GPS speed is not always accurate. Sometimes it "lags" sudden changes in "Actual" speed, sometimes it has weird fluctuations. If your software shows GPS Speed as perfectly smooth, with no artefacts like that, your software is lying to you! This is particularly a problem for "certain" software developed for karting, then finding its way into road racing by means of clever, and somewhat shameless, marketing.

But why? - you may ask. Why can't I have perfectly smooth, always accurate GPS Speed? Well, GPS signal does not work that way. It is, at best, an approximation of reality when it comes to speed, and speed senor measuring revolutions of your speed or your driveshaft will almost always have higher precision, especially during acceleration/deceleration.

What? Well, remember that what GPS is really good at - what it is designed to do, in fact, is determining your time and position. That's how you get a bomb to land in a back of a Toyota pickup.
Speed is a "first order derivative". Without going into too much math, it's basically a calculation with an order of accuracy sacrificed, to get more data. Basically, it would be like watching someone eat 3 pounds of ice cream, then "deriving" a conclusion that this person will be 3 pounds heavier for the next 2 hours. You may be a little off. It may end up being 2.7lbs for the next 2.8 hours. But you "derived" more information about the situation. This is not  the greatest analogy, I must admit.
Anyway. (nearly) Every time you take a real world derivative, you sacrifice some precision.

So, if you take a derivative from speed, you get acceleration (Physics and Math magic, just trust me on this). That is the green trace above. Notice, that while it generally follows yellow trace (direct measurement of proper acceleration, from accelerometer), it is sort of all over the place. That's normal and expected. It can be smoothed and filtered, of course - but then it may not be as accurate at any given point. Tough choice.

Here's how you spot when your software is "massaging" the data behind the scenes, to make those 1st and 2nd order derivatives look smooth and neat (which can easily mislead, or, at least, misinform your data analysis):


Ah, those wonderful, smooth curves, sweeping peaks and valleys. Lies, all lies. Pink line is GPS Speed (first order derivative). Can it be more precise than speed measured by the wheel rotation (light blue line)? Nope. Not possible. Even if it was measured by a military grade GPS chip, and not $400 pocket lap timer, it would still not be as precise measuring speed, as wheel speed signal. So, Pinocchio is pulling the fast one on you.

Now, check out green trace. This is a second order derivative, "GPS Acceleration" (Lateral, in this case). Compare it to the brown Lateral trace from actual accelerometer (which, by the way, is also smoothed and "fixed" by the software - thanks, I guess). Is it possible that 2nd order derivative is more accurate than direct, "proper" measurement? Nope. Can you eyeball how much ice cream your friend ate, and then tell precisely how much heavier he (or she!) is? Nah-ah. So, how can it be so smooth and neat? Only as a result of doctoring, approximating, and smoothing the values to the point where they are so off from the actual measurement, they become close to meaningless. Shame on you, Pinocchio. Back to your go-kart, stay away from my race car!

OK. But is this all important? Well, that depends. When you use your racing data, do you want to be sort of in the ballpark, or dead on?

Is it important that your data traces make for nice, good looking curves, with simple messages about your (or your competitors) driving, or do you want to have access to all the complexities and nuances of hardware signal resolutions, sampling rates, GPS drift and signal strength?

Priorities will, of course, vary, but at the very least, the choices should be informed.

Coming up next time - how to fix mis-oriented (disoriented?!) accelerometer signal in your data.

Preview:




No comments:

Post a Comment