Author: Jon Berndt
Date started: 21 February 2007
- ------------- Copyright (C) 2006 Jon S. Berndt (jsb@hal-pc.org) -------------
+ ------------- Copyright (C) 2006 Jon S. Berndt (jon@jsbsim.org) -------------
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free Software
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGFCSComponent.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_ACTUATOR "$Id$"
+#define ID_ACTUATOR "$Id: FGActuator.h,v 1.13 2012/04/08 15:04:41 jberndt Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
applied to the actuator. In order of application to the input signal,
these are:
- -System lag (input lag, really)
- -Rate limiting
- -Deadband
- -Hysteresis (mechanical hysteresis)
- -Bias (mechanical bias)
- -Position limiting ("hard stops")
+ - System lag (input lag, really)
+ - Rate limiting
+ - Deadband
+ - Hysteresis (mechanical hysteresis)
+ - Bias (mechanical bias)
+ - Position limiting ("hard stops")
There are also several malfunctions that can be applied to the actuator
by setting a property to true or false (or 1 or 0).
Syntax:
@code
-<actuator name=\94name\94>
+<actuator name="name">
<input> {[-]property} </input>
<lag> number </lag>
- <rate_limit> number <rate_limit>
+ <rate_limit> number </rate_limit>
<bias> number </bias>
<deadband_width> number </deadband_width>
<hysteresis_width> number </hysteresis_width>
Example:
@code
-<actuator name=\94fcs/gimbal_pitch_position\94>
+<actuator name="fcs/gimbal_pitch_position_radians">
<input> fcs/gimbal_pitch_command </input>
<lag> 60 </lag>
- <rate_limit> 0.085 <rate_limit> <!-- 5 degrees/sec -->
+ <rate_limit> 0.085 </rate_limit> <!-- 0.085 radians/sec -->
<bias> 0.002 </bias>
<deadband_width> 0.002 </deadband_width>
<hysteresis_width> 0.05 </hysteresis_width>
- <clipto> <!-- +/- 10 degrees -->
+ <clipto> <!-- +/- 0.17 radians -->
<min> -0.17 </min>
<max> 0.17 </max>
</clipto>
@endcode
@author Jon S. Berndt
-@version $Revision$
+@version $Revision: 1.13 $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/** This function fails the actuator to zero. The motion to zero
will flow through the lag, hysteresis, and rate limiting
functions if those are activated. */
- inline void SetFailZero(bool set) {fail_zero = set;}
- inline void SetFailHardover(bool set) {fail_hardover = set;}
- inline void SetFailStuck(bool set) {fail_stuck = set;}
-
- inline bool GetFailZero(void) const {return fail_zero;}
- inline bool GetFailHardover(void) const {return fail_hardover;}
- inline bool GetFailStuck(void) const {return fail_stuck;}
+ void SetFailZero(bool set) {fail_zero = set;}
+ void SetFailHardover(bool set) {fail_hardover = set;}
+ void SetFailStuck(bool set) {fail_stuck = set;}
+
+ bool GetFailZero(void) const {return fail_zero;}
+ bool GetFailHardover(void) const {return fail_hardover;}
+ bool GetFailStuck(void) const {return fail_stuck;}
+ bool IsSaturated(void) const {return saturated;}
private:
- double dt;
double span;
double bias;
double rate_limit;
bool fail_zero;
bool fail_hardover;
bool fail_stuck;
+ bool initialized;
+ bool saturated;
void Hysteresis(void);
void Lag(void);