Shop OBEX P1 Docs P2 Docs Learn Events
Quadrotor Control Coupling — Parallax Forums

Quadrotor Control Coupling

QuadrtrFlyrQuadrtrFlyr Posts: 73
edited 2011-12-30 15:34 in Propeller 1
Hello,

I have a question that has been on my mind for a long time. Currently I am working on a PID controlled quadrotor and am tuning the quadrotor axes SEPARATELY.
I heard though that you can couple the two arms and then have one PID loop executing instead of 2 separate ones. Does anyone know how to approach
my problem? I have done a bunch of research and know the 6 differential equations that model the quadrotor system.. I think I have to use these but am not sure.

Thank you
Robert

Comments

  • Cluso99Cluso99 Posts: 18,069
    edited 2011-12-29 15:35
    Hi QuadrtrFlyr and welcome to the great world of the propeller (prop) chip.

    Jason probably has the best skills to answer. He has two current threads (see the QUADX thread in this forum and the QuadCopter Ken/Cluso/Jason and others in the General Forum) - both are recent in the last day or two so easy to find).
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-12-29 16:08
    Robert,

    I suspect the best way to do this would be using quaternions. You would represent your desired orientation with one quaternion and your current orientation with another. You can then measure the angle between them and feed that angle through your PID loop. The resulting PID output would be a "strength" to apply to the motor outputs in a ratio that moves you along the desired axis of rotation.

    Quaternions can be a bugger to visualize, but I found that this helped: http://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation

    For quaternion IMU references, have a look at:
    http://www.uavdesign.net/adaptive-a-distributed-control/quaternion-based-quadrotor-control/
    http://diydrones.com/profiles/blogs/the-freespace-imu
    https://decibel.ni.com/content/docs/DOC-18964

    I'm likely to pursue this approach myself at some point, just to see how it compares with my current DCM-based one, but it'll probably be a while.

    Jason
  • QuadrtrFlyrQuadrtrFlyr Posts: 73
    edited 2011-12-30 15:03
    Very Interesting, I have never heard of quaternions. Although I do like the idea behind that method I think I am going to go with a standard LQR controller. My close friend, a graduate in control theory, recommended it and I will attempt to implement it in my system. For those interested in this method here is a fragment of the email he sent to me.

    The most common and straightforward way of doing this is through a linear quadratic regulator (LQR). You would start with the system differential equations and linearize them about a trim condition (surely hovering, in this case). Then, given the matrices that are output from the linearization, you can use the LQR procedure. You don't really need to know the optimal control derivation of LQR, because the computations are rather straightforward... even MATLAB has a built-in routine to do. If you're not sure how to linearize the system, the only book I can think of off the top of my head that does it is Etkin/Fan's book on flight mechanics. Maybe Slotine's Nonlinear Control book actually shows a decent example, too.

    The positives of LQR are that it's easy, it usually works, it has theoretical guarantees, and allows you to combine multiple states with multiple control inputs.

    The negatives are that it's just proportional control, unless you add states to your system to 'fake' derivative or integral control... it requires full-state feedback, and it's based on a linearization (though I don't think you'll want to venture into any true nonlinear control yet).

    Thank you,
    Robert
  • JasonDorieJasonDorie Posts: 1,930
    edited 2011-12-30 15:34
    I've never heard of LQR, so we're even. :) I think that you'll likely find it's not necessary to treat the system as a whole for the purpose of control, as long as your attitude estimation does it. That's the purpose of the DCM estimator I'm working with, and the quaternion system I linked to. Both of those ultimately have to come up with an amount of motor output for your various motors anyway.

    What's your eventual goal? Do you want something that is self-stable, and will hold a set location and altitude? Or just something that's fun to fly? If it's the latter, my current quad uses a single 3-axis gyro and that's it. Anyone who can fly a model helicopter could fly it. The DCM-based version I'm working on will be self-leveling, and will eventually include a compass and altimeter as well, but it still needs a decent amount of tuning before I can release it.
Sign In or Register to comment.