spong 7.7

Upload: giordano-vieira

Post on 04-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Spong 7.7

    1/3

    7.7) Pesquise a literatura de controle e encontre dois ou mais algoritmos para o problema de atribuio de polos para sistemas lineares. Projetar uma lei de controle derealimentao de estados para 7.68 utilizando os valores dos parmetros indicados noExemplo 7.4.1, de modo que os polos esto em s = -10. Simule a resposta ao degrau.Como ele se compara com a resposta do Exemplo 7.4.1? Como os perfis de torque socomparados?

    Exemplo 1 disponvel em:http://www.engr.usask.ca/classes/EE/480/notes/myee480-p7-poleassign.pdf

    Exemplo 2 disponvel em:http://dasl.mem.drexel.edu/courses/wp-content/uploads/2011/06/PolePlacement1.pdf

    Exemplo 1 - Mtodo de Atribuio Plos de AckermannO sistema de servo motor DC

    ( )( )

    Este servo motor DC submetido a controle digital, talvez por algum tipo decompensador digital. Segue o algoritmo de controle.

    %-----------------------------------------------------------% Example of Ackermans State Feedback, Pole Assignment Method % K. Takaya, 2004%-----------------------------------------------------------% find the state space model of a transfer function in continuous time domain

    % --> sampler --> ZOH --> 1/(s(s^2+s+1)) --> sampler -->% This system is a DC motor that has two poles.% 1/s means that output is in rotational angle.% Do not attempt to move the pole at s=0 (or z=1 in z-plane)% just model analog part only: 1/(s(s^2+s+1))numA=[1]denA=[1, 1, 1, 0][A, b, c, d]=tf2ss(numA,denA)T=0.05;% calculate discrete time (digital) state equation[P, q]=c2d(A, b, T)% find poles of this systemdisp(Poles of the discrete time model);

    poles=eig(P)

    % simulate system response with a pulse input N=500; pulse=zeros(1,N); pulse(N/20+1:N/20+N/20)=ones(1,N/20);34timebase=[0: T: (N-1)*T];% use dlsim for simulation[y,x]=dlsim(P, q, c, d, pulse);% plot input and outputfigure(1);

    plot(timebase, pulse, timebase, y); title(Open loop response to pulse); %verify the final DC levelstf=tf(numA,denA)dft=c2d(stf,T,zoh) [zz,pp,kk]=zpkdata(dft,v)

    %Response to 25 impulses (to make a rectangular pulse)disp(****DC level at the steady state is:); Gdc=25*kk*sum(poly(zz))/sum(poly(pp(2:3)))

  • 8/13/2019 Spong 7.7

    2/3

    %-----------------------------------------------------------% apply Ackermanns pole assignment method to do state feedba ck%-----------------------------------------------------------cs=input(Enter case number 1 or 2 or 3 or 4 =,s); switch cscase 1 newpoles=[1, 0.97+j*0.05, 0.97-j*0.05]

    case 2 35newpoles=[1, 0.98+j*0.05, 0.98-j*0.05]case 3 newpoles=[1, 0.97, 0.97]case 4 newpoles=[1, 0.95, 0.95]endalphac=poly(newpoles)K=ackermann(P, q, alphac)% state feedback compensated matix of PcPc=P-q*Kdisp(new poles by state feed back K); newpoles=eig(Pc)% use dlsim for simulation of compensated system

    [y1,x1]=dlsim(Pc, q, c, d, pulse);% plot input and outputfigure(2);

    plot(timebase, pulse, timebase, y1); title(State feedback system by pole assignment); %plot(timebase, y1);title(State Feedback by Pole Assignment); % Convert discrete time system back to transfer function to find DC gain[num1, den1] = ss2tf(Pc, q, c, d, 1)36% check DC gain%++++ Write your code to calculate the steady state DC level%++++ of the pole assigned feedback system with K% check if poles are the samedisp(check if poles of the transfer ftn are the same); check_poles=roots(den1)

    Exemplo 2 - Regulador Linear Quadrtico (LQR) a teoria ideal do mtodo dealocao de plos.Para a explicao do mtodo de alocao de plos assumimos um sistema que pndulo. O sistema de pndulo o sistema de segunda ordem e definido noalgoritmo a seguir:

    num = 1;den = [1 0.05 10];sys = tf(num,den)figure(1)step(sys)grid onlegend( 'pendulum' )hold off% In step response, the response tells that when the external force acts on% the pendulum, the pendulum swings freely a lot because of a small damping% ratio. Now we want to control this pendulum system not to have% oscillation with no steady state error.% This is the second order system so we can choose two desired pole% location to move the original poles to there. The second order system is% very well analyzed in many text books. In this case we will focus on% removing oscillation casused by low damping.% In s domain, the damping ratio, zeta, is defined as the distance from the% imaginary axis. The original poles are located atroots(den)% The complex ploes are placed at 0.025 from the imaginary axis. Now we

  • 8/13/2019 Spong 7.7

    3/3

    % want to move these poles to -2 from the axis so the desired pole location% will be -2 + 3.1622i and -2 - 3.1622i. To move to the desired pole% location we have to fine feedback gains. Mathematically this computation% is very simple but MATLAB supports simple function for this called% 'place'. (refer to 'place' in MATLAB help% Our desired pole location is,desiredpole = [-2+3.1622i -2-3.1622i];

    % Before applying 'place' we need to convert our transfer function to state% space representation. To do that,[A,B,C,D] = tf2ss(num,den)% Now we apply 'place' function to get gain KK = place(A,B,desiredpole)% K is the state feedback gain, in other word, to move original poles to% the desired pole location we have to have feedback loop with K.% The closed loop state space representation with gain K will be,Anew = A-B*KBnew = B;Cnew = C;Dnew = D;% Thus our closed loop system is,[numnew, dennew] = ss2tf(Anew,Bnew,Cnew,Dnew);sysnew = tf(numnew,dennew)

    t = 0:0.01:10;figure(2)step(sys,t)hold onstep(sysnew,t)grid onlegend( 'ori sys' ,'new sys' )hold off% There is still steady state error, and to compenstate we should find% reference gain. But we will not cover this in our course.% (Can be added)