• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • Maritime HMIs
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Examples and Tutorials
  • Redundant Control System Example

Redundancy in Automation System Using SQL Database in C++ Object

Redundant Control System Example

Introduction

The purpose of this example is to demonstrate how a redundancy framework can be used to create a redundant control system easily. Redundancy is crucial for mission-critical systems to ensure that the control system as a whole does not lose its function when some parts of the system fail.

Project Overview

The example is very similar to the other example with the main difference, that in this example the single-application system is split into multiple separate applications, to add redundancy:

  • ControllerA and ControllerB - two identical redundant controllers whose purpose is to control the crane motion while compensating the ship's movements.
  • ControllerUI - a user interface for the crane controllers.
  • HWSimulator - hardware simulator application that simulates the crane and moving platform movement sensors.

The Crane Model and HWSimulator Application

The crane model consists of several key components: a base tower, a boom, and a moving platform. The base tower can rotate freely around its joint axis. The boom is connected to the base and includes a sliding telescope, while a lifting cylinder allows the boom to raise and lower. At the end of the boom telescope is a carriage, which can be rotated by motors along three axes, enabling the carriage to be oriented in any direction. The entire crane is mounted on a moving platform (like a ship).

The HWSimulator application is a simple non-code-created simulation application that simulates this crane model motors and winches and also moving platform movement sensors so that we could monitor and visualize the crane motion without the need to have an actual physical crane or actual physical ship motion reference unit.

ControllerUI Application

The ControllerUI application is a simple user interface for the crane controller. It allows to set and move the crane carriage to any position and orientation and also to inspect the currently active controller and its motors state. It can also be used to adjust the ship movement simulator parameters.

Redundant controllers

The ControllerA and ControllerB applications are identical controllers that control the crane motion while compensating the ship movements. These applications are configured as redundant controller pairs so that when one of the controllers fails, the other controller can immediately take over the control of the crane.

The ControllerB was created as a clone of a ControllerA using the CDP Studio Cloning Existing Applications feature. This means that ControllerB is a Clone of ControllerA and therefore needs no manual configuration in the future. When the controller applications need configuration changes, only ControllerA has to be changed. The CDP Studio Update From Source feature can be used to apply those changes to ControllerB. For more details, refer to the CDP Studio Configure Mode manual Cloning Existing Applications.

Rendandancy Blocks

To make the crane controller failure-resistant, some Redundancy Blocks have been added to the system.

First, ControllerA and ControllerB both have an RDSynchronizer block that takes care of synchronizing the internal state from the current leader controller to follower controller.

As the DHChain model used by controllers is quite stateless there is not much to synchronize between the controllers. There are still some stateful objects in the DHChain, like the PID regulator Integral parts used in the CalculatedDSpeed and CalculatedThetaSpeed outputs of the controller. These cumulated integral values are also synchronized from the leader to the follower controller via RDSynchronizer blocks, to make sure that both controller's PID regulators are in the same state at the moment of the controller failover.

For reliable leader election, ControllerA and ControllerB, along with all other applications, include an RDSelector block responsible for selecting the application to act as the leader. These blocks are identically configured across all applications, with the RDAppList property set to "ControllerA;ControllerB". This configuration ensures that every RDSelector block in the system points to the same elected leader controller at any given time via the LeaderIndex property.

How to Run the Example

To run the example from CDP Studio, open Welcome mode and find it under Examples. Next, in Configure mode right-click on the system project and select Run & Connect. See the Running the Example Project tutorial for more information.

Testing the redundancy

To test the redundancy in action, the redundant controllers should be stopped and re-started one by one while inspecting the crane motion at the same time.

For that, after starting the system, switch to DHChain Visualizer in the CDP Studio, by selecting the HWSimulator.CraneVisualizer component and then switching to the DHChain Visualizer tab. In cases when some links are not fully visible you may need to click on the Fit in view button .

While leaving the DHChain Visualizer visible, switch to the ControllerUI, and instruct the crane to go and hold some position , despite the base platform movements.

To simulate the controller failure, right-click on the currently active controller (like ControllerA) in CDP Studio Project tree and select Stop from the context menu. You can inspect from the UI current leader indicator how the redundant running controller immediately becomes the leader and takes over the control of the crane so that crane motion compensation is not disturbed.

To simulate the failed controller recovery, first, disconnect from the system and then right-click on the controller name (like ControllerA) in CDP Studio Project tree and select Start from the context menu. After that, inspect that the re-started controller will not take over the control and is rather acting now as a follower, thus ready to take over the control again when the other controller fails (or is stopped).

You can repeat the above steps similarly to simulate the other controller failure and its recovery.

Note: Understandably, running this example on the local machine is for example and testing purposes only. For actual hardware failure protection, the redundant controllers should be configured to run on separate hardware.

For More Information

For more information about the Redundancy framework used in this example see the Redundancy framework documentation.

For more information about how the Kinematics framework was used to create the crane controller, see the documentation in the original example and also the Kinematics framework documentation.

Redundancy in Automation System Using SQL Database in C++ Object

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2025 CDP Technologies. Privacy and cookie policy.

Return to top