Jump to content
7Y-Loki

AirplaneX / suspension / PhysX

Recommended Posts

Good evening,

 

I have been trying to implement physX into my custom airplane, but something is clearly wrong. Not sure if it is a common mistake, so for the time being I'll show you a video of my problem.

Whenever I start a game with the airplane, either Editor or Virtual Arsenal, the plane starts moving forwards on it's own accord, with the engine Off.

The thing is, the door and cabin close, and the wheels do rotate, so it's not like the model is just "slipping".

Here's the vid:

 

https://youtu.be/NcIdnuizh_Q

 

Not sure if it's some basic command I've missed or what but it's driving me crazy.

Any help would be much appreciated.

 

Thanks for your time!

Share this post


Link to post
Share on other sites

AirplaneX + wheel suspension + physx = the horrors of arma 3 modding ;) At least to me. 

 

From what I've tried you have two options, but maybe someone with a better understanding can assist further:

  1. Change the stiffness of the suspension so the plane stabilizes
  2. Change the center of mass in the geo lod so it stops rolling

Both are interdependent from what I know, so it might be a combination of both to stop the plane from rolling away.

 

Good luck!

 

Share this post


Link to post
Share on other sites

Hey mate,

 

When you mean the stiffness are you referring to latStiffX/Y and longitudinalStiffnessPerUnitGravity?

 

