Jump to content
The simFlight Network Forums

Doug Moldenhauer

Members
  • Posts

    11
  • Joined

  • Last visited

Doug Moldenhauer's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Pete, I purchase FSUIPC and Wide a few years back. I've reinstalled windows and FSX and cant find the info to register. Can you help? E-Mail me if you need any info.
  2. Hi Pete....I have a question I was hoping you might be able to shed some light on. I have a C# program I have written and I'm trying to start the engines on a default 737 in FSX. I've had very unreliable results and I'm not sure I'm doing the right things. I begin by starting the fuel pumps at : Offset EngineFuelPumps = new Offset(0x3125,1). This works fine without any issues. I then fire off the Starter at : Offset Engine1Starter = new Offset("Engine1Info",0x0892). This also works fine without any issues. I then wait for N2 to get above ~20% at: Offset Engine1N2 = new Offset("Engine1Info", 0x0896). No issues here either Once I'm at or above 20% N2, I fire off the Fuel valve: Offset Engine1MixtureLever = new Offset("Engine1Info", 0x0890). This is where the issues are. The results are not repeatable. Sometimes the engine starts other times not. I know the Offset value is being fired as I see it using Fsinterrogate2. Sometimes the engine goes....much of the time not. Only other thing I might add is that this routine is being done in a C# worker thread. Not sure if that has any effect. Do you have any suggestions. I've never had issues before using FSUIPC and the SDK before. I must be missing something.
  3. I have a question regarding implementing FSUIPC SDK Code. I have been implementing the code with Visual C++ 6.0 and using MFC, and I have a fairly large program that I'm using and I tried to convert it to 2008 Express however I get alot of compile errors. I'd really like to use the Express 2008 version as it has a much better toolbox for developing nice looking Dialogs or Forms. I tried to create a new project using CLR and windows forms but it won't compile the FSUIPC.CPP and the FSUIPC.h without a bunch of errors. I noticed a .NET module in a pinned post above and tried to implement that. I did have success at adding the reference to the dll, and it does compile and run. I just put together a simple program to open a connection to fsuipc. #pragma once namespace test { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; using namespace System::Windows::Forms; using namespace System::Data; using namespace System::Drawing; using namespace FSUIPC; public ref class Form1 : public System::Windows::Forms::Form { public: Form1(void) { InitializeComponent(); } protected: ~Form1() { if (components) { delete components; } } private: System::Windows::Forms::Button^ button1; protected: private: System::Windows::Forms::Button^ button2; private: System::ComponentModel::Container ^components; #pragma region Windows Form Designer generated code void InitializeComponent(void) { this->button1 = (gcnew System::Windows::Forms::Button()); this->button2 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // button1 // this->button1->Location = System::Drawing::Point(48, 209); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(75, 23); this->button1->TabIndex = 0; this->button1->Text = L"button1"; this->button1->UseVisualStyleBackColor = true; // // button2 // this->button2->Location = System::Drawing::Point(163, 209); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(75, 23); this->button2->TabIndex = 1; this->button2->Text = L"button2"; this->button2->UseVisualStyleBackColor = true; this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click); // // Form1 // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->ClientSize = System::Drawing::Size(292, 266); this->Controls->Add(this->button2); this->Controls->Add(this->button1); this->Name = L"Form1"; this->Text = L"Form1"; this->ResumeLayout(false); } #pragma endregion private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) { FSUIPCConnection::Open(); } }; } I havn't used 2008 express much and it is quite a bit different to Visual C++ 6.0. The above compiles and runs, however in my application I need 3 different connections, and I'm unable to figure out how to do that using the FSUIPCClient.dll reference method. My old program just creates 3 instances of the FSUIPC Object, and then opens it up for communications. I was wondering if someone might give me a idea as to how to create 3 instances of the FSUIPCConnection? I think I'll be able to figure the rest of it out once I'm able to do that. Or give me a Idea on another method as to how I might implement FSUIPC using 2008 Express? I would like to use CLR Windows forms to create my Forms for data display and input. Thanks in advance.
  4. Thanks for the info Pete.....I have one last question. The calls for ReadAndProcess, WriteAndProcess, and Process...are they blocking type calls or not? For example, will a call to Read and then a Process() stall at the Process call until until the data is available?
  5. Pete, I took a look at my code and it seemed to be hanging because I had several ReadAndProcess() commands in the same timer routine. Also a contributing factor was I have 3 timer routines and all of them are either reading or writing data to fsuipc using the same declaired connection. As the timer routines were running at different times, so the process() commands in each of the timer routine may have had data colliding. Anyway, I declared 3 different connections and moved the routines into Worker Threads and everything is working fine and has sped things up quite a bit. Another question....There is 2 different offsets for vertical speed in FSUIPC. I've tried both but the data seems to be filtered by FSX as it lags behind what is really happening. Caused some tuning issues for my Vertical Speed Controller. I have it tuned fairly well now, but the lag in the data (or averaged data) keeps me from making it more responsive. I was wondering when you wrote your autopilot if you found the same problem? Perhaps this is normal as Vertical Speed feedback on a real plane is measuring the rate of change in atmosphereic pressure?
  6. Well thanks for the information. I'll try some of your suggestions now that I'm home and I'll see how it all goes. Also thanks for providing such a useful utility for the FS world. I have purchased FS2004 version and now the FSX version. Alot of addons that are made today couldn't have come about without your work. I'd buy you a beer if I was still traveling to europe. I used to goto Harrow England, and Chalon Sur Sone France about once a year for work, however I don't get over there anymore, so it'll have to be a virtual one :lol: Thanks again Doug
  7. Thanks for the insights Pete. I think I may have more than one process call in the routine. I'll have to correct that. As far as the timing is concerned, a year ago or so I wrote some stuff for a home built Autopilot MCP panel that I created from a microcontroller. I exchanged data back and forth with the MCP via USB Communications. I had multiple threads that handled the data. I believe I used to sleep the thread for a specified time, then continue processing, and then rinse and repeat. I'll have to create a new thread for this and give that a shot when I get home from work. I hadn't concidered that the data was updated based on screen rate FPS. I run mine locked at 30 and it maintains that almost everywhere with the stock scenery. I have most everything set up on high, but I have the Traffic turned down. NYC JFK airport does drop my FPS a bit when I'm at the airport and there is alot of parked aircraft around. I'll try a more reasonalbe frequency of 20 to 25 hz and see where that gets me. For the PID Controllers to have decent responce, I'd like to get the gains up. But that will require that the data is refreshed at a fairly good rate(in both directions), and that the Simulator reponds quickly to the new changes. The time between getting the Data and the Simulator responce after a output change will dictate how good the responce of the controller can possibly be, and how high the gains can be. Edit: Pete....I just read about offset 0x06D0. You already have Autopilot functions in FSUIPC? How are the gain values changed...I don't see any information regarding those ie. Proportional Gain, Integral, and Derivative. Feedforward, Rate, ect.
  8. Sorry, that's all gibberish to me. What's a PID anyway? Sorry Pete.....The PID Controllers that I'm Speaking of that I wrote are for a AutoThrottle Speed Hold, Altitude, Vertical Speed, and Pitch. A PID Controller is Proportional + Integral + Derrivative controller used to control a process to a requested Setpoint. PID controller - Wikipedia http://www.google.com/url?sa=U&start=1&q=http://en.wikipedia.org/wiki/PID_controller&ei=USViSfzKIZyxmQfK4o27Dg&usg=AFQjCNHkUua2Nb9ou3vIFxhNYknTgfmxdA The current method I'm using is via a Timer Callback Routine in Visual C++ 6.0. I'm running it every 20ms which should produce 50hz, but I'm not getting that as the routine is getting stalled somewhere inside and it appeared to be related to FSUIPC Communications. Perhaps I have something else bottleing the routine up. It would be interesting to check the throughput and bandwidth of FSUIPC....I'll have to put together a timer and polling routine to check it out. Anyway, I've always hated the responce the stock Jet Aircraft Autopilots have in FSX. You also cant get at all of the tuning parameters for the different autopilot modes. This, I think is why the Payware Plane Developers write their own autopilots I think. I Also wanted a "Level Change Mode" for a managed Altitude change which uses a fixed N1% (for a Climb, and limited to Flight Idle durring decents)and manages Pitch to maintain your set Speed to reach your new altitude. This allows you to set your new target altitude and your speed, and then press the Level Change Mode button and the Autopilot increases the throttle to produce a Climb N1% Setting (for a climb) and then will vary pitch to maintain your set speed. This produces variable climb rates dependant on your speed setpoint and aircraft loading The real aircraft has this but is missing in the 737-800 Stock plane. The Stock Plane also doesn't have a FMC which I'd like to mess around with in the future.
  9. Pete, I was wondering what kind of throughput I might expect to get from FSUIPC. I've been writting a autopilot that is a external program that receives and sends data to FSX via FSUIPC. I havn't done any real timing checks but it seems that the polling routine and PID routines currently run at around 10hz. If I disable the PID routines and leave the data reads and writes to FSX, the frequency stays about the same. The values I'm currently reading and writing to: offset size Description Direction 0570 8 Altitude, in metres and fractional metres Read 0578 4 Pitch, *360/(65536*65536) for degrees. Read 02C8 4 Vertical speed, signed, as 256 * metres/sec. Read 0BC0 2 Elevator trim control input: –16383 to +16383 Write 02BC 4 IAS: Indicated Air Speed, as knots * 128 Read 088C 2 Engine 1 Throttle lever, –4096 to +16384 Write 0924 2 Engine 2 Throttle lever, –4096 to +16384 Write 310A 1 Controls the joystick connection Write I was wondering what the most efficient way to read/write this data is and what kind of throughput I might expect in a continuous polling situation? It sure would help if it was just a contiguous block of data, but my registers are all over the place so that doesn't seem possible. The Speed Regulator PID is nailed right on at the moment with its current configuration. The Altitude, Vertical Speed, and the Pitch PID regulators are working pretty well, however I'd like to Increase the Gains, but they tend to get a bit nervous when I get the gains much higher. I expect this is due to the lack of bandwidth. I'd like to increase PID update bandwidth if possible. My current system is a Core2 Duo E8500 with 3Gig Memory and a Nvidia 9600GT 512mb Video Board. That should have enough horsepower to handle this with no problems. Perhaps I'm not doing the read/writes in the most efficient manner or have not configured correctly. I'm using the MFC version of your FSUIPC 4.40 SDK Any Suggestions or Ideas would be greatly appreciated Doug M
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.