SYSTEM NOTICE

Auto translation by AI. Be sure, accuracy, nuances and authorial intent may not be fully reflected.
見出し画像

How to Build a Low-Cost, High-Precision GPS Lap Timer and Racing Line Logger ver. 3.5 - u-blox M9 x Android x RaceChrono Setup Guide -

[Disclaimer] I cannot be held responsible for any damages or losses resulting from operations, work, or purchases made based on the information in this content. Please note that results may differ from the descriptions depending on OS/software versions or individual execution environments.

1. Overview

This system achieves ultra-high-precision driving logs at "20Hz (20 position fixes per second)," comparable to commercial data loggers in the tens of thousands of yen range, by combining a low-cost external GPS module (a few thousand yen) with an Android smartphone.

The biggest feature is that by increasing the update rate to 20Hz, you can record your racing line—"when, where, and how you drove"—smoothly and accurately. The time error compared to circuit transponders was recorded at "within 0.022 seconds" in terms of mean absolute error over more than 130 laps. By overlaying accurate racing lines and speed graphs, you can perform advanced riding analysis to figure out "where to shave off those fractions of a second.""0.022 seconds" (Note: The previous sentence was adjusted for flow).

2. Requirements

[Hardware]

  • External GPS: u-blox M9-equipped module. You can purchase one from QUESCAN on AliExpress for around 4,000 yen. I recommend a Type-C connector model to avoid using conversion adapters when connecting to your smartphone. *An M9 chip capable of receiving four satellite systems (GPS, GLONASS, Galileo, BeiDou) simultaneously is required.

  • Smartphone: An Android device with high processing power, such as the Pixel series.

  • PC: A Windows machine for initial GPS chip configuration.

[Software]

  • u-center (for Windows): Official u-blox configuration software. Used to rewrite chip settings (free).

  • GNSS Master (Android app): A relay app that bridges GPS data to your smartphone (free).

  • RaceChrono (Android app): The main app for lap time measurement and analysis (The Pro version is paid, but the free version is sufficient for this system).

  • Latest AI: Ask Claude for the hard stuff and Gemini for the easy stuff!

