Profile image

need help with PID(solved)

2,515 nasiihchan  one year ago

solved, the altitude limiter's engine was too sensitive.


playing around with PID to get a minimum altitude limiter but the system keeps on glitching and raise the altitude abruptly until the craft explodes from it, I am trying to figure out why and a little help explaining more about PID would be helpful.


[ Details ]

My craft is an airship, weighing 25.000kg, limited to 75kmh with the help of Airbrakes, it has wings(both vertical and horizontal) to aid in keeping the airship not veering off, it also has four outboard engines mounted on free rotators and aided by gyroscope to keep it pointing down to make the craft hover, it also has four internal engines to aid the craft to move forward, backward, upward, and downward, it has a single gyroscope to keep the airship stable and to change the elevation of the nose from 30° to -30° and two weaker gyroscope rotated 90° to the side to keep the airship from turning unstably, it can climb up to 2000m before the air supply to the engines is too thin to support the weight of the airship.


[ Problem ]

the PID reacts to the altitude change(or speed) too violently, when it is removed, the craft responses normally.


[ Questions ]

the code i used according to my understanding is PID(10,AltitudeAgl,0.08,0,0.06), I tried tuning it both ways with SnoWFLakE0s's method but it still reacts violently, but when the PID is taken off, the craft is normal which led me to assume that I used the code wrongly, my question is, how do you really use PID, and if possible, I ask for a few examples since as far as I tried to search for "PID, Hovertank, Hoverbike, Altitude Limiter" it only gives me old crafts from 3-4+ years ago.


if it aids in explaining to me, this is my understanding of PID according to SnoWFLakE0s's guide.

• Target: the value that you want to reach
• Current: the input
• Proportional: the amount of power/thrust given to match the Target
• Integral: how quick/fast it reacts to the change(confused as to what higher values or lower values do, does higher means more slower reaction time or?)
• Derivative: how careful is the PID, as in when it should start providing thrust..?
__
and sincerely, thanks.

  • Log in to leave a comment
  • Profile image
    1,591 XxRxX

    @nasiihchan its ready
    here take a look

    https://www.simpleplanes.com/a/b9qa8I/XML-guide-hovercraft-gunship

    one year ago
  • Profile image
    2,515 nasiihchan

    @XxRxX do not worry and take it easy, I am not really in hurry with it, thank you for even bothering to reply actually.

    one year ago
  • Profile image
    1,591 XxRxX

    @nasiihchan no i have to apologies
    I thought i could perhaps finish making it sooner but i was busy at the time
    I will build it tonight i am free now mostly

    one year ago
  • Profile image
    2,515 nasiihchan

    @XxRxX pardon my insolence, but I do have to ask, did you perhaps did not tagged me correctly?

    one year ago
  • Profile image
    1,591 XxRxX

    @nasiihchan let me show u instead
    When I'm back home i will build a demonstration
    It will be easier this way

    one year ago
  • Profile image
    2,515 nasiihchan

    @XxRxX I have different engines for that purpose, I only needed something to limit the minimum altitude so I do not crash unintentionally, there is also a reason I do not use the pitch and roll, as it is used for manual aiming for the armaments aboard, I also respectfully reject the offer, I want it to be the work of my hand fully if you understand my sentiment, I'd like to ask though, how would you work around it if I may? and thanks.

    one year ago
  • Profile image
    1,591 XxRxX

    Are you trying to make it hover?
    And also be able to freely move around and be able to increase and decrease its altitude
    Now i think you're over complicating it, i could suggest an easier workaround
    If you give me a link to your build i can try to make it a bit easier to control or operate in general
    I do have a bit of experience with helicopters, hovercrafts and vtols

    one year ago
  • Profile image
    2,515 nasiihchan

    @zwen I see, that's why both methods acts differently, the one with integral feels slightly more stable, although both methods still results in sending-to-outer-space fiasco, unfortunately.
    .
    I do have to ask though, if you'd have to do it, how would you go about it? I'm most curious about what each P,I, and D do and how they'd affect each other since I'm trying to learn FT, and also, thanks.

    one year ago
  • Profile image
    1,139 zwen

    Your PID equals to 0.08×(Agl-10)+0.06×VS, so at Agl10 and stabilized, the output is 0. IIRC, PD controller without integral constant is prone to drifting, which means staying in a position other than Agl10.

    one year ago