calculate the state feedback gain for single-input or multiple-input systems according to desired closed-loop poles - MapleSim Help

ControlDesign[StateFeedback][PolePlacement] - calculate the state feedback gain for single-input or multiple-input systems according to desired closed-loop poles

 Calling Sequence PolePlacement(Amat, Bmat, p, opts) PolePlacement(sys, p, opts)

Parameters

 sys - System; system object p - list; list of desired closed-loop poles (real or complex). Complex poles including those containing symbolic parameters must be given in complex conjugate pairs. All symbolic parameters in the list are assumed to be real. Amat - Matrix; system matrix of a state-space system Bmat - Matrix or Vector; input matrix of a state-space system opts - (optional) equation(s) of the form option = value; specify options for the PolePlacement command

Description

 • The PolePlacement command calculates the state feedback gain ${K}_{c}$ for single-input or  multiple-input systems according to the desired closed-loop pole locations given by p.
 • The system sys is a continuous or discrete-time linear system object created using the DynamicSystems package. The system object must be in state-space (SS) form and must be controllable. If Amat and Bmat matrices are specified, the (Amat, Bmat) pair must be controllable.
 • The pole placement is performed using the Sylvester equation method if open-loop and closed-loop poles are disjoint and there are no symbolic parameters in the $A$ and $B$ matrices and the p list. The closed-loop system matrix is then $\mathrm{Ac}=A-B\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{K}_{c}$ where ${K}_{c}$ is the calculated feedback gain. The algorithm detects if any of the open-loop poles and desired closed-loop poles are at the same position (or numerically too close) or if any symbolic parameters exists and switches to the cyclic method in such cases.
 • When the syntax PolePlacement(sys, p, return_Kr) is used, the direct gain ${K}_{r}$ is computed as follows:

