ROV Propeller Coding
kershawrobotics
Posts: 8
Can someone identify a thread or provide assistance on developing code for an Underwater Remote Operated Vehicle? Please understand, I am not a programmer, but may be able to find someone local with experience in other types of coding (Robot C, Labview, etc). This is a pretty simple control system, so I am confident someone has created a similar control program.
Basic Setup
1. USB game pad to laptop.
2. Ethernet hardwire from laptop to onboard network switch.
3. Ethernet hardwire from network switch to "brain".
4. PWM output from "brain" to 4 H-bridge speed controllers.
a. 2 independent vertical thrusters
b. 2 independent horizontal thrusters
5. Digital (off-on) output to 7 air valves.
6. Digital (off-forward-reverse) to one electric motor.
7. Input from pressure, humidity, and temperature sensors to "brain".
8. Data display from "brain" on sensors, valve position, thruster power, etc. to laptop.
Control System
Brain-
9. USB Propeller (Gadget Gangster)
Boards-
10. Ethernet sister board (Gadget Gangster)
11. 3 axis accelerometer (Parallax)
12. 1 axis gyroscope (Parallax)
13. H-bridge speed controllers (RobotShop)
14. Humidity sensor (Parallax)
15. Pressure sensor
The current programmer walked away this weekend and nothing is wired, coded or working. I have found several Objects for USB game pads, ethernet setup, and H-bridge controllers. However, I cannot locate a complete program (I just started looking). What I don't understand is how to fit the pieces of coding together. Which one is first? What is the best sequence? Here is what I assume:
1. Boot or start routine.
2. Establish ethernet communication with laptop.
3. Scan sensors for data.
4. Output sensor data to laptop.
3. Scan USB game pad for input.
4. Output game pad instructions to thrusters, air valves, electric motor, etc.
Thank you in advance for any assistance.
Kershawrobotics
Basic Setup
1. USB game pad to laptop.
2. Ethernet hardwire from laptop to onboard network switch.
3. Ethernet hardwire from network switch to "brain".
4. PWM output from "brain" to 4 H-bridge speed controllers.
a. 2 independent vertical thrusters
b. 2 independent horizontal thrusters
5. Digital (off-on) output to 7 air valves.
6. Digital (off-forward-reverse) to one electric motor.
7. Input from pressure, humidity, and temperature sensors to "brain".
8. Data display from "brain" on sensors, valve position, thruster power, etc. to laptop.
Control System
Brain-
9. USB Propeller (Gadget Gangster)
Boards-
10. Ethernet sister board (Gadget Gangster)
11. 3 axis accelerometer (Parallax)
12. 1 axis gyroscope (Parallax)
13. H-bridge speed controllers (RobotShop)
14. Humidity sensor (Parallax)
15. Pressure sensor
The current programmer walked away this weekend and nothing is wired, coded or working. I have found several Objects for USB game pads, ethernet setup, and H-bridge controllers. However, I cannot locate a complete program (I just started looking). What I don't understand is how to fit the pieces of coding together. Which one is first? What is the best sequence? Here is what I assume:
1. Boot or start routine.
2. Establish ethernet communication with laptop.
3. Scan sensors for data.
4. Output sensor data to laptop.
3. Scan USB game pad for input.
4. Output game pad instructions to thrusters, air valves, electric motor, etc.
Thank you in advance for any assistance.
Kershawrobotics
Comments
Since your using the Propeller you are able to perform some of the routines in parallel. For example, you can scan the sensors for data and at the same time output instructions to thrusters, air valves, electric motors, ect. and at the same time you can communicate with the laptop. The Propeller is a multi-core (8 total) micro-controller.
I don't think you'll find a complete program on the OBEX so you may have to create it yourself. Also since your using mostly Parallax sensors and devices then the objects for those devices can be used without any extra coding.
What code do you have, if any?
Interfacing with the 7 air valves and electric motor will also likely need external electronics, depending on the power draw of those parts. If they're small (like 500ma or less, max) you could use a Darlington Transistor array like this one: http://www.sparkfun.com/products/312 If they're larger than that, using the transistor array to drive relays is relatively easy, or you could use MOSFETs, which may take a little more circuit work. From the software side of things, all of these would be driven in the same manner - Simply set the connected output pin to 1 to turn the device on and 0 to turn it back off, like this:
You typically only need to set the direction of a pin once at the beginning of your program.
Programming the Propeller isn't very hard, especially if you're mostly using ready made objects from the object exchange, but if no one in your group has any programming experience at all it's going to seem pretty daunting. Take a look at the Propeller tutorials - they demonstrate very simple stuff like working with the input / output pins, calling functions, writing loops, and so on.
I received your Spyder program this morning. I will open it tonight when I get home. The air valves should work directly from a digital I/O pin because the current is 0.1 amp. The thrusters will be controlled by a 48 vdc H-bridge from Robot Shop via the PWM signal. I read some of the tutorials today, and yes it will be a steep learning curve for me. I'm hoping a local contact can provide a quick solution. The team needs to demo the vehicle at the end of April.
Comments are welcome.
Looking at your diagram, the "thrusters" object will likely be a single object controlling 4 pins. A good number of the PWM objects in the Obex will handle multiple outputs. The Fast PWMx8 object will do 8 at a time, so you won't need the "port/starboard/horizontal/vertical" things to be independent objects - they'll just be different "ports" on the same PWM object. The Spyder code I sent you uses the Servo32 object (called ESC in the code) in the same way.
The team is reviewing your Quad-Copter files. It should help us get past "Power on". The air valves are actually 12 vdc, so they must be toggled from a separate device. The Darlington Array will solve the problem; thanks. We are working on another path to get the ethernet board working, and hope to make progress this weekend.
Anyone have ideas on the USB Game Pad communication? Can we assume the game pad will have software that can direct output to ethernet? If so, is an OBJECT needed to handle the game pad input, and which is best?
Thanks to everyone for the feedback. The team is still a long way from a functioning ROV.
It's conceivable you could find something that'll direct the game pad output to Ethernet for you, but I haven't heard of it. You're unlikey to find a Prop object to deal with it from there. Gamepad objects for the Prop assume the pad is connected directly to the Prop.
I plan to retain all of the related information and pursue this control system in the coming months. I will need a Propeller expert to assist with the programming. My new deadline is September 2011.
Thanks to all who responded to my requests. While I am still not a programmer, I have a better understanding of the Propeller capabilities.