Nothing seems to change much when I alter values for latstiffX/Y. I have seen a graph on the wiki, and it seems that 3/18 should be fine (same as samples' airplane model)

However, when I change longitudinalStiffnessPerUnitGravity from 600 (rear wheel) or 1000 (front two wheels) to 0, the plane no longer moves forwards with the engine off.

When I put engine on and increase throttle, it does move forwards, but jumping from one side to the other (damaging gear).

 

I have tried increasing longitudinalStiffnessPerUnitGravity too, but to no effect. I don't really understand this value, only that it "affects" acceleration and brake force of the vehicle.

If I give it a value over 0, it just does the same as on post number 1.

 

Thanks for your time!

Share this post


Link to post
Share on other sites

Usually I leave those settings as they are and alter these three values:

 

                sprungMass = 3333;
                springStrength = 83325;
                springDamperRate = 13332;

This combined with dampingRate seems to influence the stiffness of the suspension and if it rolls away most.

Share this post


Link to post
Share on other sites

The sum of the sprungMass values from all of the wheels needs to add up to the total mass of your entire vehicle (from the Geometry LOD).

In a car, the centre of mass (or Centre of Gravity) is often located near the middle of the vehicle and the suspension is then set-up for an even sprungMass across all 4 wheels.

 

On your Spitfire (looks beautiful!), you obviously have only 3 wheels - I'm guessing CoG might still be central, so perhaps you would then use:

nose wheel sprungMass = 1/2 Total Mass

left main wheel sprungMass = 1/4 Total Mass

right main wheel sprungMass = 1/4 Total Mass

 

The springStrength's are calculated to provide your vehicle with enough damping to cushion the landings - not too strong or it'll be too bouncy, not too weak or it will compress the springs and smash into the bottom of the wheel bays.

For many vehicles you can use an approximation of 25 x sprungMass and work upwards from there.

 

The springDamperRate tells you how fast the springs react to input from landings/bumps and the value is often related to both the sprungMass and springStrength.

Here's a formula to use as a guide:

springDamperRate = 2 x squareRoot (springStrength x sprungMass)

 

maxDroop and maxCompression should be related (and often equal to) to the suspension travel defined in your model.cfg.

 

You can leave playing with the latStiff and longitudinalStiffnessPerUnitGravity until later in the process.

Share this post


Link to post
Share on other sites

Thank you both for your answers.

 

This is my physX part at the moment:

 

class Wheels
		{
			class Wheel_1
			{
				boneName					= "Wheel_1";
				steering					= 1;
				side						= "left";
				center						= "Wheel_1_center";
				boundary					= "Wheel_1_rim";
				width						= 0.25;		///wheel width (not radius!)
				mass						= 32;		///wheel mass
				MOI							= 0.5;		///0.5 * wheelMass * wheel radius * 2? (not diameter!)
				dampingRate					= 0.5;		///0.25-2.0 values should be ok. Higher means more difficult to move the wheel
				dampingRateDamaged			= 5;
				dampingRateDestroyed		= 1000;
				maxBrakeTorque				= 500;
				maxHandBrakeTorque			= 200;
				suspTravelDirection[]		= {0, -1, 0};
				suspForceAppPointOffset		= "Wheel_1_center";
				tireForceAppPointOffset		= "Wheel_1_center";
				maxCompression				= 0.1;		//should be the same as offset1
				maxDroop					= 0.1;		//should be the same as offset0
				sprungMass					= 600;		/// vehicle mass/number of wheels
				springStrength				= 15000;	/// sprungmass * 25	
				springDamperRate			= 2400;		///0.8 * raízCuadrada(sprungmass*springstrengh)
				
				longitudinalStiffnessPerUnitGravity	= 600;
				latStiffX					= 25;
				latStiffY					= 180;
				frictionVsSlipGraph[]		= {{0, 1}, {0.5, 1}, {1,1}};
			};
			class Wheel_2: Wheel_1
			{
				steering					= 0;
				boneName					= "Wheel_2";
				center						= "Wheel_2_center";
				boundary					= "Wheel_2_rim";
				mass						= 85;
				MOI							= 3.8;
				width						= 0.6;
				maxBrakeTorque				= 3000;
				maxCompression				= 0.15;
				maxDroop					= 0.15;
				sprungMass					= 1200;
				springStrength				= 30000;
				springDamperRate			= 4800;
				//longitudinalStiffnessPerUnitGravity	= 1000;
				suspForceAppPointOffset		= "Wheel_2_center";
				tireForceAppPointOffset		= "Wheel_2_center";
			};
			class Wheel_3: Wheel_2
			{
				boneName					= "Wheel_3";
				side						= "right";
				center						= "Wheel_3_center";
				boundary					= "Wheel_3_rim";
				suspForceAppPointOffset		= "Wheel_3_center";
				tireForceAppPointOffset		= "Wheel_3_center";
			};
		};

The total mass of the airplane is 3000Kg in the geom lod, and wheel mass above is as in geom lod too. Maybe something to do with the memory LOD?

Is this correct?

 

Wheel center+Rim in memory:

https://drive.google.com/open?id=0BwkBlM6ab2oUWF84Uy1qeVd5U28

 

Landcontact:

https://drive.google.com/open?id=0BwkBlM6ab2oUSE11b0JRMUh6T0U

 

Geom PhysX:

https://drive.google.com/open?id=0BwkBlM6ab2oUenNXMlgtOWU0ckk

 

Geom:

https://drive.google.com/open?id=0BwkBlM6ab2oUQzhMR1NDak9ERGs

 

Also here's the concerning part of wheels in the model.cgf:

 

		skeletonBones[] =
		{
			...
			"gear_1","",
			"gear_1_steering","gear_1",
			"gear_1_damper","gear_1_steering",
			"gear_1_Steering2","gear_1",
			"gear_1_stabil_1","gear_1_steering",
			"wheel_1","gear_1_damper",
			"gear_2","",
			"gear_2_damper","gear_2",
			"gear_2_stabil","gear_2",
			"wheel_2","gear_2_damper",
			"gear_3","",
			"gear_3_damper","gear_3",
			"gear_3_stabil","gear_3",
			"wheel_3","gear_3_damper",
			"wheel_2_damper_land","",
			"wheel_3_damper_land","",
			...etc



			class gear_1_Steering: Rotation
			{
				type = "rotation";
				source = "noseWheelTurn";
				selection = "gear_1_Steering";
				axis = "gear_1_damper_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = -1.000000;
				maxValue = 1.000000;
				angle0 = -0.349066; //+
				angle1 = 0.349066; //-
			};
			class gear_1_Steering2: gear_1_Steering
			{
				selection = "gear_1_Steering2";
				axis = "gear_1_Steering2_axis";
				angle0 = 0.349066*0.7;
				angle1 = -0.349066*0.7;
			};
			class gear_1_damper
			{
				type = "translation";
				source = "altRadar";
				selection = "gear_1_damper";
				axis = "gear_1_damper_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0.000000;
				maxValue = 1.000000;
				offset0 = -0.1;	// equal to maxDroop in PhysX
				offset1 = 0.1;	// equal to maxCompression in PhysX
			};
			/*
			class gear_1_stabil_1: gear_1_damper
			{
				type = "rotation";
				selection = "gear_1_stabil_1";
				axis = "gear_1_stabil_1_axis";
				angle0 = 0.1;
				angle1 = -0.1;
			};
*/
			class Gear_2: Rotation
			{
				type = "rotation";
				source = "Gear";
				selection = "Gear_2";
				axis = "Gear_2_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0.000000;
				maxValue = 0.700000;
				angle1 = 1.36; //+1.46
				angle0 = 0;
			};
			/*
			class gear_2_piston_1: Gear_2
			{
				selection = "gear_2_piston_1";
				axis = "gear_2_piston_1_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 0.1;	//0.5
			};

			class gear_2_piston_2: Gear_2
			{
				selection = "gear_2_piston_2";
				axis = "gear_2_piston_2_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 0.2;	//0.9
			};
			*/
			class gear_2_damper
			{
				type = "translation";
				source = "altRadar";
				selection = "Gear_2_damper";
				axis = "Gear_2_damper_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0.000000;
				maxValue = 1.000000;
				offset0 = -0.15;		// equal to maxDroop in PhysX
				offset1 = 0.15;			// equal to maxCompression in PhysX
			};

			class gear_2_stabil: Rotation
			{
				type = "Rotation";
				source = "Damper_2_source";
				selection = "gear_2_stabil";
				axis = "gear_2_stabil_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0;
				maxValue = 1.000000;
				angle1 = 0.1;
				angle0 = -0.1;
			};
			
			class Gear_3: Rotation
			{
				type = "rotation";
				source = "Gear";
				selection = "Gear_3";
				axis = "Gear_3_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0.000000;
				maxValue = 0.700000;
				angle1 = -1.36; //-1.447
				angle0 = 0.00;
			};
			
			class gear_3_piston_1: Gear_3
			{
				selection = "gear_3_piston_1";
				axis = "gear_3_piston_1_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 0.1;
			};
			
			class gear_3_piston_2: Gear_3
			{
				selection = "gear_3_piston_2";
				axis = "gear_3_piston_2_axis";
				minValue = 0;
				maxValue = 1;
				angle0 = 0;
				angle1 = 0.2; //-
			};
			
			class gear_3_stabil: Rotation
			{
				type = "Rotation";
				source = "Damper_3_source";
				selection = "gear_3_stabil";
				axis = "gear_3_stabil_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0.000000;
				maxValue = 1.000000;
				angle0 = 0.1;
				angle1 = -0.1;
			};
			
			class gear_3_damper
			{
				type = "translation";
				source = "altRadar";
				selection = "Gear_3_damper";
				axis = "Gear_3_damper_axis";
				memory = 1;
				sourceAddress = "clamp";
				minValue = 0.000000;
				maxValue = 1.000000;
				offset0 = -0.15;		// equal to maxDroop in PhysX
				offset1 = 0.15;			// equal to maxCompression in PhysX
			};

			class Wheel_1
			{
				type = "rotation";
				source = "wheel";
				selection = "wheel_1";
				axis = "wheel_1_axis";
				memory = 1;
				sourceAddress = "loop";
				minValue = 0.000000;
				maxValue = 1.000000;
				angle0 = 0.000000;
				angle1 = 3.141593; //-
			};
			class Wheel_2: Wheel_1
			{
				selection = "wheel_2";
				axis = "wheel_2_axis";
			};
			class Wheel_3: Wheel_1
			{
				selection = "wheel_3";
				axis = "wheel_3_axis";
				angle1 = -3.141593;
			};
			
			class Wheel_2_Damper
			{
				type="translation";
				source="damper";
				selection="wheel_2_damper_land";
				axis="Basic_Damper_Destruct_Axis";
				animPeriod = 1;
				minValue= 0;
				maxValue= 1;
				offset0= 0.1;
				offset1= -0.1;
				memory=1;
			};
			class wheel_3_Damper: Wheel_2_Damper
			{
				selection="wheel_3_damper_land";
			};

 

Again, thanks for your time. This is a nightmare, everything works perfectly fine WITHOUT physX.cfg

But it's not the same without it, right? :D

 

Share this post


Link to post
Share on other sites

Just a quick suggestion on the suspension dampers.

 

In model.cfg,

      suspension distance moved = (offset1 - offset0) x distance between memory points in the axis

So if your memory points in "gear_n_damper_axis" are not spaced 1m apart, then the suspension travel will not be 0.3m total as you might be expecting.

And then the maxDroop and maxCompression values from config.cpp won't match up either.

It's personal preference, but I set translation axis memory points at the distance apart I want, then use offsets of 0 and 1 (or -0.5 / +0.5).

 

If you haven't lost sleepless nights over physX configuration, you're not a proper vehicle modder.  ;-)

Share this post


Link to post
Share on other sites
11 minutes ago, UK_Apollo said:

...

If you haven't lost sleepless nights over physX configuration, you're not a proper vehicle modder.  ;-)

 

