# Model Feedback Control Systems

## Generating Linearized Plant Models

Control system design often begins with the linearized plant model. Given the inputs and outputs, MotionSolve can automatically linearize a complex multibody model and generate the state space form which is suitable for control packages:(1)
$\begin{array}{l}\stackrel{˙}{x}=Ax+Bu\\ y=Cx+Du\end{array}$
The set of inputs and outputs are defined using Control_PlantInput and Control_PlantOutput elements, respectively. The Param_Linear command element triggers the linearization, which produces the following results:
• Matrices A, B, C, and D are written in the Matlab format in four separate files with extensions .a, .b, .c, and .d, respectively.
• The state space form linear system is written in the Simulink format in an MDL file. This is the Simulink MDL format, which is different from the MotionView MDL format.
• States selected for linearization are written to a TAG file.
• Eigenvalues are written to the EIG file.
• Eigenvectors and Eigenvalues are written in tabular format to the TAB file.
• One MRF file is written per eigenvector. It is used for mode shape animation in conjunction with the MotionView model MDL file.
Note: The MotionView MDL and Simulink MDL file formats are different.

## SISO and MIMO Systems Modeling

MotionSolve provides the following modeling elements for representing both Single Input Single Output (SISO) and Multiple Input Multiple Output (MIMO) systems. This allows control systems defined elsewhere to be imported into a MotionSolve model.
Item
Description
Control_SISO - Single Input Single Output (SISO) Control Element
The Control_SISO element defines a transfer function in the Laplace domain.(2)
$G\left(s\right)=\frac{Y\left(s\right)}{U\left(s\right)}=\frac{{b}_{0}+{b}_{1}s+\cdots +{b}_{m}{s}^{m}}{{a}_{0}+{a}_{1}s+\cdots +{a}_{n}{s}^{n}},m\le n$

It is used for modeling linear, time invariant systems arising in diverse fields, such as aerodynamics, hydraulics, and electrical systems. It can also be used to fit experimentally measured transfer functions. The curve fitting must be done using other software, such as MATLAB.

Control_StateEqn - Multiple Input Multiple Output (MIMO) System Element
This element is used for time domain representation of general multiple input multiple output (MIMO) systems and controllers. Control_StateEqn element can be of two types:
Type LINEAR
Defines a multi-dimensional, linear time invariant system of differential equations in the state space form. (3)
$\begin{array}{l}\stackrel{˙}{x}=Ax+Bu\\ y=Cx+Du\end{array}$
Type USERSUB
Defines a multi-dimensional, nonlinear time varying system of differential equations in the state space form. (4)
$\begin{array}{l}\stackrel{˙}{x}=f\left(x,u,t\right),x\left({t}_{0}\right)={x}_{0}\\ y=g\left(x,u,t\right)\end{array}$
$x$ is the vector of control state variables, $u$ is the vector of input variables, and $y$ is the vector of output variables. The functions f() and g() must be continuous everywhere. They are defined using user subroutines that can be written in Fortran or C/C++ and linked with MotionSolve.