[AIRCRAFT] Understanding TMC Contacts Interaction with RIGIDBODIES and COLLISION HULLS

  • Jet-Pack (IPACS)

    This is the Essence of a conversation I had in Private with Jan, that he thought should be posted here for the benefit of others attempting Aircraft development

    Hi Jan

    I really want to understand how the TMC contact positions and TMD Wheel Hulls and Physics Rigidbodies, affect the models position on the ground. Front wheels work great but rear end falls through the ground and I cant understand why? It looks to all intents and purposes as the Camel and DR1 so don't understand why what I did, did not work. Collision code is not currently present in the TMD. I tend to take that out for starters because it always throw out a lot of errors to start with (although I think I understand now why that is). Three Spheres appear correctly positioned in the TMC for the wheel contacts with ground.

    Note: The Snipe Tail skid pivots to provide a degree of steering unlike the Camel and DR1 which is fixed, but it doesn't move as much as the rudder (confined by a slot in the fuselage). That is why I've used a 0.25 scaling of the Rudder output for the Tailskid graphics animation

    KR Matt

    Visualization of Rigidbody set up... wheel rigidbodies are basically a box the size of the wheel so didn't bother to create those.

    TMC Contacts Code...

    Code
            <[vec32array][ContactSpheres][ ( 0.01334 0.7407 -1.29756 0.365931) (  0.01334 -0.7407 -1.29756 0.365931) ( -4.3579 0.0 -0.38231 0.0079985) ]>

    Tailskid TMD Physics Code...

    Tail Skid TMD Graphic Body Code....

    Code
                <[hingedbodygraphics][TailGear][]
                    <[string8][GeometryList][ tailskid ]>
                    <[uint32][PositionID][Fuselage.R]>
                    <[uint32][OrientationID][Fuselage.Q]>
                    <[uint32][InputID][ServoRudder.Output]>
                    <[tmvector3d][Axis][ 0.0 0.0 -1.0 ]>
                    <[tmvector3d][Pivot][-4.178 0.000000 0.175]>
                    <[float64][Scaling][0.25]>
                >

    Edited once, last by MDIvey (April 28, 2023 at 1:58 PM).

  • Hi Matt,

    The contact points are used to determine the initial attitude of the model for the very first simulation step. After initialization they are no longer used. That's why they are in the tmc file, which is an description and overview file used to load the model and not in the tmd file which defines the dynamics of the aircraft.

    From the first simulation step onwards the wheels and collisionhulls add forces onto the rigidbodies they are attached to (parameter Body).

    In your case there does not seem to be a wheel or collisionhull for the tail gear. Just add a collision hull, copy one from the Sopwith Camel and rename the geometry to your 'tailskid' part.

    Add this in the dynamics section of the TMD file and insert your own geometry name for the tail skid instead of RearGear in the Geometry property.

    Code
                <[collisionhull][CollisionTailGear][]
                    <[string8][Body][TailGear]>
                    <[string8][Geometry][RearGear]>
                    <[float64][K][20000.0]>
                    <[float64][D][200.0]>
                    <[float64][StaticFrictionCoefficient][1.5]>
                    <[float64][KineticFrictionCoefficient][0.9]>
                >

    The K and D values should be modified if the aircraft is significantly lighter or heavier than the Sopwith Camel that this code is from. K is the spring constant and D the damping.

    Static and kinetic friction coefficients can be used to fine tune how much the tail skid "digs" into the ground. Higher values stabilize the direction of travel as long as the tail skid is on the ground.

  • Thanks Jan

    Got it working.... finished code below. Something I hadn't realized about the collision entries, was that in the geometry line, it needs to be named as the object is in the TGI... in this case "tailskid" not "TailGear"

    KR Matt

    Physics Section:

    Geometry Section:

    Code
                <[hingedbodygraphics][TailGear][]
                    <[string8][GeometryList][ tailskid ]>
                    <[uint32][PositionID][Fuselage.R]>
                    <[uint32][OrientationID][Fuselage.Q]>
                    <[uint32][InputID][ServoRudder.Output]>
                    <[tmvector3d][Axis][ 0.0 0.0 -1.0 ]>
                    <[tmvector3d][Pivot][-4.178 0.000000 0.175]>
                    <[float64][Scaling][0.25]>
                >
  • MDIvey May 25, 2023 at 8:27 PM

    Changed the title of the thread from “AIRCRAFT: Understanding TMC Contacts Interaction with RIGIDBODIES and COLLISION HULLS” to “[AIRCRAFT] Understanding TMC Contacts Interaction with RIGIDBODIES and COLLISION HULLS”.