Tweety777
Posts: 4
Joined: Tue Jun 30, 2015 11:26 am
Location: The Netherlands

Programming for a ship model

Tue Jun 30, 2015 12:06 pm

Hello guys,

This is my first post here, so I'll introduce myself.
My name is Josse, I live in The Netherlands.
In my free time I like to build ship models, preferably of ships I've encountered in my work.
Some 7 years ago I started a project during my internship of a diving support vessel for the oil industry.
The idea at the time was trying to get as many functions working as possible.
At that time I had a standard 2-channel radio (which obviously is totally inadequate for the job) and knew about radios with up to 12 channels and I had heard about ways to use 1 channel to control several functions and I heard it costs quite a bit of money.
I started working on the boat itself, and with some help from a member of the modelling club of which I was a member at the time I deviced a way to use the 4th channel on a 4 channel radio to switch between 3 sets of functions groups with servo's to control the functions.
This was a nice and cheap set-up but falls short of what I found out a few years later through the same guy.
He introduced me to Arduino, with which I started attempting to get things working, with lots of help because I'm no good at programming.
For as far as I know I'm the first person to ever control a shipmodel by a laptop using Arduino's to control the boat and for the communication between the laptop and the boat.
This system however was far from flawless, fast manouvring to evade a collision would only cause the boat to keep doing what it already was doing because it jammed the transmission permanently.

Some months ago I started looking into Raspberry Pi because I have a few people close to me who have experience in programming for Linux, which is, as you all know, the language for Pi.
At this point I've did some very basic programming for the Arduino, but don't yet really understand what I'm actually doing.
My father and my brother (my father has the most programming experience) will help me out here, but I'd like to get myself a good start too and maybe this will become an inspiration for others to go the same route.

What is the project all about: I want a model that looks as much as possible like the real ship both in photo's and in videos, the latter meaning there should be quite some working functions.
The ship has 2 360degree rotatable thrusters under the stern (which of course should have unlimited steering possibilities on the model as well) with the throttle also independently controllable, 2 tunnel bow thrusters that should also be controlled independent, a retractable thruster like at the stern, also fully functional (this was decided this month only, good thing I currently only have a watertight hull ready for sanding).
Then there are the main crane and 2 smaller cranes, davits to put a total of 6 lifeboats overboard, the 6 lifeboats should be able to sail as well (due to the size these will be operated using Arduino's).
Then there are the anchors, both operated independently, with means to flush them when getting them back inboard.
There's lots of decklights, there is interior lighting that I want to be switched on and off random and off course not all 60 at the same time but each apart from the other.
Then there are the navigation lights and a total of 21 signal lights, the latter also to be switched independent from each other.
There will be cooling water from 6 engines with options for acting as if the harbour generator is running, this I want to control by putting my finger on the engine I want to start (which also gives a cloud of smoke from the corresponding smokestack) and then have the cooling water pump increase it's power.
There are also 2 fire monitors which are to be controlled independent.
There will also be 2 ROV's which will be mounted with a camera each (720p preferably, otherwise 1 Pi might not be adequate to deal with all the video input).
The main crane will also have a camera and there will be at least 1 camera in the wheelhouse, but if possible I'd prefer if there would be 4, the ship is quite big so lot's of models can be hidden from my sight behind the big flat like superstructure.
This gives a total of some 140 functions, counting the 60 interior lights as only 1 function, so I might as well call it 200 functions.

I still own some Arduino Mega's and an Arduino Uno which I can use to add to the functionality and mostly for registering inputs for which I haven't yet found proper means on the Raspberry Pi.
I also own 2 Rapsberry Pi B+'s, 1 of which for in the transmitter which I will make myself to satisfy to my needs, and 1 for the boat.

This is what I;ve done so far with the Pi, I booted it and tried to test the Adafruit 16channel PWM module, but with no success so far.

Why did I start this topic?
Even though my father has experience in programming for Linux, this is not quite what he has been programming for and I only recently started to have a look at programming, so I'm a total noob for that matter.
Any help would be useful.
I'll try to find myself a way to start something that might look like a programme for this job and I'll keep you posted for the progress as I think I could learn quite a lot here.
The build log of the model can be found on several modelling forums for those interested, search google for Well Enhancer, there's only 1 model of her and that's mine.
If you guys are interested I'll post a few photo's but I'll keep the modelling on the modelling forums.

I hope you guys can help me out here.

Greetings Josse

User avatar
RogerW
Posts: 286
Joined: Sat Dec 20, 2014 12:15 pm
Location: London UK

Re: Programming for a ship model

Tue Jun 30, 2015 2:45 pm

Since noone else has responded I will start the ball rolling. I have no direct experience so I hope others will add some detail or correct me if I am totally wrong.
You do not say what range you will need. If this is limited to around 100m then I can see two options. Put wiFi dongles in bothe pis and run one as a wiFi hotspot. Then you should be able to use something like sockets to communicate. Otherwise there are wirelss transceivers available which you could drive with the pi GPIO pins.
Having decided how to make the connection you could then define a simple protocol, say one byte containing a command followed by other bytes with the parameters. It may be good to have the ship respond with an an acknowledge message so you know the command has arrived.
It is quite possible that software already exists that you could modify but I do not know where.

ghans
Posts: 7882
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: Programming for a ship model

Tue Jun 30, 2015 2:53 pm

The experience of the FishPi project (http://www.fishpi.org) might be useful here. All in all you propably need good project management skills and perseverance.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

Tweety777
Posts: 4
Joined: Tue Jun 30, 2015 11:26 am
Location: The Netherlands

Re: Programming for a ship model

Tue Jun 30, 2015 3:03 pm

Hello Roger,

Thanks forum the information.
For the transmission I already have 2 2,4GHz transceivers with a range of 1000m.
I already had these For the Arduino system.
I was told it should work with the Pi.

Greetings Josse

Return to “Automation, sensing and robotics”