FlightGear
next
FGPID.h
Go to the documentation of this file.
1
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3
Header: FGPID.h
4
Author: Jon Berndt
5
Date started: 6/17/2006
6
7
------------- Copyright (C) 2006 by Jon S. Berndt, jon@jsbsim.org -------------
8
9
This program is free software; you can redistribute it and/or modify it under
10
the terms of the GNU Lesser General Public License as published by the Free
11
Software Foundation; either version 2 of the License, or (at your option) any
12
later version.
13
14
This program is distributed in the hope that it will be useful, but WITHOUT
15
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17
details.
18
19
You should have received a copy of the GNU Lesser General Public License along
20
with this program; if not, write to the Free Software Foundation, Inc., 59
21
Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23
Further information about the GNU Lesser General Public License can also be
24
found on the world wide web at http://www.gnu.org.
25
26
HISTORY
27
--------------------------------------------------------------------------------
28
Initial Code 6/17/2006 JSB
29
30
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31
SENTRY
32
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33
34
#ifndef FGPID_H
35
#define FGPID_H
36
37
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38
INCLUDES
39
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
40
41
#include "
FGFCSComponent.h
"
42
43
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44
FORWARD DECLARATIONS
45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46
47
namespace
JSBSim
{
48
49
class
FGFCS
;
50
class
Element
;
51
class
FGParameter
;
52
53
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
54
CLASS DOCUMENTATION
55
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
56
120
121
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
122
CLASS DECLARATION
123
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
124
125
class
FGPID
:
public
FGFCSComponent
126
{
127
public
:
128
FGPID
(
FGFCS
*
fcs
,
Element
* element);
129
~FGPID
();
130
131
bool
Run
(
void
)
override
;
132
void
ResetPastStates
(
void
)
override
;
133
135
enum
eIntegrateType
{
eNone
= 0,
eRectEuler
,
eTrapezoidal
,
eAdamsBashforth2
,
136
eAdamsBashforth3
};
137
138
void
SetInitialOutput
(
double
val) {
139
I_out_total = val;
140
Output
= val;
141
}
142
143
private
:
144
double
I_out_total;
145
double
Input_prev, Input_prev2;
146
147
bool
IsStandard;
148
149
eIntegrateType
IntType;
150
151
FGParameter
*Kp, *Ki, *Kd, *Trigger, *ProcessVariableDot;
152
153
void
bind(
Element
* el)
override
;
154
void
Debug(
int
from)
override
;
155
};
156
}
157
#endif
FGFCSComponent.h
JSBSim::Element
Definition
FGXMLElement.h:143
JSBSim::FGFCSComponent::FGFCSComponent
FGFCSComponent(FGFCS *fcs, Element *el)
Constructor.
Definition
FGFCSComponent.cpp:52
JSBSim::FGFCSComponent::Output
double Output
Definition
FGFCSComponent.h:111
JSBSim::FGFCSComponent::fcs
FGFCS * fcs
Definition
FGFCSComponent.h:101
JSBSim::FGFCS
Definition
FGFCS.h:188
JSBSim::FGPID::SetInitialOutput
void SetInitialOutput(double val)
Definition
FGPID.h:138
JSBSim::FGPID::ResetPastStates
void ResetPastStates(void) override
Definition
FGPID.cpp:143
JSBSim::FGPID::~FGPID
~FGPID()
Definition
FGPID.cpp:131
JSBSim::FGPID::eIntegrateType
eIntegrateType
These define the indices use to select the various integrators.
Definition
FGPID.h:135
JSBSim::FGPID::eAdamsBashforth3
@ eAdamsBashforth3
Definition
FGPID.h:136
JSBSim::FGPID::eNone
@ eNone
Definition
FGPID.h:135
JSBSim::FGPID::eRectEuler
@ eRectEuler
Definition
FGPID.h:135
JSBSim::FGPID::eTrapezoidal
@ eTrapezoidal
Definition
FGPID.h:135
JSBSim::FGPID::eAdamsBashforth2
@ eAdamsBashforth2
Definition
FGPID.h:135
JSBSim::FGPID::Run
bool Run(void) override
Definition
FGPID.cpp:152
JSBSim::FGPID::FGPID
FGPID(FGFCS *fcs, Element *element)
Definition
FGPID.cpp:49
JSBSim::FGParameter
Represents various types of parameters.
Definition
FGParameter.h:59
JSBSim
Definition
FGFDMExec.cpp:67
src
FDM
JSBSim
models
flight_control
FGPID.h
Generated on Tue Jun 3 2025 12:58:38 for FlightGear by
1.13.2