EN RU CN
PID Controller Block Diagram
  • Hello everyone!;

    1)I want to work with Matlab-Simulink in order to tune P,I,D gains. I got the transfer function of the plant via analyze tab and then imported it to simulink but I don't have any idea about the what is happening inside the PID controller. If you have any idea or document related to this, can you inform me ?


    2)At the stabilization tab in the GUI, there are check boxes like gain multipliers and outer P, what is the difference between them ? Because i coulnd't find any.

    Thank you very much for your attentions;
  • Hi,

    I am trying to do something very similar and am also stuck. Did you ever figure out what the input and output of the tests were? Do you know what the units are?
  • Hi, guys.
    In few words:

    1) "Analyze" deal with the output from sensor and PID signal probe in various points. Depending on a test, they may be "in" or "out". The units: gyro rate sensor raw units. 2000 deg.sec/32767.

    2) PID is quite regular. "Gain" is just a multiplier for P, D to extend their range. I-term is multiplied by P before applying.

    Equivalent transfer function is:

    G = Kp + Ki/s + Kd*s

    Coefficients are calculated as follows:

    Kp = params.P * 0,42723305523395538330078125
    Ki = params.P * params.I * 1,33510329760611057281494140625e-4 / SAMPLING_TIME
    Kd = params.D * 3,41786444187164306640625 * SAMPLING_TIME
    SAMPLING_TIME = 0,0008

    Input and output are expressed in gyro sensor units, where 1 equals to 0,06103701895 degree/sec.
    If D-term LPF filter is set in the GUI, transfer function slightly differs:

    G = Kp + Ki/s + Kd*s/(1 + T*s), but for T I have no equivalent here
  • The "Outer P" is outer loop over the angular error. It's output is mixed to the input of the "inner" loop over the gyro rate, in a point after D-term is calculated (to not amplify sharp edges).
  • Hello.

    Thank you for providing the coefficients. When the LPF bandwidth was set to a default value, T was nearly 1/869,8

    I would like to know the overall diagram if possible. What I have found so far are

    1) There is an Outer_I parameter and I can set it to a value between 0..255 via serial command. But there is no change in the tracking response: the ERR plots.

    2) If I set Outer_P equal to zero, it is stable but not tracking. If I set Outer_P high value say 255, it seems to converge quite quicker than 50 (default value). Thus, Outer_P is actually an outer_pi parameter because it enables the tracking.

    3) Analyze tab shows the frequency plot of the input output time domain data. When you have the csv file you can generate the same graph using
    >> [Txy, F] = tfestimate( input, output, 512, [], 50000, 1250) % smooth checked
    >> [Txy, F] = tfestimate( input, output, 1024, [], 50000, 1250) % smooth unchecked

    4) Except 'Controller-Only', all the other option with whatever stimulus and cut-off frequency combination have very poor 'coherence plot' after 250 Hz. The exact frequency may depend on the physical configuration of the actual gimbal.

    5) Is there a possibility that we can use encoder information instead of gyro ? When gyro is used, I had to hold the structure with my hands very firmly to get a good and smooth frequency plot.
  • Hi,

    Is there a specific factor that Outer_P is multiplied by as well when it is used in the control loop?