• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

AP speed hold PID controller

Hi Bjoern,
Actually the integral of velocity is the distance while the derivative is acceleration. anyway, Wanted to share my approach perhaps someone would find it useful. Thanks for the feedback.
 
Hello. I wish I had come to this place before I attempted to write my own PID for FS. In any case, it's been done - for the most part but I have a few questions. My PID was "stolen" from some RC aircraft site and is extremely simple but seems to work. Although, as a pilot, I would find it insufficient for passenger comfort and an aircraft (at least the way I was taught) is properly flown. For example, when banking at 30°, the lead-in to level out would start about 15° from desired heading. But perhaps as a PID trainer, it might be useful. Here are my PID equations for a heading change:
P = error * Kp
I = (ErrorAccumulated + Error) * Ki
D =(Error - PreviousError) * Kd
anti-windup
Imax = some max value for I

Output = P + I + D

Notice that I do not have any time constants. The values above are just scanned at the gauge scan rate of 18Hz.

Question #1: What applicable formula would apply to the above?

I see that the aircraft.cfg (for my PID test, I set max bank at 40) has the following:
max bank = 25
max bank velocity = 3.5
max bank acceleration = 1.0

Question #2: How are these parameters applied in FS' PID's scheme?

Question #3: What percentage step change of a process variable would be considered extreme (i.e.: PV = 0° to 180°)?

I actually applied the above to a real-world application. I made a split serial cable and I used Excel (VBA) to talk to a GPS through my laptop's COM port. I then applied the above PID and then output through the COM port to a step motor board. I then attached it to my yoke (in a Cessna 182). In order to get it to have the correct amount of leverage to the links, I had to add an "arm" or "throw" value, so my actual output = throw * (P + I + D).

Question #4: What proper terminology would be applicable to the "throw" variable?

In the picture attached, it can be seen I'm using the Co50 PFD. In the gauge, a "tracking line" is used with the following formula:

(A:Velocity world X, m/s) (A:Velocity world Z, m/s) atg2 (A:Magvar, radians) - (A:Plane heading degrees gyro, radians) -

I see that it seems to trend what the ball does in a turn coordinator (A:TURN COORDINATOR BALL).

Question #5: What is being sought with the above formula?
 

Attachments

  • MyPIDControllerForFS.PNG
    MyPIDControllerForFS.PNG
    318.6 KB · Views: 367
Back
Top