Marine systems simulation
PIDController.h
1#ifndef __PIDController_H
2#define __PIDController_H
3
10#include <SimObject.h>
11#include <string>
12#include <Eigen/Eigen>
13using namespace Eigen;
14
15
16namespace Ship{
17 class PIDController: public SimObject
18 {
19 public:
20 PIDController(const std::string& simObjectName, ISimObjectCreator* const creator);
21 virtual void OdeFcn(const double T, const double* const X, double* const XDot, const bool bIsMajorTimeStep);
22
23 #ifdef FH_VISUALIZATION
25 virtual void RenderInit(Ogre::Root* const ogreRoot, ISimObjectCreator* const creator){}
26
28 virtual void RenderUpdate(const double T, const double* const X){}
29 #endif
30
31 protected:
32 const double* Out(const double T, const double *const X);
33
34 double Kp,Kd,Ki;
35 double m_ControlValue;
36 ISignalPort* m_InCurrent;
37 ISignalPort* m_InCurrentRate;
38 ISignalPort* m_InDesired;
39 ISignalPort* m_InDesiredRate;
41
43 double m_LastValue;
44 double m_LastTime;
45 };
46}
47#endif
Definition: PIDController.h:18
ISignalPort * m_InCurrentRate
Current position.
Definition: PIDController.h:37
int m_IErrorIntegral
Desired position.
Definition: PIDController.h:40
double m_LastTime
used in numerical differentiation
Definition: PIDController.h:44
double m_CurrentNumericalDerivative
The relative index of the StatePositionErrorSum state in the state array.
Definition: PIDController.h:42
const double * Out(const double T, const double *const X)
returns object derivatives as a function of time, states and input ports
ISignalPort * m_InDesired
Current position.
Definition: PIDController.h:38
virtual void OdeFcn(const double T, const double *const X, double *const XDot, const bool bIsMajorTimeStep)
reads parameters, registers states, input/output ports and shared resources
ISignalPort * m_InDesiredRate
Desired position.
Definition: PIDController.h:39
Simple waypoint object.
Definition: CableAttach.h:16