Slightly off-topic: 2:40 am and facing a Jeep in Unsung that does wheelies ...

  • Like 1

Share this post


Link to post
Share on other sites
12 hours ago, UK_Apollo said:

In model.cfg,

      suspension distance moved = (offset1 - offset0) x distance between memory points in the axis

 

So the distance between the two points that make the damper axis influences the damper itself? Interesing... didn't know that!

 

12 hours ago, UK_Apollo said:

If you haven't lost sleepless nights over physX configuration, you're not a proper vehicle modder.  ;-)

 

I'm turning into a vehicle modder monster then! :D

 

12 hours ago, TeTeT said:

Slightly off-topic: 2:40 am and facing a Jeep in Unsung that does wheelies ...

 

While trying to get a Churchill tank to work, it would flip over, slip sideways, suddenly be catapulted somewhere... bloody PhysX!

Will continue to try things randomly, because I have no clue to what is going on.

longitudinalStiffnessPerUnitGravity is the only parameter that seems to change something significantly!

 

Thank you both for your time and answers!

Share this post


Link to post
Share on other sites

Good evening,

Just wanted to post something I came accross while trying out the arma3diag.exe

Don't know how to fix this, but I tried checking for anormal forces acting on the airplane that could explain the fact that it is moving forwards.

 

Arma3diag forces on plane

 

