I'm trying to control a plane via roll using PID controller ,

I had a problem finding the transfer function thus I used the following method :-

Fix the plane in an air tunnel

change the motor that controls the roll in fixed steps and check the roll

thus I will have a table of roll/motor degree

next is to deduce the nonlinear function using wolfram alpha or approximation neural network .

Is this a correct method or should I try another method ?


2 Answers 2


You're correct that measurement and modeling is the right way to go about this.

For your PID to work properly, you need to be able to make a somewhat linear conversion of error (desired roll vs actual roll) into corrective force (in this case, provided by the control surfaces -- the aileron angle, influenced by air speed and other factors).

The $k_d$ term of your PID should account for the inertia of the plane in rolling from side to side, so don't worry about that in your measurements.

What you should measure in your wind tunnel tests is the torque on the longitudinal axis of the plane, in response to airspeed (in both X and Y axes, if you have on-board sensors for that) and aileron angle. That will provide data on the following relationship:

$$ \tau_{actual} = f(\theta_{\text{aileron}}, \text{airspeed}_x, \text{airspeed}_y, \text{[other measurable factors]}) $$

You are going to approximate the inverse of that function -- finding $\theta_{\text{aileron}}$ given $\tau_{desired}$. Whether you do that with a neural network, wolfram alpha, multivariate regression, or a good knowledge of physics is up to you. In the end, you want to produce a modeling function in this form: $$ \theta_{\text{aileron}} = f(\tau_{desired}, \text{airspeed}_x, \text{airspeed}_y, \text{[other measurable factors]}) $$

The PID will give you $\tau_{desired}$, and your sensors will give you the other factors to plug into this function.

  • $\begingroup$ Can you explain more ? more details $\endgroup$
    – RoboMan
    Sep 28, 2014 at 7:09
  • 1
    $\begingroup$ Details on how the PID works, or on how to write the modeling function? $\endgroup$
    – Ian
    Sep 28, 2014 at 13:44
  • $\begingroup$ Modeling function , I understand PID very well , what I don't get is the test you mentioned above and expected results Thanks for your time ! $\endgroup$
    – RoboMan
    Sep 28, 2014 at 13:47
  • 1
    $\begingroup$ You were on the right track in your original question -- you would use a neural network or some other kind of multivariate regression to find the function that produces your desired aileron angle. Your experimental setup and torque measurements will produce data according to this function: $\tau_{actual} = f(\theta_{\text{aileron}}, \text{airspeed}_x, \text{airspeed}_y, etc)$. You are going to approximate the inverse of that function -- finding $\theta_{\text{aileron}}$ given $\tau_{desired}$. $\endgroup$
    – Ian
    Sep 29, 2014 at 14:38

I'm not an expert concerning aerodynamics, but I guess you are using kind of aileron to get the right roll.
So your setpoint is the roll (in degrees or something similar) and your input is the motor position (in degrees, too).
Your method was only about measuring the open-loop gain.
This won't help you in designing the PID.

Now you have a Look-up-table with lot of different values. You can just look up your motor position for your target roll, BUT you cannot control the roll, therefor you need to measure the complete step-answer.

IF you set your motor to a specific position your plane will not have the target roll instantaneously. The plane will roll other a period of time. This period of time may be short but it is measurable and you are interested (as a control designer) to see how the system reacts in this dynamic state.

You should change your method!
One possible solution (there are others) is identifying the system with the step-answer You just need to measure your roll in degrees as a function of time, when you turn your motor from 0 to a specific position. Then you can carry on with mathematica or matlab

  • $\begingroup$ what I understood is to take all points specially the points when changing the position , what about air speed ? $\endgroup$
    – RoboMan
    Sep 28, 2014 at 7:10
  • $\begingroup$ Airspeed can be considered as another parameter (like Ian wrote in his answer). Your target should be getting the step answer of the system dependent of different input variables (target angle , airspeed,....) $\endgroup$
    – TobiasK
    Sep 29, 2014 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.