I'm new to Arduino and not sure where to post this. I'm working with an engineering friend to build an autonomous gps robot. The goal is to create an robot that will navigate a course using only gps coordinates, but also have a switch for manual control. We are using a Dagu Wild Thumper 4WD Chassis with a 7.2v battery, an Arduino Uno R3, two Pololu Dual VNH5019 Motor Shields, a Sparkfun GPS Shield with EM-406A GPS Module, and a Turnigy 9x v2 8 channel remote. We stacked all the boards on top of each other with the two motor shields on top of the Arduino and the gps shield on top of the motor shields. Individually, everything works fine. The motor shields run the motors fine with hard coded values. The remote connects fine and the Arduino IDE serial monitor shows the correct values when throttle/steering are pressed, and the gps reads position fine as well. The problem is trying to add in movement code to the test code.
With the remote, the robot moves but it doesn't move correctly. Either it will crawl, regardless of how much the throttle is pressed and have random amperage spikes, or it will sit there like the throttle isn't being pressed but I'll hear the motors trying to move. The motor lights will flicker but nothing happens. Using the getM1CurrentMilliamps() functions in the DualVNH5019MotorShield library, I found that the motors were spiking at upwards of 6000-7000ma, normal operation without the remote is 300-500ma(at full speed). I don't believe this is a programming error because, again, what I see in the serial monitor is the correct value for the speed. Basically, I'm taking the throttle amount and subtracting the idle throttle from it, roughly 1400 idle with max 1800 min 1000. My engineer friend tells me it looks like the voltage is randomly going through the motor shield unresisted because 6a x 1.2ohms = 7.2v and 7.2v / 1.2ohms = 6a(I just assume he knows what he's talking about). I can post my code for this but I don't know if that would belong in this thread.
With the gps shield, putting even simple movement code into the TinyURL test examples does nothing. I believe this is because of a pin problem. The gps wants/needs to use pin 2 but so does the motor shield. I've tried changing the pins for both the gps and the motor shield in the dualVNH5019MotorShield.cpp but it only breaks the gps and motor. I've tried changing the gps from DLINE to UART but i don't see a difference.
I feel that with everything we're trying to do, there might be a lack of pins available. The motor shield needs pins 2,4,6,7,8,12, A0,A1. The gps needs 2 pins, and the remote will need 3 pins. I've completely hit the wall on debugging this thing. It feels like a hardware problem to me, but I'm just the programmer and the hardware may as well be latin written backwards for how well I understand it. Can this be done with the Arduino Uno R3 or would we need something else like the Mega2560?
Thank you so much anyone who has any advice.