Random communication drops

Seems that you have gone a long road, so I will skip to a simple suggestion: start simple. It might be faster to understand under which conditions this problem is present if we start from a basic and known setup.

  1. Disconnect all I/O (PWM, CAN, etc) from the roboRIO
  2. Connect by USB
  3. Create a LabVIEW roboRIO project from the template in the splash screen
  4. Run it
  5. Enable the robot from the Driver Station. Nothing will move because you disconnected all the I/O. Let it run for a while. Do you see the disconnection event? Which is the behavior? Can you post a log file/screenshot?

Once we understand how a very basic setup as this one behaves, then we start adding complexity (such as your code, ethernet connections, limelight, and whatnot) or continue troubleshooting if the problem is still present.

One more thing: you mention that the disconnection is random. Have you noticed any pattern at all? Is the robot moving too much when this happens? Is it every time you enable or once per our/couple of period of testing?