Basics of UAV stabilization

I'm pretty much a newbie in this area and I was trying to understand the basic ideas around an autopilot.
This are actuallty 2 questions:
1 - can someone recommend some readings about autopilot algorithms and similar stuff?
2 - I wanted a confirmation about something I think I understood, which I explain below.

The super-basic concept behind every kind of stabilization (ex. pitch, roll yaw, or GPS position hold for a helicopter) is that the commands should try to make the readings coming from the gyro/magnotemeter, GPS the same as the intended ones.
And since the there is the inertia of the vehicle, we need a PID controller to make the correction without fluctuation as much as possible.
I know this is a super simplistic view, but is this correct?

Thank you
Simone

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • PID loop is very simple. It outputs a value based on error. The first term is proportional to the error, the second is the integrated (over time) error value, and the last is the rate of change of the error.

    Output = (error * P_GAIN) + (integrated_error * I_GAIN) + (error_rate_of_change * D_GAIN)

    You can just start with the P stuff. Error is simply (command - actual), multiply that by a gain, and that's what feeds the output (servo, etc). That will settle at a value that is not quite right. That's where I comes in. It drives the DC (non-changing) error to zero.

    Every "update" you integrate your error. So if you computed error like this:

    error = command - actual

    You can do the integral like this (using euler integration):

    integrated_error = integrated_error + (error * dt)

    ... Where dt is the floating point timestep (ie, .1 for 1/10th of a second). This just happens over and over in the update loop.

    The derivitave term is the same deal. That just "backs off" of the output the faster the error is changing. For example, if you are commanding a particular roll angle, and the plane starts to roll hard to correct, this term will grow larger and back off of the output a bit. It helps to prevent overshoot.

    I usually just do P and PI loops, throwing in D when there's oscillations.

    Here's an example to command a bank angle:

    void update_roll_PID( float dt )
    {
    error = (roll_angle - desired_roll_angle);
    integrated error += error * dt
    aileron_servo_out = error * P_GAIN + integrated_error * I_GAIN + roll_gyro * D_GAIN;
    }

    So with these PID loops, I fly my plane with the following loops:
    1) Desired heading PID ---> Bank angle PID --> ailerons
    2) Altitude PID --> Pitch angle PID --> elevator
    3) Airspeed PID --> throttle


    So at this point you're commanding airspeed, heading, and desired altitude.

    Hope this helps.
  • I highly recommend Aircraft Control and Simulation for aircraft control theory.

    You have the right idea about stabilization. Generate an error signal (actual roll - desired roll, for example) and use a PID (or other algorithm) to drive a servo that makes the error go to zero.
This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…