ep_n_1( 0.0 ),
edf_n_1( 0.0 ),
edf_n_2( 0.0 ),
- u_n_1( 0.0 )
+ u_n_1( 0.0 ),
+ r_scale( 1.0 ),
+ y_scale( 1.0 )
{
int i;
for ( i = 0; i < node->nChildren(); ++i ) {
if ( prop != NULL ) {
input_prop = fgGetNode( prop->getStringValue(), true );
}
+ prop = child->getChild( "scale" );
+ if ( prop != NULL ) {
+ y_scale = prop->getDoubleValue();
+ }
} else if ( cname == "reference" ) {
SGPropertyNode *prop = child->getChild( "prop" );
if ( prop != NULL ) {
r_n = prop->getDoubleValue();
}
}
+ prop = child->getChild( "scale" );
+ if ( prop != NULL ) {
+ r_scale = prop->getDoubleValue();
+ }
} else if ( cname == "output" ) {
int i = 0;
SGPropertyNode *prop;
double y_n = 0.0;
if ( input_prop != NULL ) {
- y_n = input_prop->getDoubleValue();
+ y_n = input_prop->getDoubleValue() * y_scale;
}
double r_n = 0.0;
if ( r_n_prop != NULL ) {
- r_n = r_n_prop->getDoubleValue();
+ r_n = r_n_prop->getDoubleValue() * r_scale;
} else {
r_n = r_n_value;
}
y_n( 0.0 ),
r_n( 0.0 ),
u_min( 0.0 ),
- u_max( 0.0 )
+ u_max( 0.0 ),
+ y_scale( 1.0 ),
+ r_scale ( 1.0 )
{
int i;
for ( i = 0; i < node->nChildren(); ++i ) {
if ( prop != NULL ) {
input_prop = fgGetNode( prop->getStringValue(), true );
}
+ prop = child->getChild( "scale" );
+ if ( prop != NULL ) {
+ y_scale = prop->getDoubleValue();
+ }
} else if ( cname == "reference" ) {
SGPropertyNode *prop = child->getChild( "prop" );
if ( prop != NULL ) {
r_n = prop->getDoubleValue();
}
}
+ prop = child->getChild( "scale" );
+ if ( prop != NULL ) {
+ r_scale = prop->getDoubleValue();
+ }
} else if ( cname == "output" ) {
int i = 0;
SGPropertyNode *prop;
if ( debug ) cout << "Updating " << name << endl;
double input = 0.0;
if ( input_prop != NULL ) {
- input = input_prop->getDoubleValue();
+ input = input_prop->getDoubleValue() * y_scale;
}
double r_n = 0.0;
if ( r_n_prop != NULL ) {
- r_n = r_n_prop->getDoubleValue();
+ r_n = r_n_prop->getDoubleValue() * r_scale;
} else {
r_n = r_n_value;
}
// Input values
double y_n; // measured process value
double r_n; // reference (set point) value
+ double y_scale; // scale process input from property system
+ double r_scale; // scale reference input from property system
// Configuration values
double Kp; // proportional gain
// Input values
double y_n; // measured process value
double r_n; // reference (set point) value
+ double y_scale; // scale process input from property system
+ double r_scale; // scale reference input from property system
double u_min; // Minimum output clamp
double u_max; // Maximum output clamp