Notifications
Clear all

Ship model with custom made transmitter and Raspberry Pi control

38 Posts
4 Users
0 Likes
3,523 Views
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

Hello guys,

 

For the last 12 years I've been working in this project, a ship model based on the ship I helped building during my internship. The first 6 years were very much learning and trying to discover which way would take me to my goal: a ship model that would function like the real ship. Normal transmitter systems would be very costy and not really usable for controlling functions like cranes and the lifeboats (6 in total) alongside the propulsion. I decided it would be best to look for alternatives and finally set my mind on the Raspberry Pi, after a laptop controlled Arduino adventure (I actually made a test trial with this setup with a Arduino Nano as translater between the laptop and transceiver).

 

Right now I have a custom made transmitter in progress, though I still need to make things working. The transmitter will have no less than 16 joysticks, a touchscreen and off course an on/off switch. The brain behind it will be my old Raspberry Pi model B. The touchscreen 7" large and will be used to overview the controls, control the on/off switch and to show what the functions of 12 of the 16 joysticks is. Why this last? There will be 2 main propulsion joysticks and 2 for bow thruster control. The remaining 12 joysticks will control a host of functions greater then the 12 can handle. More joysticks will not be practical on the size of the transmitter and using the software I recon I could easily manipulate the command. 

Because of the large amount of analogue joystick inputs (16x2 = 32 inputs in total) I intent to use 4 MCP3008 analogue/ digital converters. This is also my first challenge I can't seem to resolve at the moment. I'm trying to interpret the MCP3008 which I have for some years now, but I get no other readings then 0, even though I do have either a joystick or potmeter attached. Just to be sure the MCP3008 hasn't died yet I will receive 2 new MCP3008's tomorrow. I am using the Adafruit program for MCP3008. Tomorrow I'll upload a photo showing the setup with wiring and the new joysticks and MCP3008's and show a bit what I'm doing so you guys can give good advice on what is going wrong. 

 

Then there is the control of the boat itself. I have decided to use a still to be ordered RPi 4 (since my second Model B has died) as the base and add 4 16 channel PWM modules to control the large amount of servo's. I will also add some MCP23017 16channel I/O expanders to control the large amounts of on/off functions. 

Here in lies my second challenge: I have a 16 channel PWM module from Adafruit, but I never ever got it to work, not even with Adafruits learning tool and it's test tool. Just to be sure I ordered the non HAT version so I can try again starting tomorrow again. 

 

My personal knowledge for programming is very basic, I only understand some things in the codes I get from the internet and use my fathers skills a lot, but my father has no experience in controlling devices with software so we are up to quite a challenge together. I do know some basics in electronics but first and foremost I'm a model builder. I can probably use your knowledge and advice quite a lot during this build.

 

Does anyone already have a thought? I understand I don't give quite a lot yet, which I will make right in the coming days.

 

Thanks in advance.

 

Greetings Josse

 

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
Quote
(@starnovice)
Member
Joined: 5 years ago
Posts: 110
 

I have not had experience with the MCP3008 but I would like to hear more about your transmitter design.

 

Pat Wicker (Portland, OR, USA)


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

Hello guys,

 

Yesterday I realised that the GPIO pins on the RPi could also be broken. Since the other Pi (I bought a set of 2 years ago) has died it might well be that the remaining Pi is at fould too. What do you fokes think? I did get readings of either the highest value (I had the GND and 3,3V mixed up, so 2x 3,3V rather then 3,3V and GND) or 0. Tested the corrected mistake with the spare MCP3008 with only 0 as reading.

I promised some photo's, here are the first few. I realised I need to re-wire because of the due to arrive cobbler cable so more photo's on that later.

Photo 1

The plate with the joysticks is still to be revised, I now have no room for the battery and the main joysticks are too far inwards for my thumbs to reach. Also the on/off switch has to move for the battery.

[IMG] [/IMG]

Photo 2

This is the rear side, this clearly is much work in progress still. The RPi will move to the rear wall behind the screen and the MCP3008's (4 in total) will be placed more conveniently as well. 

[IMG] [/IMG]

