navX ahrs : Z displacement always zero

Hello,
We’ve been trying to get the displacement of the Z axis of the robot via navX-MXP.
However, printing it always returns 0.
(No matter where we move it, it’s always zero).

We’re using Java , and the navX is installed correctly . (we can still get rotations like yaw , etc.)
Any leads?

Which direction on the robot does Z axis displacement represent motion in? (Fwd/Back, left/right?) Depends on how the navX is mounted.

What do you plan to use Z displacement for? What type of accuracy do you need?

From the documentation:

    * Returns the displacement (in meters) of the Z axis since resetDisplacement()
    * was last invoked [Experimental].
    * 
    * NOTE:  This feature is experimental.  Displacement measures rely on double-integration
    * of acceleration values from MEMS accelerometers which yield "noisy" values.  The
    * resulting displacement are not known to be very accurate, and the amount of error 
    * increases quickly as time progresses.
    * @return Displacement since last reset (in meters).
    */

From the FAQ:


    Accelerometer data from the navX-MXP’s onboard MPU-9250 are double-integrated by the navX-MXP firmware to estimate displacement, and are accurate to approximately 1 meter of error during a 15 second period.

    To track a FRC or FTC robot’s position during autonomous requires an accuracy of about 1 cm of error per 15 seconds.  While the accuracy of the navX-MXP displacement estimates might be good enough to track the position of an automobile on a road, it is too low for use in tracking a FRC or FTC robot’s position during the 15 second autonomous period.

    The root cause of the displacement estimate error rate is accelerometer noise.  Estimating displacement requires first that each acceleration sample be multiple by itself twice (cubed), and then integrated over time.  Practically, if a noisy signal is cubed, the result is very noisy, and when this very noisy value is integrated over time, the total amount of error grows very quickly.

    The current noise levels (approximately 150 micro-g per square-root-hertz) would need to be reduced by a factor of 100 (two orders of magnitude) before displacement estimates with 1 cm of error per 15 seconds can be achieved by double-integration of accelerometers.

    MEMS accelerometers which feature these low noise levels are beginning to emerge, but are currently very expensive.  KauaiLabs is actively researching these technology developments and projects that MEMS technology that is both (a) low noise (1 micro-g per square root hertz) and (b) available at low cost will be available in approximately 5 years (~2020).  KauaiLabs plans to develop a product which can be used for accelerometer-based dead-reckoning at that time.

Adding on to what @Joe_Ross quoted: the value, even if non-zero, would be close to useless for any practical FRC usage. Double integral of acceleration on an FRC robot (or other mobile object that has high jerk for that matter) will quickly result in lofty errors.

3 Likes