Read up on this for PID control: http://en.wikipedia.org/wiki/PID_controller
The maths are a bit hard, so I don’t expect you to get it outright, but if you are 16, you have probably learned enough to understand the figure under “Summary”. It’s a lot easier to understand than it looks at first glance.
The PID is used to steer the car/boat/aircraft onto the heading.
The compass I used was a Sparkfun Razor 9DoF. This proved to be a pretty sound investment, and it does all of the tilt compensation for you. On a boat, you shouldn’t really need to worry about tilt compensation, however.
For steering with variable thrust, you can’t use PWM. You’ll have to use some form of motor control, maybe an H bridge.
If I were you, I’d buy a semi-cheap hobby grade RC boat and play with that. It may not be the cheapest option, but it will be very, very robust.
Of course, you could still go the differential thrust option, but you will need to figure out how best to input steering from that.
It might be good if you mocked up a driver where you could feed it a value (say: 90) and it would push both motors to full speed. A value of 0 would mean the left motor was stopped and the right was full power, and a value of 180 would mean the right motor was stopped and left was full power. This would emulate the steering servo exactly, and then you would not need to worry about the ESC driver.
You could then incorporate a collective system, where you could also define the speed as well as the turn direction.
As for cost, RWAR wasn’t the cheapest project, but that’s partially because I went overboard on a few things. Expect to spend a few hundred dollars for the IMU, GPS, boat and physical control systems (motors, etc).
As for sensors, RWAR has…
- Sparkfun 9DoF Razor
- GPS (Currently LS20033, this week upgrading it to a SkyTraq devboard from Sparkfun)
COM4 is remapped due to my use of XBees for data logging. The XBee isn’t used in the latest iteration of code, so there is currently no apparent use of COM4.