ControlDesign

 ComputePoles
 compute the poles used in an Ackermann pole placement design based on a desired time constant of the closed-loop system

 Calling Sequence ComputePoles(sys, Tc, opts)

Parameters

 sys - System; system object Tc - And(positive, numeric); desired closed-loop time constant (in seconds) opts - (optional) equation(s) of the form option = value; specify options for the ComputePoles command

Options

 • parameters = {list, set}(name = complexcons)
 Specifies numeric values for the parameters of sys. These values override any parameters previously specified for sys. The numeric value on the right-hand side of each equation is substituted for the name on the left-hand side in the sys equations. The default is the value of sys given by DynamicSystems:-SystemOptions(parameters).

Description

 • The ComputePoles command returns a list of poles needed to design a state feedback controller for sys by pole placement with the Ackermann command. The returned list will contain as many poles as the number of states of sys.
 • The computation of the poles is done based on the desired time constant, Tc (seconds), of the closed-loop system.
 • The system sys is a continuous or discrete-time linear system object created using the DynamicSystems package. The system object must have a single input and must be controllable and in state-space (SS) form.
 • If sys is uncontrollable, try the ReduceSystem command to remove any structurally uncontrollable states of sys.

Examples

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

Use parameters option

 • Consider a state-space system corresponding to a DC Motor:
 > $\mathrm{sys_a}≔\mathrm{Matrix}\left(\left[\left[-\frac{d}{J},\frac{K}{J},0\right],\left[-\frac{K}{L},-\frac{R}{L},0\right],\left[1,0,0\right]\right]\right):$
 > $\mathrm{sys_b}≔\mathrm{Matrix}\left(\left[\left[0,\frac{1}{J}\right],\left[\frac{1}{L},0\right],\left[0,0\right]\right]\right):$
 > $\mathrm{sys_c}≔\mathrm{Matrix}\left(\left[\left[0,1,0\right],\left[1,0,0\right],\left[0,0,1\right]\right]\right):$
 > $\mathrm{sys_d}≔\mathrm{Matrix}\left(\left[\left[0,0\right],\left[0,0\right],\left[0,0\right]\right]\right):$
 > $\mathrm{sys1}≔\mathrm{StateSpace}\left(\mathrm{sys_a},\mathrm{sys_b},\mathrm{sys_c},\mathrm{sys_d},'\mathrm{inputvariable}'=\left[V\left(t\right),T\left(t\right)\right],'\mathrm{outputvariable}'=\left[\mathrm{i_out}\left(t\right),\mathrm{omega_out}\left(t\right),\mathrm{theta_out}\left(t\right)\right],'\mathrm{statevariable}'=\left[\mathrm{ω}\left(t\right),i\left(t\right),\mathrm{θ}\left(t\right)\right]\right):$
 > $\mathrm{PrintSystem}\left(\mathrm{sys1}\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[{V}{}\left({t}\right){,}{T}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{i_out}}{}\left({t}\right){,}{\mathrm{omega_out}}{}\left({t}\right){,}{\mathrm{theta_out}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{\omega }}{}\left({t}\right){,}{i}{}\left({t}\right){,}{\mathrm{\theta }}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{-}\frac{{d}}{{J}}& \frac{{K}}{{J}}& {0}\\ {-}\frac{{K}}{{L}}& {-}\frac{{R}}{{L}}& {0}\\ {1}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{cc}{0}& \frac{{1}}{{J}}\\ \frac{{1}}{{L}}& {0}\\ {0}& {0}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{0}& {1}& {0}\\ {1}& {0}& {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$ (1)
 • The numeric values of the model parameters are as follows:
 > $\mathrm{params1}≔\left\{J=0.01,d=0.1,K=0.01,R=1,L=0.5\right\}:$
 • Extract a subsystem with the desired input and output.
 > $\mathrm{subsys1}≔\mathrm{Subsystem}\left(\mathrm{sys1},\left\{1\right\},\left\{2\right\}\right):$$\mathrm{PrintSystem}\left(\mathrm{subsys1}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{V}{}\left({t}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{omega_out}}{}\left({t}\right)\right]\\ {\mathrm{statevariable}}{=}\left[{\mathrm{\omega }}{}\left({t}\right){,}{i}{}\left({t}\right){,}{\mathrm{\theta }}{}\left({t}\right)\right]\\ {\mathrm{a}}{=}\left[\begin{array}{ccc}{-}\frac{{d}}{{J}}& \frac{{K}}{{J}}& {0}\\ {-}\frac{{K}}{{L}}& {-}\frac{{R}}{{L}}& {0}\\ {1}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{0}\\ \frac{{1}}{{L}}\\ {0}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1}& {0}& {0}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{0}\end{array}\right]\end{array}\right$ (2)
 • Check if the subsystem is controllable:
 > $\mathrm{Controllable}\left(\mathrm{subsys1}\right)$
 ${\mathrm{true}}$ (3)
 • Compute the poles for a desired time constant of 1 second:
 > $\mathrm{τ}≔1:$
 > $\mathrm{p1}≔\mathrm{ComputePoles}\left(\mathrm{subsys1},\mathrm{τ},'\mathrm{parameters}'=\mathrm{params1}\right)$
 ${\mathrm{p1}}{≔}\left[{-}{1.}{,}{-}{1.}{,}{-}{1.}\right]$ (4)
 • Use the previous results to compute the state feedback gain:
 > $\mathrm{Kc}≔\mathrm{StateFeedback}:-\mathrm{Ackermann}\left(\mathrm{subsys1},\mathrm{p1},'\mathrm{parameters}'=\mathrm{params1}\right)$
 ${\mathrm{Kc}}{≔}\left[\begin{array}{ccc}{36.49000000}& {-}{4.500000000}& {0.5000000000}\end{array}\right]$ (5)

Use ReduceSystem

 • Consider the following state-space system
 > $\mathrm{Am}≔\mathrm{Matrix}\left(\left[\left[\mathrm{δ},1,-\mathrm{φ},\mathrm{σ}\right],\left[3,0,0,3\right],\left[1,0,-1,1\right],\left[0,0,0,0\right]\right]\right):$
 > $\mathrm{Bm}≔\mathrm{Matrix}\left(\left[\left[5,z,-1\right],\left[1,3,-x\right],\left[0,2,y\right],\left[0,0,z\right]\right]\right):$
 > $\mathrm{Cm}≔\mathrm{Matrix}\left(\left[\left[1,0,3,5\right],\left[-3,0,\mathrm{σ},7\right]\right]\right):$
 > $\mathrm{Dm}≔\mathrm{Matrix}\left(\left[\left[1,0,0\right],\left[0,1,1\right]\right]\right):$
 > $\mathrm{sys2}≔\mathrm{StateSpace}\left(\mathrm{Am},\mathrm{Bm},\mathrm{Cm},\mathrm{Dm}\right):$$\mathrm{PrintSystem}\left(\mathrm{sys2}\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}{\mathrm{\delta }}& {1}& {-}{\mathrm{\phi }}& {\mathrm{\sigma }}\\ {3}& {0}& {0}& {3}\\ {1}& {0}& {-1}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{ccc}{5}& {z}& {-1}\\ {1}& {3}& {-}{x}\\ {0}& {2}& {y}\\ {0}& {0}& {z}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1}& {0}& {3}& {5}\\ {-3}& {0}& {\mathrm{\sigma }}& {7}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {1}& {1}\end{array}\right]\end{array}\right$ (6)
 • Extract a subsystem with the desired input and output.
 > $\mathrm{subsys2}≔\mathrm{Subsystem}\left(\mathrm{sys2},\left\{1\right\}\right):$$\mathrm{PrintSystem}\left(\mathrm{subsys2}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 1 input\left(s\right); 4 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\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}{\mathrm{\delta }}& {1}& {-}{\mathrm{\phi }}& {\mathrm{\sigma }}\\ {3}& {0}& {0}& {3}\\ {1}& {0}& {-1}& {1}\\ {0}& {0}& {0}& {0}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{5}\\ {1}\\ {0}\\ {0}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{cccc}{1}& {0}& {3}& {5}\\ {-3}& {0}& {\mathrm{\sigma }}& {7}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{1}\\ {0}\end{array}\right]\end{array}\right$ (7)
 • The numeric values of the system parameters are:
 > $\mathrm{params2}≔\left[\mathrm{δ}=2,\mathrm{φ}=7,\mathrm{σ}=3,z=4\right]:$
 • Check if the system is controllable:
 > $\mathrm{Controllable}\left(\mathrm{subsys2}\right)$
 ${\mathrm{false}}$ (8)
 > $\mathrm{Observable}\left(\mathrm{subsys2}\right)$
 ${\mathrm{true}}$ (9)
 • The subsystem is uncontrollable. Try removing structural uncontrollable states
 > $\mathrm{rsys}≔\mathrm{ReduceSystem}\left(\mathrm{subsys2}\right):$$\mathrm{PrintSystem}\left(\mathrm{rsys}\right)$
 $\left[\begin{array}{l}{\mathbf{State Space}}\\ {\mathrm{continuous}}\\ {\mathrm{2 output\left(s\right); 1 input\left(s\right); 3 state\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\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}{\mathrm{\delta }}& {1}& {-}{\mathrm{\phi }}\\ {3}& {0}& {0}\\ {1}& {0}& {-1}\end{array}\right]\\ {\mathrm{b}}{=}\left[\begin{array}{c}{5}\\ {1}\\ {0}\end{array}\right]\\ {\mathrm{c}}{=}\left[\begin{array}{ccc}{1}& {0}& {3}\\ {-3}& {0}& {\mathrm{\sigma }}\end{array}\right]\\ {\mathrm{d}}{=}\left[\begin{array}{c}{1}\\ {0}\end{array}\right]\end{array}\right$ (10)
 > $\mathrm{Controllable}\left(\mathrm{rsys}\right)$
 ${\mathrm{true}}$ (11)
 > $\mathrm{Observable}\left(\mathrm{rsys}\right)$
 ${\mathrm{true}}$ (12)
 • Compute the poles for a desired time constant of 1 second:
 > $\mathrm{τ}≔1:$
 > $\mathrm{p2}≔\mathrm{ComputePoles}\left(\mathrm{rsys},\mathrm{τ},'\mathrm{parameters}'=\mathrm{params2}\right)$
 ${\mathrm{p2}}{≔}\left[{-}{1.049223528}{+}{0.2188673555}{}{I}{,}{-}{1.049223528}{-}{0.2188673555}{}{I}{,}{-}{0.043808373}\right]$ (13)
 > $\mathrm{Kc}≔\mathrm{StateFeedback}:-\mathrm{Ackermann}\left(\mathrm{rsys},\mathrm{p2},'\mathrm{parameters}'=\mathrm{params2}\right)$
 ${\mathrm{Kc}}{≔}\left[\begin{array}{ccc}{0.5898446403}& {0.1930322270}& {-}{1.400163308}\end{array}\right]$ (14)