From: Aaron S. <air...@gm...> - 2005-08-31 21:40:03
|
Hi, I want to implement an airspeed hold autopilot. The autopilot needs to=20 calculate the airspeed error first. But I don't know which property (i.e.,= =20 true airspeed) should be used to calculate the airspeed error=20 (=3Dairspeed_setpoint - true_airspeed). Could someone tell me? A related question is: Should the output of the "airspeed hold autopilot" b= e=20 ap/elevator_cmd or fcs/throttle-cmd-norm? A third question is: How to make the aircraft fly a glide slope either=20 through a script or an autopilot? Thanks a lot! |
From: Ron F. <ron...@at...> - 2005-09-01 13:53:21
|
----- Original Message ----- From: Aaron Simpson To: jsb...@li... Sent: Wednesday, August 31, 2005 4:39 PM Subject: [Jsbsim-devel] Airspeed hold autopilot and flying a glide slope >Hi, >I want to implement an airspeed hold autopilot. The autopilot needs to >calculate the airspeed error first. But I don't know which property (i.e., >true airspeed) should be used to calculate the airspeed error >(=airspeed_setpoint - true_airspeed). Could someone tell me? As Tony said, 'CAS' is probably best. Though real AC typically only have the IAS reading for speed. 'EAS' is virtually 'CAS' at prop AC speeds, and proportional to sqrt (qbar). However, Jets climb at a certain IAS, which drops relative to EAS at higher FL's. Generally IAS is close to CAS at jet climb, cruise, and descent speeds. Above a certain flight level, jets switch to Mach Hold for speed. A typical climb schedule is 300 kts IAS, switching to Mach 0.78 when that is reached. Finally, accelerating to Mach 0.80 for cruise. Some form of pitch/VS/Altitude hold is required at higher Mach levels, jets are generally statically unstable past Mach 0.72 or so. That is often a 'Mach stability system', and is legally required to be operational to fly above the critical Mach Number. However, ALT hold will do with a simulation. Be sure to use some Rate Feedback to damp the speed control. >A related question is: Should the output of the "airspeed hold autopilot" >be ap/elevator_cmd or fcs/throttle-cmd-norm? Note AC tend to be unstable in vertical speed if 'speed' is held, but pitch (AoA) is set manually. One also needs pitch control if holding speed. Holding speed by throttle is most common, however pitch control is nice for climb/descent. Since vertical speed is then controlled by the throttle. >A third question is: How to make the aircraft fly a glide slope either >through a script or an autopilot? Thanks a lot! Note ILS and GS generally schedule the Gain, since control becomes more sensitive as the touchdown point is approached. Ron |
From: Aaron S. <air...@gm...> - 2005-09-03 04:23:09
|
Thank you all for your help. For my purpose, it seems that I can use pitch to control altitude and use= =20 throttle to control airspeed when the aircraft is flying a glideslope. When= =20 I try to write an airspeed hold autopilot XML script, I don't know how to= =20 command the throttle. If the output of the autopilot is=20 fcs/throttle-cmd-norm, there will be runtime error ("property=20 throttle-cmd-norm is not bound"). How come fcs/aleron and fcs/elevator all can be the output of an autopilot= =20 channel, but fcs/throttle-cmd-norm cannot? How can I control the throttle with an autopilot (or autothrottle?) in=20 JSBSim? Thanks! |
From: Jon B. <js...@ha...> - 2005-09-03 11:34:50
|
I'll try and look at that this morning. It could very well be because we have not yet "connected" a throttle with a property. Jon -----Original Message----- From: jsb...@li... [mailto:jsb...@li...]On Behalf Of Aaron Simpson Sent: Friday, September 02, 2005 11:23 PM To: jsb...@li... Subject: Re: [Jsbsim-devel] Airspeed hold autopilot and flying a glide slope Thank you all for your help. For my purpose, it seems that I can use pitch to control altitude and use throttle to control airspeed when the aircraft is flying a glideslope. When I try to write an airspeed hold autopilot XML script, I don't know how to command the throttle. If the output of the autopilot is fcs/throttle-cmd-norm, there will be runtime error ("property throttle-cmd-norm is not bound"). How come fcs/aleron and fcs/elevator all can be the output of an autopilot channel, but fcs/throttle-cmd-norm cannot? How can I control the throttle with an autopilot (or autothrottle?) in JSBSim? Thanks! |
From: Jon B. <js...@ha...> - 2005-09-03 12:20:52
|
For my purpose, it seems that I can use pitch to control altitude and use throttle to control airspeed when the aircraft is flying a glideslope. When I try to write an airspeed hold autopilot XML script, I don't know how to command the throttle. If the output of the autopilot is fcs/throttle-cmd-norm, there will be runtime error ("property throttle-cmd-norm is not bound"). Can you post an example of the component that you are using to control the throttle? Jon |
From: Aaron S. <air...@gm...> - 2005-09-03 15:28:26
|
Here is what I did: <!--beging---> <!-- Calibrated Airspeed hold --> <!-- The Airspeed Error component below computes the Airspeed error,=20 subtracting the desired Airspeed (airspeed_setpoint) from the actual Airspeed.=20 --> <channel name=3D"AP Throttle Airspeed hold"> <component name=3D"Airspeed Error" type=3D"SUMMER"> <input> -velocities/vc-kts </input> <input> ap/airspeed_setpoint </input> <clipto> <min>-100</min> <max> 100</max> </clipto> </component> <component name=3D"Airspeed Error Lag" type=3D"LAG_FILTER"> <input> fcs/airspeed-error </input> <c1> 1 </c1> </component> <component name=3D"AP Airspeed Hold Switch" type=3D"SWITCH"> <default value=3D"0.0"/> <test logic=3D"AND" value=3D"fcs/Airspeed-Error-Lag"> ap/airspeed_hold =3D=3D 1 </test> </component> <component name=3D"Airspeed Integral" type=3D"INTEGRATOR"> <input> fcs/ap-airspeed-hold-switch </input> <c1> 0.00001 </c1> </component> <component name=3D"Airspeed Proportional" type=3D"PURE_GAIN"> <input> fcs/ap-airspeed-hold-switch </input> <gain> 0.02 </gain> </component> <component name=3D"Airspeed Control Summer" type=3D"SUMMER"> <input> fcs/airspeed-integral </input> <input> fcs/airspeed-proportional </input> <clipto> <min>-1.0</min> <max> 1.0</max> </clipto> </component> <component name=3D"Airspeed Throttle cmd norm" type=3D"PURE_GAIN"> <input> fcs/airspeed-control-summer </input> <gain> -1.0 </gain> <output> fcs/throttle-cmd-norm </output> </component> </channel> <!--end--> Thanks! On 9/3/05, Jon Berndt <js...@ha...> wrote: >=20 > For my purpose, it seems that I can use pitch to control altitude and us= e=20 > throttle to control airspeed when the aircraft is flying a glideslope. Wh= en=20 > I try to write an airspeed hold autopilot XML script, I don't know how to= =20 > command the throttle. If the output of the autopilot is=20 > fcs/throttle-cmd-norm, there will be runtime error ("property=20 > throttle-cmd-norm is not bound"). >=20 > Can you post an example of the component that you are using to control th= e=20 > throttle? > Jon > |
From: Jon B. <js...@ha...> - 2005-09-03 16:16:56
|
<component name="Airspeed Throttle cmd norm" type="PURE_GAIN"> <input> fcs/airspeed-control-summer </input> <gain> -1.0 </gain> <output> fcs/throttle-cmd-norm </output> </component> </channel> <!--end--> This looks OK, but you might try: <output> fcs/throttle-cmd-norm[0] </output> Theoretically, you really need to specify the engine number. If that doesn't fix it, there are some other approaches that should help. First, make sure that the entire config file is getting read properly. Look at the information that is echoed out at startup as the config file is parsed. Make sure there are no errors. Second, you can set an environment variable in your shell that will give you a lot of information. All but the last few lines are probably unneeded, but you can do this: setenv JSBSIM_DEBUG 63 -or- export JSBSIM_DEBUG=63 Then, run JSBSim like normal and watch the results. Jon |
From: Jon B. <js...@ha...> - 2005-09-05 22:49:25
|
Aaron: I think I have identified the error. Will get back to you later. Jon |
From: Aaron S. <air...@gm...> - 2005-09-05 23:46:21
|
Thanks, Jon!=20 Looking forward to hearing from you! On 9/5/05, Jon Berndt <js...@ha...> wrote: >=20 > Aaron: > I think I have identified the error. Will get back to you later. > Jon > |
From: Jon B. <js...@ha...> - 2005-09-06 03:35:37
|
Aaron: Your autopilot (autothrottle) definition includes this, as you have mentioned: <component name="Airspeed Throttle cmd norm" type="PURE_GAIN"> <input> fcs/airspeed-control-summer </input> <gain> -1.0 </gain> <output>fcs/throttle-cmd-norm</output> </component> Unfortunately, at this moment, the "fcs/throttle-cmd-norm" property has not yet been created (that is, it has not been Tied to a class attribute or access function). The autopilot components are read in prior to the flight control components, and the "bindmodel" function call that creates the fcs/throttle-cmd-norm property is not called until all of the flight control components are loaded. The problem is, then, understood and straightforward. The first idea I have for a solution is to bind the throttle (and mixture and prop-advance) properties in the AddThrottle function itself - just after the throttle is created. That might work. That way, the throttle properties would be created and available just after the propulsion system is loaded. So, then, the AddThrottle() function in FGFCS.cpp might look like this: void FGFCS::AddThrottle(void) { ThrottleCmd.push_back(0.0); ThrottlePos.push_back(0.0); MixtureCmd.push_back(0.0); MixturePos.push_back(0.0); PropAdvanceCmd.push_back(0.0); PropAdvance.push_back(0.0); unsigned int num = ThrottleCmd.size(); bindThrottles(num); } And, bindThrottles() could look like this: void FGFCS::bindThrottles(int num) { char tmp[80]; snprintf(tmp, 80, "fcs/throttle-cmd-norm[%u]",num); PropertyManager->Tie( tmp, this, num, &FGFCS::GetThrottleCmd, &FGFCS::SetThrottleCmd); snprintf(tmp, 80, "fcs/throttle-pos-norm[%u]",num); PropertyManager->Tie( tmp, this, num, &FGFCS::GetThrottlePos, &FGFCS::SetThrottlePos); snprintf(tmp, 80, "fcs/mixture-cmd-norm[%u]",num); PropertyManager->Tie( tmp, this, num, &FGFCS::GetMixtureCmd, &FGFCS::SetMixtureCmd); snprintf(tmp, 80, "fcs/mixture-pos-norm[%u]",num); PropertyManager->Tie( tmp, this, num, &FGFCS::GetMixturePos, &FGFCS::SetMixturePos); snprintf(tmp, 80, "fcs/advance-cmd-norm[%u]",num); PropertyManager->Tie( tmp, this, num, &FGFCS::GetPropAdvanceCmd, &FGFCS::SetPropAdvanceCmd); snprintf(tmp, 80, "fcs/advance-pos-norm[%u]", num); PropertyManager->Tie( tmp, this, num, &FGFCS::GetPropAdvance, &FGFCS::SetPropAdvance); } Of course, if the above is done, then the existing bindmodel() function will need to have the code that does the binding of the throttles, mixture, and prop-advance removed. I'll be investigating this change, but I thought you might like a heads-up on a possible solution. Jon |
From: Jon B. <js...@ha...> - 2005-09-06 04:07:26
|
Correction: void FGFCS::AddThrottle(void) { ThrottleCmd.push_back(0.0); ThrottlePos.push_back(0.0); MixtureCmd.push_back(0.0); MixturePos.push_back(0.0); PropAdvanceCmd.push_back(0.0); PropAdvance.push_back(0.0); unsigned int num = ThrottleCmd.size() - 1; bindThrottles(num); } This seems to work. Jon |
From: Aaron S. <air...@gm...> - 2005-09-06 19:20:51
|
Hi, Jon, Thanks for your reply. I added the code. But I still see this error at run time "Failed to tie=20 property fcs/advance-pos-norm[0] to indexed object methods". I tried using= =20 "fcs/throttle-cmd-norm", "fcs/throttle-cmd-norm[0]" and=20 "fcs/throttle-cmd-norm[1]" in the following: <component name=3D"Airspeed Throttle cmd norm" type=3D"PURE_GAIN"> <input> fcs/airspeed-control-summer </input> <gain> -1.0 </gain> <output> fcs/throttle-cmd-norm</output> </component> Here is part of the log that shows where that error message appears: --begin-- Loading Component "Airspeed Error" of type: SUMMER INPUTS:=20 -vc-kts airspeed_setpoint CLIPTO: -100.0000, 100.0000 Loading Component "Airspeed Error Lag" of type: LAG_FILTER INPUT: airspeed-error C1: 1.0000 C2: 0.0000 C3: 0.0000 C4: 0.0000 C5: 0.0000 C6: 0.0000 Loading Component "AP Airspeed Hold Switch" of type: SWITCH Switch VALUE is 0.0000 by default. Switch VALUE is 0.0000 if=20 airspeed_hold =3D=3D 1.0000 Loading Component "Airspeed Integral" of type: INTEGRATOR INPUT: ap-airspeed-hold-switch C1: 0.0000 C2: 0.0000 C3: 0.0000 C4: 0.0000 C5: 0.0000 C6: 0.0000 Loading Component "Airspeed Proportional" of type: PURE_GAIN INPUT: ap-airspeed-hold-switch GAIN: 0.0200 Loading Component "Airspeed Control Summer" of type: SUMMER INPUTS:=20 airspeed-integral airspeed-proportional CLIPTO: -1.0000, 1.0000 Loading Component "Airspeed Throttle cmd norm" of type: PURE_GAIN INPUT: airspeed-control-summer GAIN: -1.0000 OUTPUT: throttle-cmd-norm Flight Control (FCS: c172) Loading Component "Pitch Trim Sum" of type: SUMMER INPUTS:=20 elevator_cmd elevator-cmd-norm pitch-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Elevator Control" of type: AEROSURFACE_SCALE INPUT: pitch-trim-sum GAIN: 0.0175 OUTPUT: elevator-pos-rad MIN: -28.0000 MAX: 23.0000 Loading Component "Roll Trim Sum" of type: SUMMER INPUTS:=20 aileron_cmd aileron-cmd-norm roll-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Left Aileron Control" of type: AEROSURFACE_SCALE INPUT: roll-trim-sum GAIN: 0.0175 OUTPUT: left-aileron-pos-rad MIN: -20.0000 MAX: 15.0000 Loading Component "Right Aileron Control" of type: AEROSURFACE_SCALE INPUT: -roll-trim-sum GAIN: 0.0175 OUTPUT: right-aileron-pos-rad MIN: -20.0000 MAX: 15.0000 Loading Component "Yaw Trim Sum" of type: SUMMER INPUTS:=20 rudder-cmd-norm yaw-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Rudder Control" of type: AEROSURFACE_SCALE INPUT: yaw-trim-sum GAIN: 0.0175 OUTPUT: rudder-pos-rad MIN: -16.0000 MAX: 16.0000 Loading Component "Flaps Control" of type: KINEMAT INPUT: flap-cmd-norm DETENTS: 4 0.0000 0.0000 10.0000 2.0000 20.0000 1.0000 30.0000 1.0000 OUTPUT: flap-pos-deg Failed to tie property fcs/throttle-cmd-norm[0] to indexed object methods Failed to tie property fcs/throttle-pos-norm[0] to indexed object methods Failed to tie property fcs/mixture-cmd-norm[0] to indexed object methods Failed to tie property fcs/mixture-pos-norm[0] to indexed object methods Failed to tie property fcs/advance-cmd-norm[0] to indexed object methods Failed to tie property fcs/advance-pos-norm[0] to indexed object methods Aerodynamics:=20 1 dimensional table with 13 rows. ... --end-- Thanks again! On 9/6/05, Jon Berndt <js...@ha...> wrote: >=20 > Correction: >=20 > void FGFCS::AddThrottle(void) > { > ThrottleCmd.push_back(0.0); > ThrottlePos.push_back(0.0); > MixtureCmd.push_back(0.0); > MixturePos.push_back(0.0); > PropAdvanceCmd.push_back(0.0); > PropAdvance.push_back(0.0); > unsigned int num =3D ThrottleCmd.size()* **- 1*; > bindThrottles(num); > }=20 >=20 > This seems to work. > Jon > |
From: Jon B. <js...@ha...> - 2005-09-06 19:34:29
|
OK. I'll check in my changes. Then, you'll need to do an update. We'll see if that eliminates the problem. If not, at least we'll be able to have a common starting point. The only thing that is not yet complete in my current code is that some normalized values are not available. That can be dealt with in at least a couple of ways. Jon -----Original Message----- From: jsb...@li... [mailto:jsb...@li...]On Behalf Of Aaron Simpson Sent: Tuesday, September 06, 2005 2:21 PM To: jsb...@li... Subject: Re: [Jsbsim-devel] Airspeed hold autopilot and flying a glide slope Hi, Jon, Thanks for your reply. I added the code. But I still see this error at run time "Failed to tie property fcs/advance-pos-norm[0] to indexed object methods". I tried using "fcs/throttle-cmd-norm", "fcs/throttle-cmd-norm[0]" and "fcs/throttle-cmd-norm[1]" in the following: <component name="Airspeed Throttle cmd norm" type="PURE_GAIN"> <input> fcs/airspeed-control-summer </input> <gain> -1.0 </gain> <output> fcs/throttle-cmd-norm</output> </component> Here is part of the log that shows where that error message appears: --begin-- Loading Component "Airspeed Error" of type: SUMMER INPUTS: -vc-kts airspeed_setpoint CLIPTO: -100.0000, 100.0000 Loading Component "Airspeed Error Lag" of type: LAG_FILTER INPUT: airspeed-error C1: 1.0000 C2: 0.0000 C3: 0.0000 C4: 0.0000 C5: 0.0000 C6: 0.0000 Loading Component "AP Airspeed Hold Switch" of type: SWITCH Switch VALUE is 0.0000 by default. Switch VALUE is 0.0000 if airspeed_hold == 1.0000 Loading Component "Airspeed Integral" of type: INTEGRATOR INPUT: ap-airspeed-hold-switch C1: 0.0000 C2: 0.0000 C3: 0.0000 C4: 0.0000 C5: 0.0000 C6: 0.0000 Loading Component "Airspeed Proportional" of type: PURE_GAIN INPUT: ap-airspeed-hold-switch GAIN: 0.0200 Loading Component "Airspeed Control Summer" of type: SUMMER INPUTS: airspeed-integral airspeed-proportional CLIPTO: -1.0000, 1.0000 Loading Component "Airspeed Throttle cmd norm" of type: PURE_GAIN INPUT: airspeed-control-summer GAIN: -1.0000 OUTPUT: throttle-cmd-norm Flight Control (FCS: c172) Loading Component "Pitch Trim Sum" of type: SUMMER INPUTS: elevator_cmd elevator-cmd-norm pitch-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Elevator Control" of type: AEROSURFACE_SCALE INPUT: pitch-trim-sum GAIN: 0.0175 OUTPUT: elevator-pos-rad MIN: -28.0000 MAX: 23.0000 Loading Component "Roll Trim Sum" of type: SUMMER INPUTS: aileron_cmd aileron-cmd-norm roll-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Left Aileron Control" of type: AEROSURFACE_SCALE INPUT: roll-trim-sum GAIN: 0.0175 OUTPUT: left-aileron-pos-rad MIN: -20.0000 MAX: 15.0000 Loading Component "Right Aileron Control" of type: AEROSURFACE_SCALE INPUT: -roll-trim-sum GAIN: 0.0175 OUTPUT: right-aileron-pos-rad MIN: -20.0000 MAX: 15.0000 Loading Component "Yaw Trim Sum" of type: SUMMER INPUTS: rudder-cmd-norm yaw-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Rudder Control" of type: AEROSURFACE_SCALE INPUT: yaw-trim-sum GAIN: 0.0175 OUTPUT: rudder-pos-rad MIN: -16.0000 MAX: 16.0000 Loading Component "Flaps Control" of type: KINEMAT INPUT: flap-cmd-norm DETENTS: 4 0.0000 0.0000 10.0000 2.0000 20.0000 1.0000 30.0000 1.0000 OUTPUT: flap-pos-deg Failed to tie property fcs/throttle-cmd-norm[0] to indexed object methods Failed to tie property fcs/throttle-pos-norm[0] to indexed object methods Failed to tie property fcs/mixture-cmd-norm[0] to indexed object methods Failed to tie property fcs/mixture-pos-norm[0] to indexed object methods Failed to tie property fcs/advance-cmd-norm[0] to indexed object methods Failed to tie property fcs/advance-pos-norm[0] to indexed object methods Aerodynamics: 1 dimensional table with 13 rows. ... --end-- Thanks again! On 9/6/05, Jon Berndt <js...@ha...> wrote: Correction: void FGFCS::AddThrottle(void) { ThrottleCmd.push_back(0.0); ThrottlePos.push_back(0.0); MixtureCmd.push_back(0.0); MixturePos.push_back(0.0); PropAdvanceCmd.push_back(0.0); PropAdvance.push_back(0.0); unsigned int num = ThrottleCmd.size() - 1; bindThrottles(num); } This seems to work. Jon |
From: Jon B. <js...@ha...> - 2005-09-06 19:52:45
|
OK. I'll check in my changes. Done. Jon |
From: Aaron S. <air...@gm...> - 2005-09-06 20:00:09
|
Thanks! I'll check them in.=20 On 9/6/05, Jon Berndt <js...@ha...> wrote: >=20 > OK. I'll check in my changes.=20 >=20 > Done. > Jon > |
From: Aaron S. <air...@gm...> - 2005-09-06 20:01:01
|
Sorry, I meant check them out. On 9/6/05, Aaron Simpson <air...@gm...> wrote: >=20 > Thanks! I'll check them in.=20 >=20 > On 9/6/05, Jon Berndt <js...@ha...> wrote: > >=20 > > OK. I'll check in my changes.=20 > >=20 > > Done. > > Jon > > =20 >=20 > |
From: Erik H. <er...@eh...> - 2005-09-06 07:34:08
|
Jon Berndt wrote: > Unfortunately, at this moment, the "fcs/throttle-cmd-norm" property has > not yet been created (that is, it has not been Tied to a class attribute > or access function). The _/autopilot/_ components are read in prior to > the flight control components, and the "bindmodel" function call that > creates the fcs/throttle-cmd-norm property is not called until all of > the _/flight control/_ components are loaded. The problem is, then, > understood and straightforward. The property system lets you add a property when it gets referenced but it's not yet available, do you use that functionality at this time? SGPropertyNode *n = getNode("/path/to/node", true); The last parameter orders the code to create the property if non existent. Erik |
From: Jon B. <js...@ha...> - 2005-09-06 13:53:44
|
> The property system lets you add a property when it gets referenced but > it's not yet available, do you use that functionality at this time? > > SGPropertyNode *n = getNode("/path/to/node", true); > > The last parameter orders the code to create the property if non existent. > > Erik Yeah, that's a good and useful capability in some cases. What I want to try to do with JSBSim, though, is to avoid the use of that capability unless it's absolutely necessary. In my opinion, using that feature within the flight control system might allow a typo to get through, and leave the user wondering why things don't work as expected. So, requiring a property to exist prior to referring to it, I think, tends to act as a sort of a syntax check. Regardless, JSBSim should better handle the situation where a non-existent property is referenced. Right now I think JSBSim segfaults. That's not good, of course. Jon |
From: Jon B. <js...@ha...> - 2005-09-06 15:01:49
|
I've also gone through the code and made some tweaks to that if this situation was to happen again you'd get a more graceful shutdown. Now, you'll get a message stating the name of the offending property, and a program exit, instead of a segfault. This has not yet been committed to CVS, as there is another pending change in my working directory. I'm home sick today, so if I'm feeling up to it this change may be committed today. Jon |
From: Erik H. <er...@eh...> - 2005-09-07 08:05:36
|
Jon Berndt wrote: > Yeah, that's a good and useful capability in some cases. What I want to try to do with > JSBSim, though, is to avoid the use of that capability unless it's absolutely necessary. > In my opinion, using that feature within the flight control system might allow a typo to > get through, and leave the user wondering why things don't work as expected. So, requiring > a property to exist prior to referring to it, I think, tends to act as a sort of a syntax > check. Ok, that makes sense. Detecting typos is fairly easy in FlightGear due to the presence of the property browser. I an imagine you don't want to add *that* to JSBSim :-) Erik |
From: Jon B. <js...@ha...> - 2005-09-07 00:49:49
|
Aaron: By the way, the test value below: <component name="AP Airspeed Hold Switch" type="SWITCH"> <default value="0.0"/> <test logic="AND" value="fcs/Airspeed-Error-Lag"> ap/airspeed_hold == 1 </test> </component> should be: <test logic="AND" value="fcs/airspeed-error-lag"> (note case) Jon |
From: Aaron S. <air...@gm...> - 2005-09-07 13:46:37
|
Hi, Jon, I checked out JSBSim from CVS yesterday after you checked your stuff in.=20 There is an runtime error with the current CVS version when I use the=20 configuration files I sent you. Then I did a folder comparison and found=20 that your proposed changes, i.e., bindThrottles(int num), etc are not in it= .=20 After adding your proposed changes to FGFCS.h and FGFCS.cpp, the log is=20 different but there is still run time error. Here is part of the log (notic= e=20 the "Failed to tie property fcs/throttle-cmd-norm[0] to indexed object=20 methods" error message before the Aerodynamic in the log): --begin-- Loading Component "Airspeed Error" of type: SUMMER INPUTS:=20 -vc-kts airspeed_setpoint CLIPTO: -100.0000, 100.0000 Loading Component "Airspeed Error Lag" of type: LAG_FILTER INPUT: airspeed-error C1: 1.0000 C2: 0.0000 C3: 0.0000 C4: 0.0000 C5: 0.0000 C6: 0.0000 Loading Component "AP Airspeed Hold Switch" of type: SWITCH Switch VALUE is 0.0000 by default. Switch VALUE is airspeed-error-lag if=20 airspeed_hold =3D=3D 1.0000 Loading Component "Airspeed Integral" of type: INTEGRATOR INPUT: ap-airspeed-hold-switch C1: 0.0000 C2: 0.0000 C3: 0.0000 C4: 0.0000 C5: 0.0000 C6: 0.0000 Loading Component "Airspeed Proportional" of type: PURE_GAIN INPUT: ap-airspeed-hold-switch GAIN: 0.0200 Loading Component "Airspeed Control Summer" of type: SUMMER INPUTS:=20 airspeed-integral airspeed-proportional CLIPTO: -1.0000, 1.0000 Loading Component "Airspeed Throttle cmd norm" of type: PURE_GAIN INPUT: airspeed-control-summer GAIN: -1.0000 OUTPUT: throttle-cmd-norm Flight Control (FCS: c172) Loading Component "Pitch Trim Sum" of type: SUMMER INPUTS:=20 elevator_cmd elevator-cmd-norm pitch-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Elevator Control" of type: AEROSURFACE_SCALE INPUT: pitch-trim-sum GAIN: 0.0175 OUTPUT: elevator-pos-rad MIN: -28.0000 MAX: 23.0000 Loading Component "Roll Trim Sum" of type: SUMMER INPUTS:=20 aileron_cmd aileron-cmd-norm roll-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Left Aileron Control" of type: AEROSURFACE_SCALE INPUT: roll-trim-sum GAIN: 0.0175 OUTPUT: left-aileron-pos-rad MIN: -20.0000 MAX: 15.0000 Loading Component "Right Aileron Control" of type: AEROSURFACE_SCALE INPUT: -roll-trim-sum GAIN: 0.0175 OUTPUT: right-aileron-pos-rad MIN: -20.0000 MAX: 15.0000 Loading Component "Yaw Trim Sum" of type: SUMMER INPUTS:=20 rudder-cmd-norm yaw-trim-cmd-norm CLIPTO: -1.0000, 1.0000 Loading Component "Rudder Control" of type: AEROSURFACE_SCALE INPUT: yaw-trim-sum GAIN: 0.0175 OUTPUT: rudder-pos-rad MIN: -16.0000 MAX: 16.0000 Loading Component "Flaps Control" of type: KINEMAT INPUT: flap-cmd-norm DETENTS: 4 0.0000 0.0000 10.0000 2.0000 20.0000 1.0000 30.0000 1.0000 OUTPUT: flap-pos-deg Failed to tie property fcs/throttle-cmd-norm[0] to indexed object methods Failed to tie property fcs/throttle-pos-norm[0] to indexed object methods Failed to tie property fcs/mixture-cmd-norm[0] to indexed object methods Failed to tie property fcs/mixture-pos-norm[0] to indexed object methods Failed to tie property fcs/advance-cmd-norm[0] to indexed object methods Failed to tie property fcs/advance-pos-norm[0] to indexed object methods Aerodynamics:=20 1 dimensional table with 13 rows. 0.0000 1.2030=20 0.1000 1.1270=20 0.1500 1.0900=20 0.2000 1.0730=20 0.3000 1.0460=20 0.4000 1.0550=20 0.5000 1.0190=20 0.6000 1.0130=20 0.7000 1.0080=20 0.8000 1.0060=20 0.9000 1.0030=20 1.0000 1.0020=20 1.1000 1.0000=20 Function: aero/function/ground-effect-factor-lift 1 dimensional table with 13 rows. 0.0000 0.4800=20 0.1000 0.5150=20 0.1500 0.6290=20 0.2000 0.7090=20 0.3000 0.8150=20 0.4000 0.8820=20 0.5000 0.9280=20 0.6000 0.9620=20 0.7000 0.9880=20 0.8000 1.0000=20 0.9000 1.0000=20 1.0000 1.0000=20 1.1000 1.0000=20 Function: aero/function/ground-effect-factor-drag 2 dimensional table with 17 rows, 2 columns. 0.0000 1.0000=20 -0.0900 -0.2200 -0.2200=20 0.0000 0.2500 0.2500=20 0.0900 0.7300 0.7300=20 0.1000 0.8300 0.7800=20 0.1200 0.9200 0.7900=20 0.1400 1.0200 0.8100=20 0.1600 1.0800 0.8200=20 0.1700 1.1300 0.8300=20 0.1900 1.1900 0.8500=20 0.2100 1.2500 0.8600=20 0.2400 1.3500 0.8800=20 0.2600 1.4400 0.9000=20 0.2800 1.4700 0.9200=20 0.3000 1.4300 0.9500=20 0.3200 1.3800 0.9900=20 0.3400 1.3000 1.0500=20 0.3600 1.1500 1.1500=20 Function: aero/coefficient/CLwbh 1 dimensional table with 4 rows. 0.0000 0.0000=20 10.0000 0.2000=20 20.0000 0.3000=20 30.0000 0.3500=20 Function: aero/coefficient/CLDf Function: aero/coefficient/CLDe Function: aero/coefficient/CLadot Function: aero/coefficient/CLq Function: aero/coefficient/CDo 1 dimensional table with 4 rows. 0.0000 0.0000=20 10.0000 0.0070=20 20.0000 0.0120=20 30.0000 0.0180=20 Function: aero/coefficient/CDDf 2 dimensional table with 26 rows, 4 columns. 0.0000 10.0000 20.0000 30.0000=20 -0.0873 0.0041 0.0000 0.0005 0.0014=20 -0.0698 0.0013 0.0004 0.0025 0.0041=20 -0.0524 0.0001 0.0023 0.0059 0.0084=20 -0.0349 0.0003 0.0057 0.0108 0.0141=20 -0.0175 0.0020 0.0105 0.0172 0.0212=20 0.0000 0.0052 0.0168 0.0251 0.0299=20 0.0175 0.0099 0.0248 0.0346 0.0402=20 0.0349 0.0162 0.0342 0.0457 0.0521=20 0.0524 0.0240 0.0452 0.0583 0.0655=20 0.0698 0.0334 0.0577 0.0724 0.0804=20 0.0873 0.0442 0.0718 0.0881 0.0968=20 0.1047 0.0566 0.0874 0.1053 0.1148=20 0.1222 0.0706 0.1045 0.1240 0.1343=20 0.1396 0.0860 0.1232 0.1442 0.1554=20 0.1571 0.0962 0.1353 0.1573 0.1690=20 0.1745 0.1069 0.1479 0.1708 0.1830=20 0.1920 0.1180 0.1610 0.1849 0.1975=20 0.2094 0.1298 0.1746 0.1995 0.2126=20 0.2269 0.1424 0.1892 0.2151 0.2286=20 0.2443 0.1565 0.2054 0.2323 0.2464=20 0.2618 0.1727 0.2240 0.2521 0.2667=20 0.2793 0.1782 0.2302 0.2587 0.2735=20 0.2967 0.1716 0.2227 0.2507 0.2653=20 0.3142 0.1618 0.2115 0.2388 0.2531=20 0.3316 0.1475 0.1951 0.2214 0.2351=20 0.3491 0.1097 0.1512 0.1744 0.1866=20 Function: aero/coefficient/CDwbh Function: aero/coefficient/CDDe Function: aero/coefficient/CDbeta 1 dimensional table with 3 rows. -0.3490 0.1080=20 0.0000 0.0000=20 0.3490 -0.1080=20 Function: aero/coefficient/CYb Function: aero/coefficient/CYda Function: aero/coefficient/CYdr Function: aero/coefficient/CYp Function: aero/coefficient/CYr 1 dimensional table with 3 rows. -0.3490 0.0311=20 0.0000 0.0000=20 0.3490 -0.0311=20 Function: aero/coefficient/Clb Function: aero/coefficient/Clp 1 dimensional table with 2 rows. 0.0000 0.0800=20 0.0940 0.1900=20 Function: aero/coefficient/Clr Function: aero/coefficient/Clda Function: aero/coefficient/Cldr Function: aero/coefficient/Cmalpha 1 dimensional table with 4 rows. 0.0000 0.0000=20 10.0000 -0.0654=20 20.0000 -0.0981=20 30.0000 -0.1140=20 Function: aero/coefficient/CmDf Function: aero/coefficient/Cmq Function: aero/coefficient/Cmadot Function: aero/coefficient/Cmo Function: aero/coefficient/Cmde 1 dimensional table with 3 rows. -0.3490 -0.0227=20 0.0000 0.0000=20 0.3490 0.0227=20 Function: aero/coefficient/Cnb Function: aero/coefficient/Cnp Function: aero/coefficient/Cnr Function: aero/coefficient/Cnda Function: aero/coefficient/Cndr Winsock DLL loaded ... Successfully bound to socket ... Output parameters read inline Log output goes to file: JSBout172B.csv in CSV format output at rate 20 Hz Properties logged: - qbar-psf --end-- Thanks again. On 9/6/05, Jon Berndt <js...@ha...> wrote: >=20 > Aaron: > By the way, the test *value* below: > <component name=3D"AP Airspeed Hold Switch" type=3D"SWITCH"> > <default value=3D"0.0"/> > <test logic=3D"AND" value=3D"fcs/Airspeed-Error-Lag"> > ap/airspeed_hold =3D=3D 1 > </test> > </component> > should be: > <test logic=3D"AND" value=3D"fcs/airspeed-error-lag"> > (note case) > Jon > |
From: Jon B. <js...@ha...> - 2005-09-04 12:54:27
|
> For my purpose, it seems that I can use pitch to control altitude > and use throttle to control airspeed when the aircraft is flying a > glideslope. When I try to write an airspeed hold autopilot XML > script, I don't know how to command the throttle. If the output of > the autopilot is fcs/throttle-cmd-norm, there will be runtime error > ("property throttle-cmd-norm is not bound"). Hi, Aaron: Wanted to let you know I continue to look into this - you are not the only one who has reported this. Two comments: 1) Are you using the latest code from JSBSim CVS? (I hope I haven't asked this, yet) 2) Can you send me offline your engine, aircraft, autopilot, thruster, and script files? Using your files might be better/quicker than trying to duplicate a similar setup here (thought I'm still going to try and do that). Jon |