## 3 DC Motor Mathematical Modeling  
Many applications using miniature DC motors require the motors to be driven at more than one load point or through specific load cycles. Running the motor at usable load points requires an adjustable power supply, which can be achieved by adjustable DC voltage supplies or by pulse-width modulation (PWM). PWM voltage regulation can be used effectively in battery- or direct-current-source-driven applications. Improved PWM drive efficiency increases battery life and reduces the heating of electronic components. DC motors offer very little inertia and low inductance. This allows the use of the engine in an application where dynamic behavior and fast responses are desired. The use of PWM allows current control in the windings. Therefore, the output angular speed, which is linearly proportional to the average winding current, can be controlled correctly [36]. A DC motor basically consists of the armature winding, field winding or permanent magnets, commutator, and brushes, for which:  
* Armature winding: it is located in the rotating part of the DC motor (rotor) and is responsible for producing the torque that moves it and the output voltage when in generator mode. * Field winding: this is a fixed part that is responsible for the constant magnetic flux passing through the armature; in small DC motors, such as those used in this work, the field winding is often replaced by placing permanent magnets around the armature, which are responsible for generating a constant magnetic field. * Commutator: It keeps the armature current circulating in the same direction, causing the torque to maintain its direction for a constant input voltage. * Brushes: these are where the armature winding contacts the power supply. Direct current machines are widely used in control systems due to their linear behavior. Figure 4 shows a schematic diagram of a DC machine (motor or generator). Figure 4 presents a schematic diagram for a direct current (DC) motor controlled by the armature: that is, the input signal is the voltage applied to the armature (\(va\)) [37; 38]. In this diagram, the load is being modeled by a moment of inertia \(J\), and viscous friction is represented by the coefficient \(b\). Therefore, it is considered that  
Figure 3: Polulu N30 micromotor. (1)  
and  
\[ \begin{split} vg=Km\cdot\omega\end{split}  \tag{2}\]  
The constant \(Km\) is known as the engine constant. Due to the relationships between the motor elements, it is possible to model the equivalent circuit of a DC motor, as shown in Figure 5.  
From the circuit in Figure 5, the following transfer function is extracted:  
\[ \begin{split}\frac{\Omega(s)}{Va(s)}=\frac{Km}{JLas^{2}+(JRa+bLa)s+ bRa+Km^{2}}\bigg{[}\frac{rad\cdot s^{-1}}{V}\bigg{]}\;.\end{split}  \tag{3}\]  
If the armature impedance is neglected (\(La\to 0\))--which is almost always possible, as the time constant related to the mechanical behavior of the motor is much greater than that related to electrical operation--the function of transfer that relates the angular velocity at the output with the voltage input is represented by  
\[ \begin{split}\frac{\Omega(s)}{Va(s)}=\frac{Km}{JRas+bRa+Km^{2}}= \frac{K}{\tau s+1}\bigg{[}\frac{rad\cdot s^{-1}}{V}\bigg{]}\;.\end{split}  \tag{4}\]  
Therefore, if the armature impedance is neglected, the motor transfer function that relates the angular velocity to the input voltage behaves like a first-order system. The greatest difficulty encountered when controlling DC motors is the high amplitude of the armature current, which requires the use of an input signal \(va\), which is provided by a high  
Figure 4: Schematic diagram of a DC motor. Figure 5: Electrical equivalent of a DC motor. power source [37; 38]. Figure 6 presents the dynamic response to a step-type input for a first-order system. From Figure 6, it is clear that the entry to the step begins at time \(t_{0}\). The input signal has a minimum value (\(u_{min}\)) and a maximum value (\(u_{max}\)).