# NEO-M8U automatic alignment and Fusion initialization in an e-bike project

**URL:** <https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094>\
**Category:** GPS/GNSS\
**Created:** [November 13, 2026, 1:07pm UTC](https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094 "2026-11-13T13:07:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_Bharadwaj](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/abhishek_bharadwaj/32/13678_2.png) [@Abhishek\_Bharadwaj](https://community.sparkfun.com/u/Abhishek_Bharadwaj)\
**Post date:** [November 13, 2026, 1:07pm UTC](https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094/1 "2026-11-13T13:07:27Z")

</div>

Hi everyone,

I’m working on an e-bike project using the SparkFun NEO-M8U-06B GPS Dead Reckoning Breakout with an ESP32-S3.

I’m using the SparkFun u-blox GNSS Arduino Library and communicating with the module over UART.

I’m having some trouble understanding how automatic IMU alignment and Fusion initialization work, especially when the module is restarted or removed from its mounting.

My setup:

- GNSS module: SparkFun NEO-M8U-06B

- MCU: ESP32-S3

- UART baud rate: 115200

- Backup supply: Onboard battery connected to V\_BCKP

- The NEO-M8U remains powered independently of the ESP32.

- I’m using UBX-NAV-PVT, HNR-PVT, ESF-STATUS and ESF-ALG messages.

The module is mounted upside down on my e-bike, with X pointing left, Y pointing towards the rear and Z pointing down.

What I’m experiencing:

Sometimes the receiver stays in “INITIALIZING” for a long time before entering Fusion. It can take quite a bit of riding before Fusion becomes active.

I want to make sure I’m handling the alignment and receiver configuration correctly.

A few questions:

1. Once automatic alignment reaches “FINE”, are the calculated mounting angles retained? What happens if the main power is interrupted but V\_BCKP remains powered?

2. If I remove the module for maintenance and reinstall it a few hours later in exactly the same orientation, will it retain its previous alignment? What if its mounting angle changes slightly?

3. Is it recommended to save the automatically calculated alignment angles as user-defined angles using UBX-CFG-ESFALG? If so, what is the correct way to do this?

What I’m trying to achieve:

I want the NEO-M8U to handle GNSS and dead reckoning independently, while the ESP32 handles the application and reads the navigation data.

Ideally, I would like to complete alignment once during initial setup, retain the correct mounting configuration, and avoid unnecessary realignment or configuration changes every time the ESP32 restarts.

I’d appreciate any suggestions or experience from people who have used the NEO-M8U in vehicle or bicycle applications.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![YellowDog](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/yellowdog/32/1782_2.png) [@YellowDog](https://community.sparkfun.com/u/YellowDog)\
**Post date:** [November 13, 2026, 1:11pm UTC](https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094/2 "2026-11-13T13:11:46Z")

</div>

This won’t answer all your questions but might have some useful information.

> [@Calibrating NEO-M8U on E-Bike](https://community.sparkfun.com/t/calibrating-neo-m8u-on-e-bike/40319):
>
> Hello everyone We plan on using the NEO-M8U GPS Dead Reckoning sensor on a “fast” e-bike (~45km/h top speed). So far I am unable to get the fusion mode to be enabled/the sensor to be calibrated correctly. I have driven around on the E-Bike for around 45minutes, performing the various maneuvers mentioned in the tutorial: stopping, turning (left/right) and reaching speeds over 30km/h. These were also performed in an open area. I am using a passive GPS-antenna uFL with 1dBi of gain (don’t know if that could also be the issue). As E-Bikes typically have more vibrations than your average car, I am wondering if there is too much vibration/noise for the IMU to calibrate correctly using an E-Bike? Does anyone have any experience with this? Basically I have two questions: can you calibrate the NEO-M8U GPS Dead Reckoning module with an E-Bike (45km/h, more vibrations than car)? can you calibrate the sensor on a car and then use it on the E-Bike, or will there be too much noise during E-…

---

<div class="post-metadata">

**Author:** ![Abhishek\_Bharadwaj](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/abhishek_bharadwaj/32/13678_2.png) [@Abhishek\_Bharadwaj](https://community.sparkfun.com/u/Abhishek_Bharadwaj)\
**Post date:** [November 13, 2026, 3:51pm UTC](https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094/3 "2026-11-13T15:51:36Z")

</div>

Thank you.

This did help me. I was able to achieve GNSS+DR.

The thing is that if I leave the e-bike inside the basement parking space, the location drifts after half an hour or two.

Also facing an issue where if I leave the e-bike for a day and come back the next day, the IMU mount alignment would go back to initializing. (P.s. rn I have only enabled auto mount alignment and yet to finalize the mount alignment angles for user defined).

---

<div class="post-metadata">

**Author:** ![Eric\_S](https://avatars.discourse-cdn.com/v4/letter/e/aca169/32.png) [@Eric\_S](https://community.sparkfun.com/u/Eric_S)\
**Post date:** [November 13, 2026, 6:41pm UTC](https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094/4 "2026-11-13T18:41:30Z")

</div>

At least, with F9R, for e-bike dynamic, you’re supposed to have a wheel tick sensor. Not the case with M8U?

And also, do you use auto-alignment? Again, with F9R, it is only available with automotive dynamic.

---

<div class="post-metadata">

**Author:** ![TS-Russell](https://yyz1.discourse-cdn.com/sparkfun/user_avatar/community.sparkfun.com/ts-russell/32/6092_2.png) [@TS-Russell](https://community.sparkfun.com/u/TS-Russell)\
**Post date:** [November 13, 2026, 8:53pm UTC](https://community.sparkfun.com/t/neo-m8u-automatic-alignment-and-fusion-initialization-in-an-e-bike-project/70094/5 "2026-11-13T20:53:11Z")

</div>

Most of this stuff is covered in the [Integration Manual](https://cdn.sparkfun.com/assets/7/0/f/5/d/NEO-M8U_HardwareIntegrationManual__UBX-15016700_.pdf)

While it’s in the parking garage it will still drift until it can get a new fix, but you can help minimize the cold and hot start times

1. It should save the last known-good info/settings to enable hot-start the next power-on…do keep in mind, however, a new fix requires a clear view of the sky and your data will tend to drift when obstructed (blind dead-reckoning). One tip is to hook the M8U up to power and let it stay ‘charging’ for a day to let the backup battery fully charge up 🙂  
UDR firmware has a save-on-shutdown feature (`UBX-UPD-SOS`). The sequence is a controlled GNSS stop via `UBX-CFG-RST`. On the next start it restores that data automatically, and you can poll `UBX-UPD-SOS` to see whether the restore actually worked. For a bike with a switched battery, this is worth wiring into your shutdown path (if you can detect/predict power-down early enough)

2. Yes, and the calibration and data will be offset by any change in position (integration manual recommends that the module be mounted with orientation stability within approximately **2 degrees** ). _ANY_ movement will need a re-calibration (a socketing rigid mount might be best?)

3. You betcha. Here’s what I suggest as a workflow:

```auto
1. Mount rigidly in its final position; auto-alignment enabled 
2. Ride a calibration route until ESF-ALG status is FINE and ESF-STATUS shows fusion active.
3. Read the angles and write them as user-defined with `UBX-CFG-ESFALG`, then save with `UBX-CFG-CFG`.
4. On every ESP32 boot, don’t reset or reconfigure. Just poll the current state and only reconfigure if something differs.
5. Optionally use `UBX-UPD-SOS` on controlled shutdown.
6. If you ever remove or bump the module, switch back to auto-alignment and repeat.

```

That should get you most of the way there…fully charge the backup battery, rigid mount the IMU, don’t move it unless you _need_ to, save settings to the NVM, re-calibrate as often as needed
