In general when troubleshooting, it is good to simplify your system as much as possible and make sure each part is working before incrementally adding back in components to figure out where the issue is. To try that with your system, and verify that there is not a problem with the driver, can you load the VNH5019 Arduino Demo.ino sketch to the Arduino connected to the VNH5019 shield and let it run for a while to see if you ever get the same full-speed forward or full-speed backward behavior?
Also, can you describe the behavior you are getting and the data you saw more? It sounds like your system works normally for some time, then after a while, the robot begins to go full-speed forward or full-speed reverse (which sounds like either the ‘A’ or ‘E’ case in your code). When the robot is stuck rotating at those speeds, are you saying that on the Arduino IDE Serial Monitor you can see the cmd value updating as you expect from manipulating your transmitter, but the robot ignores the new cmd values? Or are you seeing only your full-speed values at the receiving Arduino, regardless of what commands you are transmitting?
-Jon
