1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
4 Author: Tony Peden, for flight control system authored by Jon S. Berndt
7 ------------- Copyright (C) Anthony K. Peden -------------
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
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
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.
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.
27 --------------------------------------------------------------------------------
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41 # include <simgear/compiler.h>
42 # ifdef SG_HAVE_STD_INCLUDES
52 #include "FGFCSComponent.h"
53 #include <input_output/FGXMLElement.h>
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
59 #define ID_FLAPS "$Id$"
61 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
63 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
67 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
69 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
71 /** Encapsulates a kinematic (mechanical) component for the flight control system.
72 This component models the action of a moving effector, such as an aerosurface or
73 other mechanized entity such as a landing gear strut for the purpose of effecting
74 vehicle control or configuration. The form of the component specification is:
77 <kinematic name="Gear Control">
78 <input> [-]property </input>
81 <position> number </position>
87 <min> {[-]property name | value} </min>
88 <max> {[-]property name | value} </max>
90 [<gain> {property name | value} </gain>]
91 [<output> {property} </output>]
95 The detent is the position that the component takes, and the lag is the time it
96 takes to get to that position from an adjacent setting. For example:
99 <kinematic name="Gear Control">
100 <input>gear/gear-cmd-norm</input>
103 <position>0</position>
107 <position>1</position>
111 <output>gear/gear-pos-norm</output>
115 In this case, it takes 5 seconds to get to a 1 setting. As this is a software
116 mechanization of a servo-actuator, there should be an output specified.
119 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
121 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
123 class FGKinemat : public FGFCSComponent {
126 @param fcs A reference to the current flight control system.
127 @param element reference to the current configuration file node.
129 FGKinemat(FGFCS* fcs, Element* element);
134 /** Kinematic component output value.
135 @return the current output of the kinematic object on the range of [0,1]. */
136 double GetOutputPct() const { return OutputPct; }
138 /** Run method, overrides FGModel::Run().
139 @return false on success, true on failure.
140 The routine doing the work. */
144 vector<double> Detents;
145 vector<double> TransitionTimes;
150 void Debug(int from);