# Zero Average Dynamic Controller for Speed Control of DC Motor
## 2 Materials and Methods
### Buck-Motor System Model  
The DC motor must be modeled to represent the complete circuit of the study. Consequently, the mechanical part of the model is represented in (1), and the electrical part is represented in (2). This constitutes a second-order system with some variables defined in the model, such as the speed of the motor and the armature current. \[\dot{W}_{m}(t)=\frac{-BW_{m}(t)}{J_{eq}}+\frac{k_{t}i_{a}(t)}{J_{eq}}+\frac{-T _{fric}}{J_{eq}}+\frac{-T_{L}}{J_{eq}} \tag{1}\]  
\[\dot{i_{a}}(t)=\frac{-k_{e}}{L_{a}}W_{m}(t)+\frac{-R_{a}}{L_{a}}i_{a}(t)+\frac {V_{a}(t)}{L_{a}} \tag{2}\]  
The term \(R_{a}\) is the armature resistance (\(\Omega\)) of the DC motor, \(i_{a}(t)\) is the armature current [A], \(W_{m}(t)\) is the speed of the motor [rad/s], \(k_{e}\) is a voltage constant [V/rad/s], and \(L_{a}\) is the armature inductance [mH]. Furthermore, \(V_{a}(t)=v_{c}(t)\) represents the voltage applied to the motor (V), \(B\) the viscous friction coefficient (N\(\cdot\)m/rad/s), \(J_{eq}\) is the inertia moment (kg\(\cdot\)m\({}^{2}\)), \(k_{t}\) is the torque constant of the motor (N\(\cdot\)m/A), \(T_{fric}\) is the friction torque (N\(\cdot\)m), and \(T_{L}\) is the load torque (N\(\cdot\)m). These parameters were measured and calibrated in real time using a GSPACE board and the method described in [42]. Figure 2 illustrates the diagram of the buck-motor system. This model considers the following terms: \(E\) as the source voltage, \(r_{s}\) the internal source resistance, \(D\) as the diode, \(C\) as the capacitor, \(L\) as the inductor, \(r_{L}\) the inductor resistance, and \(V_{fd}\) as the forward voltage of the diode. Other previously defined variables used in this model are \(W_{m}\) as the speed of the motor [rad/s], \(i_{a}\) is the armature current [A], \(V_{a}\) represents the voltage applied to the motor (V). The advantages of using this converter to feed the DC motor are defined as follows. The system protects the motor because there are no sudden voltage and current changes at the input. Besides, it provides a regulated voltage and prevents overheating, increasing its useful life. According to the operation of this system, a better study can be performed with circuits broken down into two parts, as in Figures 3 and 4. For instance, Figure 3 shows the  
Figure 2: Model of the buck-motor system. equivalent circuit for a continuous conduction mode when the switch S = ON and the diode is inactive. The second part of the circuit is presented when the diode is on conduction and the switch opens (S = OFF), as shown in Figure 4.  
If [PERSON]'s laws are applied to the circuit in Figure 3, the model is then represented as in Equation (3). This is a complete form that represents \(\dot{x}=A_{1}x+B_{1}\) after considering that the variables in Equation (3) are presented as \(x_{1}=W_{m}\), \(x_{2}=i_{a}\), \(x_{3}=v_{c}\), and \(x_{4}=i_{L}\). \[\left[ \begin{array}{c}\dot{W}_{m}\\ \dot{i}_{a}\\ \dot{v}_{c}\\ \dot{i}_{L}\end{array} \right]=\left[ \begin{array}{ccc}\frac{-B}{T_{aq}}&\frac {k_{x}}{T_{aq}}&0&0\\ \frac{-k_{x}}{T_{a}}&-\frac{R_{x}}{T_{a}}&\frac{1}{1_{a}}&0\\ 0&\frac{-1}{C}&0&\frac{1}{C}\\ 0&0&\frac{-1}{L}&-\frac{(r_{L}+r_{L})}{L}\end{array} \right]\left[ \begin{array} []{c}W_{m}\\ i_{a}\\ v_{c}\\ i_{L}\end{array} \right]+\left[ \begin{array}{c}\frac{-(T_{pric}+T_{L})}{l_{q }}\\ 0\\ \frac{E}{L}\end{array} \right] \tag{3}\]  
The electrical circuit presented in Figure 4, when the switch S is open (\(S=OFF\)), can be modeled as in Equation (4). This is a complete form that represents \(\dot{x}=A_{2}x+B_{2}\) after considering that the variables in Equation (4) are presented as \(x_{1}=W_{m}\), \(x_{2}=i_{a}\), \(x_{3}=v_{c}\), and \(x_{4}=i_{L}\). \[\left[ \begin{array}{c}\dot{W}_{m}\\ \dot{i}_{a}\\ \dot{v}_{c}\\ \dot{i}_{L}\end{array} \right]=\left[ \begin{array}{ccc}\frac{-B}{T_{aq}}&\frac {k_{x}}{T_{aq}}&0&0\\ \frac{-k_{x}}{T_{aq}}&\frac{-R_{x}}{T_{aq}}&\frac{1}{L_{a}}&0\\ 0&\frac{-1}{C}&0&\frac{1}{C}\\ 0&0&\frac{-1}{L}&\frac{-(r_{L})}{L}\end{array} \right]\left[