Photo 3

And the top lay-out. As said the 2 main joysticks will be moved outwards.

 

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

Hi all,

 

Just to be sure I started thinking that my GPIO pins might also be faulty. I just hooked up my new cobbler cable and tested what wire was what, which resulted in a burning LED. I thereby also managed to figure out which wire was the 3,3V and which the 5V. Does this mean the GPIO's are alright? Or can any GPIO pin be faulty regardless of other GPIO's working correctly?

 

Is there any easy manual on how the wires on the FC-40P are connected? I do know that the wires on both ends are from the same row of GPIO pins, but this means that somewhere along the line there is a change in which wire connects to the 1st row and which to the second. Google didn't help me much yet...

 

Thanks in advance.

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

Hi all,

 

A made myself a new test set-up using my 2 new joysticks, 1 MCP3008 and off course a Pi, and now I got a reading!! The program I run only gives 1 reading but I got a result! Now the next challenge will be to get more readings and then to read from an interface program I started working on quite some time ago now. This interface will be used to control the on/off functions such as various lights. The interface part is finished, now the interface needs to be expanded to actually send commands.

 

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

@coco777

So this is a radio controlled model ship?
How big is it? Can you attach any images to a post?
Maybe you could also control it using a wireless connection to the internet?
Maybe have visual feedback (as with drones) so it is like being on the boat yourself?

 


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

@robotbuilder,

The boat is 1,76m long, about as long as an average man, though I myself am a bit taller then that. 

I have tried posting photo's but apparently, that post is still awaiting moderation, I'll try again here.

Boats 065 (1)

 This is the real ship.

 DSC7413

This is the furthest I came, here with both Arduino and a traditional 4 channel transmitter. This proved not to be such a good combination and I had to ask my father to bring his kayak to get the boat back, but the superstructure had fallen overboard by this time.

DSC 4102

This is where I am now. I started over 6 years ago, partly because the old hull did not have room for the Pi because of the bulkheads I made.

20200530 210934

This is the test setup with which I managed to read the first input! The joysticks and the MCP3008 are brand new.

 

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

Hi all,

 

Here are some screenshots showing my interface. Text is in Dutch since that is my native langauge. There are some texts in English which will in time be replaced by sensor readings showing angle of the main propulsion and engine speeds of the main engines and the bowthruster engines. And there will be a dynamic positioning mode, but this will be added last of all probably since I haven't the slightest clue on how to get this working yet.

Well Enhancer Verlichting

This is the main screen with all navigation related functions. I also need to add a list showing the current functions of each of the 12 multipurpose joysticks.

Well Enhancer Reddingsboten

This is the second screen, used for when sailing with the life boats, which are to be controlled through the ship itself. This because the lifeboats will be so tiny that a long range receiver won't fit and since they will always be close to the ship this seemed to be the most logic choice.

 

Still to be added is a channel selector, I have been thinking about making a potmeter control for this but then I'd either need to add a 5th MCP3008, which goes past the limit on how many SPI interfaces the Pi can handle, or I can't attach 1 of the wires from either of the bowthruster joysticks, but I want to make the transmitter such that a change in software in whatever boat will make it work with a next boat. I could add a up and down button off course.

20200530 101933[1]

This is the transmitter. Still a lot to do, I will make a new plate for the joysticks so the main control joysticks can be moved outwards to make room for the battery and for better ergonomics. The on/off button is also in the way for the battery and will be moved forward or maybe just below the screen, maybe aligned with a potmeter for dimming the backlighting of the screen for sailing at night for example. Also need to make the rear plate to which the Pi will be attached and some cable trays so I can properly lay out the wiring.

 

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 
Posted by: @coco777

I have tried posting photo's but apparently, that post is still awaiting moderation, I'll try again here.

Yes the post is still in the 'moderation' queue as I missed it yesterday, but the photos in it are not showing up.  They are just black blocks.  Are the photos that should appear in that post the exact same photos that appear in the post with the quote I used at at the head of this post?  While I didn't memorize every word of that post is there anything in the post that has not already been re-posted?

