PIControllerBasic Class Reference

#include <PIController.h>

+ Inheritance diagram for PIControllerBasic:

Public Member Functions

 PIControllerBasic ()=default
 
 PIControllerBasic (Mdouble pGain, Mdouble iGain)
 
void set (Mdouble pGain, Mdouble iGain)
 
void reset ()
 
Mdouble apply (Mdouble error, Mdouble timeStep)
 
double getIError () const
 

Private Attributes

Mdouble pGain_ = 0.0
 
Mdouble iGain_ = 0.0
 
Mdouble iError_ = 0.0
 

Constructor & Destructor Documentation

◆ PIControllerBasic() [1/2]

PIControllerBasic::PIControllerBasic ( )
default

◆ PIControllerBasic() [2/2]

PIControllerBasic::PIControllerBasic ( Mdouble  pGain,
Mdouble  iGain 
)
inline
35 : pGain_(pGain), iGain_(iGain) {}
Mdouble iGain_
Definition: PIController.h:27
Mdouble pGain_
Definition: PIController.h:25

Member Function Documentation

◆ apply()

Mdouble PIControllerBasic::apply ( Mdouble  error,
Mdouble  timeStep 
)

Applies a PI-controller, strain = pGain * error + iGain * interror, with the integrated stress interror += error * timeStep

Parameters
error= (stress-stressGoal)
timeStep
Returns
strain
25  {
26  // Proportional Controller
27  Mdouble pController = pGain_ * error;
28 
29  //Integral Controller
30  iError_ += iGain_ * timeStep * error;
31 
32  // Controller Command
33  return pController + iError_;
34 }
double Mdouble
Definition: GeneralDefine.h:13
Mdouble iError_
Definition: PIController.h:29
int error
Definition: calibrate.py:297

References calibrate::error, iError_, iGain_, and pGain_.

Referenced by PIController::apply().

◆ getIError()

double PIControllerBasic::getIError ( ) const
inline
43 { return iError_; }

References iError_.

◆ reset()

void PIControllerBasic::reset ( )
36  {
37  iError_ = 0;
38 }

References iError_.

Referenced by PIController::reset().

◆ set()

void PIControllerBasic::set ( Mdouble  pGain,
Mdouble  iGain 
)
12 {
13  this->pGain_ = pGain;
14  this->iGain_ = iGain;
15  //logger(INFO,"Set PI controller with pGain %, iGain %", pGain, iGain);
16 }

References iGain_, and pGain_.

Referenced by StressStrainControlBoundary::set().

Member Data Documentation

◆ iError_

Mdouble PIControllerBasic::iError_ = 0.0
private

Referenced by apply(), getIError(), and reset().

◆ iGain_

Mdouble PIControllerBasic::iGain_ = 0.0
private

Referenced by apply(), and set().

◆ pGain_

Mdouble PIControllerBasic::pGain_ = 0.0
private

Referenced by apply(), and set().


The documentation for this class was generated from the following files: