Quote:
Originally Posted by Techwiz
We have a NavX IMU connected via USB to the RoboRio. From time to time we seem to be loosing comminucation with the NavX. Watching the Update counter on the smart dashboard shoes hiccups along the way. Furthermore watching the isConnected() on the smart dashboard shows random disconnects.
We are at a loss. Its clear that the gyro(Yaw) reading is much less noisy. But for some reason when we execute turns using a PID controller and the Navx we get unpredictable results. Often the turn operates as we expect. However a fair amount of the trials we get a haywire result.
Our current robot code:
https://github.com/TechplexEngineer/fred2
Where the AHRS imu is instantiated:
https://github.com/TechplexEngineer/...Drive.java#L83
Using the imu in a PIDCommand for turning:
https://github.com/TechplexEngineer/...urn_angle.java
|
The first thought that comes to mind is that the electro-mechanical connection between the USB cable and the navX is somehow loose, and that the actual motion of the robot during the rotational move is sufficient enough to dislodge it. The actual behavior you should expect in this case differs in this way:
a) If you are also connected to the navX MXP via the MXP connector as well as the USB, you have two sources of power to the navX MXP (the 5VDC on the USB cable, and the 5VDC on the MXP power rail). In this case, the navX MXP will stay powered even if the USB connection comes loose.
b) If you are NOT connected via the MXP connector when you use the USB connection method, the board can actually get reset if the USB cable shakes loose momentarily.
I'm assuming you are using configuration b). To verify that a reset is what's causing the disconnect, when the disconnect occurs immediately look at the navX MXP and see if it's 3.3V Power LED and the S1/S2 LEDs go out momentarily. If they do, the navX MXP is losing power. The navX MXP takes about 3 seconds after it gets reset before it starts sending out data again.
It's possible you can't look at the robot when it's in this state. In that case, another way to tell a reset has occurred is if the navX MXP isConnected() returns FALSE for awhile, and then after it comes back the IsCalibrating() is TRUE for awhile (typically, 15-20 seconds). This will tell you for sure that the navX MXP is getting reset.
If the cable is indeed the issue, please consider using a zip tie or other means to provide strain relief for the cable assembly so that it can't move during a robot rotation.
Aloha,
- scott