diff --git a/src/FDM/LaRCsim/c172_aero.c b/src/FDM/LaRCsim/c172_aero.c index 0adafd05d..d6f390c76 100644 --- a/src/FDM/LaRCsim/c172_aero.c +++ b/src/FDM/LaRCsim/c172_aero.c @@ -262,10 +262,11 @@ void aero( SCALAR dt, int Initialize ) { { - if((Flap_handle != lastFlapHandle) && (dt > 0)) + if((Flap_handle != lastFlapHandle) && (dt > 0)) { Flaps_In_Transit=1; - else if(dt <= 0) + } else if(dt <= 0) { Flap_Position=Flap_handle; + } lastFlapHandle=Flap_handle; if((Flaps_In_Transit) && (dt > 0)) diff --git a/src/FDM/LaRCsim/c172_gear.c b/src/FDM/LaRCsim/c172_gear.c index b95aec32e..11a2b3bdd 100644 --- a/src/FDM/LaRCsim/c172_gear.c +++ b/src/FDM/LaRCsim/c172_gear.c @@ -36,6 +36,9 @@ $Header$ $Log$ +Revision 1.10 1999/11/03 16:46:24 curt +Patches from Tony to enable brakes. + Revision 1.9 1999/11/01 18:17:16 curt c172 updates from Tony. Fix extra yaw when using ailerons. Flaps and elevator tweaks. @@ -196,7 +199,7 @@ char rcsid[] = "$Id$"; * Put aircraft specific executable code here */ - percent_brake[1] = 0.; /* replace with cockpit brake handle connection code */ + percent_brake[1] = Brake_pct; /* replace with cockpit brake handle connection code */ percent_brake[2] = percent_brake[1]; caster_angle_rad[0] = 0.03*Rudder_pedal; diff --git a/src/FDM/LaRCsim/c172_main.c b/src/FDM/LaRCsim/c172_main.c index 6813fa0ad..4c874958f 100644 --- a/src/FDM/LaRCsim/c172_main.c +++ b/src/FDM/LaRCsim/c172_main.c @@ -201,6 +201,7 @@ int main(int argc, char *argv[]) { SCALAR *control[7]; SCALAR *state[7]; float old_state,effectiveness,tol,delta_state,lctrim; + float newcm,lastcm,cmalpha; if(argc < 6) { @@ -232,19 +233,23 @@ int main(int argc, char *argv[]) { printf("\nLong_control: %g\n\n",Long_control); - IC.altitude=1000; - setIC(IC); - ls_loop(0.0,-1); - IC.flap_handle=10; - setIC(IC); - ls_loop(0.0,-1); - IC.flap_handle=20; - setIC(IC); - ls_loop(0.0,-1); - IC.flap_handle=30; - setIC(IC); - ls_loop(0.0,-1); - + IC.cg=0.155; + IC.alpha=-5; + setIC(IC);ls_loop(0.0,-1); + newcm=CLwbh*(IC.cg - 0.557); + lastcm=newcm; + out=fopen("cmcl.out","w"); + while(IC.alpha < 22) + { + IC.alpha+=1; + setIC(IC);ls_loop(0.0,-1); + newcm=CLwbh*(IC.cg - 0.557); + cmalpha=newcm-lastcm; + printf("alpha: %4.0f, CL: %5.2f, Cm: %5.2f, Cma: %7.4f\n",Alpha*RAD_TO_DEG,CLwbh,newcm,cmalpha); + fprintf(out,"%g %g\n",newcm,CLwbh); + lastcm=newcm; + } + fclose(out); /* find_trim_stall(200,out,IC); IC.vc=120;