Page 2 - Support; Worldwide Technical Support and Product Information; Technical Support and Professional Services
Support Worldwide Technical Support and Product Information ni.com National Instruments Corporate Headquarters 11500 North Mopac Expressway Austin, Texas 78759-3504 USA Tel: 512 683 0100 Worldwide Offices Australia 1800 300 800, Austria 43 662 457990-0, Belgium 32 (0) 2 757 0020, Brazil 55 11 3262 3...
Page 3 - Important Information; Warranty; WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
Important Information Warranty TThe media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. Nat...
Page 4 - Conventions; response; File»Page Setup»Options; italic; monospace
Conventions The following conventions are used in this manual: < > Angle brackets that contain numbers separated by an ellipsis represent a range of values associated with a bit or signal name—for example, DIO<3..0>. [ ] Square brackets enclose optional items—for example, [ response ]. »...
Page 5 - Contents
© National Instruments Corporation v Xmath Control Design Module Contents Chapter 1Introduction Using This Manual......................................................................................................... 1-1 Document Organization...........................................................
Page 8 - Index
Contents Xmath Control Design Module viii ni.com Appendix ATechnical References Appendix BTechnical Support and Professional Services Index
Page 9 - Introduction; Using This Manual; Xmath Help; Document Organization; This manual includes the following chapters:
© National Instruments Corporation 1-1 Xmath Control Design Module 1 Introduction The Control Design Module (CDM) is a complete library of classical and modern control design functions that provides a flexible, intuitive control design framework. This chapter starts with an outline of the manual and...
Page 10 - Building System Connections; Bibliographic References; Technical References; Commonly Used Nomenclature
Chapter 1 Introduction Xmath Control Design Module 1-2 ni.com particular system properties or to change the format of a system. These topics include continuous/discrete system conversion, as well as finding equivalent transfer function state-space representations. • Chapter 3, Building System Connec...
Page 11 - Related Publications
Chapter 1 Introduction © National Instruments Corporation 1-3 Xmath Control Design Module • H ( s ) is used to denote the frequency response, over some range of frequencies of a system where s is the Laplace variable. H ( q ) is used to indicate that the system can be continuous or discrete. • A sin...
Page 12 - Control Design Tutorial; Helicopter Hover Problem: An Ad Hoc Approach; letting the state variables
Chapter 1 Introduction Xmath Control Design Module 1-4 ni.com Control Design Tutorial This tutorial illustrates the use of functions and commands provided in Xmath and the Xmath Control Design Module to solve control problems. The emphasis of the tutorial is on using a number of different approaches...
Page 13 - Use
Chapter 1 Introduction © National Instruments Corporation 1-5 Xmath Control Design Module ssys (a state space system) = A -0.4 0 -0.01 1 0 0 -1.4 9.8 -0.02 B 6.3 0 9.8 C 0 0 1 D 0 X0 0 0 0 State Names ----------- Pitch Rate Pitch Angle Horizontal v Input Names ----------- Rotor Angle Output Names --...
Page 14 - Input Names; in the feedforward path.; Block Diagram of Helicopter System
Chapter 1 Introduction Xmath Control Design Module 1-6 ni.com Input Names ----------- Rotor Angle Output Names ------------ Horizontal v System is continuous The system has poles and zeros in the right half of the complex plane and therefore is open-loop unstable. Checking the pole and zero location...
Page 15 - Note; Gs; Feedback Loop Gain
Chapter 1 Introduction © National Instruments Corporation 1-7 Xmath Control Design Module One approach to stabilizing this system is to try to cancel the pole at –0.656513 by adding a compensator, K 1 ( s ), with a zero at –0.656513. Note It is important to understand that this is primarily an acade...
Page 16 - Locus of all Open-Loop and Closed-Loop Roots of Gs; . To close the interactive root locus dialog; File»Exit
Chapter 1 Introduction Xmath Control Design Module 1-8 ni.com Figure 1-2. Locus of all Open-Loop and Closed-Loop Roots of Gs If you cannot move the slider so that the gain is exactly 2, click the box to the right of the slider and enter 2 . To close the interactive root locus dialog box, select File...
Page 17 - Close the loop using the single-input syntax of; Helicopter Velocity Response to a Step Input at the Rotor; Instead, you now place
Chapter 1 Introduction © National Instruments Corporation 1-9 Xmath Control Design Module Close the loop using the single-input syntax of feedback( ) , which implements direct unity-gain negative feedback, and obtain the system’s step response using step( ) : Kc = 2; cl_syscomp1 = feedback(Kc*K1s*K2...
Page 18 - Block Diagram of the Closed-Loop Controller; DC; G s
Chapter 1 Introduction Xmath Control Design Module 1-10 ni.com Figure 1-4. Block Diagram of the Closed-Loop Controller This is a block diagram of the closed-loop controller with compensator K c 1 K 1 ( s ) in the feedforward path and K c 2 K 2 ( s ) in the feedback path. This time, instead of having...
Page 19 - Because; The system has 1 uncontrollable state
Chapter 1 Introduction © National Instruments Corporation 1-11 Xmath Control Design Module Because cl_syscomp2 contains an internal pole-zero cancellation, you can rewrite it in minimal form and then check the closed-loop pole and zero locations: cl_syscomp2m = minimal(cl_syscomp2); The system has 1...
Page 20 - Helicopter Velocity Tracking Step Input at the Rotor; You also can look at the gain and phase margins of the system.; There are no 0 dB gain crossings.; The bode plot of the closed-loop system is shown in Figure 1-6.
Chapter 1 Introduction Xmath Control Design Module 1-12 ni.com Figure 1-5. Helicopter Velocity Tracking Step Input at the Rotor You also can look at the gain and phase margins of the system. H = bode(cl_syscomp2m, {npts = 200, !wrap}); [gm,pm] = margin(H) There are no 0 dB gain crossings. gm (a pdm)...
Page 21 - Closed-Loop System Bode Plot; Helicopter Hover Problem: State Feedback and Observer Design; The approach taken in the
Chapter 1 Introduction © National Instruments Corporation 1-13 Xmath Control Design Module Figure 1-6. Closed-Loop System Bode Plot The domain of the gain and phase margin PDMs indicates the frequency (in hertz) at which the margin occurs. So the gain can be increased by about 26.1 dB before the sys...
Page 22 - Full-State Feedback Regulator
Chapter 1 Introduction Xmath Control Design Module 1-14 ni.com You can verify that your system is controllable, then define the closed-loop poles you want and use poleplace( ) to find the feedback gains required given the system A and B matrices. [,,nuc] = controllable(Gs) nuc (a scalar) = 0 Because...
Page 23 - est
Chapter 1 Introduction © National Instruments Corporation 1-15 Xmath Control Design Module Specify the observer poles at [–3 + 3j, –4] and call poleplace( ) again: op = [-3+3*jay, -4]; L = poleplace(A',C',op) L (a row vector) = 5.46645 4.67623 9.58 You connect the controller to the observer using lq...
Page 24 - by the desired scaling factor.; Step Response for Observer-Based Design; The
Chapter 1 Introduction Xmath Control Design Module 1-16 ni.com You can choose to scale the system output here for zero steady-state error in the step response. This is accomplished in an intuitive manner, dividing the system sys_cl by the desired scaling factor. sys_cl = sys_cl/51.76; v_obc = step(s...
Page 25 - When you create the estimator system
Chapter 1 Introduction © National Instruments Corporation 1-17 Xmath Control Design Module When you create the estimator system sys_est , you use the original A matrix for the state-update equation, but you provide a zero external input (a B matrix of zero). The output matrix is an identity matrix p...
Page 26 - by Estimator, Given Incorrect Initial Values; Helicopter Hover Problem: Discrete Formulation; Helicopter Hover Problem: State; ssys
Chapter 1 Introduction Xmath Control Design Module 1-18 ni.com Figure 1-10. Multiple Plots Showing Time Needed for States to be Correctly Tracked by Estimator, Given Incorrect Initial Values Helicopter Hover Problem: Discrete Formulation Discrete-time control systems are most frequently designed in ...
Page 27 - You can use the default exponential discretization method with; dt
Chapter 1 Introduction © National Instruments Corporation 1-19 Xmath Control Design Module You can use the default exponential discretization method with dt = 0.01 and compare frequency responses between the original system and the discretized system: ssysd = discretize(ssys, 0.01); f = freq(ssys,lo...
Page 28 - Step Response of a Discrete System Using Discretized; The resulting response is shown in Figure 1-12.; Inverted Wedge-Balancing Problem: LQG Control
Chapter 1 Introduction Xmath Control Design Module 1-20 ni.com Figure 1-12. Step Response of a Discrete System Using Discretized Observer-Based Controller As you discretize the compensator, form the closed-loop, scaled system, and simulate its response to a step input, you must ensure that the sampl...
Page 29 - is the angle (in radians) the wedge makes with the vertical axis,
Chapter 1 Introduction © National Instruments Corporation 1-21 Xmath Control Design Module The linearized state-space equations, including the actuator and sensor dynamics, are as follows: θ is the angle (in radians) the wedge makes with the vertical axis, x is the position of the sliding mass, and ...
Page 30 - You then can verify that the regulator gain; Kr; can be used with full-state; NULL; and feeding back the states:
Chapter 1 Introduction Xmath Control Design Module 1-22 ni.com Because this system is open-loop unstable and has fairly fast poles in both halves of the s-plane, you want to make sure it can bring the effect of an external disturbance (such as a sharp push to the cart) to zero as quickly as possible...
Page 31 - The following steps generate the plot shown in Figure 1-14:
Chapter 1 Introduction © National Instruments Corporation 1-23 Xmath Control Design Module Figure 1-13. Response of Full-State Feedback Controller to a Unit Step Disturbance Having established your regulator design, you build the estimator and simulate performance of the closed-loop system feeding b...
Page 32 - Response of Observer-Based Controller to a Unit Step Disturbance
Chapter 1 Introduction Xmath Control Design Module 1-24 ni.com Figure 1-14. Response of Observer-Based Controller to a Unit Step Disturbance
Page 33 - Linear System Representation; Xmath provides a structure for system representation called a; Linear Systems Represented in Xmath; Summary of Linear Systems; System Type; Transfer function
© National Instruments Corporation 2-1 Xmath Control Design Module 2 Linear System Representation Xmath provides a structure for system representation called a system object . This object includes system parameters in a data structure designed to reflect the way these systems are analyzed mathematic...
Page 34 - Transfer Function System Models; Minimal Realizations
Chapter 2 Linear System Representation Xmath Control Design Module 2-2 ni.com Transfer Function System Models One way of representing continuous-time finite-dimensional linear time-invariant systems is with the transfer function: with num(s) and den(s) being polynomials in s . They can be specified ...
Page 35 - State-Space System Models
Chapter 2 Linear System Representation © National Instruments Corporation 2-3 Xmath Control Design Module form the same transfer function as that derived in the preceding transfer function equation using known pole, zero, and gain values: (2-4) The systems represented in Equations 2-3 and 2-4 can be...
Page 37 - and
Chapter 2 Linear System Representation © National Instruments Corporation 2-5 Xmath Control Design Module State-Space System Models State-space models comprise the second category of linear system representations in Xmath. In state-space form, first-order differential (continuous-time) and differenc...
Page 38 - Basic System Building Functions
Chapter 2 Linear System Representation Xmath Control Design Module 2-6 ni.com Again, you create the system using the system( ) function. This time you use the optional dt keyword to indicate that this system is discrete. A = [0,1;-0.75,0]; B = [1,0]'; C = [0,1]; D = 0; sys4 = system(A,B,C,D, {dt = 0...
Page 39 - Discretizing a System
Chapter 2 Linear System Representation © National Instruments Corporation 2-7 Xmath Control Design Module The system( ) function can create both the transfer-function and state-space forms of the system object. It requires four compatibly-sized matrices to create a state-space system, or a pair of p...
Page 40 - Using system( ) to Change the Attributes of an Existing System
Chapter 2 Linear System Representation Xmath Control Design Module 2-8 ni.com Example 2-3 Using system( ) to Change the Attributes of an Existing System sys4=system([0,1;-0.75,0],[1,0]',[0,1],[], {dt=0.5}); sys4 = system(sys4, {inputNames = "Current", outputNames = "Velocity", stateN...
Page 41 - Sys; itself remains unchanged. The transfer function must be proper.
Chapter 2 Linear System Representation © National Instruments Corporation 2-9 Xmath Control Design Module done internally to return A, B, C, and D, though the format of the variable Sys itself remains unchanged. The transfer function must be proper. Using the systems defined in Examples 2-1 and 2-2,...
Page 42 - num
Chapter 2 Linear System Representation Xmath Control Design Module 2-10 ni.com numden( ) [num,den] = numden(Sys) The numden( ) function returns the numerator and denominator polynomials comprising a single-input, single-output system in transfer function form. If the system is in state-space form, a...
Page 43 - Using period( ) to Extract the Sampling Period; Xmath Commands
Chapter 2 Linear System Representation © National Instruments Corporation 2-11 Xmath Control Design Module these polynomials into a transfer-function and uses period( ) to set the sampling interval to match that of sys4 . Example 2-6 Using period( ) to Extract the Sampling Period [num,den]=numden(sy...
Page 44 - Size and Indexing of Dynamic Systems; convert; y q
Chapter 2 Linear System Representation Xmath Control Design Module 2-12 ni.com outputNames = "Velocity", stateNames = ["Torque","Angle"]}); [,,stateNames] = names(sys5)? statenames (a row vector of strings)=Torque Angle Size and Indexing of Dynamic Systems The size of a syste...
Page 45 - initial delay outputs
Chapter 2 Linear System Representation © National Instruments Corporation 2-13 Xmath Control Design Module check(sys, {stable}) ans (a scalar) = 0 check(sys, {discrete, ss}) ans (a scalar) = 1 [, tfsys] = check(sys, {tf, convert}) tfsys (a transfer function) = (z + 0.26) --------------------- (z + 0...
Page 46 - Method of Approximation; forward; d t
Chapter 2 Linear System Representation Xmath Control Design Module 2-14 ni.com discretization methods used based on the specification of each keyword are discussed in the following sections. Numerical Integration Methods: forward, backward, tustins Xmath provides three methods of numerical integrati...
Page 47 - ztransform; z d t
Chapter 2 Linear System Representation © National Instruments Corporation 2-15 Xmath Control Design Module Pole-Zero Matching: polezero The pole-zero matching method of discretizing a continuous system follows from the relation between the continuous s and discrete z frequency domains: where T is th...
Page 48 - exponential
Chapter 2 Linear System Representation Xmath Control Design Module 2-16 ni.com The exponential keyword assumes that the response value between samples is constant and can, therefore, be represented by a zero-order hold polynomial. When exponential is specified, the continuous-time step response is d...
Page 49 - Comparison of Different Frequency Response Techniques
Chapter 2 Linear System Representation © National Instruments Corporation 2-17 Xmath Control Design Module gain_z = 20*log10(abs(freq(Hd_z,F))); gain_e = 20*log10(abs(freq(Hd_e,F))); and plot it (as shown in Figure 2-1). plot ([gainc,gain_f,gain_b,gain_t,gain_z,gain_e], {legend = ["Continuous...
Page 50 - Hold Equivalence; Verifying a Discretization Using makecontinuous( ); s d t
Chapter 2 Linear System Representation Xmath Control Design Module 2-18 ni.com Many of the discretization techniques discussed in the Hold Equivalence Methods: exponential and firstorder section can be easily reversed to obtain a continuous equivalent to a discrete system. The makecontinuous( ) func...
Page 51 - Now convert back to the continuous form:
Chapter 2 Linear System Representation © National Instruments Corporation 2-19 Xmath Control Design Module Now convert back to the continuous form: Hc = makecontinuous(Hd_f, {forward}); [num,den] = numden(Hc) num (a polynomial) = (s + 0.36) den (a polynomial) = 2 (s + 0.999998)(s + 1)(s + 0.79s + 0....
Page 52 - overloaded; Linear System Interconnection Operators; Diagram
© National Instruments Corporation 3-1 Xmath Control Design Module 3 Building System Connections Large system models are frequently built by connecting smaller models together. You can perform different types of linear system interconnections using the Xmath functions discussed in this chapter. Math...
Page 53 - Summary of Interconnection Operators (Continued)
Chapter 3 Building System Connections Xmath Control Design Module 3-2 ni.com Sys = Sys2 * Sys1 Cascade connection of Sys 1 and Sys 2 where the output of Sys is y 2 and the input is u 1 . Sys = Sys1/Sys2 Cascade connection of Sys1 and inverted Sys2 where Sys = Sys 1 * inv(Sys 2 ) , u = u 2 , and y = ...
Page 54 - General
Chapter 3 Building System Connections © National Instruments Corporation 3-3 Xmath Control Design Module Dynamic systems also can be flexibly combined with scalars and compatibly sized matrices using the operators in Table 3-1. A compatibly sized matrix is one having the same dimensions as the dynam...
Page 55 - Linear System Interconnection Functions
Chapter 3 Building System Connections Xmath Control Design Module 3-4 ni.com Linear System Interconnection Functions afeedback( ) , append( ) , connect( ) , and feedback( ) connect dynamic systems in state–space or transfer–function form to produce a larger system in state-space form. The following ...
Page 56 - Using afeedback( ) to Connect Two Systems; Algorithm
Chapter 3 Building System Connections © National Instruments Corporation 3-5 Xmath Control Design Module • By default, feedback is defined to be negative. • The number of outputs from the first system must equal the number of inputs to the second system. • The number of outputs from the second syste...
Page 57 - eps; MATRIXx Help
Chapter 3 Building System Connections Xmath Control Design Module 3-6 ni.com if the condition estimate for either matrix is less than eps . For more information on this condition estimate, refer to the MATRIXx Help for the Xmath function rcond( ) . Using Sys to denote the state-space representation ...
Page 58 - Output of a Dynamic System
Chapter 3 Building System Connections © National Instruments Corporation 3-7 Xmath Control Design Module is created by appending the inputs, outputs, and states of Sys1 and Sys2 . A larger number of systems can be appended by appending two at a time. • Both systems must have the same sample rate. • ...
Page 60 - Both systems must have the same sample rate.
Chapter 3 Building System Connections © National Instruments Corporation 3-9 Xmath Control Design Module • By default, feedback is defined to be positive. To enforce negative feedback, specify connect(Sys,-K) . • A “selection matrix” has a single 1 in each row; the rest of the row contains zeros. Th...
Page 61 - KD; rcond
Chapter 3 Building System Connections Xmath Control Design Module 3-10 ni.com 2 C -1.5 1.5 D 0 X0 0 0 Algorithm For the feedback system shown in Example 3-3, you can write the following system equations: Combining these equations with the equation for the positive feedback input term: and multiplyin...
Page 62 - Feedback System Configuration; Implementing Unity Gain Feedback Using feedback( ); # negative unity gain feedback
Chapter 3 Building System Connections © National Instruments Corporation 3-11 Xmath Control Design Module feedback( ) Sys = feedback(Sys1,{Sys2}) The feedback( ) function connects two dynamic systems together in a feedback loop as shown in Figure 3-4. • By default, feedback is defined to be negative...
Page 63 - The system used for the feedback loop,
Chapter 3 Building System Connections Xmath Control Design Module 3-12 ni.com -1 1 D 0 X0 0 0 State Names ----------- Input Names ----------- Input 1 Output Names ------------ Output 1 System is continuous Algorithm The system used for the feedback loop, Sys2 , is optional. If it is not specified, a...
Page 65 - System Analysis; Time-Domain Solution of System Equations
© National Instruments Corporation 4-1 Xmath Control Design Module 4 System Analysis This chapter discusses time-domain solutions of the equations underlying transfer functions and state-space system models, and what these solutions tell us about the stability of the system. Xmath provides a number ...
Page 66 - System Stability: Poles and Zeros; stability
Chapter 4 System Analysis Xmath Control Design Module 4-2 ni.com The time-response of discrete systems is found directly as a summation of the information from preceding time points in the state and input histories. Using * to indicate discrete convolution, you can express the time domain output as ...
Page 67 - zeros; Using poles( ) with a System in Transfer Function Form
Chapter 4 System Analysis © National Instruments Corporation 4-3 Xmath Control Design Module and define the zeros of S( λ ) as any values of λ for which the system matrix drops rank. For single-input single-output systems this is equivalent to the polynomial zeros of the transfer-function numerator....
Page 68 - normal rank
Chapter 4 System Analysis Xmath Control Design Module 4-4 ni.com directly from the roots of the transfer function numerator. If Sys is in state-space form, the definition of its zeros arises from the system matrix, (4-3) and its MIMO transfer function: (4-4) Defining n as the number of states in the...
Page 69 - QZ; Partial Fraction Expansion; residue
Chapter 4 System Analysis © National Instruments Corporation 4-5 Xmath Control Design Module ans (a column vector) = -0.98875 + 2.4773 j -0.98875 - 2.4773 j k (a scalar) = 1.34P Algorithm The algorithm used for state-space zero computation creates a reduced-order S ( λ ), using Householder reflectio...
Page 70 - Dynamic Response through Partial Fraction Expansion; Constructing the Closed-Loop System; Calculate the closed-loop transfer function.; initial integrator outputs
Chapter 4 System Analysis Xmath Control Design Module 4-6 ni.com Example 4-3 Dynamic Response through Partial Fraction Expansion To illustrate how you can examine the stability and dynamic response of a system using Xmath, start with the open-loop transfer function system You close a unity feedback ...
Page 71 - You can examine the stability of; ) by representing it as a sum of partial; G t
Chapter 4 System Analysis © National Instruments Corporation 4-7 Xmath Control Design Module 0 0 Input Names ----------- Input 1 Output Names ------------ Output 1 System is continuous You can examine the stability of G cl ( s ) by representing it as a sum of partial fractions, using the residue( ) ...
Page 72 - Transient Response of the Closed-Loop System as a Function of Time
Chapter 4 System Analysis Xmath Control Design Module 4-8 ni.com Figure 4-2. Transient Response of the Closed-Loop System as a Function of Time You also can calculate the impulse response directly with t = [0 : 0.1 : 350 ]; hi = impulse(syscl,t); plot(hi, { xlab = "Time (sec)", ylab = "T...
Page 73 - pls; Verifying a; Rp
Chapter 4 System Analysis © National Instruments Corporation 4-9 Xmath Control Design Module and orders for which the residue(s) should be found. If a user-specified value for pls is not actually a pole of the system or if the order requested is greater than the multiplicity of the pole, the corresp...
Page 74 - General Time-Domain Simulation; y s
Chapter 4 System Analysis Xmath Control Design Module 4-10 ni.com (s + 1) (s + 0.79s + 0.16) initial integrator outputs 0 0 0 0 Input Names ----------- Input 1 Output Names ------------ Output 1 System is continuous Note G2 matches the system G where residues were computed in Example 4-4. General Ti...
Page 76 - System Time Response to a Series of Step Signals; General Time-Domain Simulation for a MIMO System
Chapter 4 System Analysis Xmath Control Design Module 4-12 ni.com Figure 4-3. System Time Response to a Series of Step Signals The (system)*(PDM) construct for performing time-domain simulation is used analogously no matter how many inputs the system has. For a multi-input, multi-output system, the ...
Page 77 - Impulse Response of a System
Chapter 4 System Analysis © National Instruments Corporation 4-13 Xmath Control Design Module Impulse Response of a System An impulse input to a system is defined somewhat differently depending on whether the system is discrete or continuous. For a continuous-time system, an impulse is a unit-area s...
Page 78 - 5-second Impulse Response of a Stable State-Space System
Chapter 4 System Analysis Xmath Control Design Module 4-14 ni.com Note A continuous system and its discrete-time equivalent (computed using the impulse-invariant z-transform) have impulse responses differing only by a factor of 1/ dt . impulse( ) computes the impulse response by using the B matrix f...
Page 79 - 5-Second Impulse Response; computes a regular time vector (in units of seconds); tvec; time
Chapter 4 System Analysis © National Instruments Corporation 4-15 Xmath Control Design Module Figure 4-4. 15-Second Impulse Response deftimerange( ) tvec = deftimerange(Sys) deftimerange( ) computes a regular time vector (in units of seconds) that can be used in time-domain simulations to observe th...
Page 80 - System Response to Initial Conditions
Chapter 4 System Analysis Xmath Control Design Module 4-16 ni.com The maximum time, Tmax , is computed as follows, with vP denoting the vector of scaled poles and dt the period: Tmax=abs(log(.05)/... max(real(vP(find(real(vP)<>0))))) If Tmax == null # all poles purely imaginary Tmax=100*dt end...
Page 81 - Using initial( ) to Determine the Sensitivity of the States; 5-Second System Response to Unity Nonzero Conditions
Chapter 4 System Analysis © National Instruments Corporation 4-17 Xmath Control Design Module The simulation performed in initial( ) uses an input of zero for each point in the time vector. The output Y is a PDM where domain is the time vector. By varying the initial values of the states individuall...
Page 82 - Step Response; Performance Measurements for a Step Response
Chapter 4 System Analysis Xmath Control Design Module 4-18 ni.com Step Response The response of a system to a unit step input is one of the most commonly used measures of how well a given control system’s output tracks the system input. A unit step is a time signal which is zero up until the beginni...
Page 83 - 5-Second Step Response, Showing Performance Measures; Mp
Chapter 4 System Analysis © National Instruments Corporation 4-19 Xmath Control Design Module From Figure 4-6 you see that the delay time ( t d ) is about 0.5 seconds, the rise time ( t r ) is 0.8 seconds, the peak time ( t p ) is 1.6 seconds, the settling time ( t s ) is about 5.5 seconds, and the ...
Page 84 - Subtract domain values to get time duration:
Chapter 4 System Analysis Xmath Control Design Module 4-20 ni.com Get indices of all values > 0.9 * final value: gt_9_10 = find(Y > 0.9*Yf); Subtract domain values to get time duration: tr = domain(Y(gt_9_10(1,1)))-... domain(Y(gt_1_10(1,1))) tr (a scalar) = 0.8 Get peak value of response: max...
Page 85 - Classical Feedback Analysis; The open-loop systems analyzed in Chapter 4,; Feedback Control of a Plant Model; Feedback Control System Block Diagram; The output of the open-loop system is; Y s
© National Instruments Corporation 5-1 Xmath Control Design Module 5 Classical Feedback Analysis The open-loop systems analyzed in Chapter 4, System Analysis , generally perform in a satisfactory manner only if the system model is very accurate and there are no external disturbances. These condition...
Page 86 - Root Locus
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-2 ni.com Because open-loop systems are generally easier to study and model than closed-loop systems, you want to design closed-loop systems based on information obtainable from the open-loop system. Root Locus In Chapter 4, System A...
Page 87 - Graphics; pattern; RECOMPUTE; A Comparison of Several Discretization Methods
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-3 Xmath Control Design Module rlocus( ) rlroots=rlocus(sys,K,{xmin,xmax,ymin,ymax,pattern,graph}) rlocus(sys,{xmin,xmax,ymin,ymax,pattern})# (interactive) The rlocus( ) function computes and draws root locus diagrams for cont...
Page 88 - Root Locus of
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-4 ni.com Figure 5-2. Root Locus of H for Gain K = 0.07 This syntax allows you to vary the root locus gain through an interactive form. Within this form, you can change the gain value through either a slider or an editable label wher...
Page 89 - Frequency Response and Dynamic Response
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-5 Xmath Control Design Module As the gain varies, small ✱ ’s appear on the locus indicating the closed-loop pole location for that choice of gain. The locus shown in Figure 5-2 shows that for small gain values the closed-loop...
Page 90 - PHP; I A
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-6 ni.com For discrete-time state-space systems with a sampling interval of T , the frequency response for each frequency point ω is shown in the following equation: Algorithm The algorithm, based on [Lau86], uses a Hessenberg decomp...
Page 91 - Representation of the Open-Loop System; Frequency Response of a Simple System; track; Bode Frequency Analysis
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-7 Xmath Control Design Module For an example of frequency response of a simple system, refer to Example 5-2. Given the single-input, single-output open-loop plant in Figure 5-3, where U ( s ) and Y ( s ) are the frequency dom...
Page 92 - minimum phase
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-8 ni.com because they can be used to assess the relative stability of a closed-loop system given the frequency response of the open-loop system. It should be noted that the open-loop system should be stable and minimum phase , havin...
Page 93 - KH
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-9 Xmath Control Design Module Referring to the entire closed-loop system in Figure 5-1 as G cl , the poles of G cl are the roots of its denominator—that is, the values of s such that either of the following is true: The magni...
Page 94 - Analyzing a Frequency Response Using bode( )
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-10 ni.com Referring to Figure 5-4, notice the additional lines drawn on the plots at the frequencies where the gain crosses the 0 dB line and where the phase crosses the 180 ° line. When the gain crosses the 0 dB line, the phase is ...
Page 95 - Bode Plot Showing System Gain and Phase Margins; contributes –90
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-11 Xmath Control Design Module Figure 5-4. Bode Plot Showing System Gain and Phase Margins These plots illustrate how the location of the system poles and zeros shapes the gain and phase curves. Each pole contributes a factor...
Page 96 - atan
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-12 ni.com Each of these contributes a phase angle φ defined by: with ω and p n expressed in the same units, either radians per second or Hz, and using a four-quadrant arctangent function similar to that provided by atan2( ) in Xmath...
Page 97 - Mg
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 ...
Page 99 - Nyquist Stability Analysis
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-15 Xmath Control Design Module The result is shown in Figure 5-5. Figure 5-5. nichols( ) Gain-Phase Plot Nyquist Stability Analysis Nyquist analysis is a frequency domain method for examining system performance of dynamic sys...
Page 100 - Closed-Loop System Containing a Variable Gain
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-16 ni.com plant is open-loop stable, then there should be no encirclements. If the plant has one open-loop unstable pole, there should be one negative (counter-clockwise) encirclement. The stability criterion is most easily derived ...
Page 102 - Nyquist Plot of the Open-Loop System for Frequencies
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-18 ni.com Figure 5-7. Nyquist Plot of the Open-Loop System for Frequencies from 0.01 Hz to 10 Hz Figure 5-8. Nyquist Plot of the Open-Loop System for Frequencies from 0.5 Hz to 5 Hz
Page 103 - Nyquist Contour Formed by Drawing the System’s Nyquist Plot; will be equal
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-19 Xmath Control Design Module By combining the information from the two plots, reflecting them across the real axis to account for the negative frequency response and augmenting them with a line closing the contour in the cl...
Page 104 - Linear Systems and Power Spectral Density; Uspec; H q
Chapter 5 Classical Feedback Analysis Xmath Control Design Module 5-20 ni.com -0.52263 0.00336213 + 3.75217 j 0.00336213 - 3.75217 j -11.4841 Two of the poles of the closed-loop system are now unstable. Linear Systems and Power Spectral Density A key characteristic of the linear, time-invariant syst...
Page 105 - Verifying the Response of a System to White Noise Input; j w; j w
Chapter 5 Classical Feedback Analysis © National Instruments Corporation 5-21 Xmath Control Design Module values at which the power spectral density is to be computed and where dependent matrices are the input power spectral density matrix at each frequency. psd( ) computes a cross power spectral de...
Page 106 - Controllability
© National Instruments Corporation 6-1 Xmath Control Design Module 6 State-Space Design The functions in this chapter are generally termed “modern control” tools. They are based on the state-space linear system representation, and employ methods which are generally applicable to both SISO and MIMO p...
Page 107 - an
Chapter 6 State-Space Design Xmath Control Design Module 6-2 ni.com matrix B, then the mode of the system associated with the corresponding eigenvalue cannot be controlled with any input. You can think of this in the SISO transfer function case as a cancellation between a numerator and denominator r...
Page 108 - Full-State Feedback Being Used to Relocate the Eigenvalues; function returns; The system has 2 uncontrollable states
Chapter 6 State-Space Design © National Instruments Corporation 6-3 Xmath Control Design Module Figure 6-1. Full-State Feedback Being Used to Relocate the Eigenvalues of a Controllable System Based on the Value of the Gain K controllable( ) [SysC,T,nuc]=controllable(Sys,{tol}) The question that natu...
Page 109 - Similarly, if you form the controllability matrix for this system,; Observability and Estimation; As described in the
Chapter 6 State-Space Design Xmath Control Design Module 6-4 ni.com X0 0 Input Names ----------- Input 1 Output Names ------------ Output 1 System is continuous T (a square matrix) = 2.22045e-16 0 -1 0 1 0 -1 0 2.22045e-16 nuc (a scalar) = 2 These results indicate that only the first state of the sy...
Page 110 - Du
Chapter 6 State-Space Design © National Instruments Corporation 6-5 Xmath Control Design Module Beginning with the basic state-space equations (the Du output term can be omitted without loss of generality): you can obtain expressions for the successive derivatives of the output term, thus forming a ...
Page 111 - General Observer Block Diagram; LC; A L C
Chapter 6 State-Space Design Xmath Control Design Module 6-6 ni.com Figure 6-2. General Observer Block Diagram If the observability matrix is nonsingular, you will be able to put the eigenvalues (pole locations) of ( A – LC ), shown in Equation 6-4, anywhere you want. Thus, you can choose them to ma...
Page 112 - Observability of a System; The system has 1 unobservable state; Similarly, if you form the observability matrix for this system,; endFor
Chapter 6 State-Space Design © National Instruments Corporation 6-7 Xmath Control Design Module Example 6-2 Observability of a System A system is described by: A = [1,0,0.01;0,1,0;0,0,1]; B = [1,0,0]';C = [0.6,0.8,0];D = 0; Sys = system(A,B,C,D); Performing, [SysO,T,nuo] = observable(Sys); The syste...
Page 113 - Finding a Minimal Realization for a System
Chapter 6 State-Space Design Xmath Control Design Module 6-8 ni.com minimal( ) [SysM,T,nuco] = minimal(Sys,{tol}) Because nonminimal systems are uncontrollable, unobservable, or both, you want to be able to compute the minimal realization for a given system. This comprises the controllable and obser...
Page 114 - ans is null; A T
Chapter 6 State-Space Design © National Instruments Corporation 6-9 Xmath Control Design Module ans (a scalar) = 1 zeros(SysM) ans is null stair( ) [SysT,T,nc] = stair(Sys,tol) The stair( ) converts a dynamic system to staircase form. In the staircase form, the A and B system matrices are linearly t...
Page 115 - Duality and Pole Placement
Chapter 6 State-Space Design Xmath Control Design Module 6-10 ni.com Duality and Pole Placement The new state-update equation in the Controllability section and the Observability and Estimation section, the time-update equation in the Observability and Estimation section, along with the correspondin...
Page 116 - Arbitrary Pole Placement for a Controllable System
Chapter 6 State-Space Design © National Instruments Corporation 6-11 Xmath Control Design Module poleplace( ) is unusual among Xmath’s modern control design functions in that only the A and B matrix variables are used as input, rather than a complete system variable. This is done because the other s...
Page 117 - Linear Quadratic Regulator; Continuous-Time Regulator
Chapter 6 State-Space Design Xmath Control Design Module 6-12 ni.com pairs as poles( ) . For each pole value in poles( ) , poleplace( ) forms a vector by subtracting the pole’s value from each diagonal element of S except for the last element (0). The resulting matrix is then divided by the correspo...
Page 119 - Designing a Regulator for the Inverted Pendulum
Chapter 6 State-Space Design Xmath Control Design Module 6-14 ni.com The optimal estimator and regulator problems illustrate the principle of duality—that for any given system realization {A,B,C} there is a dual realization {A',C',B'} with related controllability and observability. Refer to the Dual...
Page 120 - Diagram of Plant for the Inverted Pendulum Problem
Chapter 6 State-Space Design © National Instruments Corporation 6-15 Xmath Control Design Module Figure 6-4. Diagram of Plant for the Inverted Pendulum Problem Figure 6-4 shows the pendulum at φ = 0 and φ > 0. The distance of the cart from some initial reference point along the line of its motion...
Page 121 - Ruu; Linear Quadratic Estimator
Chapter 6 State-Space Design Xmath Control Design Module 6-16 ni.com Ruu is a scalar because you have only one input for this particular model. [Kr,ev,P] = regulator(ipsys,Rxx,Ruu); Kr Kr (a row vector) = -348.778 -32.1056 -100 -27.3036 Note You will use this regulator gain later in designing a comp...
Page 122 - Diagram of the Estimator Representation; A x B u G w; E G
Chapter 6 State-Space Design © National Instruments Corporation 6-17 Xmath Control Design Module Figure 6-5. Diagram of the Estimator Representation estimator( ) inputs include the dynamic system Sys , and the noise intensity matrices Q xx , Q yy , or Q xy . For a linear–time–invariant process descr...
Page 123 - and where the matrix
Chapter 6 State-Space Design Xmath Control Design Module 6-18 ni.com numerical difficulties are encountered, the algorithm will attempt to determine whether or not the problem is well posed. Checks are made to determine the reachability and the positive definiteness or semipositive-definiteness of t...
Page 125 - Riccati Equation
Chapter 6 State-Space Design Xmath Control Design Module 6-20 ni.com this measurement update, derived in [Kal60], are shown in the following equations. Substituting the system and noise matrices for the steady-state case, you solve the discrete Riccati equation to obtain P and thence K e , as shown ...
Page 126 - . For an example of how to design a state estimator; , which is a function of the input matrix:; Ke; Linear Quadratic Gaussian Compensation
Chapter 6 State-Space Design © National Instruments Corporation 6-21 Xmath Control Design Module If you want the closed-loop system eigenvalues, compute them as the eigenvalues of A – K e C . For an example of how to design a state estimator for the inverted pendulum problem, refer to Example 6-6. E...
Page 127 - and state estimator with gain; Linear Quadratic Gaussian Compensator (in the Bold Rectangle)
Chapter 6 State-Space Design Xmath Control Design Module 6-22 ni.com a compensator is shown in Figure 6-6. This figure combines full-state regulator with gain K r and state estimator with gain K e . Combining the plant, or system, equations with those of the regulator and estimator, you can simplify...
Page 128 - SysC; Combining the Regulator and Estimator into a Full Compensator
Chapter 6 State-Space Design © National Instruments Corporation 6-23 Xmath Control Design Module lqgcomp( ) SysC = lqgcomp(Sys,Kr,Ke,{direct}) The lqgcomp( ) function creates a dynamic compensator given a dynamic system having at least one state and the regulator and estimator gain matrices. The ret...
Page 129 - Set plot attributes for all three plots:; endfor
Chapter 6 State-Space Design Xmath Control Design Module 6-24 ni.com simulate the system’s response to a slow sine input, starting with the cart at rest and the pendulum initially held in the upright ( φ = 0) position to obtain Figure 6-7: t = 0:0.01:15; u = pdm([sin(t/2); zeros(t);zeros(t)],t);ycl ...
Page 132 - System is continuous; Discrete Riccati Equation
Chapter 6 State-Space Design © National Instruments Corporation 6-27 Xmath Control Design Module 0 0 0 -4 B 0 -2 0 1 C 0.211325 0.756044 0.000221135 0.330327 D 0 X0 0 0 0 0 System is continuous [P,resid] = riccati(A,Q,R); norm(A'*P+P*A-P*R*P+Q,1) ans (a scalar) = 2.53297e-13 R = 1e-5; [P,resid]=ricc...
Page 133 - System is discrete, sampling at 1 seconds.; A X X B
Chapter 6 State-Space Design Xmath Control Design Module 6-28 ni.com 0 1 0 B 1 0 0 C 1 0 0 D 0 X0 0 0 0 System is discrete, sampling at 1 seconds. [P,resid]=riccati(Sys,Q,RD,B); norm(A'*P*A-P-A'*P*B*inv(RD+B'*P*B)*B'*P*A+Q,1) resid (a scalar) = 7.90593e-12 [P,resid]=riccati(Sys,Q,RD,B); norm(A'*P*A-...
Page 135 - Steady state; eye; C x
Chapter 6 State-Space Design Xmath Control Design Module 6-30 ni.com or the following for the discrete case: (6-16) These results derive from the Lyapunov method of stability analysis for linear systems. Steady state means that at some point the states no longer change. The derivative term approache...
Page 136 - To solve the special Lyapunov equation, use the following syntax:; Discrete Lyapunov Equation; A X
Chapter 6 State-Space Design © National Instruments Corporation 6-31 Xmath Control Design Module of the diagonal elements of the Schur-decomposed A and B matrices sum to zero, a warning is given that the continuous equation solution may not be unique. A similar warning appears for the discrete equat...
Page 137 - Special Lyapunov Equation; Ucov; A X X A; C X C
Chapter 6 State-Space Design Xmath Control Design Module 6-32 ni.com Special Lyapunov Equation A = [-4,10;2,7]; C = [.3,6;2,9]; X = lyapunov(A,C) X (a square matrix) = 1.1816 -0.209028 1.12431 -0.773611 A*X + X*A' + C; norm(A*X + X*A' + C,1) ans (a scalar) = 5.4956e-15 rms( ) [Yrms,Ycov] = rms(Sys,U...
Page 138 - Balancing a Linear System
Chapter 6 State-Space Design © National Instruments Corporation 6-33 Xmath Control Design Module Example 6-11 rms( ) Response Sys = system([-2.3,0.01,5.1;0,-0.35,-2; 0,2,-.35],[1,.25,.25]',[1.34,0,0],0); w = logspace(0.01,1,50); Uspec = pdm(ones(w),w); [Ypsd,Yspec] = psd(Sys,Uspec); Balancing a Line...
Page 139 - T x
Chapter 6 State-Space Design Xmath Control Design Module 6-34 ni.com For discrete-time systems, the integrals in the W c and W o equations are replaced by summation signs and the grammians are obtained as the solutions of the discrete-time Lyapunov equations: (6-19) The controllability grammian must...
Page 140 - SysB; D u
Chapter 6 State-Space Design © National Instruments Corporation 6-35 Xmath Control Design Module and σ 1 2 through σ n 2 are the singular values of the matrix H satisfying Σ 2 = H'H. They are termed the Hankel singular values. The σ k 2 terms are ordered so that σ 1 2 ≥ σ 2 2 ≥ … ≥ σ n 2 ≥ 0. The ba...
Page 141 - HSV; Balancing a System
Chapter 6 State-Space Design Xmath Control Design Module 6-36 ni.com T is the transformation relating the states of the original system to the states of the balanced system Transforming to balanced coordinates can be useful in model reduction because the relative importance of the state to the syste...
Page 142 - Modal Form of a System
Chapter 6 State-Space Design © National Instruments Corporation 6-37 Xmath Control Design Module and compare the condition numbers of the balanced system’s grammians: WcB=lyapunov(Ab,Bb*Bb'); WoB=lyapunov(Ab',Cb'*Cb); condition(WcB) ans (a scalar) = 12.7394 condition(WoB) ans (a scalar) = 12.7394 Th...
Page 143 - AT; keep
Chapter 6 State-Space Design Xmath Control Design Module 6-38 ni.com accurate. Given a variable Sys built from the matrices {A,B,C,D}, the modal decomposition SysMod is built from T –1 AT , T –1 B , CT , and D , where T is the transformation matrix to modal form. If you have complex poles, then T –1...
Page 144 - Model Reduction Module
Chapter 6 State-Space Design © National Instruments Corporation 6-39 Xmath Control Design Module the derivative of x 2 is set to zero, resulting in reduced-order state equations of the form: In the discrete case, x 2 k + 1 is taken to be equal to x 2 k so that the state equations become: When using ...
Page 147 - Modal System and Reduced Modal System
Chapter 6 State-Space Design Xmath Control Design Module 6-42 ni.com Figure 6-8. Modal System and Reduced Modal System
Page 152 - default frequency range
© National Instruments Corporation I-1 Xmath Control Design Module Index A abcd, 1-16, 2-8adjoint system, 3-3afeedback, 3-4append, 3-6appending dynamic systems, 3-6autocorrelation function, 5-20 B balance, 6-35bilinear transform, 2-14Bode default frequency range (deffreqrange), 5-10 format, 5-8frequ...
Page 153 - converting to continuous
Index Xmath Control Design Module I-2 ni.com converting to continuous equivalent, 2-19 from a continuous system (example), 1-18 discrete-time Riccati equation, 6-25discretize, 2-13discretizing a system backward rectangular method, 2-14forward rectangular method, 2-14hold equivalence methods, 2-15pol...
Page 154 - linear
Index © National Instruments Corporation I-3 Xmath Control Design Module I impulse, 4-13 input, 4-13 continuous time, 4-13discrete time, 4-13 response, 4-13, 6-33 initial, 4-16initial conditions, 4-14, 4-16input disturbance matrix, 6-17names, extracting, 2-11 instability, 5-9instrument drivers (NI r...
Page 155 - operators
Index Xmath Control Design Module I-4 ni.com steady-state response to white noise, 6-29white process, 6-23 nomenclature, 1-2numden, 2-10numerical integration methods, 2-14Nyquist contour, 5-19plot, 5-17stability criterion, 5-15 nyquist, 5-16 O observability, 6-4, 6-35 grammians, 6-30matrix, 6-5 obse...
Page 156 - selection matrix for adding or removing
Index © National Instruments Corporation I-5 Xmath Control Design Module rms, 6-32root locus, plotting, 5-3root-mean-square response, 6-32 S sample period, extract with period, 2-10sample rate, 2-4 choosing, 1-18 scale system output, 1-16Schur decomposition, 6-30solver, 6-26 selection matrix for add...
Page 157 - transform
Index Xmath Control Design Module I-6 ni.com T technical support, B-1time domain simulation, general, 4-10update, 6-19 training and certification (NI resources), B-1transfer function checking for, 2-12coefficients form, 2-3converted to state space before decomposition, 2-9 creating, 2-3form, definit...