Documentation
Tools for embedded systems
Loading...
Searching...
No Matches
qlibs::smithPredictor Class Reference

A Smith Predictor implementation for compensating time delays in control systems. More...

#include <ltisys.hpp>

Public Member Functions

virtual ~smithPredictor ()
 
 smithPredictor (ltisys &modelTf, ITransportDelay &mDelay, const real_t initialCondition=0.0_re)
 Constructs a Smith Predictor with a plant model, delay model, and optional initial output estimate.
 
 smithPredictor (ltisys &modelTf, ITransportDelay &mDelay, ltisys &filterTf, const real_t initialCondition=0.0_re)
 Constructs a Smith Predictor with a plant model, delay model, and optional initial output estimate.
 
bool updatePrediction (const real_t ut, const real_t yt) noexcept
 Updates the internal prediction based on control input and measured plant output.
 
real_t getPrediction () const noexcept
 Retrieves the current delay-free predicted output of the system.
 
bool setFilter (ltisys &filterTf) noexcept
 Sets an optional filter for the internal Smith Predictor model.
 

Detailed Description

A Smith Predictor implementation for compensating time delays in control systems.

The Smith Predictor is a model-based feedforward control strategy designed to improve performance in systems with significant dead time. It estimates the delay-free output using an internal model of the process, a delay block, and optionally an output filter model.

Constructor & Destructor Documentation

◆ ~smithPredictor()

virtual qlibs::smithPredictor::~smithPredictor ( )
inlinevirtual

◆ smithPredictor() [1/2]

qlibs::smithPredictor::smithPredictor ( ltisys & modelTf,
ITransportDelay & mDelay,
const real_t initialCondition = 0.0_re )
inline

Constructs a Smith Predictor with a plant model, delay model, and optional initial output estimate.

Parameters
[in]modelTfReference to the LTI system model representing the delay-free plant.
[in]mDelayReference to the transport delay block modeling the plant’s dead time.
[in]initialConditionInitial value for the internal output prediction (yp_hat). Default is 0.0.
Note
Both the model and delay block are passed by reference and stored internally as pointers.

◆ smithPredictor() [2/2]

qlibs::smithPredictor::smithPredictor ( ltisys & modelTf,
ITransportDelay & mDelay,
ltisys & filterTf,
const real_t initialCondition = 0.0_re )
inline

Constructs a Smith Predictor with a plant model, delay model, and optional initial output estimate.

Parameters
[in]modelTfReference to the LTI system model representing the delay-free plant.
[in]mDelayReference to the transport delay block modeling the plant’s dead time.
[in]filterTfReference to the LTI system used as the robustness filter.
[in]initialConditionInitial value for the internal output prediction (yp_hat). Default is 0.0.
Note
Both the model and delay block are passed by reference and stored internally as pointers.

Member Function Documentation

◆ getPrediction()

real_t qlibs::smithPredictor::getPrediction ( ) const
inlinenoexcept

Retrieves the current delay-free predicted output of the system.

Returns
The internally computed predicted output.

◆ setFilter()

bool qlibs::smithPredictor::setFilter ( ltisys & filterTf)
inlinenoexcept

Sets an optional filter for the internal Smith Predictor model.

The filter is used to improve the system's robustness, attenuate measurement noise, and ensure internal stability, particularly in the case of unstable plant dynamics.

Parameters
[in]filterTfReference to the LTI system used as the robustness filter.
Returns
true if the filter was set successfully.
Note
The filter is applied internally to the model-based prediction and does not affect the plant or delay block directly.

◆ updatePrediction()

bool smithPredictor::updatePrediction ( const real_t ut,
const real_t yt )
noexcept

Updates the internal prediction based on control input and measured plant output.

This method should be called at each control step. It updates the internal predicted output by propagating the input through the internal delay-free model and adjusting the prediction using the actual plant output.

Parameters
[in]utThe control input applied to the real plant.
[in]ytThe actual measured output from the delayed plant.
Returns
true if the prediction was successfully updated, false otherwise.
Note
The time-step used to call this function must match the time base used by both the plant model and the delay block.