Section 2.0 Manual control

Impulse disturbance of weight 5

Flysim output

Impulse disturbance of weight 5

Bode diagram

Bode diagram for impulse disturbance of weight 5

Nyquist diagram

Nyquist for impulse disturbance

Step disturbance of weight 5

Flysim output

Step disturbance of weight 5

Integral action explanation

I am using integral action even when the error is zero from 8 to 9 seconds, the controller output stays above 0. As the disturbance is a step input, once the controller “forget” the disturbance, the error will start again, as shown from 10 seconds onwards.

Section 2.1 Pilot induced oscillation

Impulse disturbance under control

Impulse disturbance under control

Impulse disturbance under no control

Impulse disturbance under no control

Bode diagram

PIO bode

How bode diagram explains the feedback loop

The phase margin is very small. This means the system is marginally stable and that instability can be caused by a very small amount of delay.

Guideline to make PIO less likely

We can increase the phase margin through a phase compensator so that a small delay will not introduce in huge instabilities.

Section 2.2 Sinusoidal disturbances

With control

Sinusoidal disturbances with manual control

Without control

Sinusoidal disturbances without control

Whether the controller can reduce error

Manual control is unable to reduce the error.

Bode

Bode diagram of sinusoidal input

Section 2.3 An unstable aircraft

Flysim output

Unstable aircraft flysim output

Nyquist diagram

Nyquist for an unstable aircraft

Explanation of stability with proportional gain greater than 0.5 using Nyquist criterion

When the number of unstable poles is equal to the number of encirclement of the critical point (-1/K, 0). When K is greater than 0.5, -1/K will be less than -2, which allows the encirclement of pole at -2.

How is the Nyquist diagram modified with delays

At the origin, there will be a spiral similar to the first Nyquist plot in the report (Section 2). Assuming the delay is small, parts of the plot other than the original will stay the same.

Section 3 Autopilot

Autopilot not stablilized

gain: 17.4199829 time period = 1.771`

Section 3.1 A PID controller

PID controller generated from Ziegler-Nichols rule

PID controller after increase Kd by 40%

Section 3.2 Integrator wind-up

Intergrator windup before correction

Intergrator windup after correction

%
% Command file flysim.m for 3F1 Flight Control Experiment.
% Copyright: Cambridge University Engineering Department, October 1994.
% Author: M.C. Smith.
%
% T=0.4;

num=[6.3, 4.3, 0.28];den=[1, 11.2, 19.6, 16.2, 0.91, 0.27]; %  Numerator and denominator of plant 
            %  Laplace transfer function

runtime=15;     % target simulation interval in seconds

wght=[0,2,0,0]; % entries are: impulse, step and sinusoid disturbance
        % weightings and sinusoidal frequency (Hz). Impulse and step
        % occur randomly between 0.2 and 0.6 secs. Sinusoid 
        % begins at t=0.

samper=30;  % target sampling period in milliseconds

srate=(samper+1.3)/1000;    % anticipated average sampling period in secs
                            % was samper+0.6

grphc1

integ=0;
deriv=0;
yprev=0;
Kp=10.44;
Ti=0.9;
Td=0.225*1.4;
% Td=0.225;
for i=1:count
    set(hh,'Xdata',hx,'Ydata',hy+y*hz);
%   pp=p(1,2);
    integ=integ +  y * srate;
    integ=sign(integ)*min(abs(integ),0.169);
    deriv=(y-yprev)/srate;
    pp=-Kp*(y+integ/Ti+deriv*Td);
    yprev=y;
    pp=sign(pp)*min(max(0,abs(pp)-0),10);
    set(jh,'Xdata',jx,'Ydata',jy+pp*jz);
    drawnow;

    ylist(i)=y;
    ulist(i)=pp;

    x=adis*x + bdis*(pp+disturb(i));
    y=cdis*x + ddis*(pp+disturb(i));
    
    while (time2-time1<samper)
        time2=clock;time2=1000*(60*time2(5)+time2(6));
    end
    thetimes(i)=time2;
    time1=time2;
    
    if (y<-10 | y>10 )
        flg=1;crashind=i+1;
        thetimes(i+1)=thetimes(i)+samper;
        ylist(i+1)=y;
        ulist(i+1)=sign(p(1,2))*min(abs(p(1,2)),10);
        break;
    end

end

grphc2