PLCs In Boats

The friendliest place on the web for anyone who enjoys boating.
If you have answers, please help by responding to the unanswered posts.
Joined
Jan 27, 2013
Messages
10,429
Location
USA
This thread is to continue a discussion about using PLCs (Programmable Logic Controllers) in boats that started elsewhere as a side discussion. The relevant posts have been moved here so the discussion can continue without distracting from the other thread.



@twistedtree - I may be following in your footsteps yet! I'm interested in how the Modbus stuff is going, otherwise I'll be heading more towards the DIY and home assistant for both control and monitoring if I ever throw Maretron (definitely not impossible!)
The Modbus stuff is actually working quite well. I primarily use it for power monitoring and control, and it does that very well. I also export some data on N2k for display on N2KView for convenience. Programming PLCs and HMIs is positively stone-age, along the lines of 1980 BASIC programming. But programs are inherently pretty simple, so it works, and that's the best part. You turn it on, and a few years later it's still running just like the day you turned it on. I've had no issues at all with modbus compatibility, either with wired Modbus or Modbus/TCP.

Because it's so reliable and well proven, I'm comfortable using PLCs, modbus, etc for controlling stuff on the boat, where I'm not comfortable using N2K for that. So my PLC/Modbus system monitors all my AC power sources (shore cords and generators), detects power and automatically connects the load panels (inverter, non-inverter, and HVAC loads), automatically controls the isolation transformer boost switch for dealing with 208 vs 240V shore power, and my new favorite - automatically adjusts the VIctron Inverter input load limit based on the capacity of the power source, and what other loads are connected. So the only manual operation is to plug/unplug shore cords, and start/stop generators, and the system does all the rest, assuming I have it in Auto mode. It can all be controlled manually too. And it even does generator autostart when the batteries drop below a set point. It's nice to know that I can leave the boat and if the shore power fails, the inverter will keep everything running. And if the batteries get low, the generator will recharge them. And when shore power is restored, everything will switch back. I know a lot of people don't like automation, but for me it comes down to on simple question. Is it reliable? Automation that works is awesome, and automation that doesn't work sucks. So far this all works.
 
Last edited by a moderator:
The Modbus stuff is actually working quite well. I primarily use it for power monitoring and control, and it does that very well. I also export some data on N2k for display on N2KView for convenience. Programming PLCs and HMIs is positively stone-age, along the lines of 1980 BASIC programming. But programs are inherently pretty simple, so it works, and that's the best part. You turn it on, and a few years later it's still running just like the day you turned it on. I've had no issues at all with modbus compatibility, either with wired Modbus or Modbus/TCP.

Because it's so reliable and well proven, I'm comfortable using PLCs, modbus, etc for controlling stuff on the boat, where I'm not comfortable using N2K for that. So my PLC/Modbus system monitors all my AC power sources (shore cords and generators), detects power and automatically connects the load panels (inverter, non-inverter, and HVAC loads), automatically controls the isolation transformer boost switch for dealing with 208 vs 240V shore power, and my new favorite - automatically adjusts the VIctron Inverter input load limit based on the capacity of the power source, and what other loads are connected. So the only manual operation is to plug/unplug shore cords, and start/stop generators, and the system does all the rest, assuming I have it in Auto mode. It can all be controlled manually too. And it even does generator autostart when the batteries drop below a set point. It's nice to know that I can leave the boat and if the shore power fails, the inverter will keep everything running. And if the batteries get low, the generator will recharge them. And when shore power is restored, everything will switch back. I know a lot of people don't like automation, but for me it comes down to on simple question. Is it reliable? Automation that works is awesome, and automation that doesn't work sucks. So far this all works.
Wow! People probably do not realize the complexity of what you just described.

Which PLC is your preferance?
Are you coding the PLC by hand or using a GUI?

This is really interesting. I've worked in automation engineering in the electrical industry on RTU's and Protective Relays, but never PLC's, but would like to learn. What you are doing sounds like a bunch of fun!
 
Wow! People probably do not realize the complexity of what you just described.

Which PLC is your preferance?
Are you coding the PLC by hand or using a GUI?

