Skip to main content
Visitor II
December 17, 2024
Solved

eCompass compared to a smart phone compass

  • December 17, 2024
  • 1 reply
  • 782 views

Hello,

I once compared your eCompass application (STM32F401RE/X-NUCEO-IKS01A3) with the compass on my smart phone.
The compass on my smart phone behaves much better than the ECompass; it is not affected by rapid changes in the angle of inclination or by vibrations.
What is the reason for this? Is it due to the sensors or the software?

    This topic has been closed for replies.
    Best answer by unsigned_char_array

    It looks like a 6-axis sensor with a separate magneto sensor. There are 9-axis sensors that feature build-in sensor fusion that might be better.
    My smartphone compass sucks. I frequently have to calibrate it and sometimes it points in the wrong direction.

    What is your application? Assumptions about the conditions of the device can be used to improve the algorithm. If your application features slow movements you can filter out fast movements, for instance. If your application remains flat you can filter out tilts in certain directions.

    1 reply

    Graduate II
    December 17, 2024

    It looks like a 6-axis sensor with a separate magneto sensor. There are 9-axis sensors that feature build-in sensor fusion that might be better.
    My smartphone compass sucks. I frequently have to calibrate it and sometimes it points in the wrong direction.

    What is your application? Assumptions about the conditions of the device can be used to improve the algorithm. If your application features slow movements you can filter out fast movements, for instance. If your application remains flat you can filter out tilts in certain directions.

    RGünt.1Author
    Visitor II
    December 30, 2024

    In my case, it's an electrically powered vehicle that simply has to drive straight ahead in a given direction off-road.

    For example, I can't get app_mems.c (eCompass) to debug.
    The debugger does not stop when I set a breakpoint on subsequent function calls because, for whatever reason, the “SensorReadRequest” always has the value 0.:

    RTC_Handler(&msg_dat);

    Accelero_Sensor_Handler(&msg_dat);

    Gyro_Sensor_Handler(&msg_dat);

    Magneto_Sensor_Handler(&msg_dat);

    Humidity_Sensor_Handler(&msg_dat);

    Temperature_Sensor_Handler(&msg_dat);

    Pressure_Sensor_Handler(&msg_dat);

    I also need direct access to the variable “heading”.