dynamic positioning conference october 13-14, 2015 …€¦ · write readable and testable code....

35
DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 DESIGN 2 Software Management of a Real-time, Critical System Ivar-Andé Ihle Rolls Royce Marine AS

Upload: others

Post on 23-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

DYNAMIC POSITIONING CONFERENCEOctober 13-14, 2015

DESIGN 2

Software Management of a Real-time, Critical System

Ivar-Andé IhleRolls Royce Marine AS

Page 2: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software management of a real-time, critical system

DYNAMIC POSITIONING CONFERENCEOctober 13-14, 2015

Page 3: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software on board 2

Work systems

Propulsors and thrusters

Deck Machinery

Rudders and steering gears and control systems

Switchboards &power distribution

Engines, machinery and fuel systems

Cargo and tank systems

Dynamic Positioning

Ship Automation

Integrated Navigation System (INS)

Auxiliary (bridge) Equipment

Joystick control

Track pilot

Data logging & monitoring

Data logging & monitoring

Remote thruster control

Remote steering control

Remote Access

Page 4: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Introduction

Analog PID (electrical)

Software PIDprevious_error = 0 integral = 0 start:

error = setpoint - measured_valueintegral = integral + error*dtderivative = (error - previous_error)/dtoutput = Kp*error + Ki*integral + Kd* derivative previous_error = error wait(dt) goto start

Op-amp integrator circuit:

Page 5: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Introduction & Motivation

Software - an important vessel component

Software management for DP during development

Share practices and experiences

Promote discussion about best practice

Page 6: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Industrial standards

DNV-GL Integrated Software Dependent Systems

ABS Integrated Software Quality Management

MTS TECHOP on Software testing

Page 7: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software life cycle management

Page 8: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Rolls-Royce Product Management

Page 9: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software challenges

Multiple developers

Continuous development phase

Testing

Safety management

Version control

Page 10: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

The challenge with codeprevious_error = 0 integral = 0 start:

error = setpoint - measured_valueintegral = integral + error*dtd= (error - previous_error)/dtoutput = Kp*error + Ki*integral + Kd* dprevious_error = error wait(dt) goto start

previous_error = 0 integral = 0 axyz = 10; speed = input > 5 //testing onlystart:

error = setpoint - measured_value*0.3048integral = integral + error*dtd= (error - previous_error)/dt//intgrl = max(integral, axyz) //Check thisintgrl = integral/2 // For vessel alfaif (speed)

output = Ki*integral + Kd*d;else

output = Kp*error + Ki* intgrl + Kd* d previous_error = error wait(dt) goto start

Page 11: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Lessons

General code base

Organize software structure

Write readable and testable code

Test extensively. Test early

Verify all inputs.

Focus on the final product

Consider robustness early.

Design for usability

Keep track of execution time.

Track issues

Transparent development phase

Page 12: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

How?

Page 13: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Requirements

Class rulesBusiness requirementsCustomer inputs

Find actual problem and operator needAnalyze problem => find actual needDP operators interview

Page 14: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Requirements: Usability

Technical coffe pot specification:• Isolating handle• Cover to keep content warm• Precision spout

Page 15: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Icon DP software

Page 16: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

General code base

General interfaces.Generic modules

Vessel-specific parameters

Configuration files

Page 17: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

GUI Design Principles 16

«Less is more»Pixel perfectConsistent User Interaction Operational flexibilityModern

Page 18: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Common-look-and-feel

Page 19: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software code

Understand pros and cons of code languages

Integrated Development Environment (IDE):- What works best for your needs?

TestingLinkingDebuggingBuildingCode analysisRefactoringAutocompletion

Page 20: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Mars Climate Orbiter193 million USDDisintegrated in the atmosphere.Altitude miscalculation

Mix of US and SI units.

Readable Code base

Coding guidelines

Descriptive file names and methodsSingle responsibility

SI units in code.

Page 21: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Code: floating point numbersAriane 5 steeering failure:Convert sideways velocity from 64-bit to 16-bit format.

Redundant controllers.Similar failure.

Self-destruct before disintegration

Rocket and four (uninsured) researchsatelites lost

Page 22: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Robust code

Numerical robustness

Code robustness – input validation

if m>epsilona = F/m

thrust = saturate(cmdThrust, minThrust, maxThrust)

while(…){… }

functionA(waypointFile){ok = areWaypointsOK(waypointFile)if ok {

followWaypoints(waypointFile)} }

Page 23: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Product documentation

Page 24: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Development tools: issue tracking

Page 25: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Development organization

Transparent development phaseUnderstand personal contribution

Page 26: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Development organization

Distributed development: communication is important

Cooperation is recommended.

Programming in pairs.

Test-driven programming.

Page 27: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Testing during development

Page 28: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Simulator driven development and testing

Internal ”Hardware-in-the-loop” testing

Simulated environment

Failure mode simulations

Page 29: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Unit testing

Test software functions and componentsRuns at compilation time Independent of user inputsConsistent test scopeRepeatableNo additional effort

if{…}else{…}

Page 30: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Module test

Extensive testing of a larger software moduleAutomatically or manualLarger variation of user inputsDifferent interactionsUser interactive

Page 31: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

System tests

Fully assembled systemVerify advanced featuresTest interfacesVerify sub-systems and external suppliersRealistic input handling

Page 32: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software version control

Software is a dynamic product

Continuous design, development, updates and deployment

Source code management: retrieve earlier versions

Software is never modified on specific installations.

Page 33: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Software safety managementReported safety concern

Safety alert report

Safety hazard report

Demonstrate safety

Communicatedinternally

Communicatedexternally

Investigation and analysis

Implementation plans

Page 34: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Conclusions and lessons learned

Software safety depends on implementation and following establishedstandards

Transparent software development process

Organize software structures and product

Readable, testable and flexible software

Trace issues

Page 35: DYNAMIC POSITIONING CONFERENCE October 13-14, 2015 …€¦ · Write readable and testable code. Test extensively. Test early. Verify all inputs. Focus on the final product. Consider

Q & A