Some advice please.

15 posts
by viciouspenguin » Mon Jun 11, 2012 9:05 pm

Some of you may remember way back at the beginning of March I came up with FishPi (link), an autonomous boat of sorts, powered by the Raspberry Pi.

Well this month I began building it (link), and I am at the stage where I need to buy the add-ons. For the Proof-Of-Concept Vechicle (POCV) I hope to run a GPS, Camera, Compas, Electronic Speed Controller (ESC) & rudder control.

I have picked out some modules to use but before I buy I wanted to seek advice on their suitability.

For the GPS I had planned to use a USB device, but with all the power problems, and high CPU use I have found an i2c module by flytrons (link).

I understand that the Raspi has a single pwm channel, I need two. One for the ESC, and the other for the rudder. I have come up with two options; 1) connect up a multi-servo i2c controller and run the ESC and rudder servo from that, or 2) use the pwm channel for the ESC and use an OpenServo i2c module (link) for the rudder.

From a programming point of view what would be my best choices, for both the GPS and the ESC & rudder combinations?

I expect to fit an i2c compas, and the CSI camera module when it is available.

I have no experience of programming, aside from some Turbo Pascal back in the 90s, and any advice you can all hand-out will be greatly appreciated.



The POCV complete with the Kort Nozzle & propeller
1.jpg (37.05 KiB) Viewed 2153 times

A top view showing the motor & gearbox, propshaft & coupling, rudder servo & rudder arm.
2.jpg (40.88 KiB) Viewed 2153 times
FishPi: An autonomous drop In the Ocean.
User avatar
Posts: 32
Joined: Sat Mar 03, 2012 9:14 pm
by pbreneman » Fri Jun 15, 2012 10:31 am
I have a number of minimal distributions of Free Pascal that make it *very* easy to try things. See this new message:
Last edited by pbreneman on Fri Jun 15, 2012 10:56 am, edited 2 times in total.
Posts: 13
Joined: Thu Jun 07, 2012 12:31 pm
by godFather89 » Fri Jun 15, 2012 10:35 am
I think the Pi will use too much power (>2W - just the Pi). Why not use a microcontroller? What will the boat do?
Posts: 150
Joined: Fri May 18, 2012 9:40 am
Location: Timisoara, RO
by viciouspenguin » Fri Jun 15, 2012 5:49 pm
Thanks pbreneman for the info but I'd like to keep the programming in Python if I can, it seems to follow the Raspi's guidlines.

2w is fine, the ocean going FishPi will have 130w, and the smaller Proof-Of-Concept Vehicle (POCV), which I'm building now, will be run from a 5000mah 7.2v battery. Regulated Power will be supplied from the battery through 5v and 3.3v LDOs.

I've been doing some research since my post and I expect I'll run all the devices through the i2c bus. It seems to offer the most reliable option, plus I can have over 15 servos of a single i2c controller board. More importantly they seem to use little power.

EDIT: The POCV will test the functions in a lake, the prototypes I expect will cross the Channel, and the first proficient FishPi will go transatlantic.
FishPi: An autonomous drop In the Ocean.
User avatar
Posts: 32
Joined: Sat Mar 03, 2012 9:14 pm
by jwatte » Sat Jun 16, 2012 9:07 pm
Will there be no person on board?
What will you do for safety and liability?
Recognizing and reacting to dangerous (for the surroundings) situations is a much harder nut to crack than controlling some motors based on GPS. Unfortunately, safety is not optional.
Posts: 155
Joined: Sat Aug 13, 2011 7:28 pm
by jecxjo » Sat Jun 16, 2012 9:58 pm
So how much I/O do you plan on having the Pi record and how are you getting it? I'm just wondering if using the UART creating a multi-point serial network connected to micro controllers would make more sense. A complete power/steering system managed by a small micro controller could then communicate back to the main terminal unit (in this case the Pi). The Pi could made a decision and tell the "navigator" microcontroller to turn hard-a-port for 30 seconds. This moves the physical movement down to the controller and the logic up in the Pi.

But then again, this adds to your board count.
User avatar
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)
by viciouspenguin » Sat Jun 16, 2012 11:05 pm
There will only be the Raspberry Pi onboard as the controller, there will probably be a solar charge regulator and power distribution manager to handle the solar panel & the batteries. it will be seperate to the Raspi. Thats about it.

There will be no people on the craft, it will be not much larger than the average desktop (1.2m x 60cm), the size is decided by the single 130w solar panel it will run from (the ocean going version anyway).

All i/o will be through the i2c bus, unless there is something more suitable through uart, usb or otherwise. What exactly will be onboard will be decided at a later date. The Proof-Of-Concept Vehicle, which is being built now, will have GPS, an i2c servo controller, compass (probably), and a camera.

