JSBSim Flight Dynamics Model  1.0 (02 March 2017)
An Open Source Flight Dynamics and Control Software Library in C++
FGActuator.h
1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 
3  Header: FGActuator.h
4  Author: Jon Berndt
5  Date started: 21 February 2007
6 
7  ------------- Copyright (C) 2006 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 Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  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 with
20  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21  Place - Suite 330, Boston, MA 02111-1307, USA.
22 
23  Further information about the GNU Lesser General Public License can also be found on
24  the world wide web at http://www.gnu.org.
25 
26 HISTORY
27 --------------------------------------------------------------------------------
28 
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30 SENTRY
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
32 
33 #ifndef FGACTUATOR_H
34 #define FGACTUATOR_H
35 
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37 INCLUDES
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39 
40 #include "FGFCSComponent.h"
41 
42 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 DEFINITIONS
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
45 
46 #define ID_ACTUATOR "$Id: FGActuator.h,v 1.20 2015/02/27 20:36:47 bcoconni Exp $"
47 
48 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
49 FORWARD DECLARATIONS
50 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
51 
52 namespace JSBSim {
53 
54 class FGFCS;
55 
56 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 CLASS DOCUMENTATION
58 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
59 
125 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
126 CLASS DECLARATION
127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
128 
130 {
131 public:
133  FGActuator(FGFCS* fcs, Element* element);
135  ~FGActuator();
136 
140  bool Run (void);
141  void ResetPastStates(void);
142 
143  // these may need to have the bool argument replaced with a double
147  void SetFailZero(bool set) {fail_zero = set;}
148  void SetFailHardover(bool set) {fail_hardover = set;}
149  void SetFailStuck(bool set) {fail_stuck = set;}
150 
151  bool GetFailZero(void) const {return fail_zero;}
152  bool GetFailHardover(void) const {return fail_hardover;}
153  bool GetFailStuck(void) const {return fail_stuck;}
154  bool IsSaturated(void) const {return saturated;}
155 
156 private:
157  //double span;
158  double bias;
159  FGParameter* rate_limit_incr;
160  FGParameter* rate_limit_decr;
161  double hysteresis_width;
162  double deadband_width;
163  double lag;
164  double ca; // lag filter coefficient "a"
165  double cb; // lag filter coefficient "b"
166  double PreviousOutput;
167  double PreviousHystOutput;
168  double PreviousRateLimOutput;
169  double PreviousLagInput;
170  double PreviousLagOutput;
171  bool fail_zero;
172  bool fail_hardover;
173  bool fail_stuck;
174  bool initialized;
175  bool saturated;
176 
177  void Hysteresis(void);
178  void Lag(void);
179  void RateLimit(void);
180  void Deadband(void);
181  void Bias(void);
182 
183  void bind(void);
184 
185  void Debug(int from);
186 };
187 }
188 #endif
~FGActuator()
Destructor.
Definition: FGActuator.cpp:134
void SetFailZero(bool set)
This function fails the actuator to zero.
Definition: FGActuator.h:147
Represents various types of parameters.
Definition: FGParameter.h:63
Encapsulates an Actuator component for the flight control system.
Definition: FGActuator.h:129
bool Run(void)
This function processes the input.
Definition: FGActuator.cpp:155
Encapsulates the Flight Control System (FCS) functionality.
Definition: FGFCS.h:193
Base class for JSBSim Flight Control System Components.
FGActuator(FGFCS *fcs, Element *element)
Constructor.
Definition: FGActuator.cpp:59