I'm going to go ahead and 'approve' then we'll figure out to proceed.

SteveG


   
ReplyQuote
robotBuilder
(@robotbuilder)
Member
Joined: 5 years ago
Posts: 2042
 

One of the posts only has 3 black blocks instead of images.

The next post has images.

Here is a google Dutch to English translation of text on two of the images.

Not sure what souk means.

Unfortunately in this forum printing as you like is not obvious or maybe sometimes, like choice of fonts, is not possible? I don't know how to get it to use fixed-width fonts. In other forums there is usually a control character between two square brackets you can just type in like [code]....[/code]

==================================================================
Well.Enhancer........................Well.Enhancer
Verlichting.Reddingsboten.en.ROV's...Lighting.Lifeboats.and.ROVs
Navigatie.en.signaalverlichting......Navigation.and.signal.lighting

Navigatieverlichting.uit.............Navigation.lights.off
Ankerlicht.uit.......................Anchor.light.off
BB.Panamalicht.uit...................BB.Panama.light.off
Mid.Panamalicht.uit..................Mid.Panama.light.off
Golfslag.BB.uit......................Wave.BB.out
Golfslag.SB.uit......................SB.wave.out
Passerren.BB.uit.....................SB.Compass.out
Passeren.uit.........................Pass.out
Duiker.te.water.uit..................Diver.out.of.the.water
Beperkt.manouvreebaar.uit............Limited.maneuverability
Suezlamp.uit.........................Suez.lamp.off
Helikopter.waarschuwingslamp.uit.....Helicopter.warning.lamp.off

Overige.verlichting..................Other.lighting

Dekverlichting.voor.uit..............Deck.lighting.for.out
Dekverlichting.achter.uit............Rear.deck.lighting
Dek.schijnwerpers.voor.uit...........Cover.spotlights.out.front
Dek.schijnwerpers.achter.uit.........Cover.spotlights.behind
Interieurverlichting.uit.............Interior.lighting.off
Verlichting.brug.uit.................Lighting.out.bridge
Hijskraan.verlichting.uit............Crane.lighting.off
BB.zoeklict.uit......................BB.search.conflict
BB.soeklicht.draaien.................BB.Rotate.souk.light

SB.zoeklicht.uit.....................SB.searchlight.off
SB.soeklicht.draaien.................SB.rotate.souk.light

Verlichting.helidek.uit..............Helideck.lighting.off
===============================

 


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 
Posted by: @robotbuilder

One of the posts only has 3 black blocks instead of images.

So I can't count!  🤣 

SteveG


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

@codecage,

The photo's have indeed been placed in my order posts, the now approved post can be deleted for as far as I'm concerned. 

 

@Robotbuilder,

This is just the interface of the software. In your translation I can see several mis translations but it serves the purpose. These are the various types of navigational and signal lights, stated by there purpose. The Off indicates that the lights are now switched off, upon pressing that changes to on. I think I can upload the source code, maybe you fokes can help find a way to send a command so the lights will actually be turned on. 

Important to know in the programming, I intent to make the transmitter a dumb, code sending device. The Pi in the boat will translate this code into what function it needs to have. The codes should be build up of 2 letters and then 3 numbers, for example AA155, this would mean that servo AA should move to position 155. There will be 2 exceptions to this rule: the 4 propulsion joysticks will send 0A155, 0B155, 0C155 etc. This is so the propulsion can easily be identified at all times and will have no other purpose then controlling the propulsion. The other exception is for the On/Off functions: AAAA1. 

In the command AA155 the first A relates to the input, the second A relates to the setting for this input. The settings can be controlling the cranes (this will be the default setting) or the lifeboats or the ROV's. The fact that the command gives room for as much as 26 different settings makes it possible to go even crazier in the future. 

The above about the commands is something I have been thinking about for a long time, however, my knowledge about programming does not go anywhere near far enough to find a way to make this work in the programming. Any help from you all would be greatly appreciated. This code will be writen in CodeTyphon, embedded in the interface software.

 

My next step will be testing the new PWM module, hopefully I can do this on short notice.

 

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  
Posted by: @coco777

