timsc Posted April 7, 2005 Report Posted April 7, 2005 Pete, or anyone who knows, I am working on a tool to set a aircraft to a preset location, attitude and other settings for use in pilot trials. One parameter that is proving tricky is the engine status. This is necessary as after I set the aircraft in flight using FSUIPC, the airspeed falls very quickly as the engines take a few seconds to respond to the throttle input. This causes the nose to pitch down rather alarmingly when starting the trial. I am writing the engine N1 to locations 0x0898, 0x0930 etc. The engines do not seem to respond. I expected a spike in engine N1 lasting for a few seconds (until they respond to the throttle). Are the N1, N2 values output parameters only? Any alternate method for setting engine thrust? Or has anyone attempted to make a preset locations tool for MSFS? short int test = 16876; //About 102% N1 Sim.Write(0x0898, 2, &test); Sim.Write(0x0930, 2, &test); Sim.Write(0x09C8, 2, &test); Sim.Write(0x0A60, 2, &test); Sim.Process(); Regards, Tim
Pete Dowson Posted April 7, 2005 Report Posted April 7, 2005 I am writing the engine N1 to locations 0x0898, 0x0930 etc. The engines do not seem to respond. N1 and N2 values are results of simulation, not control inputs. You don't control the turbine or propeller revs directly, but by control over fuel injected and so on. Any alternate method for setting engine thrust? Of course. Engine thrust is controlled by thrust levers, also known as throttles. Offsets 088C etc. For props you also need to control mixture and propeller pitch to set the thrust appropriate to your environment and phase of flight. Regards Pete
timsc Posted April 7, 2005 Author Report Posted April 7, 2005 Thanks for the quick response. I am setting the throttle controls as you describe. My difficulty is the engines take a few seconds to respond. I need to intialise the engine to the required thrust directly to avoid the engines having to "catch up" with the throttle setting. I hope that makes sense! Tim
timsc Posted April 7, 2005 Author Report Posted April 7, 2005 PS I use the words "required thrust" in the broadest possible interpretation. There may be some other writable engine parameter?
Pete Dowson Posted April 7, 2005 Report Posted April 7, 2005 I am setting the throttle controls as you describe. My difficulty is the engines take a few seconds to respond. I need to intialise the engine to the required thrust directly to avoid the engines having to "catch up" with the throttle setting. I hope that makes sense! Well, it may make sense for whatever it is you want to do it for, but it doesn't in terms of simulating a real engine. I don't think there's any way to set the outputs/results of simulation without simply doing no simulation, which seems to wreck the whole point of a simulator. If you want to simply fake the controls you can have your own gauges and so on with fake values. If the spool up time is too slow there may well be some parameters you can change to adjust that (for less realism, effectively?) in the AIRCRAFT.CFG file. You may need some advice from an FS aircraft designer for that, but check the documentation in the Microsoft SDKs in case it is clear there. Regards, Pete
timsc Posted April 7, 2005 Author Report Posted April 7, 2005 You obviously know 1000x more than me on the MSFS interface but I would disagree with your interpretation of what a simulator should & could do. What MSFS actually does might be more limited. Allow me to explain. For the engine system at the start of the simulation it has an "initial state". That state could anywhere from stopped to full power. This is independent of the initial throttle setting. The engine system has an input - throttle. (among others) The engine system has an output - N1, N2, thrust force etc. The engine system from moment to moment responds to throttle but it needs to know what state it was in the previous moment for it do to any simulation. It could be thought of mathematically as like engineState(t) = engineState(t-1) + throttleEffect. (I think mathematicians are probably recoiling in horror right now!) The point is I want to set (or reset) the engine "initial state". This is required in any simulation of the engine. Perhaps this is not accessible in the MSFS interface? Regards, Tim
Pete Dowson Posted April 7, 2005 Report Posted April 7, 2005 It could be thought of mathematically as like engineState(t) = engineState(t-1) + throttleEffect. (I think mathematicians are probably recoiling in horror right now!) Yes, I agree with all that. I don't think that is in disagreement with anything I said before. The point is I want to set (or reset) the engine "initial state". This is required in any simulation of the engine. Perhaps this is not accessible in the MSFS interface? Try setting it up and saving a flight. When you reload that flight, it should set everything about the simulation according to the saved parameters. That's your "initial state". The process of loading a flight actually destroys all the data structures owned by the SIM1.DLL (the core simulation engine) and creates completely new ones from scratch with entries and values based on the flight just loaded. From then on the simulation is in operation. I'm sorry, but I don't know of any way of changing the initial states other than by loading a flight, as it is that which creates the needed structures and initialises them. Regards, Pete
Pete Dowson Posted April 7, 2005 Report Posted April 7, 2005 Perhaps this is not accessible in the MSFS interface? Just one more thing on this. Well, two really. First, there's no such thing here as an "MSFS interface" -- the interfaces Microsoft provide officially don't come anywhere near providing what you see in FSUIPC. Nearly everything in the FSUIPC "interface" has been obtained by hacking into FS code over many years. Second, almost all of the engine values in the 088C-0AE0 offset area are actually derived by FSUIPC and populated there explicitly to provide compatibility across FS98-FS2000-CFS1-CFS2-FS2002 and FS2004. Those ones you can write to, such as the throttle, these days actually cause FSUIPC to call procedures in FS to action the change. You don't access anything directly anymore -- that only used to happen completely in FS98, less so as time has passed. You might like to try, instead, writing to some of the more "original" values -- for example the N1/N2 values in the 2000 offset region. I've no idea if you can achieve any success there. You'll see several inter-related values -- whether you need to change them all for consistency, and whether they would stick, I really don't know. The only reason I even suggest this is that I have been surprised when folks have actually written so some of the velocity and acceleration values in 3060-30B8 and 3178-31D0 areas and achieved actual changes, albeit rather short-lived. All those areas are "directly mapped" into SIM1's private data structures. Regards Pete
timsc Posted April 8, 2005 Author Report Posted April 8, 2005 Pete, I have started investigating engine parameters around 0x0210 - 0x2314. These seem to have a temporary effect on the engine behaviour. For example if I am stationary with engines at idle and I set with FSUIPC to: *Taxi forward speed 50knots *Engine throttle at full *N1 and N2 at full power the engine N1 gauge jumps from 24->70->61->98 fairly quickly. This means there is not too much loss of thrust in the first 2 seconds of simulation. Setting the engines and throttle to idle does a similar thing (100->40->60->19). I do suspect the gauge reading is a filtered output on the internal N1 value and there is some simulation going on that causes the 70->61 drop in N1. This is not too significant for my application I think. I might have a try with saved files if this fails. Are there any other parameters in SIM1's private data structures that might be relevant that are not accessible in FSUIPC? Thanks for you help, Tim
Pete Dowson Posted April 8, 2005 Report Posted April 8, 2005 Are there any other parameters in SIM1's private data structures that might be relevant that are not accessible in FSUIPC? I should say that's a certainty. I provide access through FSUIPC for things that I other others (more expert in FS's simulation than I) have identified. But each one take many hours of hacking into the code to locate. It used to be easier, because the data was either in global variable space (e.g. in GLOBALS.DLL in FS98, and in the individual DLL's global variable space in FS2000). But since MS have been re-writing everything in C++ and using OOP class-type structures, it has become a nightmare. Data is private to each Class, classes are inherited and polymorphed and all that sort of stuff, and data is ephemeral not fixed. Data structures which used to be there whether or not the data is used or not are now not even pointed to when not applicable, and chains of pointers have to be followed for almost every access simply to get commonly required data. I'm doing no more of that sort of hacking for FS2004, because I'll only have to start again for FS2006. The work involved for FS2004 took several thousand hours, I am hoping that MS will not completely re-write everything yet again. Even so, it will take a lot of time. If you wish to try to locate things, feel free. Disassemble SIM1.DLL and start working through it. Tracing using something like Soft-Ice gives you a start into where to begin. The disassembler I use is Ida Pro. Regards, Pete
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now