# 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:

$$\begin{array}{l}\dot{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.$$G(s)=\frac{Y(s)}{U(s)}=\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.
$$\begin{array}{l}\dot{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. $$\begin{array}{l}\dot{x}=f(x,u,t),x({t}_{0})={x}_{0}\\ y=g\left(x,u,t\right)\end{array}$$