Update: I have now created a spreadsheet that you can download and helps run the analysis a lot quicker: GPS Speed Run Analyzer

### Contents

_

### GPS Accuracy

In case you haven’t read about it, you can read about the accuracy of GPS velocity readings here. Not only is GPS accurate, it provides an extremely accurate and easy way to measure velocity. It also avoids one of the largest problems of measuring velocity: obtaining the velocity of the object’s actual trajectory, but this is a topic for another day. However, a simple example would be a light gate. If the quadcopter was not moving perfectly parallel between the light gates, the recorded speed will show up slower (it will always show slower) than its actual speed.

Side Note: I have not researched it yet, but depending on the type of light gate the DRL Racer X was using, it could have been going even faster than the recorded speed! But like I said, there might be ways to measure the angle of movement that I am not aware of.

_

### Keep It Honest

Make it public

Another great thing about having GPS data is that the log file can be made publicly available. This keeps the results as honest as possible and open to review.

Interpretation

In an attempt to keep the speed results as honest as possible, I have decided to interpret data in a widely accepted standard for reporting top speed: the average velocity going in opposite directions where the velocity (for each direction) is an average over a distance of at least 100 meters. This accomplishes a few things

- It removes the effects of wind
- It shows the speed is repeatable
- It shows the speed is sustainable

Additionally, GPS can be used to rule out effects of gravity (or potential energy) since you can also calculate the angle of movement. There is probably a definition of ‘level flight’ out there that includes an acceptable amount of tolerance on the trajectory angle relative to the horizon. Another thing to research…

Lastly, having a log of GPS velocity recordings makes it easy to identify a false reading which happens, but rarely (no method is perfect!).

_

### Let’s Begin

Although there are several ways to record GPS data, the data analysis is generally the same.

I’ll be going through an example of one of the speed runs that was done on the VXR-190. As a matter of fact, it is this log right here.

NOTE: There is a long flat line in this log where satellite lock was lost. However, just as I was about to land, the receiver locked back in and I was able to complete the flight.

The logging was done using the ublox m8n in combination with Betaflight and a Betaflight F3 flight controller which has an SD card slot. The data is recorded in a .bfl log file on the SD card.

Decoding

In order to make the data useful, the .bfl has to be decoded. The decoder can be found here.

- Unzip the zip file into a folder
- Place the .bfl file in the same folder
- Drag the .bfl file onto the blackbox_decode.exe file

_

### The Files

There are 3 files that the decoder generates. There are 2 .csv files and one gpx file.

- One is a .csv file which logs all flight controller data at whatever rate (up to the looptime rate) you choose.
- The 2nd .csv file is a log of all the gps data. This isn’t nearly as large as the flight controller data since (at least in this case) the gps data is recorded at a rate of 5hz.
- The third file is a gpx file. This file can be loaded into google earth and shoes the path that the gps recorded. NOTE: the gpx file will show speed. However, it is calculated with position points, not doppler so it is extremely noisy.

5hz!? That’s a joke!

The sampling rate of the gps unit has absolutely nothing to do with accuracy. The only thing sampling rate will do is give you more resolution. The article on GPS accuracy can be found here.

The numbers

Of course, we are intersted in the gps .csv file. When you open the file, you will see a number of columns with the following headers:

- Time (us): in microseconds (one millionth of a second)
- GPS_numSat: the number of satellites the receiver is tracking
- GPS_coord[0]: Latitude
- GPS_coord[1]: Longitude
- GPS_altitude: Altitude in meters above sea level
- GPS_speed (m/s): velocity in meters per second
- GPS_ground_course: the compass heading of the GPS receiver

At first glance, you might think that it’s as simple as finding the highest number under the speed column. There are 2 things wrong with doing this:

- Gps can give a false reading (no measurement system is perfect)
- Simply finding the max speed only gives us our ground speed, not our true speed.

_

### Start Crunching

In order to reach our goal of finding our average speed in opposite directions over a 100 meter distance, we have to do the following steps:

- Change the ‘above sea level’ altitude to ‘above ground’ altitude
- Find the time between each data point
- Find the distance traveled between each data point
- Find the distance traveled up to each data point
- Graph the speed AND altitude vs distance traveled
- Identify peak speed passes on the graph
- Identify the direction of each pass
- Find consecutive data points in each pass that add up to at least a distance of 100m
- Find which of the above data points is the fastest for each pass
- Find the trajectory angle of each pass
- Identify the 2 fastest passes that are in opposite directions and average them

Steps 1-4

For the manipulation of data, I added in the following columns:

- Time between points in seconds
- Ground altitude
- Distance between points
- Total distance

For the first empty cell for the time between points, total distance, and distance between points, I start with 0.

In the next empty cell of each column, I added the following formulas. I then copied and pasted them down the whole column:

- Time between points in seconds: =(A3-A2)/1000000
- Ground altitude: : =F2-$F$2
- Distance between points: =B3*I3
- Total distance: =H2+J3

Now is a good time to save the file in an excel file format.

To make things easier, highlight the first row, go to the view tab and select freeze panes:

Step 5: The Graph