Seems some force is acting sideways on the airplane towards the right side...? It is blue and says "T:(succesion of numbers)"

Anyone got a clue what it might be?

 

Also, it gives rpm values, but engine is off..?

Edited by 7Y-Loki
Adding info

Share this post


Link to post
Share on other sites

Could it be the effect of engine torque / p-factor, which makes most prop aircraft yaw to the left without rudder input to correct?

I know you said the engine is off, but you're showing 2375 rpm and forward movement (16kph).

Share this post


Link to post
Share on other sites
On 9/30/2017 at 5:29 PM, UK_Apollo said:

Just a quick suggestion on the suspension dampers.

 

In model.cfg,

      suspension distance moved = (offset1 - offset0) x distance between memory points in the axis

So if your memory points in "gear_n_damper_axis" are not spaced 1m apart, then the suspension travel will not be 0.3m total as you might be expecting.

And then the maxDroop and maxCompression values from config.cpp won't match up either.

It's personal preference, but I set translation axis memory points at the distance apart I want, then use offsets of 0 and 1 (or -0.5 / +0.5).

 

If you haven't lost sleepless nights over physX configuration, you're not a proper vehicle modder.  ;-)

This is a gem of a post.. Helped answer a lot of questions..

Share this post


Link to post
Share on other sites

@7Y-Loki
How did this turn out for you?

I am experimenting with it right now (again) and have set up a simple demonstrator aircraft, for tricycle and taildragger configuration:

My goal is to set up 2 very simple versions as reference.

 

I managed to sort of set it up somewhat for the tricycle version, but not for the taildragger.

Having the exact same issue, it rolls away
 

 

Taildraggers do not seem to be supported by physX either.

Did you find a solution for this?

 

***** Edit: Adding a landcontact LOD and adjusting CoG helped me. Still messy - once you add cargo they still roll away so I am developing a parking brake script ****

  • Like 2

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×