# DC motor modeling and control loop design

## Motor description

![Motor Scheme](/files/-LT8a8YkstXkzevNCh-8)

![Variables and parameters table](/files/-LT8a8YmpTopinM6GK6m)

## System modeling

**Electric equation:**

From kirchhoff's voltage law :

$$
L\frac{di(t)}{dt} =v(t) - Ri(t) - e(t)
$$

**Mechanical equation:**

By Newton's law:

$$
J\frac{d\omega(t)}{dt} = \sum T(t) = T\_m(t)-f\omega(t)
$$

where $$T(t)$$ is the total torque applied on the rotor.

**Electro-mechanical coupling:**

The back EMF is proportional to speed :

$$
e(t) = K\_e \omega(t)
$$

$$K\_e$$ : electromotive constant $$(V.rad^{-1}.s)$$

The motor torque is proportional to current :

$$
T\_m(t) = K\_T i(t)
$$

$$K\_T$$ : Torque constant $$(N.m.A^{-1})$$

The mechanical power produced by the DC motor is $$T\_m\omega = K\_Ti\omega$$. The electric power $$P\_e = vi$$ delivered by the source goes into heat loss in the resistance $$R$$, into stored magnetic energy in the inductance $$L$$ and the remaining quantity $$iK\_e\omega$$ is converted in mechanical energy $$T\_m\omega$$. It leads to $$T\_m\omega = K\_Ti\omega = K\_ei\omega$$ whether $$K\_T = K\_e = K\_\phi$$ (Chiasson2005).

## Motor Bloc Diagram

![DC Motor Bloc Diagram](/files/-LT8a8YoBParE8_iLdjE)

## Motor control : cascaded strategy

The control synthesis is inspired by Permanent Magnet Synchronous Motor control synthesis based on cascaded control synthesis. Due to frequency separation the control can be divided into two control loops. The inner loop control the electrical dynamic while the outer loop treats the mechanical dynamic. Generally the the electrical dynamics is neglected and the mechanical dynamics is considered only. However in the case where motor resistance is low, this strategy can damage the motor.

### Electrical dynamics control

The objective is to control the motor torque $$T\_m(t)$$. Indeed $$T\_m(t) = K\_\phi i(t)$$ the motor torque is imposed by the current.

![Closed loop electrical system](/files/-LTHJMRCF9tbPy0vlf3A)

With the assumption that the mechanical dynamic is slower the the electrical one, one has :

$$
\tau\_{\rm elec} = \frac{L}{R}<<\tau\_{\rm meca} = \frac{J}{f}
$$

The velocity $$\omega$$ can then be considered as constant from the point of view of the electrical dynamics.

**Feedback control with integral action**

The electrical dynamics is given by

$$
\begin{array}{lcl}
\dot{i}  &=& -\frac{R}{L} i + \frac{1}{L}v -\frac{K\_\phi}{L}w\\
&=& -\frac{1}{\tau\_e} i + \frac{K\_e}{\tau\_e}v -\frac{K\_\phi}{L}w
\end{array}
$$

The control objective is to ensure $$i^\star =i\_{\rm ref}$$, where $$i^\star$$ is the current steady state and $$i\_{\rm ref}$$ is the current reference. To ensure zero steady state error, an integral action is necessary. The principle is to insert an integral action the the feed-forward loop between the error compactor and the process (Ogata2010). The control scheme is given by :

![Electrical dynamics state feedback](/files/-LTHKnH7zUKWkUMhF1qy)

From the figure one gets :

$$
\begin{array}{lcl}
\dot{i}  & = & -\frac{R}{L} i + \frac{1}{L}v -\frac{K\_\phi}{L}w \\
\dot{\varepsilon} & = & i\_{\rm ref} - i \\
v & = & -Ki+K\_I\varepsilon
\end{array}
$$

with $$\varepsilon$$ the output of the integrator.

The system dynamics can be described by

$$
\begin{bmatrix}
\dot{i}\\\dot{\varepsilon}
\end{bmatrix} =
\begin{bmatrix}
-\frac{R}{L} & 0\\-1 &0
\end{bmatrix} \begin{bmatrix}
{i}\\{\varepsilon}
\end{bmatrix}+
\begin{bmatrix}
\frac{1}{L}\0
\end{bmatrix}v+
\begin{bmatrix}
\frac{K\_\phi}{L}\0
\end{bmatrix}\omega+
\begin{bmatrix}
0\1
\end{bmatrix}i\_{\rm ref}
$$

