open source perfect pass

Ok been several years since I did some robot programing with c++ and I am kind of out of it. Please tell me if using an arduino uno, gps shield, stepper driver and stepper motor and then either an lcd and some buttons or blue tooth to a phone app would allow me to perform the basic functions of a perfect pass type GPS based "cruise control" for a boat? Here is a link to the commercially available system http://www.perfectpass.com/sites/all/themes/perfectpass%20-%20Copy/images/StarGazer-Wake-Flyer.pdf

all I want to do is be able to set a desired speed then manually throttle up then once I get within a certain tolerance of the desired speed start an if then loop using the stepper motor to maintain desired speed, then if I start manual pulling back on the throttle pause the program once a certain tolerance bellow desired is reached.

Sounds like a perfectly do-able program for an Arduino. Bear in mind that you'll likely have to do a lot of fine tuning to get it working the way you want it. You could not only do a "cruise control", but a "course-follower" is well within the capabilities of that hardware.

Yeah the course hold would be a fun feature but I mostly use the boat for wakeboarding so the consistent speed is much more important right now but thank you. any input on running bluetooth app on smart phone vs a display and buttons module.

This is going to take me a while its really taking me a minute to get back into programing, and I have never written an app so if I go that route it might take some research and help.

I haven't used Bluetooth on the Arduino, but from what I've read, it's pretty straightforward on the Arduino side. No idea about Apps on iCritters or AndBeasts.

not moving super fast but I have managed to adjust a variable for instance desired speed up and down with pushbutton. Probably not really the deffiniton of good code but it seams to work.

need some transistors to build a rs232 to ttl converter so I can start trying to read some GPS data.

Buttonupdown.ino (1.12 KB)

sorry about how I wrote the last post this way you can see the code without downloading

// constants won't change. They're used here to 
// set pin numbers:
const int buttonPin = 2;
const int buttonPinD = 3;// the number of the pushbutton pin
const int ledPin =  13; 
int desspeed = 0;//dessired speed variable

// variables will change:
int buttonState = 0; 
int buttonStateD = 0;// variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
 pinMode(buttonPinD, INPUT); 
Serial.begin(9600);  
}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);
  buttonStateD = digitalRead(buttonPinD);
  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED on: 
    (desspeed ++);   
    digitalWrite(ledPin, HIGH);  
    delay(500);}
 if (buttonStateD == HIGH) {     
    // turn LED on: 
    (desspeed --);   
    digitalWrite(ledPin, HIGH);  
    delay(500);
  } 
  else {
    // turn LED off:
    digitalWrite(ledPin, LOW); 
  }
  {Serial.println(desspeed);
  }
}

gchaney: not moving super fast but I have managed to adjust a variable for instance desired speed up and down with pushbutton. Probably not really the deffiniton of good code but it seams to work.

need some transistors to build a rs232 to ttl converter so I can start trying to read some GPS data.

  1. How are your pushbuttons wired? Your code is saying they are active HIGH. If you don't have the pins pulled down with resistors, you are going to have trouble with noise causing spurious swiitch activation/deactivation, If you don't want to add pulldown resistors, you should wire your pushbuttons from a pin to GND, and set the pinMode to INPUT_PULLUP, and change the active state to LOW, inactive to HIGH.

  2. Where will you be sending the RS232 at TTL levels? The Arduino UNO has a Serial port that connects to a PC through USB, and you can use SoftwareSerial to connect to the GPS, without level conversion.

  3. You might want to read Nick Gammon's excellent switch tutorial at http://www.gammon.com.au/forum/?id=11955 for some ideas on switch debouncing, detecting state changes rather than levels, etc.

Looks like you have a good start.

thank you for the response 1. I am currently using active high with the output tied to ground through 10K OHM resistor. I probably will go more with a active low in the long row and play with debouncing more, I just don't think the debouncing is going to work because I want it to continue to step if I hold the button.

  1. I am planning to readin NMEA 0183 data from the serial output on my garmin gps which transmits in RS232.

i have a perfect pass on my malibu, it's awesome butyou have to factor in reaction time. you are going to have to be able to adjust some (pid?) parameters that will take weight into consideration. if you have your ballast (or crew members) loaded up then the throttle will react differently then when empty.

gchaney: 1. I am currently using active high with the output tied to ground through 10K OHM resistor. I probably will go more with a active low in the long row and play with debouncing more, I just don't think the debouncing is going to work because I want it to continue to step if I hold the button.

  1. I am planning to readin NMEA 0183 data from the serial output on my garmin gps which transmits in RS232.

GND through a 10K resistor is just fine. There is no substantial difference between active HIGH or active LOW except for parts count. The debouncing is not a big deal to implement. When you press the button, it can bounce, even if you are pressing and holding it. Only trying it will tell you if you need it or not. But it WILL work. What you will want to detect is a state CHANGE... from HIGH to LOW, or from LOW to HIGH. If the state has not changed since the last detection of a state change, you just keep on doing whatever is appropriate for that state.

Ahh.. the Garmin.. yes, you'll need a level shifter then. You do realize that there are some pretty good GPS units that are TTL level, configurable, and so on, right? You can find them for about 30 bucks. No mapping, but the Garmin will take care of that part, and the small on-board GPS will serve as a backup, if you also have it outputting lat/lon, course and speed.

Can anyone recommend a stepper motor for this project? Cheaper the better but still functional.

gchaney: Can anyone recommend a stepper motor for this project? Cheaper the better but still functional.

probably not what you want to hear, but have you thought about buying their servo setup? it's ha been engineered and will be less likely to fail due to mechanical issue then your home built unit. of course you can always kill the engine if something major happens, but it may be worth the investment to have something tried and true...and reliable.

Yeah crossed my mind also thought about trying to interface with the gage unit they sell too but that part is pretty pricy. I think the servo and bracket is like 150

yeah, you can skip the gauge and master module and roll your own. but for the linkage to the motor, i think the $150 is well worth it. that way you don't have to re-engineer the safety mechanism that disengages when you throttle down