This is really interesting. I've worked in automation engineering in the electrical industry on RTU's and Protective Relays, but never PLC's, but would like to learn. What you are doing sounds like a bunch of fun!
I has been fun, and I think they are a really good match for larger boats. Really big boats use them extensively, as does all manner of industrial process control and manufacturing, with a huge eco system behind it all.

I am using IDEC PLCs, but it's not because of some extensive, or really any comparison or study. I looked inside and ABT hydraulics control box and saw and IDEC PLC. And I looked inside a Delta-T ventilation control box and saw an IDEC PLC. And I think I saw one somewhere else on a bigger boat, so that's what I used.

They have a whole program development suite for PLC programming, and for Display (HMI) programming. It's better than nothing, but stone-age compared to C or C++ with a good development environment.

With your background in generators, you know the importance of never connecting two power sources at the same time (excluding fancier systems that synchronize and parallel power sources). I ended up with a dual protection against that which I think is pretty robust. All my connections are via contactors controlled by the PLC, so it's critical that only the right ones are active at any time.

First protection is just the PLC logic that only allows a single power source at a time.

Second protection is via aux contacts on each contactor that feed inputs on the PLC. The aux contacts all close before the main contactor closes, and open after the main opens. As a result it gives a certain indication of the contactors actual state.

So while the PLC is commanding contactors to be open or closed, it is separately monitoring to ensure that all contactors are actually in the state that is being commanded. If there is ever a discrepancy, everything opens and it throws an error saying what was in conflict. So if a contactor is stuck, or if you go and manual press the activation button, all contactors will open before the other one closes.
 
Thanks very much!!! It might be a fun hobby to take up and keep the brain sharp.
 
I’m still doing industrial control work but am trying to spool back a little so I can have more free time.
There are many brands of plcs that will be dead reliable for this type of system. We’re currently using Siemens, omron, and some offerings from automation direct.
It’s the software packages that make this either affordable or not. The bigger brand names charge a huge amount for the programming software so aren’t really aimed at a one off project.
But, if you want a pretty modern software package at low cost, look at the brx series from automation direct. The software is free. The plc has the usual compliment of discrete, analog, and specialty modules, plus, you can get built in Ethernet capacity depending on the cpu you choose. Couple that with their c-more micro hmi and you’re up and running with little to no software cost. I’ve been buying their products for decades after Siemens dropped some of the legacy products as they continued to support them.
 
...

With your background in generators, you know the importance of never connecting two power sources at the same time (excluding fancier systems that synchronize and parallel power sources). I ended up with a dual protection against that which I think is pretty robust. All my connections are via contactors controlled by the PLC, so it's critical that only the right ones are active at any time.

First protection is just the PLC logic that only allows a single power source at a time.

Second protection is via aux contacts on each contactor that feed inputs on the PLC. The aux contacts all close before the main contactor closes, and open after the main opens. As a result it gives a certain indication of the contactors actual state.

So while the PLC is commanding contactors to be open or closed, it is separately monitoring to ensure that all contactors are actually in the state that is being commanded. If there is ever a discrepancy, everything opens and it throws an error saying what was in conflict. So if a contactor is stuck, or if you go and manual press the activation button, all contactors will open before the other one closes.
I'm curious???

You are running the Aux contacts into the PLC and checking those contacts as a verification of open or closed before closing in on a power source...

Great design!

Have you ever considered running your closing coil currents through the aux contacts of the other energy source contactors? Or with the number of sources is this impractical?

Also... Are you using mechanically, or electrically held contactors for your energy sources? If you are using mechanically held, what are you using???
 
Every time I dig into the complex realm of code writing and custom component integration I find it rewarding to get right, but completely mysterious a year later when some battery dies or component needs updating and I have to relearn the whole thing again. For stuff as relatively simple as bilge pump management, I find good old mechanical switches and counters more reliable from year to year.
 
I'm curious???

You are running the Aux contacts into the PLC and checking those contacts as a verification of open or closed before closing in on a power source...
Yes, exactly. It's not 100% fool proof, I'm sure, but a lot has to go wrong to get two contactors in the wrong position.
Great design!

