Having trouble using GPS as input for routine to control 2 motors
Hello fellow board members,
I am working on a program to use the Parallax GPS Module to determine the position of a cart that will be automated to move using this positioning. The cart uses 2 100W DC motors (LINK HERE) with the idea to run them both independently to create turning and speed. I am using the Sabertooth 2x25 speed controller (LINK HERE) to drive the motors from a single 12V battery (NiCad, 12Ah rating).
My thinking is that I have to (1) establish my local position using the GPS module, then (2) compare that position with another position nearby of my choice and lastly (3) have the BS2 output the required response to the speed controller in order to drive the motors to have the cart close in on my position of choice. Of course, these 3 steps are repeated until the local position reported by the GPS module is sufficiently close to my position of choice.
The speed controller has 4 ways of receiving input:
1) Analog Input using PWM technique to give proportional control of the motors (BS2 is not fast enough to create outputs with frequencies that can be used effectively by the speed controller)
2) R/C Input using the BS2 to create a pseudo R/C input that is just a series of pulses (This is what I tried to use).
3) Simplified serial using TTL level RS-232 data that relates to speed and direction (never considered using either style of serial input)
4) Packetized serial which uses packeted data (address byte, a command byte, a data byte and a 7 bit checksum)
Now, its seems like my logic, as I mentioned above, is OK. However, once I run the routine I am not getting any response from the motors (hence from the speed controller).
I am attaching a copy of my code for your viewing.
Can I get someone to look over my code and see if they can see where I went wrong? Of course if the program is OK then the speed controller is the problem. But at least someone can help me determine what generally is the problem.
Thank you.
I am working on a program to use the Parallax GPS Module to determine the position of a cart that will be automated to move using this positioning. The cart uses 2 100W DC motors (LINK HERE) with the idea to run them both independently to create turning and speed. I am using the Sabertooth 2x25 speed controller (LINK HERE) to drive the motors from a single 12V battery (NiCad, 12Ah rating).
My thinking is that I have to (1) establish my local position using the GPS module, then (2) compare that position with another position nearby of my choice and lastly (3) have the BS2 output the required response to the speed controller in order to drive the motors to have the cart close in on my position of choice. Of course, these 3 steps are repeated until the local position reported by the GPS module is sufficiently close to my position of choice.
The speed controller has 4 ways of receiving input:
1) Analog Input using PWM technique to give proportional control of the motors (BS2 is not fast enough to create outputs with frequencies that can be used effectively by the speed controller)
2) R/C Input using the BS2 to create a pseudo R/C input that is just a series of pulses (This is what I tried to use).
3) Simplified serial using TTL level RS-232 data that relates to speed and direction (never considered using either style of serial input)
4) Packetized serial which uses packeted data (address byte, a command byte, a data byte and a 7 bit checksum)
Now, its seems like my logic, as I mentioned above, is OK. However, once I run the routine I am not getting any response from the motors (hence from the speed controller).
I am attaching a copy of my code for your viewing.
Can I get someone to look over my code and see if they can see where I went wrong? Of course if the program is OK then the speed controller is the problem. But at least someone can help me determine what generally is the problem.
Thank you.
Comments
Take a look at some continuous rotation servo control programs to see how to program it. A good spot to look would be in the Robotics With the Boe Bot book, under the movement sections.