National Instruments 370753C-01 Fan User Manual


 
Chapter 5 Classical Feedback Analysis
© National Instruments Corporation 5-13 Xmath Control Design Module
margin( ) loops over all the frequency points in the response and
performs the following computation for phase and gain margins at each,
denoting gain margin as Mg and phase margin as Mp:
This loop finds all the frequency intervals within the response which
contain –180° phase crossings and 0 decibel gain crossings.
margin( )
then interpolates to find more exact frequency values for the crossings.
A gain margin value is returned for every pair of phases between which
a –180° phase value must occur, and a phase margin is returned for each
pair of gains between which a zero-decibel gain value must occur.
margin( ) also computes the frequency-rate of change for both the phase
and the gain of the response.
–180° and 0 dB crossings are difficult to detect accurately if the points in
the frequency response are too widely spaced.
You can examine the gain and phase margins of your open-loop system
quickly using
margin( ), without having to draw the bode gain and phase
response plots first. Input to margin is the frequency response
H of the
system. Referring to the system defined in Example 5-3, you can see that
you already have
H as the output from bode( ), but you can calculate it
explicitly using
freq( ) as shown in Example 5-4.
Example 5-4 Obtaining Gain and Phase Margin Using margin( )
H = freq(sys,{Fmin=0.01,Fmax=10,npts=300});
[Gm,Pm] = margin(H)
Gm (a pdm) =
- domain |
----------+----------
0.595514 | 44.5062
Pm (a pdm) =
domain |
----------+----------
0.0257558 | 12.3814
Mp i() phase i()
Δphase
Δω
-------------------
Δω gain i 1+()
Δω
Δgain
---------------
⎝⎠
⎛⎞
+=
Mg i()
gain i() Δgain+()
Δphase
---------------------------------------------
Δω phase i 1+()
Δω
Δphase
-------------------
⎝⎠
⎛⎞
=