How can I calibrate the IMU and fusion sensor on the SparkFun F9R and save the calibration permanently? I want to perform the calibration once, save it, and then use the F9R with an ESP32 to get accurate data such as the direction of the front or heading (IMU).
As I recall there are some UBX-MGA-SF-INI/INI2 / UBX-MGA-INI-ATT
I think you you get all info about calibration here: SparkFun GPS-RTK Dead Reckoning ZED-F9R Hookup Guide - SparkFun Learn
I will speak mostly for the automotive case. First, you have to understand that there are two aspects. The first one is alignment of IMU versus the vehicle. The second one is sensors (accelerometers and gyroscope) calibration. Mostly, gyroscope are sensitive to temperature. Sensors calibration is done at each startup although F9R is storing data for each temperature for a faster calibration next time it is operating at the same temperature. Alignment can be entered manually or automatically determined using autoalignment function. If autoalignment is successful (reaching fine state), you can store parameters and load them at next startup (and deactivate autoalignment). Then calibration will occur quite quickly, in less than 1 mn will driving. In opposite, autoalignment and calibration together take a long time and may even not converge.
You can have a look at my F9R logger project.
BTW, the good way to get fast autoalignment is to combine 8 shaped trajectory and portions at high speed (>>50 km/h). Best is obtained by combining roundabout and motorway entrance/exit loops.