Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helicopters cannot be trimmed in flight #1139

Open
2 of 3 tasks
bcoconni opened this issue Aug 15, 2024 · 6 comments
Open
2 of 3 tasks

Helicopters cannot be trimmed in flight #1139

bcoconni opened this issue Aug 15, 2024 · 6 comments

Comments

@bcoconni
Copy link
Member

I'm submitting a ...

  • bug report
  • feature request
  • support request => Please do not submit support request here, see note at the top of this template.

Describe the issue
As per the discussion #1132, helicopters can't be trimmed in flight.

What is the current behavior?
Currently, helicopters can be trimmed on ground by setting simulation/do_simple_trim to 2 (i.e. trim on ground).

However, helicopters cannot be trimmed in flight because helicopters produce lift by their rotor while the trim algorithm assumes that lift is produced by wings and hence adjusts the angle of attack to maintain constant altitude.

TrimAxes.push_back(FGTrimAxis(fdmex,&fgic,tWdot,tAlpha));
TrimAxes.push_back(FGTrimAxis(fdmex,&fgic,tUdot,tThrottle ));

What is the expected behavior?
JSBSim should be able to trim helicopters in flight just as it does for aircraft.

@dershow
Copy link

dershow commented Aug 15, 2024 via email

@gallonmate
Copy link
Contributor

So helicopters do successfully trim on ground? I'm seeing trim failure for trim on ground when testing in UE5 and with helicopter engine running. With engine off, trim is successful. I have not debugged or looked further in it. Just thought I would clarify.

There are a few other JSBSim helicopters being used in Flightgear, so I'd be curious what they do for trim, if at all.

@bcoconni
Copy link
Member Author

So helicopters do successfully trim on ground?

Well, this is what we inferred from the discussion mentioned in the PR description. I have to admit that I did not test helicopter trimming myself. But this statement seemed reasonable as, from an algorithmic point of view, trimming an helicopter on ground is not different than trimming an aircraft on ground: you have a mass and a list of contact points and the trim algorithm has to compute the location of the contact points such that the solid (helicopter or aircraft) is in a stable equilibrium.

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
// Trim the aircraft on the ground. The algorithm is looking for a stable
// position of the aicraft. Assuming the aircaft is a rigid body and the ground
// a plane: we need to find the translations and rotations of the aircraft that
// will move 3 non-colinear points in contact with the ground.
// The algorithm proceeds in three stages (one for each point):
// 1. Look for the contact point closer to or deeper into the ground. Move the
// aircraft along the vertical direction so that only this contact point
// remains in contact with the ground.
// 2. The forces applied on the aircraft (most likely the gravity) will generate
// a moment on the aircraft around the point in contact. The rotation axis is
// therefore the moment axis. The 2nd stage thus consists in determining the
// minimum rotation angle around the first point in contact that will place a
// second contact point on the ground.
// 3. At this stage, 2 points are in contact with the ground: the rotation axis
// is therefore the vector generated by the 2 points. Like stage #2, the
// rotation direction will be driven by the moment around the axis formed by
// the 2 points in contact. The rotation angle is obtained similarly to stage
// #2: it is the minimum angle that will place a third contact point on the
// ground.
// The calculations below do not account for the compression of the landing
// gears meaning that the position found is close to the real position but not
// strictly equal to it.
void FGTrim::trimOnGround(void)

I'm seeing trim failure for trim on ground when testing in UE5 and with helicopter engine running. With engine off, trim is successful. I have not debugged or looked further in it. Just thought I would clarify.

Thanks for the clarification. It's possible that this limitation applies to aircraft as well.

@seanmcleod
Copy link
Member

There are a few other JSBSim helicopters being used in Flightgear, so I'd be curious what they do for trim, if at all.

Are you sure that they're JSBSim based as opposed to YASim based? When I looked around for helicopter JSBSim FDMs a couple of years ago the majority I found at the time were YASim based.

@gallonmate
Copy link
Contributor

I'm seeing trim failure for trim on ground when testing in UE5 and with helicopter engine running. With engine off, trim is successful. I have not debugged or looked further in it. Just thought I would clarify.

Thanks for the clarification. It's possible that this limitation applies to aircraft as well.

Most aircraft I've used so far, have trimmed successfully on ground with engines running. It was just something I noticed that was different with the helicopter.

There are a few other JSBSim helicopters being used in Flightgear, so I'd be curious what they do for trim, if at all.

Are you sure that they're JSBSim based as opposed to YASim based? When I looked around for helicopter JSBSim FDMs a couple of years ago the majority I found at the time were YASim based.

Correct there are only a few JSBSim helicopters among the many for Flightgear. There was maybe 4 made with JSBSim that I found. The Alouette-III and the R22 are both JSBSim helicopters currently available directly through flightgear. The other ones were available from third parties but I can't find them at the moment. Anyways, it was more a curiosity to see how/if they use jsbsim trim.

@andgi
Copy link
Collaborator

andgi commented Aug 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants