added damping sine wave to model nose wheel bump on touchdown by lennox-xonnel · Pull Request #32 · simcodersdotcom/headshake · GitHub
Skip to content

added damping sine wave to model nose wheel bump on touchdown#32

Draft
lennox-xonnel wants to merge 5 commits into
simcodersdotcom:masterfrom
lennox-xonnel:issue/bump-nose-gear
Draft

added damping sine wave to model nose wheel bump on touchdown#32
lennox-xonnel wants to merge 5 commits into
simcodersdotcom:masterfrom
lennox-xonnel:issue/bump-nose-gear

Conversation

@lennox-xonnel

@lennox-xonnel lennox-xonnel commented Sep 13, 2021

Copy link
Copy Markdown
Contributor

This is a draft aiming to add the bump effect when the nose wheel touches down.

I added a damping sine wave to model the nose wheel bump on touchdown.
Since I'm not a real life pilot, I'm not quite sure how big the effect is and which variables might affect it (I imagine many, like wheel pressure and nose down speed, if at all possible to be determined via a dataref, tho we might want to limit the model to a few). For this reason, every damping function parameters are exposed as dataref so that they can be modified and tested in game. It would be nice if someone with real life experience could try it and tell me what parameters feel the best.

The function has the form:

y(t) = - A * e^-(L*t) * sin(2 * PI * F * t)

where:

  • y: is the camera position offset on the y axis
  • A: is the initial amplitude (simcoders/headshake/touchdowncamera/bump_initial_amplitude) [default value: 0.03]
  • L: is the decay rate (simcoders/headshake/touchdowncamera/bump_decay_rate) [default value: 1]
  • F: is the frequency (simcoders/headshake/touchdowncamera/bump_frequency) [default value: 1]

At the moment, the nose wheel touchdown check is performed assuming the nose wheel is the first in the sim/flightmodel2/gear/on_ground array dataref, but we might want to perform a better check, testing the position of each wheel using the sim/aircraft/parts/acf_gear_znodef in order to establish which wheel is the furthest forward.

All code is unfinished and unpolished, everything will be cleaned up in future commits.

Closes #28

@nico87

nico87 commented Sep 20, 2021

Copy link
Copy Markdown
Contributor

@lennox-xonnel

lennox-xonnel commented Sep 22, 2021

Copy link
Copy Markdown
Contributor Author

Unfortunately, judging from the datarefs, there seems to be no way to get the vertical speed of the nose wheel, but I'm new to XP plugin development so I could be wrong.

As for the "vertical shaking with a very little roll of the view" do you mean that, apart from the movement I already implemented on the vertical axis, it would be nice to have a roll on the longitudinal axis?

It's implemented using the "sim/aircraft/parts/acf_gear_znodef" dataref.
Taildraggers are excluded.
@nico87

nico87 commented Sep 26, 2021

Copy link
Copy Markdown
Contributor

In the datarefs there's no direct reading of the vertical speed of the nose wheel but in other plugins I just used the pitch speed to detect this kind of movement. A quick change of pitch means that the nose wheel is going to hit the ground pretty hard.

With "vertical shaking with a very little roll of the view" I mean a roll along the longitudinal axis, as you mentioned.

@lennox-xonnel

Copy link
Copy Markdown
Contributor Author

Understood, I'll try to implement it! Would you mind pointing me in the right direction with the dataref I can use to gauge the pitch speed? Thank you

@nico87

nico87 commented Oct 13, 2021

Copy link
Copy Markdown
Contributor

I would use "sim/flightmodel/position/true_theta" to get the current pitch. In the flightloop you can get the elapsed time. Tracking the change of pitch in time you get the pitch speed. :-)

@lennox-xonnel

Copy link
Copy Markdown
Contributor Author

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

Successfully merging this pull request may close these issues.

Bump on the nose gear touch down

2 participants