with the control

$$
v  =  -Ki-K\_I\varepsilon
$$

The closed loop system leads to :

$$
\begin{bmatrix}
\dot{i}\\\dot{\xi}
\end{bmatrix} =
\left(\begin{bmatrix}
-\frac{R}{L} & 0\\-1 &0
\end{bmatrix} -
\begin{bmatrix}
\frac{1}{L}\0
\end{bmatrix} \begin{bmatrix}K\&K\_I\end{bmatrix}\begin{bmatrix}i\\\varepsilon\end{bmatrix}\right)+
\begin{bmatrix}
\frac{K\_\phi}{L}\0
\end{bmatrix}\omega+
\begin{bmatrix}
0\1
\end{bmatrix}i\_{\rm ref}
$$

The closed loop dynamics depends on the eigenvalues of the matrix :

$$
\left(\begin{bmatrix}
-\frac{R}{L} & 0\\-1 &0
\end{bmatrix} -
\begin{bmatrix}
\frac{1}{L}\0
\end{bmatrix} \begin{bmatrix}K\&K\_I\end{bmatrix}\right)=
\begin{bmatrix}
-\frac{R+K}{L} & -\frac{K\_I}{L}\\-1 &0
\end{bmatrix}
$$

One has

$$
{\rm eig}\left(
\begin{bmatrix}
-\frac{R+K}{L} & -\frac{K\_I}{L}\\-1 &0
\end{bmatrix}\right) = {\rm det}\left(sI-\begin{bmatrix}
-\frac{R+K}{L} & -\frac{K\_I}{L}\\-1 &0
\end{bmatrix}\right)
$$

It leads to a characteristic equation

$$
P(s) = s^2+\frac{K+R}{L}s -K\_I
$$

to be identified with the classical second order characteristic equation

$$
P(s) = p^2+2\zeta\omega\_n s +\omega\_n^2
$$

where $$\omega\_n$$ is the desired closed loop natural frequency and $$\zeta$$ the damping coefficient.

### Mechanical dynamics control

![Closed loop cascaded system](/files/-LTK2s6m8BXFbe2pj8TR)

Assuming the electrical control has been correctly synthesized with respect to frequency separation principle, which means that the closed loop electrical dynamics is faster than the mechanical desired dynamics, then the mechanical dynamics control synthesis can be designed without considering the closed loop electrical system. The control scheme can be simplified as :

![Closed loop mechanical system](/files/-LTK2s6oPeqPCN-_qetA)

The mechanical dynamics is

$$
\begin{array}{lcl}
\dot{\omega} &=&  \frac{1}{J}T\_m-\frac{f}{J}\omega\\
&=&  \frac{K\_\phi}{J}i-\frac{f}{J}\omega
\end{array}
$$

where $$T\_m = K\_\phi i$$

The control synthesis is similar than the one proposed for the electrical dynamics with $$\dot\varepsilon\_\omega = \omega\_{\rm ref}-\omega$$ leading to

$$
\begin{bmatrix}
\dot{\omega}\\\dot{\varepsilon\_\omega}
\end{bmatrix} =
\begin{bmatrix}
-\frac{f}{J} & 0\\-1 &0
\end{bmatrix} \begin{bmatrix}
{\omega}\\{\varepsilon\_\omega}
\end{bmatrix}+
\begin{bmatrix}
\frac{K\_\phi}{J}\0
\end{bmatrix}i+
\begin{bmatrix}
0\1
\end{bmatrix}\omega\_{\rm ref}
$$

with the control

$$
i  =  -K\_\omega \omega-K\_{\omega,I}\varepsilon\_\omega
$$

By analogy, it leads to a characteristic equation

$$
P(s) = s^2+\frac{K\_\phi K\_\omega+f}{L}s -K\phi K\_{\omega,I}
$$

to be identified with the classical second order characteristic equation

$$
P(s) = p^2+2\zeta\omega\_n s +\omega\_n^2 .
$$

## References

(Chiasson2005) Chiasson, J.-N. (2005). Modeling and High-Performance Control of Electric Machines (IEEE Press).

(Ogata2010) Ogata, K. (2010). Modern Control Engineering. Prentice Hall.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rtdc.ctrl-elec.fr/control-loop-design.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