Have you ever considered running your closing coil currents through the aux contacts of the other energy source contactors? Or with the number of sources is this impractical?
In theory you could, and for a simpler setup it's probably a better way to do it. But the logic for connections in this setup would make it crazy complicated. For example, I have an "Auto" mode for each load panel where it will automatically connect to a "best" power source, if available. This makes boat operation super simple - just plug in a cord, or start a generator, and everything connects automatically. It would be super complicated to do that with a bunch of NO & NC contacts, if possible at all. On the other hand, it's a perfect application for a program.
Also... Are you using mechanically, or electrically held contactors for your energy sources? If you are using mechanically held, what are you using???
They are all electrically held. So, for example, if you lose power to the PLC, everything opens, which I think is a good safety measure. No contactor can close without explicit PLC action. Actually, that's not entirely true since the contactors have buttons you can press to manually close them, which is a key reason to have the interlock logic to detect that and open everything else if someone were to do that.
 
One of the reason that PLC programming appears "stone age" is that it is a DSP type programming task. That is, real time, with guaranteed execution times around an endless loop. With higher level programming constructs, execution times are often unpredictable, and cannot be guaranteed. My experience with them is in CNC machine tools, no doubt a more demanding application than a boat, but the concepts are the same.
 
Yes, the concepts are similar, but even if you looked at every input on every scan, as well as the analog inputs (that many times have separate processors), you’d never see a lag in performance on a boat application.
 
I want to thank the moderators for extracting out the posts to get this thread started.

Thanks
 
The "stone age" stuff that I'm thinking of are basic structured programming concepts. This may be unique to the IDEC stuff, because I have no experience with any of the other players in the space.

For example, in place of register values, which are the computer equivalent of fixed memory addresses, you can have a "tag" which is a symbolic name. That's great. So instead of D0000, I can call it "InputAmps". But it's just a name in place of D0000. If I change "InputAmps" to be D1000, all the code continues to use D0000 rather changing it to D1000. This is a major impediment to code portability.

There is also no type definition, casting, or checking. So there is no way to say that InputAmps is a 16 bit integer, 32 bit integer, floating point, etc. And no way to then warn if it's being used improperly in code. This makes it really easy to have code inadvertently step on other data because it's acting on the wrong data type. Historically I think this was one of the most common sources of bugs, and is virtually eliminated by strong type checking.

I really miss the little things like these from modern programming languages, which have been in place for 40 years.
 
Thinking about it, I like the idea that all sources fail open.
I am curious...
If the PLC fails do you have a emergency way to close in on a source, and have it stay closed in?
for example if you have a push button to manually operate a contactor, does it stay closed when you release the button?
 
Thinking about PLC's does anybody have any experience with the automation direct PLC?

How is the software? IE how high level is it? I remember maybe a decade and a half ago, playing with a PLC but it seemed to me that I had to manually write subroutines to for example smooth out the readings from a thermocouple. Is that still the case or are those kind of things built in at this point?

Sorry if this sounds basic, but my background is in Protective Relays and RTU's which were at a fairly high level. For example we could automatically apply a debounce timer to a digital input, or averaging to a analog source to filter out short term transients.

Another for example, is we used boolean algebra to define the status of either a variable or a digital output. Can you do this with a PLC or is it at a lower level.
 
Last edited:
Thinking about it, I like the idea that all sources fail open.
I think it's probably safer, but there are always good arguments both ways.

Thinking about it more, there is bit more to it. If I reboot the PLC, as happens every time I update the software, I have it set up to retain all the current variables and output states. It's optional - you can configure the PLC to either retain, or clear everything on restart - but I did it so when I'm working on some new feature and downloading new stuff constantly, I'm not blinking the lights every times. But I think it implies that if the PLC were to crash, it wold leave everything in its current state. But the PLC has a watchdog timer, and will restart if it hangs, so I think it's OK the way I have it.

And worst case, everything is protected by breakers, so even if two conflicting contactors operated, it's not the end of the world.