As far as saftey goes, or at least the legal side of things, this will have to be researched. As there will be no passengers aboard it should be relativley simple.
FishPi: An autonomous drop In the Ocean.
User avatar
Posts: 32
Joined: Sat Mar 03, 2012 9:14 pm
by Wendo » Sun Jun 17, 2012 4:00 am
On the safety side, you're not thinking about other vessels. This is really where your problems will be, especially if you plan to be in shipping lanes and other busy places. You have to a) not crash into other vessels, and b) be going at a speed that if you do, you do no damage to any other craft.

Crossing the channel safely will be exceptionally difficult to do and have your boat arrive in one piece. There are some _BIG_ ships there and they could easily destroy your boat without even noticing
Posts: 142
Joined: Sun Jun 10, 2012 8:27 pm
by viciouspenguin » Sun Jun 17, 2012 3:49 pm
You are quite right, there are some big ships out there. It wont be moving fast enough to cause damage itself, maybe 2 knotts at the most. My expectations are that it will be pushed out the way by the bow wave, on larger ship anyway Hopefully it shouldn't come into contact with anything.
FishPi: An autonomous drop In the Ocean.
User avatar
Posts: 32
Joined: Sat Mar 03, 2012 9:14 pm
by Ravenous » Wed Jun 27, 2012 1:57 pm
Unless I'm mistaken nobody actually answered your question yet.

I'd suggest your most important control job is which way the boat is pointing. So the rudder needs accurate and immediate control. You need to read the compass, do whatever calculations are needed, then angle the rudder as needed, probably several times per second. How many times per second depends on how quickly waves will knock and spin your boat - for the POCV on a lake it'll probably be OK, for a much bigger future prototype on the ocean, it might still be OK if the boat were physically bigger and heavier.

Motor speed may be something you don't need to change much, and could be controlled by 2 or more GPIO pins to give a range of preset speeds. Or a single one giving a coded output every now and then to some sort of controller thingie. It will probably only change speed depending on the battery state, most of the time.

I think the first thing you need to do is settle on a compass model, then try to determine if it gives confusing readings if the boat rolls or pitches suddenly by tilting it. I understand some of these gadgets are sensitive to tilt, because Earth's magnetic field is itself tilted at most locations... also does it take a few seconds to read properly if the boat is rotated to a new heading by accident?

Proper inertial navigation using gyros or accelerometers will be immune to such problems and always tell you where your nose is pointing, but I have no idea what the budget for such stuff is these days...
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK
by jamesh » Wed Jun 27, 2012 2:34 pm
Yachts have been using 'auto pilots' for years - it's just an solid state compass attached to an activating rod which attaches to the tiller. They seem to work pretty well, and that on a boat that tilts a lot!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17086
Joined: Sat Jul 30, 2011 7:41 pm
by Ravenous » Wed Jun 27, 2012 3:30 pm
I dimly remember something in the Maplin Magazine (perhaps) about navigating yachts using a ZX81... Mid 80s? That ages me, time for my medication Nurse!

But I remember seeing something recently about the cheap digital compasses now available, and how some are affected by tilt... (as well as nearby electric motors, etc etc...) so these are all things to check first.
Posts: 1956
Joined: Fri Feb 24, 2012 1:01 pm
Location: UK
by Mortimer » Wed Jun 27, 2012 4:06 pm
You would be able to avoid any shipping over 300 tons by installing an AIS receiver.
This is a device that outputs NMEA0183 text sentences, just like a GPS receiver does, only it reports information being transmitted by vessels.

The sentences can include a load of gumph, but importantly it will include lat-long, heading and speed. So some sort of automated avoidance action might be possible. We used a receiver from on a project recently. This was a network receiver, but I note that they do some USB ones.
User avatar
Posts: 771
Joined: Sun Jun 10, 2012 3:57 pm
by therios » Sun Jul 01, 2012 1:39 pm
Such a cool plan... Just a few thoughts.

Firstly... these guys:


I agree with the chap who says that the Pi is an odd choice or processor. One major downside is that you can only get very restricted numbers of them and one saltwater incident or boat loss is going to finish your project, unless you lie about identity or go down the ebay route. If you like Python, why not use a Pinguino for your POCV which has much more io than a Pi? Anyway, it seems to me that this is going to turn into a serious marine engineering challenge more than just a bit of playing around with micro-controllers.


You could listen to whale song...

Good luck...

Posts: 2
Joined: Sun Jul 01, 2012 1:19 pm
by therios » Sun Jul 01, 2012 1:45 pm
Posts: 2
Joined: Sun Jul 01, 2012 1:19 pm