[Reference: Author's Environment]

GNSS receiver with UBX-M9140-KB, Pixel 9a (Android 16), ThinkPad (Windows 10 ESU), 8BL-PC40, Okegawa Sportsland

3. Procedure

Step 1: Initial GPS Chip Configuration (PC Work)

First, connect the GPS to your PC and use u-center to rewrite the chip to a "high-speed specification" dedicated to circuit use.

  1. Open View > Messages View.

  2. UBX > CFG > RATE: Change Measurement Period to 50ms (= 20Hz). -> 1000ms / 50ms = 20 times/sec. The smaller the value, the higher the frequency.

  3. UBX > CFG > PRT: Change Baudrate to 460800 -> This is the data transfer speed between the GPS and the smartphone. Since it sends a large amount of data at 20Hz, the default (9600) will cause a bottleneck. It is important to set the same value on the GNSS Master side to match this value.

  4. UBX > CFG > NAV5: Change Dynamic Model to 4 - Automotive -> This is the mode where the GPS chip assumes 'what kind of vehicle you are currently in.' By setting it to Automotive, the positioning filter is optimized for high-speed and high-acceleration movements. This mode is most suitable for both motorcycles and cars.

  5. Select UBX > CFG > CFG: Save current configuration, confirm that 'BBR' and 'FLASH' (or all) are highlighted in blue under 'Devices' on the right side of the screen, and then save the settings with the [Send] button. *This ensures the settings are retained even after turning off the power.

Step 2: Smartphone intermediary app settings (Android work)

These are the settings to make the smartphone recognize the external GPS as its 'own GPS'.

  1. Developer options: From Android settings, select [GNSS Master] under 'Select mock location app'.

  2. GNSS Master settings:

  • Select USB Serial in Receiver settings.

  • Set Baudrate to 460800.

  • Turn ON Mock Location on the home screen.

3. Connection: Connect the USB, and if an access permission prompt appears, select 'Yes'. If the Data Rate starts moving, it is successful.

⚠️ Note: Android battery optimization settings If you turn off the smartphone screen and store it in your pocket or cowl while riding, Android's features may judge 'GNSS Master' or 'RaceChrono' as unnecessary background apps and force-close them, causing the log to be interrupted. Be sure to change the 'Battery usage optimization' for these apps in Android settings to 'Unrestricted' or similar.

Step 3: RaceChrono settings

  • Settings > GPS receiver: Select 'Internal GPS'. *Since GNSS Master is feeding the data, it is treated as internal by the app.

  • Operation check: Display the GPS screen using the bottom-left ⋀ button from the measurement screen; if '20Hz' is displayed, you are done.

Step 4: Mounting on the motorcycle

  • Orientation: Placing the side with the wiring facing 'rearward' can reduce damage from wind and vibration while riding.

  • Angle: Install horizontally with the ceramic surface of the antenna facing the sky.

  • Location: The best place is somewhere not covered by metal or carbon fiber (such as inside the tail cowl or near the meter).

4. Operational Advice💡

  • Racing line deviation: Due to the absolute accuracy of GPS, the line on the map may shift by a few meters. You can align it with the actual racing line by using the "Position Offset Correction" feature in the RaceChrono map editor.

  • Before entering the course: If you let it sit still in an area with an open view of the sky for about 5 minutes, the positioning will stabilize, and the log accuracy from the first lap will improve. However, as noted in "7. Other," heat countermeasures are recommended.

5. Accuracy

How accurate can lap timing really be with a low-cost setup consisting of a "smartphone + a few thousand yen external GPS"? I verified the accuracy using lap data actually acquired while riding on a circuit.

The verification used a total of 134 laps of data recorded over two days, May 2nd and May 4th. After comparing and analyzing the circuit's transponder times with this system's times, the mean absolute error was only "0.022 seconds" as a result. This figure was calculated strictly so that positive and negative deviations would not cancel each other out.

Looking at the data distribution in detail, for the majority of the 134 laps, the error converged well within less than 0.02 seconds. On the other hand, there were two laps with a deviation in the 0.1-second range. Although the cause has not been identified, it is thought that a slight fluctuation in coordinates occurred when crossing the line due to a momentary deterioration in satellite acquisition. Conversely, this means that even including those outlier data points, the overall mean absolute error remains in the 0.02-second range.

6. Q&A

Q. What is this?
A. This is a system designed to accurately record lap times and racing lines on a smartphone during circuit riding by feeding GPS data through the path of "External GPS -> Relay App -> RaceChrono." This is possible because Android has a feature that allows you to replace the GPS data received outside the smartphone with the internal GPS data.

Q. What are the benefits of installing this?
A. You can obtain a high-precision measurement environment of the same class (presumably) without buying a dedicated GPS lap timer (which costs tens of thousands of yen), using only the smartphone you use daily and an external GPS that costs a few thousand yen.

Q. How much does it cost?
A. If you already have an Android smartphone or PC, the only additional cost is around 4,000 yen for the external GPS.

Q. Can't I use it on an iPhone?
A. Unfortunately, this system is for Android only. This is because the core feature of "replacing external GPS data with internal smartphone GPS data (mock location information)" does not exist in iOS.

Q. Can it be used in a car?
A. Of course you can use it. In fact, if you attach the external GPS to the roof, I feel like you can record it with higher precision than a motorcycle because there is less change in posture.

Q. RaceChrono can be used with just a smartphone without doing all this, right?
A. That's correct; you can measure times and record racing lines with just a smartphone. However, the built-in GPS of a smartphone operates at 1Hz (positioning once per second), so the accuracy is low. Considering that at 100 km/h, you move about 28 meters per second, you can see that it is difficult to acquire accurate data. By using a high-performance external GPS, it positions 20 times (20Hz) more than the built-in GPS.

Q. It says to mess with Android's "Developer Options," but won't that mess up my phone?
A. It's fine. This is an official Android feature necessary to instruct Android to "treat external GPS data as if I received it myself (mock location app)." As long as you don't change settings other than those written in the manual, it will not have a negative impact on your daily smartphone use.

Q. Can I use it forever once I set it up?
A. There is a risk that it may suddenly stop working due to Android OS updates (security enhancements, etc.) or changes in RaceChrono specifications. Since this is a system I need for riding on the circuit, I intend to keep thinking about mechanisms that can adapt to specification changes as long as I remain interested.

Q. Isn't it strange that the average error is 0.02 seconds even though it's 20Hz (once every 0.05 seconds) positioning?
A. That's a sharp question! Your intuition that "if it only positions at 0.05-second intervals, the error should be a maximum of 0.05 seconds" is correct, but in reality, it's a bit more complex. RaceChrono detects the crossing of the start/finish line by "linearly interpolating the position between the two points immediately before and after." For example, if you have data for a position 0.03 seconds before the line and a position 0.02 seconds after crossing the line, you can calculate where you crossed the line in between. This allows you to estimate the time with higher precision than the positioning interval (0.05 seconds). On the other hand, the reason the error doesn't become zero is that the absolute position accuracy of GPS (a few meters of fluctuation) and radio wave reception disturbances due to satellite placement and weather conditions have an effect. I interpret this 0.02-second figure as a "realistic limit" where this interpolation calculation and GPS accuracy are combined.

Q. What kind of person is the author?
A. A middle-aged rider who enjoys circuit riding between childcare and work. I'm not a science major. I'm a liberal arts graduate.

7. Other (Tips & Notes)

  • The maximum capability of the u-blox M9 is 25Hz, but I have set it to 20Hz operation to prioritize stability.

  • Although there is a newer chip than the M9 called the M10, the M10 is designed for power efficiency and miniaturization, making the M9 more suitable for this high-frequency logging application.

  • There have been multiple instances where the DataRate was not displayed in GNSS Master from the second run onwards. This may be due to the effect of heat on the GPS.

  • Regarding the relay app, I believe you would get similar results using GPS Connector. I am also currently working on developing a more user-friendly relay app.

  • There is a domestic lap timer app called M-LAP, and its lap timing precision is no different from RaceChrono. However, I gave up on using it because it frequently failed to record the racing line due to errors at critical moments (cause unknown).

  • Since both smartphones and external GPS units are sensitive to heat, I recommend taking measures such as removing the smartphone from the vehicle between runs and covering the external GPS with a towel or similar item to block sunlight.

  • I attached rubber feet to the external GPS to help with vibration and heat management. Untested.

8. Conclusion

The content described here is still a work in progress, so I would appreciate it if you could let me know if there are any better equipment, apps, or settings.

いいなと思ったら応援しよう!