$\left(C-\mathrm{D}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{K}_{c}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\left(\frac{1}{-A+B\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{K}_{c}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}B+\mathrm{D}$ (continuous time)

$\left(C-\mathrm{D}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{K}_{c}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\left(\frac{1}{-A+I+B\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{K}_{c}}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}B+\mathrm{D}$ (discrete time)

 • If sys contains structural uncontrollable states, use ReduceSystem to remove them before computing the state feedback gain ${K}_{c}$.

Examples

 > $\mathrm{with}\left(\mathrm{ControlDesign}\right):$
 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$

Numeric example

 • State-space system matrix Amat and input matrix Bmat (5 states and 3 inputs)
 > $\mathrm{Amat}:=\mathrm{Matrix}\left(\left[\left[1,-2,3,-5,12\right],\left[0,4,-1,2,-3\right],\left[2,5,7,-4,3\right],\left[-2,4,3,8,7\right],\left[19,14,1,-4,7\right]\right]\right):$
 > $\mathrm{Bmat}:=\mathrm{Matrix}\left(\left[\left[3,6,3\right],\left[9,7,5\right],\left[5,2,1\right],\left[4,-1,7\right],\left[6,-8,2\right]\right]\right):$
 • Desired poles
 > $\mathrm{p1}:=\left[-1+I,-0.1,-3.581,-1-I,-5.7720\right]:$
 • Obtain the state feedback gain Kc:
 > $\mathrm{Kc}:=\mathrm{StateFeedback}:-\mathrm{PolePlacement}\left(\mathrm{Amat},\mathrm{Bmat},\mathrm{p1}\right)$
 ${\mathrm{Kc}}{:=}\left[\begin{array}{ccccc}{4.90010228021972}& {1.35723979032959}& {-}{0.298845142567289}& {-}{3.75886722413406}& {2.98040260420065}\\ {-}{0.769663041613275}& {-}{0.805638413823458}& {0.0343911471969752}& {-}{1.04028874033608}& {-}{1.15733500000762}\\ {-}{4.12917582839675}& {-}{0.310095814574338}& {0.515200545031561}& {4.00754085025247}& {-}{2.27773489827041}\end{array}\right]$ (1)
 • Verify the closed-loop system matrix has the desired poles
 > $\mathrm{LinearAlgebra}:-\mathrm{Eigenvalues}\left(\mathrm{Amat}-\mathrm{Bmat}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{Kc}\right)$
 $\left[\begin{array}{c}{-}{5.77200000000070}{+}{0.}{}{I}\\ {-}{3.58099999999910}{+}{0.}{}{I}\\ {-}{0.100000000000409}{+}{0.}{}{I}\\ {-}{0.999999999999838}{+}{0.999999999999992}{}{I}\\ {-}{0.999999999999838}{-}{0.999999999999992}{}{I}\end{array}\right]$ (2)

Symbolic example

 • System object sys with symbolic entries (3 states, 3 inputs, 3 outputs)
 > $\mathrm{sys}:=\mathrm{StateSpace}\left(\mathrm{Matrix}\left(\left[\left[1,2,3\right],\left[x,4,-1\right],\left[2,5,7\right]\right]\right),\mathrm{Matrix}\left(\left[\left[3,6\right],\left[9,7\right],\left[5,2\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,0,0\right],\left[0,1,0\right],\left[0,0,1\right]\right]\right),\mathrm{Matrix}\left(3,2\right)\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{3 output\left(s\right); 2 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right){,}{\mathrm{y3}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{1}& {2}& {3}\\ {x}& {4}& {-1}\\ {2}& {5}& {7}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{3}& {6}\\ {9}& {7}\\ {5}& {2}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {0}\\ {0}& {0}& {1}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{0}& {0}\\ {0}& {0}\\ {0}& {0}\end{array}\right]\end{array}\right$ (3)
 • Desired symbolic poles
 > $\mathrm{p2}:=\left[-4,-b+cI,-b-cI\right]:$
 • Obtain the state feedback gain Kc and the feed-forward gain Kr:
 > $\mathrm{Kc},\mathrm{Kr}:=\mathrm{StateFeedback}:-\mathrm{PolePlacement}\left(\mathrm{sys},\mathrm{p2},'\mathrm{return_Kr}'=\mathrm{true},'\mathrm{parameters}'=\left[x=0\right]\right):$
 > $\mathrm{evalf}\left(\mathrm{Kc}\right)$
 $\left[\begin{array}{ccc}{-}{0.01105243808}{}{{b}}^{{2}}{-}{0.01105243808}{}{{c}}^{{2}}{-}{0.07399413568}{}{b}{-}{0.3147790352}& {0.01492746525}{}{{b}}^{{2}}{+}{0.01492746525}{}{{c}}^{{2}}{-}{0.05451317909}{}{b}{-}{0.8774754121}& {-}{0.01297231488}{}{{b}}^{{2}}{-}{0.01297231488}{}{{c}}^{{2}}{-}{0.2777819673}{}{b}{-}{1.055971500}\\ {0.03282239188}{}{{b}}^{{2}}{+}{0.03282239188}{}{{c}}^{{2}}{+}{0.2197401605}{}{b}{+}{0.9347983468}& {-}{0.04433004833}{}{{b}}^{{2}}{-}{0.04433004833}{}{{c}}^{{2}}{+}{0.1618876227}{}{b}{+}{2.605836072}& {0.03852384419}{}{{b}}^{{2}}{+}{0.03852384419}{}{{c}}^{{2}}{+}{0.8249282666}{}{b}{+}{3.135915362}\end{array}\right]$ (4)
 > $\mathrm{evalf}\left(\mathrm{Kr}\right)$
 $\left[\begin{array}{ccc}{-}{0.008550987593}{}{{b}}^{{2}}{-}{0.008550987593}{}{{c}}^{{2}}{-}{0.001731055306}{}{b}{+}{0.04885958325}& {0.01803167490}{}{{b}}^{{2}}{+}{0.01803167490}{}{{c}}^{{2}}{+}{0.03516269174}{}{b}{-}{0.9924780905}& {-}{0.003750099818}{}{{b}}^{{2}}{-}{0.003750099818}{}{{c}}^{{2}}{-}{0.01136627340}{}{b}{+}{0.3208166598}\\ {0.02539384194}{}{{b}}^{{2}}{+}{0.02539384194}{}{{c}}^{{2}}{+}{0.005140709696}{}{b}{-}{0.07434464063}& {-}{0.05354861031}{}{{b}}^{{2}}{-}{0.05354861031}{}{{c}}^{{2}}{-}{0.1044225391}{}{b}{+}{1.510152606}& {0.01113666007}{}{{b}}^{{2}}{+}{0.01113666007}{}{{c}}^{{2}}{+}{0.03375438766}{}{b}{-}{0.4881539649}\end{array}\right]$ (5)
 • Verify the closed-loop system matrix has the desired poles
 > $\mathrm{sys}:-a:=\genfrac{}{}{0}{}{\mathrm{sys}:-a}{\phantom{x=0}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}|\phantom{\rule[-0.0ex]{0.1em}{0.0ex}}\genfrac{}{}{0}{}{\phantom{\mathrm{sys}:-a}}{x=0}:$
 > $\mathrm{eigen}:=\mathrm{LinearAlgebra}:-\mathrm{Eigenvalues}\left(\mathrm{sys}:-a-\mathrm{sys}:-b\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}.\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{Kc}\right)$
 ${\mathrm{eigen}}{:=}\left[\begin{array}{c}{-}{4}\\ {-}{b}{+}{I}{}{c}\\ {-}{b}{-}{I}{}{c}\end{array}\right]$ (6)

Use ReduceSystem

 > $\mathrm{sys1}:=\mathrm{StateSpace}\left(\mathrm{Matrix}\left(\left[\left[4,0,-3,5\right],\left[3,0,0,3\right],\left[1,0,-1,1\right],\left[0,0,0,0\right]\right]\right),\mathrm{Matrix}\left(\left[\left[5,1,-1\right],\left[1,3,-1\right],\left[0,2,6\right],\left[0,0,z\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,0,3,5\right],\left[-3,0,5,7\right]\right]\right),\mathrm{Matrix}\left(\left[\left[1,0,0\right],\left[0,1,1\right]\right]\right)\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 3 input\left(s\right); 4 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\left({t}\right){,}{\mathrm{u3}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right){,}{\mathrm{x4}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cccc}{4}& {0}& {-3}& {5}\\ {3}& {0}& {0}& {3}\\ {1}& {0}& {-1}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{ccc}{5}& {1}& {-1}\\ {1}& {3}& {-1}\\ {0}& {2}& {6}\\ {0}& {0}& {z}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1}& {0}& {3}& {5}\\ {-3}& {0}& {5}& {7}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {1}\end{array}\right]\end{array}\right$ (7)
 • Get a subsystem considering the first two inputs.
 > $\mathrm{subsys1}:=\mathrm{Subsystem}\left(\mathrm{sys1},\left\{1,2\right\}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{subsys1}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 2 input\left(s\right); 4 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right){,}{\mathrm{x4}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{cccc}{4}& {0}& {-3}& {5}\\ {3}& {0}& {0}& {3}\\ {1}& {0}& {-1}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{5}& {1}\\ {1}& {3}\\ {0}& {2}\\ {0}& {0}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1}& {0}& {3}& {5}\\ {-3}& {0}& {5}& {7}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]\end{array}\right$ (8)
 • Desired poles
 > $\mathrm{p3}:=\left[-1+I\cdot 3,-1-I\cdot 3,-7+I\cdot 9,-7-I\cdot 9\right]$
 ${\mathrm{p3}}{:=}\left[{-}{1}{+}{3}{}{I}{,}{-}{1}{-}{3}{}{I}{,}{-}{7}{+}{9}{}{I}{,}{-}{7}{-}{9}{}{I}\right]$ (9)
 • Get the state-feedback gain for subsys1
 > $\mathrm{Kc}:=\mathrm{StateFeedback}:-\mathrm{PolePlacement}\left(\mathrm{subsys1},\mathrm{p3}\right)$
 • Remove the uncontrollable states if possible. ReduceSystem will remove the structural uncontrollable states.
 > $\mathrm{rsubsys}:=\mathrm{ReduceSystem}\left(\mathrm{subsys1},'\mathrm{reducedtype}'=\mathrm{controllable}\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{rsubsys}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 2 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({t}\right){,}{\mathrm{u2}}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({t}\right){,}{\mathrm{y2}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{x1}}{}\left({t}\right){,}{\mathrm{x2}}{}\left({t}\right){,}{\mathrm{x3}}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{4}& {0}& {-3}\\ {3}& {0}& {0}\\ {1}& {0}& {-1}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{5}& {1}\\ {1}& {3}\\ {0}& {2}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1}& {0}& {3}\\ {-3}& {0}& {5}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{cc}{1}& {0}\\ {0}& {1}\end{array}\right]\end{array}\right$ (10)
 • Verify the resulting subsystem is controllable
 > $\mathrm{Controllable}\left(\mathrm{rsubsys}\right)$
 ${\mathrm{true}}$ (11)
 • Desired poles for the controllable subsystem
 > $\mathrm{p4}:=\left[-1,-7+I\cdot 9,-7-I\cdot 9\right]:$
 > $\mathrm{Kc}:=\mathrm{StateFeedback}:-\mathrm{PolePlacement}\left(\mathrm{rsubsys},\mathrm{p4}\right)$
 ${\mathrm{Kc}}{:=}\left[\begin{array}{ccc}{28.9685270912122}& {-}{26.7020470703172}& {-}{39.7576673991609}\\ {22.6847169462840}& {-}{20.6103716469187}& {-}{30.4970951956363}\end{array}\right]$ (12)