• 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
    • CDP Linux
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

  • Framework - Equipment
  • GearLifeBySpeedAndTorqueMath
  • 5.1.0

GearLifeBySpeedAndTorqueMath Class

(Equipment::GearLifeBySpeedAndTorqueMath)

Estimates remaining gear life from torque and speed samples. More...

Header: #include <GearLifeBySpeedAndTorqueMath>
Inherits: CustomMetricMath
  • List of all members, including inherited members

Public Functions

GearLifeBySpeedAndTorqueMath()

Reimplemented Public Functions

virtual void Consume(const std::vector<MetricEvent> &events) override
virtual void Create(const char *shortName, CDPBaseObject *parent) override
virtual void Destroy() override
virtual void FinishWindow() override
virtual void InitDone() override
virtual void Initialize(int measureType, const std::vector<MetricChannelSpec> &channels, const MetricOptions &opts, IMetricPropertyFactory &factory, const MetricCallbacks &callbacks) override
virtual void StartWindow(uint64_t fromTs, uint64_t toTs) override
  • 4 public functions inherited from CustomMetricMath
  • 50 public functions inherited from CDPBaseObject
  • 5 public functions inherited from MetricMathBase
  • 30 public functions inherited from CDP::StudioAPI::CDPNode
  • 5 public functions inherited from IMetricMath
  • 25 public functions inherited from CDP::StudioAPI::ICDPNode

Additional Inherited Members

  • 1 static public member inherited from CustomMetricMath
  • 1 static public member inherited from CDPBaseObject
  • 10 protected functions inherited from MetricMathBase
  • 1 protected function inherited from CDP::StudioAPI::CDPNode
  • 10 protected variables inherited from CDPBaseObject
  • 10 protected variables inherited from MetricMathBase

Detailed Description

Estimates remaining gear life from torque and speed samples.

This custom metric math integrates consumed equivalent life based on a torque/speed dependent damage rate:

  • Torque is Measure[0], speed is Measure[1].
  • T* = 0 when |T| < TorqueIgnoreThreshold, otherwise T* = |T|.
  • DamageRatePerSecond = (T* / NominalTorque)^WohlerExponent * (|n| / NominalSpeed) (units: 1/s)
  • ConsumedLifeHours += DamageRatePerSecond * Δt / 3600
  • RemainingLifeHours = max(0, NominalLifetimeHours - ConsumedLifeHours)

For window diagnostics it also computes a Wöhler exponent based equivalent torque:

  • EquivalentTorque = (Σ(|T|^m * Δt) / Σ(Δt))^(1/m)
  • LogTorqueThreshold = 0.5 * EquivalentTorque

When LoggingFlags include S (EverySample), this math requests sink flushes only when |T| >= LogTorqueThreshold.

Model attributes

NameDescription
NominalTorqueNominal torque (same unit as input torque).
NominalSpeedNominal speed (same unit as input speed).
WohlerExponentWöhler exponent (fatigue sensitivity).
NominalLifetimeHoursNominal lifetime in hours.
TorqueIgnoreThresholdTorques with |T| below this threshold are ignored.

Outputs

PropertyDescription
RemainingLifeHoursRemaining useful life in hours.
ConsumedLifeHoursAccumulated equivalent life consumed in hours (saved).
DamageRatePerSecondCurrent damage rate (1/s).
EquivalentTorqueDamage-equivalent torque over the current window.
LogTorqueThresholdLogging threshold (0.5 * EquivalentTorque).

Member Function Documentation

GearLifeBySpeedAndTorqueMath::GearLifeBySpeedAndTorqueMath()

Default constructs an instance of GearLifeBySpeedAndTorqueMath.

[override virtual] void GearLifeBySpeedAndTorqueMath::Consume(const std::vector<MetricEvent> &events)

Reimplemented from IMetricMath::Consume().

[override virtual] void GearLifeBySpeedAndTorqueMath::Create(const char *shortName, CDPBaseObject *parent)

Reimplemented from CDPBaseObject::Create().

[override virtual] void GearLifeBySpeedAndTorqueMath::Destroy()

Reimplemented from CDPBaseObject::Destroy().

[override virtual] void GearLifeBySpeedAndTorqueMath::FinishWindow()

Reimplemented from IMetricMath::FinishWindow().

[override virtual] void GearLifeBySpeedAndTorqueMath::InitDone()

Reimplemented from IMetricMath::InitDone().

[override virtual] void GearLifeBySpeedAndTorqueMath::Initialize(int measureType, const std::vector<MetricChannelSpec> &channels, const MetricOptions &opts, IMetricPropertyFactory &factory, const MetricCallbacks &callbacks)

Reimplemented from IMetricMath::Initialize().

[override virtual] void GearLifeBySpeedAndTorqueMath::StartWindow(uint64_t fromTs, uint64_t toTs)

Reimplemented from IMetricMath::StartWindow().

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 2026 CDP Technologies. Privacy and cookie policy.

Return to top