Make sure delta_u_n and u_n are always explicitely initialized.
This commit is contained in:
parent
a5f9927727
commit
ea39c09192
1 changed files with 8 additions and 8 deletions
|
@ -196,14 +196,14 @@ FGPIDController::FGPIDController( SGPropertyNode *node ):
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void FGPIDController::update( double dt ) {
|
void FGPIDController::update( double dt ) {
|
||||||
double ep_n; // proportional error with reference weighing
|
double ep_n; // proportional error with reference weighing
|
||||||
double e_n; // error
|
double e_n; // error
|
||||||
double ed_n; // derivative error
|
double ed_n; // derivative error
|
||||||
double edf_n; // derivative error filter
|
double edf_n; // derivative error filter
|
||||||
double Tf; // filter time
|
double Tf; // filter time
|
||||||
double delta_u_n; // incremental output
|
double delta_u_n = 0.0; // incremental output
|
||||||
double u_n; // absolute output
|
double u_n = 0.0; // absolute output
|
||||||
double Ts = dt; // Sampling interval (sec)
|
double Ts = dt; // Sampling interval (sec)
|
||||||
|
|
||||||
if ( Ts <= 0.0 ) {
|
if ( Ts <= 0.0 ) {
|
||||||
// do nothing if time step is not positive (i.e. no time has
|
// do nothing if time step is not positive (i.e. no time has
|
||||||
|
|
Loading…
Add table
Reference in a new issue