I am curious...
If the PLC fails do you have a emergency way to close in on a source, and have it stay closed in?
for example if you have a push button to manually operate a contactor, does it stay closed when you release the button?

Maybe. I'm using ABB contactors, and as mentioned they have a mechanical button that you can push to close the contactor, but you need to hold it against a spring or it will release. I think I saw reference to a device that can be inserted to hold the manual button down, but that was back when I was first selecting parts, and I haven't come across it again, though I haven't really gone looking either. ABB's product line is so massive that it can be a challenge to find stuff, and figure out if it's compatible or not.

So right now, in the event of a total failure, I would have to hot wire one or more contactors, either on the 24V coil side, or the outputs. I also carry a spare PLC, and have two displays running so have redundancy there all the time.
 
Thinking about PLC's does anybody have any experience with the automation direct PLC?
I don't, but cost-wise they are very appealing. I think someone earlier said they have used them, and hopefully they will chime in.
How is the software? IE how high level is it? I remember maybe a decade and a half ago, playing with a PLC but it seemed to me that I had to manually write subroutines to for example smooth out the readings from a thermocouple. Is that still the case or are those kind of things built in at this point?
Again, I can't speak to the AD products, but the IDEC stuff has various smoothing and debounce builtin and configurable. That said, I have still put timers on a handful of things. For example, I have to see SOC before the bottom threshold for something like a minute before I act on it to start a generator. And I have programmed some hysteresis around shore power voltage levels before switching the boost/noboost relay that deals with 208V shore power.
Sorry if this sounds basic, but my background is in Protective Relays and RTU's which were at a fairly high level. For example we could automatically apply a debounce timer to a digital input, or averaging to a analog source to filter out short term transients.

Another for example, is we used boolean algebra to define the status of either a variable or a digital output. Can you do this with a PLC or is it at a lower level.

Yes, this can be done with ladder logic which just models physical relays in a variety of different ways. So, for example, I have a single line of "code" that only activates a contactor if it is requested, and if no conflicting contactors show as closed.
 
PLCs in a boat are a bit like having N2K or a Maretron system in a boat. Once you have the basic infrastructure, it's easy and low cost to add stuff. Here are some examples.

We have talked extensively in other threads about 208/240V boosting for isolation transformers. An isolation transformer that can be wired for either 208V or 240V input costs about $1700 for 14kva (50A). But the same transformer packaged up with some crap to make boosting automatic turns into a $10,000 transformer. With the PLC, I was able to add a $100 contactor to my $1700 isolation transformer, and with a dozen or two lines of code, have the same automatic boosting feature that's in those $10,000 devices.

I also added a timed fuel transfer function. The fuel valves need to be set up in advance, but with the push of a button on the display, it will run the transfer pump for 10 minutes and move 30 gal of fuel. Yes, there is some risk with this, and I would never impose it on someone else, but my fuel valving is real straight forward, so I'm comfortable with it. It lets me transfer fuel to the day tank from teh pilot house while underway, which is handy. But most importantly, I can remotely move slugs of 30 gal to the day tank remotely. My day tank won't hold enough fuel to run the heating system for more than a month or so in the winter. With this I can add fuel and keep it going. I would argue that this is more reliable than having someone unfamiliar with the boat go aboard to transfer fuel.

The PLC also sends me an email anytime a generator is stopped or started, including what triggered the action. Plus it sends a general status report every 6 hours, so I can keep tabs on what's happening on board. No subscriptions or cloud services. It just uses the internet connection that's always active.
 
I have a ton of experience with the automation direct plcs.
I mentioned earlier, if you want to try something fairly modern, look at the brx line. The programming software is free. There’s more functionality than you’ll ever need for any boat project.
I have one of these running a glue application system where we monitor and control temperature of each component, flow of the components are set, then monitored with flow sensors and adjusted in real time to maintain proper ratio. There’s a pair of load cells on the tanks that maintains the fill level and we monitor tank fill to compare against flow rate as a doublecheck for pump performance. There are built in pid loops for tuning each process. Built in Ethernet capacity too. Lots to like for little cost.
 
