1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Variables for Forces on the airframe

Discussion in 'Gauges' started by Vitus, 11 Aug 2017.

  1. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    777
    Country:
    newzealand
    Good day,

    I am wondering for a while now if FSX provides variables I can use to animate parts that move in the VC due to the forces on the aircraft.
    For example: I want to control the pitch and bank of my whiskey compass due to the acceleration for all 6 DOFs. At the moment I'm very crude and just bank the compass due to the bank angle of the aircraft. Ultimately, I want to push the compass around due to the FORCES applied to the aircraft.

    I do have an idea how to derive these forces, but my approach is very GERMAN. I.e. convoluted and overly complicated. :laughing:
    So I wonder if you guys have some ideas?

    Cheers,
    Vitus
     
  2. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,757
    Country:
    unitedstates
    Well, one way I've used is to tag a parent dummy object with (A:Turn coordinator ball, position) to simulate the yaw forces...

    I haven't tried yet but presumably you could use angle of attack to simulate acceleration/deceleration forces. Just some random thoughts.
     
  3. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20 Feb 2011
    Messages:
    1,331
    Country:
    us-virginia
    The whisky compass is not gyro stabilized so it does not bank with the bank angle of the airplane. It aligns with the local gravitational acceleration vector which is aligned with the airplane axes in a balanced turn.
    This means that the direction of the magnetic field in a bank is different from that when flying straight and level, so it will have errors in the turn which alter depending on bank and heading in relation to magnetic north.
    In other words bank does affect its reading, but as an indirect effect which varies throughout the turn.
    The local magnetic field has both azimuth and vertical components which affect readings. The vertical component is minimum at the equator and increases as the magnet poles are approached.
    A whisky compass is affected by accelerations and these cause it to tilt like a pendulum would and that also affects the reading, not directly again but as a function of tilt and magnetic north vector.
    If you did want to calculate something using accelerations you could use A:ACCELERATION BODY X, feet per second squared and the equivalents for Y and Z. I suspect you would also have to map the Earth's magnetic field to get accurate results.
    Roy
     
  4. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    777
    Country:
    newzealand
    I used the turn coordinator ball before as well for some animations, but I sometimes notice strange behavior of that variable as well, plus it's only one of the two axis I need.

    Roy, what you describe is precisely what I programmed into my Whiskey Compass so far. The only thing missing is the tilting of the compass (bank and pitch) due to the acceleration of the aircraft. But this problem is not trivial, because There's not only the A:ACCELRATION BODY, there's also the angular acceleration around all three axis, for which FSX doesn't provide variables as far as I know. In my gauge file I differentiate the angular velocity to get those values.

    My engineering approach would be to come up with a differential equation for the whole plane by taking the accelerations experienced and correlate them to forces and momentum. But I hate differential equations, so I was hoping there's a better solution. FSX must store those values somewhere...
     
  5. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    777
    Country:
    newzealand
    Thinking about it.. All I need is basically a vector that points towards the current gravitational center of the plane.
     
  6. hairyspin

    hairyspin Resource contributor

    Joined:
    8 May 2010
    Messages:
    2,769
    Country:
    unitedkingdom
    Most undergraduates believe differential equations are a form of torture still to be outlawed under the Geneva Convention. After graduation they try to avoid 'em wherever possible but find rigorous engineering is stuffed with them and the torture continues. This may account for the Tin Man's testy manner.
     
  7. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20 Feb 2011
    Messages:
    1,331
    Country:
    us-virginia
    Take the accelerations a pair at a time.
    A:ACCELERATION BODY Y,Feet per second squared and A:ACCELERATION BODY Z,Feet per second squared, root sum square will give you a resultant acceleration that can give you fore/aft tilt.
    Then do the same with Y and X to get the bank tilt.
    Angular accelerations will affect the body accelerations and are small except in very agile fighters.
    The liquid has some damping effect but alcohol has low viscosity (very easy to spill your drinks)
    Practically, the flight doctrine is to wait until a turn is finished before getting a reading you can rely on, so what you want to do is eye candy pure and simple.
    In my experience precise heading maintenance needs some kind of slaved gyro and the whisky compass was only used as an emergency back-up.
    Roy
     
  8. n4gix

    n4gix Resource contributor

    Joined:
    26 Sep 2006
    Messages:
    10,757
    Country:
    unitedstates
    Given that the end result is merely "eye candy" I prefer sticking with simple solutions, especially since I seriously doubt more than one or two people will ever notice it... :confused:
     
  9. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    777
    Country:
    newzealand
    It's a cool approach, and I did consider it before. But here's the problem: without taking gravity into consideration you will be missing an important component in the calculation! This becomes obvious in a taildragger, because you're having a static 10-15 degrees attitude. By only looking at the acceleration you're parts will always be perpendicular to the aircraft's axis. I suppose you could estimate the static solution by constantly integrating your forces. But that is just inviting problems.

    In essence: while the acceleration gives you a good estimate during dynamic flight, it's not a viable solution for a static problem. I need something to incorporate both...

    As for the other part: I already implemented a spring-damping solution that applies for ALL instruments. I give every needle a mass, and coefficients for damping and spring forces. It works like charm! And the cool thing is that this makes the simulation of vibration so much easier! All I need to do is introducing a alternating vibration force and the spring-damping part does the wriggling. It looks really cool and - provided the parameters are set ok - realistic.

    Don't be such a buzz-bill! :D One of those two people is me, and it bugs me when things in my cockpit don't move as they should! :laughing:
     
    Last edited: 13 Aug 2017
  10. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20 Feb 2011
    Messages:
    1,331
    Country:
    us-virginia
    Good point. So, take the value of G FORCE,gforce which is the acceleration along the airplane's vertical axis due to gravity, multiply by 32.174 and use that instead of the Y axis body acceleration before doing the RSS. I suspect the compass will be on the stops at somewhere like 20 degrees pitch so it is only over a very small range that you will see g-force induced movement.
    Roy
     
  11. WarpD

    WarpD

    Joined:
    9 Dec 2007
    Messages:
    931
    Country:
    us-ohio
    I don't think you want to use G FORCE at all. The only reason the compass reorients when the aircraft is static is because it is weighted. Once all accelerations are removed, the weight will restore the compass to as close to a level condition as it can (allowing for stops). So for all movements it is still the acceleration values that need to be used... and when they are zero... the compass should try to return to a level condition (with relation to the earth, not the aircraft).
     
  12. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20 Feb 2011
    Messages:
    1,331
    Country:
    us-virginia
    When the aircraft has zero body axis accelerations it will be at 1g. The compass is weighted so it hangs vertically relative to the Earth. If it was not restrained is would be accelerated downwards at 32.2 FtSec^2. However it is restrained so it cannot do anything except hang directly towards the local axis of earth's gravitational force. OK so far?
    Now if it is accelerated backwards due to thrust being greater than drag, if you RSS 32.17, the acceleration due to gravity and whatever the fore/aft axis acceleration is, you will get the angle that it is tilted backwards.
    The higher the G force the smaller the angle of tilt will be.
    The issue with only using body accelerations is they are zero in normal flight when the compass hangs straight down. And therefore a fore/aft acceleration would only give 45° tilt if it was also 32.2 ftsec^2. G force is measured along the Y Axis and includes all Y axis accelerations. Y axis body acceleration on its own ignores gravity and gravity is what makes the compass hang down because it is weighted, ie its CG is below its pivot points.
    You have often promoted using existing variables rather than invent new ones. I only proposed using G force as a substitute for the Y axis acceleration. That post should be read as a follow up to Post#7, not in isolation.
    Roy
     
  13. JB3DG

    JB3DG Resource contributor

    Joined:
    24 Jun 2010
    Messages:
    1,088
    Country:
    southafrica
    You would still have to take into account aircraft attitude (could be climbing) in non accelerated flight.
     
  14. Roy Holmes

    Roy Holmes Resource contributor

    Joined:
    20 Feb 2011
    Messages:
    1,331
    Country:
    us-virginia
    I agree because it would be needed to indicate in which direction from normal the Earth's gravity forces had apparently moved. In a non-accelerated climb or dive G force is less than one but without a pitch reading there is no indication why.
    Roy
     
  15. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    777
    Country:
    newzealand
    Hey guys,

    thanks for all your input. This is a really interesting discussion! I spend some time trying various things and I think I got a solution that is satisfactory. It still needs a bit of tweaking, but overall it looks ok.
    Code:
        //////////////////////////////////////////////////////////////////////////
        //    calculate the gravitational forces:
        V2 body_force;
        body_force.x = global.body.acceleration.z / mass;    //fore/aft
        body_force.y = global.body.acceleration.x / mass;    //left/right
    
        V2 delta_pos, reset_force;
        delta_pos.x = global.body.orientation.x - global.body.gravity.x;
        delta_pos.y = global.body.orientation.z - global.body.gravity.y;
    
        reset_force.x = -global.body.orientation.x * global.body.g_force;    //pitch
        reset_force.y = -global.body.orientation.z * global.body.g_force;    //bank
    
        double ratio_body = 0.012;
        double ratio_reset = 1.5;
    
        global.body.gravity.x = body_force.x * ratio_body + reset_force.x * ratio_reset;
        global.body.gravity.y = body_force.y * ratio_body + reset_force.y * ratio_reset;
    
        set_named_variable_value(gravity_lat_id, global.body.gravity.x);
        set_named_variable_value(gravity_lon_id, global.body.gravity.y);
        
    I have two components that define the movement. The first is body_force, which is taking the aircraft's acceleration and divides it by the mass of the part (in this case the compass disc) to get the force acting on the object. The second part is reset_force, which is the gravity component that allows the compass to erect itself based on the attitude of the airplane. I took the Euler angles and multiplied them with the g-force to get a force vector (don't judge me!). Last I have some variables for the mixin'. And by trial-and-error I found the values 0.012 and 1.5 work nicely so far...

    The engineer in me is shouting insults in my way for doing it this way, but I numbed him down with some alcohol. :D

    So this is generating a set of variables gravity.x and gravity.y that is fed into my spring-damper code.

    What do you think?
     
  16. rpmc

    rpmc

    Joined:
    14 Oct 2007
    Messages:
    1,183
    Country:
    thailand
    You're taking whiskey compass a little too literally, Vitus. ;)
     
  17. Vitus

    Vitus

    Joined:
    29 Nov 2006
    Messages:
    777
    Country:
    newzealand
    There is no such thing as "too literally" when it comes to a good, old Whiskey compass.
     
  18. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,187
    Country:
    us-arizona
    Oh man... Never tell Vitus 'you're taking 'this' too literally'

    He once was trying to figure out viscosity of oil against engine RPM per oil temp/rpm/mixture.... I kid you naught... knot... not...
     
  19. lionheart

    lionheart

    Joined:
    24 Oct 2005
    Messages:
    8,187
    Country:
    us-arizona
    I would think Vololiberista would have chimed in by now on this one. He is into extremes of the sim boundries...
     
  20. vololiberista

    vololiberista

    Joined:
    24 Aug 2009
    Messages:
    1,412
    Country:
    italy
    LOL I don't think I am that much of an extremist! True that some of the things I have had to do were a pain in New Zealand like P7. I actually tried a whiskey compass in the VC10 but it never looked the part. So I ditched in the end. Am currently working on the electric panels. So yes in theory I could "replicate" the entire wiring loom as it were. But for the moment I am sticking to the major functions like TRU's otherwise I'll never get it released!
     

Share This Page