gregtomasch / EM7180_SENtral_Calibration

Get the best AHRS accuracy out of the Tlera USFS with good sensor calibration
22 stars 5 forks source link

Help with registers? #8

Closed gerowtj closed 3 years ago

gerowtj commented 5 years ago

In the Teensy_ST_USFS_Baseline_Calibration_Utility_Acc_WS folder, EM7180.cpp on lines 216-223 of the initSensors routine are several registers that I don't understand:

// Perform final Sentral alogorithm parameter modifications

  EM7180::EM7180_set_integer_param (0x49, 0x00);       // Disable "Stillness" mode
  EM7180::EM7180_set_integer_param (0x48, 0x01);       // Set Gbias_mode to 1
  EM7180::EM7180_set_mag_acc_FS (MAG_SCALE, ACC_SCALE);  // Set magnetometer/accelerometer full-scale ranges
  EM7180::EM7180_set_gyro_FS (GYRO_SCALE);           // Set gyroscope full-scale range
  EM7180::EM7180_set_float_param (0x3B, 0.0f);          // Param 59 Mag Transient Protect off (0.0)
  //EM7180::EM7180_set_float_param (0x34, 4.0f);       // Param 52 Mag merging rate (0.7 default)
  //EM7180::EM7180_set_float_param (0x35, 0.3f);       // Param 53 Accel merging rate (0.6 default)

I've looked in the datasheet for the EM7180 as well as the register map v1.3 document and cannot find a reference to parameters 0x49 or 0x48.
0x3B appears to be the "savedParamByte[0]" register, but why is a float of 0.0 written to it?
And finally 0x34 and 0x35 are single byte registers with 0x35 being read only, so why is the program writing to them?

I'm missing something simple here, please help.

Thanks, Tom

gregtomasch commented 5 years ago

In general, the parameters here in this block of code do not have dedicated registers. The "Parameter transfer process" was implemented to get configuration data into the EM7180 despite a lack of dedicated registers. The parameters in question are poorly documented by EM Micro and what little documentation we have is still requested to not be generally published. Mag transient protection (0x3B) is set to 0.0f to disable the feature; we have found it to more bother than it is worth...