Yaw data frozen after FTC Robot Restart

18 views
Skip to first unread message

Andrew Driesman

unread,
Feb 26, 2017, 10:13:31 AM2/26/17
to navx-mxp
Hi - We are using the NavX Micro navigation sensor.  Board version 4.0, firmware 2.3.  The sensor is being used during Autonomous for turns (yaw).  Several times during competition, the robot, rather than executing a 180 deg turn, spins continuously.  Long story short, we were able to isolate the behavior. Our drive team will sometimes restart the robot (from the driver's station) during the pre-match setup.  This consistently yields an unchanging (frozen) yaw output.  If the robot is power-cycled, the Nav-X starts producing data (or the software starts receiving data?). 

Some things we've done.  Hooked the NavX up to NavXUI.  Everything seems correct.  Calibration takes about 18 seconds and all the data looks good. 

Hooked the bot up to Core Device and pulled the data from the following registers while the sensor was functioning properly.
0x08 Op Status - result 4 - NAVX_OP_STATUS_NORMAL
0x09 Cal Status - result 2 - NAVX_CAL_STATUS_IMU_CAL_COMPLETE
0x0A Self Test Status - result 135 - appears to not be a valid result
0x0B Capability Flag - result 236 - appears to not be a valid result
0x10 Sensor Status - result 6 - appears to not be a valid result

Any thoughts on the matter?  Anyone else see this behavior?  Thanks, 4318

admin

unread,
Feb 27, 2017, 1:09:30 PM2/27/17
to navx...@googlegroups.com
Hi Andrew,

The sensor register data you listed are valid values, so I believe basic communication between Robot Controller and navX-Micro are OK.

In general, as long as the two green (S1 and S2) leds on the navX-Micro are solid ON, the sensor is working correctly and will respond to I2C messages.

So the mystery appears to be why when restarting the robot yields a frozen yaw output, but not when power-cycling.

When the robot is restarted from the driver station, is it possible that the AHRS close() method is being invoked, but when it starts up again that the AHRS.getInstance() method is not being invoked?

In the navx_ftc library, there is only a single instance of the AHRS class.  This single instance is retrieved via AHRS.getInstance().  This instance continues to run until the AHRS.close() method is invoked.  After that, AHRS.getInstance() needs to be re-invoked to again start the communication with the sensor.

So I'd recommend reviewing the code path that occurs during the restart to verify that if AHRS.close() is invoked that AHRS.getInstance() is invoked after that to resume communication.

Andrew Driesman

unread,
Feb 27, 2017, 1:37:11 PM2/27/17
to navx-mxp
HI - thanks for the quick response.  We will check the code.  Just one note.  Another way that we can get the NavX Micro to freeze is to quickly power cycle it.  I associated this behavior with the fact that capacitance in the system is holding the voltage and is slowly decaying.  Quickly turning off and on the power is browning out the device and putting it an unpredictable state.  I am mentioning this for completeness, but don't think it is related to the AHRS freezing when the robot restarts (unless someone else does).  Power should be constant during the whole restart process.

Anyway - I'll have the team look at the code and report back.  Looks like there is another user with the same issue.  Thanks a bunch.  -Andy
Reply all
Reply to author
Forward
0 new messages