Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
marine industry
Are you aware of the consequences?
• Most PLC or Microprocessor programs is not possible to verify with even the most
complex and thorough test system or algorithms you can find
• One singel parameter change may cause the vessel to suffer critical damage
Page 3
Facts:
• The number of computer systems on a vessel is today UNKNOWN
• Consequences of a failure of these systems are UNKNOWN
• Computer problem is the increasing source for vessel off-hire
• A 100 dollar PLC may “bring down” a 100 million dollar state-of-the-art vessel
• Most ship owners does not have any clue about the SW and parameters onboard
• Number of parameters may rise to 30-50 000 on a single vessel!
• One faulty parameter may cause a critical accident
• Reset is commonly used as the first attempt to fix a problem
BACKGROUND
Cheap PLC
The price of a microprocessor or a PLC (Programmable
Logic Controller) has now become so low that the traditional
relay logic is rarely used.
The introduction of this programmable relay controller, have
revolutionized the process control industry in terms of
efficiency and cost-effectiveness.
Control tasks, that earlier could take months to design and
connect with relays, can now be downloaded in a PLC and
executed in a few minutes.
Changes in the logic that earlier had to be reconnected during
a process stop, may now be done in full operation with a key
press, even remotely via the Internet.
The number of programmable controllers has exploded in the
past years, and have now become a standard installation in all kind of equipment onboard a modern vessel.
Few or NONE of the ship owners today have the necessary knowledge to fully understand the
consequences of this relatively small design change among the complex products delivered to the
marine industry.
The modern equipment suppliers have got their own Control System
Due to the fact that all equipment manufacturers now have stepped into the control system world, we see an
explosive increase in number of subsystems in a modern vessel.
The reason is that the price level for a PLC with a VDU is extremely low, and relatively easy to implement.
The result is that the yards purchase the equipment, along with a small control system for this component.
We have now seen this for: Diesel engines, Thrusters, Compressors, Switchboards, Separators, Winches,
Motor drives, Boilers etc., and have accepted this, due to the complexity in the control logic, together with
the demand from the supplier to have full control of his own equipment.
Page 5
Each of these systems delivered from different companies with their own PLC and local touch screen.
All these systems were connected to the IACS via a serial line.
The yard often think this is a good idea, as all systems come already commissioned, and the yard doesn’t
need to take any responsibility at all.
As long as the company that delivered this system is available, it will be possible to keep it running. But as
soon as one of these companies disappears, the problems start.
When a PLC has to be replaced, the existing logic has to be present, along with the functional specification
for the plant.
If this is missing, getting this small system up and running after the failure of a cheap PLC can develop into
a big job.
As these units are now used within the vessel’s most important components, the operation of a ship now
become totally dependent of a working PLC.
One small PLC with a cost of $100, may today set the most sophisticated vessel out of operation, by
taking out one component needed for DP2 operation
Page 6
A recent example
A 8 years old OSV had a fully redundant installation and DP2 class.
The two main engines were each controlled of a PLC. One of these PLCs failed, resulting in ME failure. No
spare unit was in store. Nor was it possible to get a unit from the manufacturer, as this unit was not under
production anymore. The owner did not have any application SW nor any tool SW, nor a PC for the job.
The vessel faced a minimum of 4 weeks off hire due to this $200 PLC
The story ended well, out of pure luck. A PLC was found in a remote warehouse in Germany. An old
programmer with an old laptop with the appropriate SW was found.
The final luck was that the type of PLC had a function for SW dump! (Which is pretty rare)
The SW from the opposite ME was downloaded and upload into the replaced unit.
Just PURE LUCK saved the owner form a considerable off hire cost.
This is mainly due to lack of understanding of the complex problems introduced, and the serious
consequences that may be introduced.
It is also a common understanding in the industry, that these changes are “modern” and therefore must be
accepted in order to be an “up to date” and modern customer.
Experienced engineers have been forced to accept all new fashion / modern design, due to the lack of
detailed knowledge, and the fact that everybody else is accepting it.
Page 7
Program Example
PLC details
There are a large variety of PLC types, based on many different techniques, but most of them will contain
some kind of memory layout.
Application SW area
Contains the Software for the specific application EEPROM /
Parameters
RAM
Parameters area
Contains changeable parameters for the application SW
Page 8
All microprocessors must have a program to execute, and this program is stored in a separate storage
media.(Application SW)
There are today a lot of different storage medias available to the market:
- RAM
- ROM
- EPROM
- EEPROM
- FLASH
- Hard Drive
- DVD
- etc
Some of these storage media are dependent of a healthy battery backup in order to keep the program.
Some of the media have a limited lifetime, and will have to be replaced several times during the lifetime of a
modern vessel.
These problems are the reason why programmable solutions require a totally different way of handling from
the supplier to the yard, and finally to the owner.
Page 9
- This is a module used for hydraulic valve control with variable opening.
- This unit contains a CPU, and has a number of parameters that need to be set in
order for the unit to operate correctly.
- These units play an important role in a million dollar crane installation, and
may cause a million dollar damage.
If a unit like this is replaced without a parameter update, the system may work, but crucial safety
functions may be missing. Or it might cause a total change of the function.
It might cause a 400 ton crane to fail in a critical lifting operation, and cause huge damages
It is not common knowledge, but it is a fact that CPU systems have got a number of abilities which may
cause the system to act faulty, and cause failures in the vital components.
Page 10
General
Most CPU systems operate with parameters.
Some systems come with all parameters set from the factory, but often adjusted during commissioning.
Some suppliers always alter these parameters during start-up.
The parameters may be stored in different ways, dependant of the actual CPU system.
Parameter change
In some CPU systems, the supplier has pre-loaded a large range of programs, for a set of products
controlled by this general CPU module.
It might be that one parameter will control if the unit should act as a generator or as a motor.
When the parameter is set to “m” the motor program will be activated, which is totally different from the
generator program.
One small parameter may actually change which part of the program is active. None of the tests performed
during commissioning and sea trials will have any value any more, as the unit is using a different program.
It is therefore essential to keep a parameter list, where all parameters are logged and changes are
documented.
Where a laptop is used to read and write parameters, a parameter file will probably be available.
This file should be stored, and marked with revision, and revision comments.
Also some kind of parameter comparison tool should be available, to check new SW revisions for possible
parameter deviations.
The focus on parameters should be increased, given the possible causes of a change.
One single parameter change, may totally alter the logic in a crucial software of the vessel.
Page 12
It is currently almost impossible to verify that all parameters are correct, or according to the design after sea
trial.
Today, there has not been much focus on these problems, as few are aware of the critical role the parameters
play.
So, when one unit is to be upgraded, it must be done with the same brand, but also with the same model and
firmware version.
In order to upgrade a PLC, you will also need to process the SW, and the tool for uploading the logic.
But the big problem comes, when you are not able to get a spare PLC of the same model.
This is because the models are rapidly changing and replaced, and the older ones become hard to find.
As a newer model may use a different format, the logic from the old PLC, may not be compatible with the
new model, and therefore impossible lo load.
In cases like this the total SW may have to be made from scratch, a job that may take a long time, and
involve extensive testing, and even new classification tests.
This is not the only problem, as the new PLC might not be compatible with any other system it was
communicating with, which may lead to an upgrade of other systems on the vessel as well.
In the worst cases, an upgrade of a small PLC, in a sub system, may lead to a necessary upgrade of the
complete control system on the vessel.
Page 13
When the same function is controlled by a PLC, a total different approach has to be put in place.
Without the PLC logic program it is impossible to fault trace this motor control.
There is no guaranty that this unit will operate according to the specification, as the logic is not present.
In order to debug this unit, the engineer has to be skilled in this type of PLC units, and needs to have the
necessary tools together with the correct uploaded SW version.
Page 14
SOFTWARE TESTING
General
This is unfortunately not the case with a computer based system, which contains timers and combinatory
logic.
A CPU with only some inputs and some program timers can contain more possible combinations than the
total number of atoms in the known universe!
This means that it is not possible to fully test a CPU controlled system, the same way as analog systems
were tested in the old days.
With only one timer running in the system, it is possible for the system to act differently for every tick of
this timer.
So, if a function was tested and found working, it may not work the next second, minute, day, month or
year, depending on the timer’s speed and the influence of this timer in the SW code.
Or, if just one of the signals in the system has a different value, the result may be completely different.
Many ship owners believe that, after an extensive testing during HAT and SAT, and even with HIL all
problems have been detected and that the systems will operate without major bugs after delivery.
They are just hidden, and will only appear at odd situations, and at random times.
HIL Testing
HIL – Hardware In the Loop Testing has been introduced in recent years by third party companies.
The test is performed by connecting a simulator to the control system, and letting the system run, while the
simulator detects the actions and any fault action taken by the control system.
For systems with complicated logic sequences and mathematical algorithms, this is an effective way to test
parts of the system.
Most of the serious suppliers today run the critical code in their own HIL facility, in order to detect the most
obvious failures.
The problem, however, is that there are just a small number of faults in the system that can be
detected with a HIL test!
As the number of combinations in such systems are practically infinite, there may only be a certain amount
of combinations that would cause the system to fail.
Page 15
If a timer is involved and declared as a data type DWord, it may have 32 bit value (4bytes)
10110011100010101111001010110010
This DWord value, is a binary number with 2 32 combinations which is 4 294 967 296.
So a normal timer may result in more than 4 billion different cases in the SW to be checked!
When only one single timer is involved in the logic, the test must be done with all combinations of this
timer.
If the timer value is increased every second, the same value will occur every 136th year.
This means that if this timer is included in a faulty SW logic, the fault may only occur once in the lifetime of
the system, or once some years after the system has been restarted.
To be able to do a test of this system and detect the failure, the system needs to test all combinations
every second in a period of at least 136 years! IMPOSSIBLE
So, with only one single value involved, this will result in so many combinations, that it will not be possible
to test all values.
If you add another 32 bit timer to the system, the number of combinations will increase to 2 64
combinations!
For a system with only 100 AI channels of each 16 bit resolution, the number of combinations will be:
2 (resolution in bit * number of variables) = 2 16 * 100 = 2 1600 or 10 480 combinations !
As a comparison, the total number of atoms in the known universe is assumed to be 10 82
Inside the logic there is a crucial bug, which will cause the generator breakers to disconnect when a 16 bit
timer reaches the value 0, and DG3 is connected to the MSB, with LOAD < 5% (Which sets the LOADED
flag in the system)
The 16 bit timer is using a WORD as the variable, which only have 16 bits binary value, which gives 2 16 =
65535 different combinations.
The timer starts to count from zero when you reset the system.
The value is increased with 1 for every second.
Page 16
In the SW, the programmer have inserted the value for DG3 LOADED instead of the variable
TIE_NOLOAD.
This programing mistake will cause the tie breaker to trip when this timer reaches the FFFF H value, or the
decimal value of 65535, together with the variable DG3_LOADED is not set.
The timer will reach this value after 65535 seconds which is approx. 18 hours and 12 minutes. A word
value, will start from zero after reaching the maximum value FFFF.
This means that this failure only will occur if DG 3 is connected with low load, when this timer reaches
FFFF.
It might take years until this combination occurs, and almost impossible to re-create, as the timer only kick
in every 18th hour.
If the timer have been a 32 bit timer, the same combination would have occurred once every 128 year!
This example is constructed and not likely to be a real case, but it indicates the problems on how to detect all
failures by testing.
In this example there are only two simple comparator elements, reading two integer values each.
The first comparator will give a logical True on the output O6 when the Sea Water temperature have the
same value as the Ships Speed.
The other comparator gives a logical True on the O6 when the time of day is 0, ie the first hour of the day.
The Trigg element converts the positive edge of the output to a single Pulse.
The output of the AND gate will initiate a total shut down of all generators if the Ship Speed equals the
Engine Room Temp in the first second of the day.
Example 3
One example from testing of a Power Management System on a large drill ship may describe the problem
with SW bugs, and how difficult it is to detect.
Some days after delivery from the yard, strange things were detected. A Generator was suddenly started by
the PMS, for no obvious reason. It was not possible to recreate the problem, and the vessel just continued
into operation.
Some months later, the same thing happened.
The problem was detected several times, but with no obvious reason.
Page 17
After further investigation, the crew was able to see that the problems started during fuel transfer.
With this clue, the SW engineers were able to detect a wrong SW connection in the PMS.
The signal for the “DO Transfer pump no 2” was connected where the signal for the “NR3 Heavy Consumer
start request” should have been.
This signal had a tag name like this “651_002_051_XC”
When looking in the SW, it was not easy to discover this programming error, especially since this actual 3rd
heavy request was not in use for this system, but it was in the PMS as a standard feature.
This is why it was not possible to detect any failure during PMS testing, as this actual pump was not
running.
Impossible to find.
The crew will then try to create a similar situation in order to cause the bug to occur again, but without the
knowledge of the special SW connections, it is not possible to recreate.
The crew will desperately hunt for the cause of the blackout, but: WILL NEWER FIND IT !
This type of logic failures in the control system will never be detected in any system test nor in a HIL
test !
Code Reading
One way to increase the SW quality is by code reading.
This method has been used in industries where the consequences of a SW bug have a large economic
impact.
Typically, in aviation and aerospace industry, it is mandatory to do code check of all critical SW in the
systems.
This is often arranged with three individual programmers, not working in a team, but often separately.
One programmer would write the code, and the two others would read the code and check for bugs.
Then they would rotate the responsibilities, as all three would take part in the actual programming job, as
well as the code reading.
Page 18
Programming languages
One of the large problem in the industry is the wide variety of programming languages. Several hundred
standards are in use today.
This line is very difficult to read unless you have long experience and are a trained programmer.
The equivalent for this is:
if (m_gen == 0)
{
ok = true;
}
else if (m_gen == 1)
{
ok = newClusters(Sp);
}
else
{
ok = newSeed(Sp);
}
This is easier to read, but still not easy for a non programmer.
Anyway, reading this language in order to find bugs, is still a complicated task, even for a trained SW
Page 19
Program block
The following programming lines are the program code for the logic of sending the start signal to a
generator engine in a drill ship.
.1:5 = COMP-R(ME2_RPM,IGN_RPM);
.2:20 := SR(AND(ME2_M_START,Not ME2_START_BL,
ME2_MANUAL),OR(ME2_START_FAIL,ME2_LOCAL,ME2_RUNN_C,0,ME2_SD_ALARM,ME2_PRW_ALARM,.1;5));
.8:20 := SR(AND(ME2_A_START,Not ME2_START_BL,
ME2_AUTO),OR(ME2_START_FAIL,ME2_LOCAL,ME2_RUNN_C,ME2_M_STOP,ME2_SD_ALARM,ME2_PRW_ALAR
M,.1;5));
ME2_STARTING := OR(.2:20,.8:20);
The solution is the programming language Function Block Diagram (FBD), a part of the 61131 IEC standard
in use in modern PLC’s.
One of the major problems, is that the SW expert has normally no experience with marine applications, and
probably no sailing time onboard any vessel either.
The necessary knowledge to understand the way a generator should behave is normally missing for a person
with detailed SW understanding.
But with FCB programing any engineer will be able to debug and understand this code when logical names
are used, and the SW is structured in a good way.
In case of programming applications that should be controlled by a non SW skilled person, this code is the
only alternative, and should always be mandatory.
Page 20
Conclusion SW Bugs
• There is no way to test the SW for all kind of bugs.
• Not even a HIL test will detect special programming bugs.
• Some bugs may be hidden in the system for months or even years before they appear, and even then
might do so only once in the lifetime of the vessel.
• The actual programming language used by the supplier is important for the ability to read the code.
• FBD should be used in important logic where code reading is necessary.
• SW generation tools have to be utilized, to prevent manual punching mistakes.
• Qualified programmers with a suitable quality system are required.
• An independent code check of all important programs is required.
• Simulator and HIL tools* must be used.
* Suppliers normally have the ability to connect the system to an own HIL simulator, which should be
required during FAT, as the third party service sometimes are too expensive compared to the benefit of
the service.
The oil industry, which has more economic and technical resources with detailed computer knowledge, has
identified this problem decades ago.
This industry has taken steps to avoid many of the consequences in the change of the basic design technique
for control systems.
But specifications developed to gain the highest operation availability in critical installations, have
unfortunately a substantial cost impact for the installed systems, and are therefore not considered in the
marine industry.
Page 21
General
In the coming years this problem will erupt all over the marine industry, and add substantial maintenance
costs to the vessel operation budgets, as well as increasing penalties due to downtime.
The only solution is that the ship owners start to take a stand, and make specifications and requirements that
will ensure reliable and durable systems, that can be operated and maintained in a safe manner, with respect
to SW and parameters.
* Stochastic calculations: used to calculate the risk of an accident with many variables
There are ways to improve the availability, to minimize the consequences of a failure, and the to limit the
system downtime.
In the end the system will have to be SIL classified in order to increase the availability towards 100%, but
this adds a considerable cost to the systems.
Actions
All ship owners should be aware of the consequences of using microprocessor based control systems, and
how to take the necessary steps in order to increase the SW quality, as well as the risk of maintenance issues
during the life time of the vessel.
For new building, the ship owner should state special concern for the installation of any PLC that are not
part of the IACS.
Page 22
In such cases there should still be some basic requirements before the PLC is accepted.
1. Require the installed SW to be supplied with the vessel
2. Require the SW logic to be shown for a third party check
3. Require the necessary programming tools to be supplied
4. Require a SW revision log to be supplied along with the system.
5. Require skilled SW engineers to do the modifications with an indicated reason.
6. Require information on the parameters and the changes done. (Parameter DB-LOG)
7. Require information of any battery installed, and the maintenance intervals
Revision Handling
It is extremely important that the SW version is identified, and that any spare unit has the latest SW version
installed.
It is also important to have a log onboard, listing the different SW versions installed during service, together
with the information on the nature of the modification.
It should be mandatory to log all SW modifications, for ALL programmable devices onboard!
The number of subsystems is increasing rapidly and increases the need for basic rules.
Program Revisions
Due to the fact that computer Programs change and need modification for different installations, and
upgrades due to bugs, all these Programs should have a version number.
Today, there are no yard/owner requirement for suppliers to keep them updated on these SW versions, nor
any owner requirement to report the discovered bugs and the remedies performed to cope with them.
In the requirement from the classification societies, there are a number of rules for the way of handling the
SW revisions, but none of them are currently required from the yard or the owners.
This leads to a total lack of any system keeping track of the SW versions on board a vessel.
In the future this database should be online, in order to also detect parameters being changed due to a battery
backup fault, a mistyping, or a faulty copy from another vessel.
Logging
Without signal logging, it is almost impossible to find the cause of an event after incidents caused by a
PLC.
The control system installed should have the ability to log all signals in the system with at least one sample
per second.
In addition Events should be generated for all Digital inputs and Digital output signals, with a minimum of
500 ms resolution.
If the control system is also equipped with a “playback” (GMR100 @HMA trademark) facility, the crew
will be much better equipped to track down any SW bugs in the IACS, or in any of the subsystems which
will probably be connected.
General
After several installations with these problems, some larger oil companies introduced a total limitation of
operator interfaces in the control room.
• All systems should be interfaced through the one selected system supplier selected for the total
installation.
• All computer control systems used in any installation on board have to come from the same brand
(such as SIEMENS, ABB, OMRON, etc)
• All programs used in the system should be delivered to the owner
• Protocols to sub systems should be limited to Modbus, NMEA and Profibus
• Suppliers with proprietary HW should be avoided.
(The used HW should be available from the shelf from independent suppliers)
This requirements limited the total use of one control system on board the installations.
This new requirement also introduced additional costs, as a lot of suppliers of complicated mechanical
packages already have standardized in using a different type of PLC's. All these suppliers, were then forced
to remove this PLC from the package before delivery. Some of these control systems were pretty
complicated, and the new program made in the standard PLC had to be made once more in a different
programming language.
Page 24
All “sub units” or “sub systems” is to be controlled by dedicated I/O signals, and all logic is to
be implemented in the IACS. No local logic will be accepted without approval.
This requirement will only limit the yard to deliver one type of operator interface, but will still open for the
use of any type of control computers in the sub systems.
For a ship owner it will also be difficult to require all suppliers to remove the standard PLC, as a lot of them
have chosen one for the package supplied.
On the other hand, if no requirements are made, the use of cheap PLC's will grow into all kind of equipment
on board, and the owner will be left with a huge number of problems during the life time of the vessel.
Programming tools
If the delivered PLC requires a special programming tool, or cable, this should be supplied together with the
spare parts. The tool is probably also made for a certain operating system like
DOS, Widows3.11 / 95/ 98 /NT/2000/XP/7 Linus, Unix CPM, etc.
The problem, is that these programs do not run on newer versions of the operating system!
Some programming tools, still requires a PC running MS-DOS!
And then the PC must also in some cases be old enough, as newer PC’s will be too fast for the SW.
Nowadays, PC manufacturers do not make HW that is backwards compatible, that means that it may be
difficult to purchase a suitable PC for an older Windows version.
This means that all different systems requiring a SW upload or SW parameter tool, would require one PC
dedicated solely to this use.
Page 25
The yard will be responsible for limiting the number of PLC's on board the vessel.
Only large installations may have a PLC installed, such as:
• Diesel Engines
• Thrusters
• Drives
• or components with a certain number of alarm points > 200
• No COMMON alarm should be accepted, as this introduces problems with multiple alarms
All PLC's installed should be of the same brand, as selected for the Integrated Alarm System.
No PLC's from a different brand should be supplied in any package without the approval of the
owner.
If a different PLC is supplied, several details have to be supplied with the unit.
(Unit list)
This document have been issued in order to inform the ship owners of the consequences of the
microprocessor revolution in the marine industry.
We do not claim to have the solution to this problem, as the price consequences for implementing the ideal
solution is enormous.
But by following some simple steps, the it is possible to get a better view of the installed systems, and the
maintenance of the systems in the future.