For multiple power sources you might want to look at reversing contactors. They are mechanically unable to close together. If you add a time delay to energization, maybe 1-2 seconds you are even better off.

While automation has a place, I prefer the KISS principle. You could wire everything to remote I/O and then bring it back to one controller, but now you will need someone who can troubleshoot to fix it. I have zero issues with PLC reliability now days. They are pretty robust.

The usual problem is the device being controlled. Pumps quit, lights burn out, wires corrode. Then add electrolysis.

But when working automation is a thing of beauty.
 
I think that an automation enabled system should be a implemented when doing the wiring and selecting devices. It’s harder to retrofit a system that’s been designed conventionally.
If doing a scratch install, you put in the i/o capability to monitor current draw on those critical devices like pumps, so you can get an alert if you go out of parameter. Same with critical lighting.
Pretty handy.
 
i used plc for more then 15 years, and they renew and get more advance then the first. They are still made and used in new project
Now they still can work on there own but can also connect to internet, you have the digital I/O but also analog, temp sensor modules and display modules, alle made to last a long time an made to extend the systems.

Just a introduction .
I was a process developer in the chemical/electronic industrie.
I use the siemens logo system first its not so costly, you can use it for a lot, and i have the latest official programmable software (i program them for the last 14 years)
On my boat hey have the following functions :
1. monitoring the motor exhaust tube temperature with pt100
2. monitoring the service bat capacity and (if selected) start/stop the generator at the selected time slot (so they not conflict with the solar mppts).
3. control the bilg pumps and if they run to long phone me with a warning, if they run at critical time keep phoning till some anser or connect to the port security with prerecorded messages.
4. control timing for the side gang lights.
5. give a warning for refill check of the service battery (all on screen)
6. give a warning or phone if the 220v service get off line (for the coolers)
just making it safe and better control when not on board.
the pic are from my latest control panel and setting to program and do the initial testing.
 

Attachments

  • Afbeelding van WhatsApp op 2024-04-10 om 15.20.58_37041500.jpg
    Afbeelding van WhatsApp op 2024-04-10 om 15.20.58_37041500.jpg
    176.1 KB · Views: 21
  • Afbeelding van WhatsApp op 2024-04-09 om 16.04.25_e613416a.jpg
    Afbeelding van WhatsApp op 2024-04-09 om 16.04.25_e613416a.jpg
    149.5 KB · Views: 22
  • plc-setup.jpg
    plc-setup.jpg
    165.7 KB · Views: 20
  • 198.jpg
    198.jpg
    71.9 KB · Views: 21
I am running 4 kincony controllers which essentially I am just using for their tuya interface. They were relatively affordable and seem fairly well designed.
 
i used plc for more then 15 years, and they renew and get more advance then the first. They are still made and used in new project
Now they still can work on there own but can also connect to internet, you have the digital I/O but also analog, temp sensor modules and display modules, alle made to last a long time an made to extend the systems.

Just a introduction .
I was a process developer in the chemical/electronic industrie.
I use the siemens logo system first its not so costly, you can use it for a lot, and i have the latest official programmable software (i program them for the last 14 years)
On my boat hey have the following functions :
1. monitoring the motor exhaust tube temperature with pt100
2. monitoring the service bat capacity and (if selected) start/stop the generator at the selected time slot (so they not conflict with the solar mppts).
3. control the bilg pumps and if they run to long phone me with a warning, if they run at critical time keep phoning till some anser or connect to the port security with prerecorded messages.
4. control timing for the side gang lights.
5. give a warning for refill check of the service battery (all on screen)
6. give a warning or phone if the 220v service get off line (for the coolers)
just making it safe and better control when not on board.
the pic are from my latest control panel and setting to program and do the initial testing.
Using them for bilge pumps, and for propane control, seems like a great idea.
 
automated bilge pump are great, but if they run for a short while and you are not looking then you cannot see when they stoped. the plc measure the running time and give a alarm when they runnig to long. the bilgpump switch panel i changed, i put a flaching red led in each with a relais that stay on until you put the bilg pump off. simple and it stay on flaching after the bilge pump had turn on
 

Latest posts

Back
Top Bottom