P-rad_sec behavior #1334
Replies: 47 comments 10 replies
-
|
Hi Josh
The issue is that The Taken from FlightGear GitLab: FGJSBsim::copy_from_JSBsim()
_set_Omega_Body( Propagate->GetPQR(FGJSBBase::eP),
Propagate->GetPQR(FGJSBBase::eQ),
Propagate->GetPQR(FGJSBBase::eR) );
_set_Euler_Rates( Auxiliary->GetEulerRates(FGJSBBase::ePhi),
Auxiliary->GetEulerRates(FGJSBBase::eTht),
Auxiliary->GetEulerRates(FGJSBBase::ePsi) );
void FlightProperties::set_Euler_Rates(double x, double y, double z)
{
_root->setDoubleValue("orientation/roll-rate-degps", x * SG_RADIANS_TO_DEGREES);
_root->setDoubleValue("orientation/pitch-rate-degps", y * SG_RADIANS_TO_DEGREES);
_root->setDoubleValue("orientation/yaw-rate-degps", z * SG_RADIANS_TO_DEGREES);
}If you’re not familiar with the difference take a look at - https://aviation.stackexchange.com/questions/83993/the-relation-between-euler-angle-rate-and-body-axis-rates Cheers |
Beta Was this translation helpful? Give feedback.
-
|
Hi Sean, For Q I understand, it behaves how I expect. Because in banks the lift. So the 0Q is negative Euler rate. Otherwise I don't know how to solve this aero issue. Cause at lower speeds it banks away from center when at bigger bank angles due to Clp. Aside from just arbitrarily increasing Clbeta or reducing Clr. Which doesn't seem right. It's not just my planes either. Kind Regards, |
Beta Was this translation helpful? Give feedback.
-
As @seanmcleod70 explained: they are not the same thing. If you read the text at the link he has provided, you will find the relation between the parameters: Hence the 2 properties are different.
Given that We definitely need to understand how |
Beta Was this translation helpful? Give feedback.
-
|
Josh can you:
|
Beta Was this translation helpful? Give feedback.
-
|
I'll get that to you. https://github.com/Octal450/MD-80/blob/master/FDE/Config/md-80-aerodynamics.xml#L531 NOTE: this issue is NOT isolated to my planes, and occurs in most JSBsim aircraft in FlightGear that are plausible. I can get the graphs to you but not this second. Bests, |
Beta Was this translation helpful? Give feedback.
-
Thanks. The first thing that strikes me is the usage of the property <function name="aero/coefficient/Clp">
<description>Roll moment due to roll rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/p-aero-rad_sec</property>
<value>-0.51</value>
</product>
</function>This property is basically the ratio of a constant (the wing span) to the total velocity. I would expect this value to go through the roof at extremely low speed. Although this is supposed to be compensated by the multiplication with jsbsim/src/models/FGAerodynamics.cpp Line 141 in 405c00d jsbsim/src/models/FGAerodynamics.cpp Lines 158 to 161 in 405c00d In addition to the parameters requested by @seanmcleod70, could you also give the values for all the parameters that are used to compute aero/coefficient/Clp ?
|
Beta Was this translation helpful? Give feedback.
-
I doubt that's an issue here since I'm pretty sure Josh is referring to his airliner model MD-80 soon after take-off, so I would imagine around the 150KIAS range or so. As opposed to the issue we had a while ago with a stationary aircraft and wind and things like |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
So, at first glance I don't see anything obviously wrong with the 737 response. The initial aileron input produces a large At the same time Given the yaw rate increase there is an increase in Also given the relationship between You can then see difference between When the aileron is centered as a step response at 3.5s the total At 4.5s the roll rate |
Beta Was this translation helpful? Give feedback.
-
|
I've run a check based on @seanmcleod70 Python script to verify that
Just added the collection of psidots.append(fdm['velocities/psidot-rad_sec'])
thetas.append(fdm['attitude/theta-rad'])ps_theory = np.array(phidots)-np.sin(np.array(thetas))*np.array(psidots) |
Beta Was this translation helpful? Give feedback.
-
|
The first thing I did after Josh shared a link to his FDM was to confirm the set of rolling moments to see if there were any that the 737 model doesn't have compared to the MD80, and then to compare the formula for each to see that the formulas for calculating the individual moments were the same, and then lastly to compare the sign and magnitude of the derivatives/coefficients. Where necessary I've converted the MD80 derivatives from per deg to per radian.
So, I'd be surprised if the MD80's response isn't very similar to the 737's response. |
Beta Was this translation helpful? Give feedback.
-
|
Forgive me for not being as well versed in aero as you guys are. My end goal here is that when stabilized at a bank angle, Clp does not "try" to roll the airplane away from neutral by the cause of P - in real I can't see how there would be a moment from that, I'd think the moment would trend towards level wings, not away. I should note that with no turn coordination enabled, the issue is less apparent because the beta angle causes it to try to roll level. But with turn coordination turned on, it is apparent. IMPORTANT NOTE: The turn coordinator does NOT use an integrator and is not very tight, even in real, so this issue is NOT caused by too much rudder from turn coordination causing a roll moment. I have verified this already - it was my first guess as what could be happening. I should note that I temporarily put I guess roll-rate-degps is just phidot from JSBsim? And fed that into Clp and it resulted in expected behavior - using the aero and non aero diff to add wind effects. Kind Regards, |
Beta Was this translation helpful? Give feedback.
-
Variables used in aero |
Beta Was this translation helpful? Give feedback.
-
No need to guess, I stated that in my very first response 😉 FGJSBsim::copy_from_JSBsim()
{
_set_Euler_Rates( Auxiliary->GetEulerRates(FGJSBBase::ePhi),
...
void FlightProperties::set_Euler_Rates(double x, double y, double z)
{
_root->setDoubleValue("orientation/roll-rate-degps", x * SG_RADIANS_TO_DEGREES);Generate a plot like I did for the 737 and let's take a look at the data. In the meantime can you spot anything you're not expecting in the 737 plot above? |
Beta Was this translation helpful? Give feedback.
-
|
"A picture tells a thousand words...", but while we wait for the equivalent graph data for the MD80 here is a potential match of the original figures mentioned compared to the 737's graph data.
So they match in terms of their sign in particular, and the magnitudes are fairly similar. |
Beta Was this translation helpful? Give feedback.
-
Remember, thetadot
You started off by saying "neutral rudder", for "THIS situation", so no turn coordination. Also don't confuse the coefficient/derivative value with the value of the moment. For example here is a snippet from the 737. <function name="aero/coefficient/Clb">
<description>Roll_moment_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/beta-rad</property>
<value>-0.09</value>
</product>
</function>
<function name="aero/coefficient/Clp">
<description>Roll_moment_due_to_roll_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/p-aero-rad_sec</property>
<value>-0.4</value>
</product>
</function>So sure, the magnitude of Take a look at the values of the moments at time = 6s. Also no turn coordination, but
You only included the following columns in your MD-82.csv, "Time, P, Q, R, Phi, Theta, Psi", i.e. no moments to plot and compare.
Remember The main cause for a negative Remember, with |
Beta Was this translation helpful? Give feedback.
-
|
I did mix up thetadot and q in my reply, but that was just due to me being tired. The same applies. If in a bank with thetadot at 0, q is positive. So it plays no inversion factor. q sin phi also makes negative so phidot is negative when p = 0 and thus it drifts further left when phi = negative. I didn't understand what you meant about moment vs coefficient. The coefficients build up to the moment no? Clp IS bigger than Clbeta which is why it drifts left. If I make Clbeta bigger it stops or drifts right. Which is why I said the issue is not always very apparent. That doesn't mean I'm confusing it, its just not the same in every situation I know. But I'm talking about the situations where the drift occurs. I'll give you a new output with Cl coefficients. What other properties do you want? The 737 in JSBSim DONT use it! It has that horrible nonsense "yaw damper" from aeromatic. Except is not a yaw damper!!! It should have a washout on r, otherwise it reacts to steady state r in turn and causes the plane to Slip and thus Clbeta is big!!!! This is not correct and I don't why the aeromatic has this nonsense. It needs washout of r with coefficient roughly 0.5 or so for c1 and then it will not slip in turns and thus Clbeta is smaller. Furthermore I have turn coordinator but no integrator on it so beta is even smaller. This is why I said Clbeta is smaller than Clp. Please do not use wrong for this, can you direct use the MD-82 flight model on my repo? J |
Beta Was this translation helpful? Give feedback.
-
|
The aeromatic and every default model in jsb should have washout added. Otherwise the rudder fights the turns and pushes the plane into a slip uncoordinated turn every time. I have no idea why that was added! J |
Beta Was this translation helpful? Give feedback.
-
I'm more than happy to make use of your MD-82 FDM if I can run it via JSBSim stand-alone, i.e. it doesn't require FlightGear Nasal support etc. Then in my example Python scripts above I can simply replace the 737 model with your MD-82 model but still trim it, generate scripted inputs and log and plot parameters etc. and then we're both looking at and using the same flight model, particularly when we want to discuss particular values we see etc. AIRCRAFT_NAME="737"
If I can run your MD-82 FDM in JSBSim stand-alone then you don't need to log any new output, my script already does all the required logging. If it's not feasible to run your FDM in JSBSim stand-alone then please log all the roll moments you have in your FDM plus control positions, in addition to what you included in your previous log.
JSBSim needs to calculate the relevant forces and moments for each axis in the FDM. Typically FDM authors do that by including functions in the relevant aero axis section, e.g. like the two examples I gave above. Now the first issue is that the function name implies that it is calculating and returning a coefficient, when in actual fact what the function is calculating and returning is a moment, which happens to make use of a particular coefficient, <function name="aero/coefficient/Clb">
<description>Roll_moment_due_to_beta</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/beta-rad</property>
<value>-0.09</value>
</product>
</function>
<function name="aero/coefficient/Clp">
<description>Roll_moment_due_to_roll_rate</description>
<product>
<property>aero/qbar-psf</property>
<property>metrics/Sw-sqft</property>
<property>metrics/bw-ft</property>
<property>aero/bi2vel</property>
<property>velocities/p-aero-rad_sec</property>
<value>-0.4</value>
</product>
</function>So in this 737 example we have two fixed coefficients, in general there could be a lookup table etc. based on say So as I mentioned, in this 737 example the magnitude of the coefficient It all depends on the other parameters in the moment calculation for each one. Once you exclude the common parameters from both then So as I pointed out for the 737 example above you had P.S https://seanmcleod70.github.io/FlightDynamicsCalcs/A4SkyhawkRollPerformance.html https://seanmcleod70.github.io/FlightDynamicsCalcs/FighterRollRates.html |
Beta Was this translation helpful? Give feedback.
-
|
Hi, OK, I understand your explanation. I also use the coefficient naming scheme. Fair enough. Regardless, what I am saying is, in the instance of this issue, Clbeta is always less than Clp. If it wasn't, then this issue would not occur. This can be verified by increasing Clbeta coefficient number (0.04 in your 737). Assuming no other coeffs are at play here (Clr, Clda, Cldr, Cldsp, etc), and the aircraft is not pushed into a skid (beta angle higher) by rudder, or wind, then Clbeta will be trying to roll you level (because the turn coordinator is never perfect at tracking sideslip, so there is always a bit of slipping going on - but NOT skidding unless some other influence like rudder or wind does so) (if there is no turn coordinator, the plane nautrally slips, NOT skids for any yaw-stable airplane), then the roll moment here consists of Clbeta and Clp. Thus in order for this to occur, the magnitude of Clp must be larger than Clbeta and Clp is at fault. Yes, I DO understand that not every situation it is like this. What I am saying is that in order for what I am describing to occur, |Clp| > |Clbeta|, because the plane is not skidding, there is 0 aileron or rudder input, wind is removed (calm weather), and theta and r are such that the p calculation return a positive (in a left bank) value when phidot is 0. I am providing you the set of conditions in which the behavior that this issue was about occurs - I of course understand that it is not UNIVERSALLY like this, which is why the issue does not occur universally, it occurs at specific instances which cause p to be positive when phidot is 0, which results in Clp negative, which results in a further left drift, because Clbeta positive is not big enough to overcome the Clp. This is also why offsetting p by phidot or downright replacing the property removes the issue, which isolates Clp and thus p-rad_sec as the cause of this drift. Again restating - this may be correct behavior. I'm not 100% convinced that this is actually a problem and perhaps it's completely correct to do so, I just thought it was odd. Btw about the yaw damper thing, I'm going to open a separate issue and I can probably provide patches to add the washout and modify aeromatic in order to it actually be a yaw damper, and not fighting and slipping the plane on every turn - I really don't know how such an oversight was missed for 10+ years but I see aeromatic FDE's all the way back to the early 2010s with this same mistake and it results in very bad behavior. But with such an issue, of course you will NOT see it, because beta is larger than it should be by that bad yaw damper thing (or even with no YD/TC, the issue is less apparent. It is only really apparent in reasonably coordinated turns because beta is small). I will provide an updated CSV file for you as soon as I am home with many more relevant properties and all moments logged. Kind Regards, |
Beta Was this translation helpful? Give feedback.
-
|
PS: Your write-ups are excellent. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
Clp here will be negative. It's a slow but noticeable roll if you pay attention. The AP can also be seen when used slightly with right aileron. This causes a slow continued left roll in that state:
Kind Regards, |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
|
It seems you were right. Well then I have no idea why it rolls left. I guess my knowledge/logic was wrong. Thoughts? J |
Beta Was this translation helpful? Give feedback.
-
|
@Octal450 @seanmcleod70 Have you guys considered the effect of yaw rate |
Beta Was this translation helpful? Give feedback.
-
|
@agodemar yep, in my plots of the moments for the 737 example above you can see the roll moment due to yaw rate |
Beta Was this translation helpful? Give feedback.
-
|
@seanmcleod70 I see. Yet another evidence of roll-yaw coupling. Well done. |
Beta Was this translation helpful? Give feedback.
-
My guess is that you're struggling to visualize things between the two frames, the body frame and the Euler frame. I tried to give some extreme examples in this comment above to demonstrate how different the body rates and Euler rates can be - #1334 (comment) Here is another simple example. Let's assume:
So given all that, in particular
Whereas you seemed to be fixated on trying to tie a single moment, the roll damping moment, in the body frame, to explain why Rather look at it in terms of the current aircraft state, plus the net moments in all 3 axes of the aircraft in the body frame resulting in a combination of If you want to dig a bit deeper for your particular example for a given |
Beta Was this translation helpful? Give feedback.
-
|
@Octal450, @agodemar I noticed a slight difference in what I was expecting the net rolling moment to be versus what I was calculating by adding up all the individual rolling moments, so I took a closer look to figure out the difference and wrote it up here - Moment Accounting. |
Beta Was this translation helpful? Give feedback.








Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I've noticed this for a long time (many years) but finally wondering about it. At slower speeds mainly, I noticed that when attitude is stable, the roll rate reported by FlightGear and JSBsim disagree. At higher speeds the issue doesn't occur and the two values agree much much closer.
The most extreme case here just after takeoff in a 20 degree LEFT bank, where the signs differ, FlightGear reports the aircraft is very slowly rolling further left (which it is), but JSBsim p-rad_sec (and aero) reports the plane is slowly rolling right. This causes Clp coefficient to be strongly negative which is causing the plane to keep rolling left...
This means the planes are roll attitude unstable just slightly, when they should really be attitude stable or even rolling slowly back to center. Just Clp is wrong here, Clr is correctly negative here in the bank. Clbeta is trying to roll right as it should. Surface moments are tiny as the controls are centered and the yaw damper is off.
What is going on here? Shouldn't p-rad_sec (and aero) be not disagreeing like this? If the plane is rolling slowly left, then p-rad_sec (and aero) should be showing a left roll. It's not a polarity issue, with larger banks, its close enough.
When I replace p-aero-rad_sec with /orientation/roll-rate-degps in the aero Clp, it behaves as I expect (minus missing wind info)
Kind Regards,
Josh
Beta Was this translation helpful? Give feedback.
All reactions