Important to know in the programming, I intent to make the transmitter a dumb, code sending device. The Pi in the boat will translate this code into what function it needs to have. The codes should be build up of 2 letters and then 3 numbers, for example AA155, this would mean that servo AA should move to position 155. There will be 2 exceptions to this rule: the 4 propulsion joysticks will send 0A155, 0B155, 0C155 etc. This is so the propulsion can easily be identified at all times and will have no other purpose then controlling the propulsion. The other exception is for the On/Off functions: AAAA1. 

In the command AA155 the first A relates to the input, the second A relates to the setting for this input. The settings can be controlling the cranes (this will be the default setting) or the lifeboats or the ROV's. The fact that the command gives room for as much as 26 different settings makes it possible to go even crazier in the future. 

The above about the commands is something I have been thinking about for a long time, however, my knowledge about programming does not go anywhere near far enough to find a way to make this work in the programming. Any help from you all would be greatly appreciated. This code will be writen in CodeTyphon, embedded in the interface software.

After giving the above some more thought I figured it might be best to have a Python based program running in the background which will read the joysticks and receive commands from the interface software, but rather a seperate program that also gets activated whenever an interface is being started. This means that this "translater" doesn't need to be modified and will always be up to date. I can then write an interface for every boat that I want to control with this system. This is all for far future, since at this moment I only have this boat and a kit tugboat. 

 

Also, I have found that the angle at which the screen is positioned now faces my chest rather then my eyes, therefore I will also make new sideplates to correct this. Then I found out that 2 joysticks need to have at least say 5mm spacing in between the PCB's so I can move them into eachother. Since the width of the transmitter doesn't provide this room I'm fully back to square 1 in this, but at least I learned from it. For now it serves the purpose of test platform perfectly well, so I'll stick with it until I'm sure the new transmitter will be good straight away.

 

Greetings Josse

 

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@coco777

Just wondering, why not use just and Arduino.  Isn't the RasPi just a bit of overkill?

The other post doesn't have to be deleted, but I can if you say the word.

SteveG


   
ReplyQuote
(@coco777)
Member
Joined: 4 years ago
Posts: 23
Topic starter  

@codecage

I have tried Arduino, but this is quite a complex project. We're talking some 40+ servo functions, some stepper motor controls (steering the ship mainly, possibly also the main crane), controlling 6 lifeboats, 2 ROV's (submersibles, too tiny to have any electronics inside, those will be kept aboard the ship and using a wire the power will be brought to the corresponding engine, and video of possible), control over the 2 fire monitors and random controlled interior lights in over 50 cabins. And let's forget that I want to have the ship keep position automatically, hoping the reach the same accuracy as the real ship, being 16cm (1/2"). That along with at least 2 video feeds (1 from the main crane, 1 from the wheelhouse), but rather even 6 (4 in the wheelhouse, 1 in the main crane, 1 overlooking the rear deck, the view from the wheelhouse to the front most section of this deck is opstructed by the second superstructure housing the dive bells. 

At the time I made the switch I thought off using the Pi as the main brain and have the controls go through no less then 4 Arduino Mega's. Then I found the PWM modules, but it took me years to figure out that does could also be used with Arduino.

After my first attempt and realising that the transmitter could best be controlled by a Pi due to the touchscreen I started learning this language and now I start to find my way in Python and CodeTyphon it seems more convenient to continue with Pi. Also, the boat is so big that large batteries are of no concern, currently I'm making room for a 12V 12A battery, which I think will be enough to sail all day long. The transmitter will have it's own 10A powerbank, commonly used to charge your phone while on the road. It provides precisely the voltage the Pi and the screen need and is very easy to hook up. I only need to combine the power and ground wires through the On/Off button.

 

To cut my story short: it's feels more convenient (also for my father, who has some understanding of Python, not Arduino) and I'm not sure whether or not the Pi will be overkill at all when the boat reaches full potential.

 

My post can be deleted if that's not too much trouble.

 

Greetings Josse

Still working on getting my transmitter to work and trying to get my boats engine's controlled with RPi.


   
ReplyQuote
Page 1 / 3