- Highlight all the numbers under the total distance and GPS speed and insert an X Y scatter plot (with connecting lines).
- Right click and select add data
- Click on the Add button
- For series name, type in altitude
- For ‘series X values’, click the icon and select all the total distance numbers
- Click on the icon again
- Delete the value in the ‘Y series values’
- Click the icon and select all the ground altitude numbers
- Click on the icon again and hit OK
- Before exiting, highlight ‘series 1’ and click Edit
- Type in Velocity for the series name

You should have a graph like this:

The blue is velocity and the orange is altitude

_

### The Roller Coaster

Step 6: Oh my – look at those climbs and dives! This is very deceptive since the scale between our axes are way off. There is PROBABLY an easier way to scale the graph, but this is how I did it:

- Right click the graphs x-axis
- Select format axis
- set both the major and minor units to 10

Right now, the x-axis looks like a mess:

Now stretch out the graph to the right – keep going until 10 units on the y-axis looks like it’s roughly the same size as 10 on the y-axis (it has to be stretched way out)

Now it looks a lot better (not much will fit in the pic, but you get the idea)

Now find the rough location of the velocity peaks. Hover the mouse over the peak and write down the value point. In this example, its 416.3814628. Just note down the 416. This is the distance flown and will make it easier to find among all the data. My data points were 416, 2348, and 2724.

Step 7: Identify the direction

With the points written down, scroll up and find the first one under the total distance column. Now look over at the speed column. To make things easier to find later, put a box around the data. Start the box approximately where the speed run begins and stop where the speed pass stops. Below is the data around the 2724 point:

Take note of the GPS ground course for this point and do this for all the other speed passes.

- opposite direction speed passes will either be roughly +180 or -180 from each other

Step 8: Find the consecutive points that add up to 100m in each pass

This is a pain, but luckily I was able to make a formula to make this a little bit easier:

- In the cell that is kitty corner to the upper right box you made around each speed pass, type in the number 10:

- In the cell below the number 10, type in the formula: =IF(SUM(OFFSET(J400,-$L$399+1,0):J400)>100,SUM(OFFSET(J400,-$L$399+1,0):J400),””)
- Copy this formula and paste it in all the empty cells up to the bottom edge of the box.

- In the cell to the right and down one from the 10, type in the formula: =IF(ISNUMBER(L400),L400/((A400-(OFFSET(A400,-$L$399,0)))/1000000),””)
- Copy this formula and paste it in all the empty cells up to the bottom edge of the box.

- Below the last cell in column M (for this set of data), enter in: =MAX(M400:M435)
- The data should look like this:

When copying and pasting these formulas to other parts of the spreadsheet, the $L$399 cell reference will have to be changed to the appropriate cell number. The other cell references SHOULD be ok.

This Means… Something

So what are we seeing here?

- Column L: This cell will calculate the distance covered over the last X amount of data points ONLY if it is greater than 100 (hence the blank cells).
- The number X is the number in cell L399 (10 in this example)
- In the example shown, the first cell in the L column that has a number in it (L417), cells J408 through J417 are being added up.

- Column M: This cell will calculate the velocity IF the adjacent cell in colums L has a number in it.
- The velocity is calculated by taking the the distance covered (in column L) and dividing it by the total time it took to cover that distance.

- Cell M436 is identifying the max speed (in meters/sec) for the number of cells given in cell L399

Step 9: Finding the fastest 100m in the pass

Now things will make sense:

- In the L399 cell, type in 4. Everything in the cells below will go blank
- I purposely start with a high number like 10 just so when I add in the formulas in the cells below, something will show up and confirm I entered the formula correctly.

- Keep changing this number in increments of 1 until something shows up in the max speed cell (M436)
- Take note of the max shown
- Keep increasing the number in L399 by 1 and compare it to the previous max that was shown until the max consistently drops or drops quickly
- Typically the lowest number entered in the L399 cell will give the best result. However, I have seen a couple instances where this wasn’t the case

Step 10: Find the Trajectory Angle:

In the example, 8 ended up being the number of consecutive cells that showed a max of 74.89729 m/s.

- Find the row in which this appears in column M (this one is row 424)
- In the same row in column N, type in the formula: =G424-(OFFSET(G424,-$L$399,0))
- This gives us the altitude difference over the time that we calculated the average speed

- Using trig, we can figure out the angle: In the next column over, type in the formula =ASIN(N424/L424)*180/PI()
- This shows that the quadcopter was at a 7.7 degree climb

If you find that you were in a negative climb (losing altitude), don’t worry just yet:

- If your opposite direction also has an opposite climb, the effect of the potential energy cancels out, much like the effect of wind.

Finding the trajectory angle is more of a “covering your a$$”. In general, I like to make the data as bullet proof as possible. As of this writing, I am unaware of anybody that has presented numbers showing how level their trajectory was. I’m not criticizing, just saying… Especially since it is nearly impossible to tell if you are on a perfectly level trajectory, if you can, you are a God.

Step 11: Identify the Top Opposite Passes

This is the easy part, all that has to be done is identify the fastest in one direction, then the other, and average the 2 speeds.

_

### Conclusion

I hope this has presented an objective presentation of data in regards to reporting how fast our quads can fly. This wonderful technology is still young and there is lots of room for improvement in many aspects of these wonders. I hope this improvement grows rapidly, but if we want to have a true idea of what we can achieve, an agreed upon standard (and I’m sure there may be more than one) needs to be set that leaves no room for doubt.

Please leave a comment if you have questions or need some clarity.