Extract simulation physics data (ie forces, etc)

  • Hi and thanks for this great simulation software.

    I'm using it in my home Cessna 172 simulator, and it works fantastic.

    I've successfully send data from gauges to AirManager in order to have virtual gauges in the cockpit (using the [sender] objects in .tdm file + AirManager.dll).

    Now i'm working on force feedback yoke:

    i've already build it, and the pitch&roll data captured by potentiometers are sent by an arduino (recognized as a HID usb joystic) to Aerofly thus i can successfully fly the aircrat.

    Now the tricky part: the force feedback.

    I'd like to ask to Developers if there is a way to extract data regarding the physics of the airplane that are real time calculated by the simulation engine (forces, momentum, accelerations...), because i need them in order to drive the actuators.

    I read in the .tdm wiki page (https://www.aerofly.com/dokuwiki/doku.php/aircraft:tmd), but unfortunatly found nothing regarding "Autopilot and Flight Management". I was hoping to find there informations about how to extract those real time data.

    Lastly, regarding stock c172 airplane TDM file, i saw that there are only 3 sender objects in the load section:

    1. [SenderElevatorForceFree] which is amost what i need, but is active only if in autopilot mode,
    2. [SenderAileronForceFree] which is amost what i need, but is active only if in autopilot mode,
    3. [SenderElevatorForceGradient] which is only a mapping from the airspeed, and (maibe) it is not usefull.

    Thanks in advice.

    Francesco

    Edited once, last by fragiova (April 19, 2020 at 10:53 AM).

  • fragiova April 19, 2020 at 10:52 AM

    Changed the title of the thread from “Extract simulation phisics data (ie forces, etc)” to “Extract simulation physics data (ie forces, etc)”.
  • Last I heard the SDK was only outputting acceleration forces at 1hz. absolute pitch/roll coming out quicker. That's why my motion platform is just a chair at the moment.

  • What data do you need exactly?

    There are senders for Airspeed, Attitude, VerticalSpeed, Altitude, Throttle, Trim, AirbrakePosition, RadarAltitude, NAV, etc.

    Yes, for testing purposes our C172 (and also B747) I think have experimental senders to create a force feedback.

    I don't think angle of attack is sent yet but we could add this for all aircraft if you need this.

    Control surface deflections could be estimated from your own joystick deflections.

    I would recommend using the SenderElevatorForceFree and SenderAileronForceFree objects and then make modifications to the tmd file (copy paste the c172 folder into your user documents, rename it and the c172 files inside - just so a Steam update doesn't delete your work). Within the tmd file you should have pretty much all the data that you would ever need and you're not limited by the sender bottleneck. You have access to linear mappings, you can square numbers or even divide, weighted sums, you could dynamically mix values (e.g. when the autopilot is on/off you can add additional forces). The simulation performance isn't impacted by this at all and it's also reusable for anyone else that wants to create a force-feedback device.

    I have a feeling that force feedback will be added naturally when we add hydraulics to the aircraft. I think that our doctor of physics will probably want to compute the forces acting on the hydraulic actuators and thus will add a computed force for each aerodynamic control surface.

    Regards,

    Jan

  • Well, i would need the forces applied on the yoke by the control surfaces, or maybe just having the forces applied on the control surfaces (ailerons, elevators and rudder) could be a good starting point.

    I would recommend using the SenderElevatorForceFree and SenderAileronForceFree objects

    Unfortunatly those senders does not give informations about forces applied, but only the status of the elevator and the aileron (the position of the yoke), giving an output value between -1 and +1, witch is an information that i already have.

    Yes, for testing purposes our C172 (and also B747) I think have experimental senders to create a force feedback.

    ...

    I have a feeling that force feedback will be added naturally when we add hydraulics to the aircraft.

    It would be great to help you testing those senders. Also, I have the same sensation as you: when you will add hydraulics to the aircraft, force feedback will be a consequence, but i also think that with the data today already processed by the simulator engine it is possible to do more, only need some sort of sender to take it out.


    hi fragio, could you explain how you send send the data to airmanager? maybe a little tutorial? thanks volker

    It is pretty easy: AirManager is already ready to accept them, you only have to look at the [sender] you want its information to be "send" to AirManager, for example (from c172.tdm):

    Code: c172.tdm
    <[string8][object][sender]
                <[string8][Name][SenderMach]>
                <[string8][Input][PitotTube.MachNumber]>
                <[string8][Message][Aircraft.MachNumber]>
            >

    then in AirManager you can create a new gauge and write

    Code: New Air Manager Gauge
    fs2_msg_subscribe("Aircraft.MachNumber","DOUBLE",callback_function)