**4. Virtual model development of a stepper motor**

Stepper motor is an asynchronous machine, the stator of which contains a control winding. The rotor is either fitted with a permanent magnet or made up of a toothed ferromagnetic magnetic circuit. The stepper motor is an impulse-excited electric machine, the movement of which is not continuous but is done stepwise. Its main advantage consists of motor perform‐ ance without the necessity of any controllers, and when the motors are not overloaded, they can work without feedback. The precise control of position or rotation at a constant speed is done simply by counting steps.

According to the construction, the stepper motors are divided into three groups, [8]:


#### **4.1. Hybrid stepper motor**

The hybrid stepper motor accumulates benefits both of stepper motors with variable reluctance and permanent magnets. It has a very small step and high power per unit of weight. The arrangement of the stator winding is similar to this stepper motor with variable reluctance. It differentiates by the rotor that is made from a cylinder permanent magnet with mounted rotor poles along the circumference having teeth. The number of teeth determinates an angle step. Typically, the motors with 50 teeth are produced, in which one step is equal to the angle of 1.8°. In the stator of the hybrid stepper motor, there are usually two windings having terminals arranged as shown in Figure 12.

**Figure 12.** Twelve ways of arranging the stator windings of a two-phase hybrid stepper motor: (a) 4 wires-only start and end points are led to terminals; (b) 5 wires-also the common middle point is led out to terminals; (c) 6 wires-the middle point of each phase is led out to terminals; and (d) 8 wires-the phases are divided into the halves and the start and end points are led to the terminals.

#### **4.2. Control of stepper motors**

According to the types of the windings, the stepper motors are divided into the unipolar stepper motor and the bipolar one. Similarly, the control of the stepper motors is divided into the following:


#### *4.2.1. Four-tact control magnetizing one phase*

**4. Virtual model development of a stepper motor**

16 E-Learning - Instructional Design, Organizational Strategy and Management

done simply by counting steps.

**c.** Hybrid stepper motors

**4.1. Hybrid stepper motor**

arranged as shown in Figure 12.

and end points are led to the terminals.

**4.2. Control of stepper motors**

the following:

**a.** Stepper motors with variable reluctance **b.** Stepper motors with permanent magnets

Stepper motor is an asynchronous machine, the stator of which contains a control winding. The rotor is either fitted with a permanent magnet or made up of a toothed ferromagnetic magnetic circuit. The stepper motor is an impulse-excited electric machine, the movement of which is not continuous but is done stepwise. Its main advantage consists of motor perform‐ ance without the necessity of any controllers, and when the motors are not overloaded, they can work without feedback. The precise control of position or rotation at a constant speed is

According to the construction, the stepper motors are divided into three groups, [8]:

The hybrid stepper motor accumulates benefits both of stepper motors with variable reluctance and permanent magnets. It has a very small step and high power per unit of weight. The arrangement of the stator winding is similar to this stepper motor with variable reluctance. It differentiates by the rotor that is made from a cylinder permanent magnet with mounted rotor poles along the circumference having teeth. The number of teeth determinates an angle step. Typically, the motors with 50 teeth are produced, in which one step is equal to the angle of 1.8°. In the stator of the hybrid stepper motor, there are usually two windings having terminals

**Figure 12.** Twelve ways of arranging the stator windings of a two-phase hybrid stepper motor: (a) 4 wires-only start and end points are led to terminals; (b) 5 wires-also the common middle point is led out to terminals; (c) 6 wires-the middle point of each phase is led out to terminals; and (d) 8 wires-the phases are divided into the halves and the start

According to the types of the windings, the stepper motors are divided into the unipolar stepper motor and the bipolar one. Similarly, the control of the stepper motors is divided into In a simple drawing (Figure 13), the rotor is replaced by a rotating permanent magnet having the north pole (red) and the south pole (blue). By switching the stator winding phases in the in the opposite coils, the north and the south poles are also excited.

The principle of the control consists of exciting (and magnetizing) one phase only. According to the cyclogram in Figure 13a, the sequence of excitation A1-B1-A2-B2 ensures the rotation of the magnetic field in the positive direction. The change of the direction is done through reverse switching of the motor phases. Here the current flows through one winding only.

In case of bipolar control (Figure 13b), the current flows simultaneously through two opposite coils. This means the current is twice higher in comparison with the unipolar type. The bipolar control differs by the necessity of change the current direction.

**Figure 13.** Cyclogram of four-tact control magnetizing one phase of a hybrid stepper motor.

#### *4.2.2. Four-tact control magnetizing two phases*

When two neighboring coils are excited simultaneously, according to the cyclogram in Figure 14, the motor torque is 2 times higher. The position of the rotor will follow the vector sum of magnetic fluxes of both phases. At this type of control, the current flows through all four windings. This type of control is used the most often.

**Figure 14.** Cyclogram of four-tact control of a hybrid stepper motor.

#### *4.2.3. Eight-tact control*

Combining the previous two control algorithms leads to doubling the number of stable states (cyclogram in Figure 15). Consequently, an increase of positioning accuracy is achieved (called "soften up"), without changing the structural adjustment. The previous commutation (fourtact control) was the symmetrical one, and the asymmetrical eight-tact commutation causes doubling of the number of rotor steps.

**Figure 15.** Eight-tact control of a hybrid stepper motor: (a) unipolar control; (b) bipolar control.

#### *4.2.4. Further modes of the control*

Other ways of controlling hybrid stepper motors exist, but due to simplification, we do not deal with them in detail here (although the modes are also included into the virtual model):


#### **4.3. Simulation model of the hybrid stepper motor**

**Figure 14.** Cyclogram of four-tact control of a hybrid stepper motor.

18 E-Learning - Instructional Design, Organizational Strategy and Management

Combining the previous two control algorithms leads to doubling the number of stable states (cyclogram in Figure 15). Consequently, an increase of positioning accuracy is achieved (called "soften up"), without changing the structural adjustment. The previous commutation (fourtact control) was the symmetrical one, and the asymmetrical eight-tact commutation causes

**Figure 15.** Eight-tact control of a hybrid stepper motor: (a) unipolar control; (b) bipolar control.

Other ways of controlling hybrid stepper motors exist, but due to simplification, we do not deal with them in detail here (although the modes are also included into the virtual model): **•** Vector control. The commutation consists in simultaneous supplying both phases by different voltages. This enables to rotate the stator magnetic field vector by a softer step. **•** Microstepper. This is done by commutation at supplying the coils by harmonic voltages that are mutually shifted by *π*/2. This causes a smooth, continuous movement of the rotor.

*4.2.3. Eight-tact control*

doubling of the number of rotor steps.

*4.2.4. Further modes of the control*

The model of the motor consists of the electrical part (Figure 16) and mechanical part, described by the dynamic equation.

**Figure 16.** Equivalent circuit diagram of hybrid bipolar stepper motor for phase A; *L*<sup>a</sup> presents the inductance, *R*a is the resistance of phase A winding, and *U*<sup>i</sup> is the electromotive force depending on the angle of the rotor.

The mathematical models of all motor subsystems together with corresponding simulation schemes are displayed in Table 3.

**Table 3.** Mathematical and simulation models of subsystems of the hybrid bipolar stepper motor

Figure 17 shows the complete simulation scheme consisting of the schemes of subsystems.

#### **4.4. Simulation results of hybrid bipolar stepper motor at various control modes**

A series of experiments before developing the GUI was done in order to verify correctness of the developed motor simulation model.

The hybrid bipolar stepper motor parameters used for simulation are as follows: *L*a = *L*b = 0.058 H, *R*a = *R*b = 30 Ω, *S*a= 1.8°, *N*r = 50, *K*m = 0.8 Nm/A, *T*d = 0 Nm, *b*m = 8.10-4 Nms/rad (damping coefficient), *M*load = 0.1 Nm, *U* = 12 V, and *J* = 6.10-6 kg m2 .

The motor simulation schemes were completed by schemes of simplified voltage sources, enabling control of the chosen stepper motor by whether the full step, half step, reduced (or shortened) step, or microstep.

Just note that the time courses in Figures 18-22 were obtained from the graphical user interface of the hybrid bipolar stepper motor (explained in detail later, in the subchapter 4.5). The graphs display the motor torque *M*, the angular speed *ω*, and the angle of displacement *θ*, and there are courses of the current and supply voltage at the bottom.

Support for Learning of Dynamic Performance of Electrical Rotating Machines by Virtual Models http://dx.doi.org/10.5772/60723 21

**Figure 17.** Simulation model of a hybrid bipolar stepper motor in Simulink

#### *4.4.1. Motor control at full step and magnetizing one phase only*

The angular displacement starts after the voltage is connected to phase B (Figure 18). The angular step displacement is 1.8° (i.e., 90/50). The load torque influence on the angular displacement is very small.

#### *4.4.2. Motor control at full step and magnetizing two phases*

The step displacement in this control mode control comes to a half in comparison with the previous case 0.9° (Figure 19). Also, the load torque has lesser influence on the angular displacement like in the previous case.

#### *4.4.3. Motor control at the half step*

**Equation**

**Total motor torque**

**motion equation**

**relation angle -speed**

**for Mathematical model (equations) Simulation model in Simulink**

*Mc* =*Ma* + *Mb* + *Md*

20 E-Learning - Instructional Design, Organizational Strategy and Management

*<sup>J</sup>* <sup>⋅</sup> (*Mc* <sup>−</sup>*bm* <sup>⋅</sup>*<sup>ω</sup>* <sup>−</sup>*Mload* )

**Table 3.** Mathematical and simulation models of subsystems of the hybrid bipolar stepper motor

(damping coefficient), *M*load = 0.1 Nm, *U* = 12 V, and *J* = 6.10-6 kg m2

are courses of the current and supply voltage at the bottom.

Figure 17 shows the complete simulation scheme consisting of the schemes of subsystems.

A series of experiments before developing the GUI was done in order to verify correctness of

The hybrid bipolar stepper motor parameters used for simulation are as follows: *L*a = *L*b = 0.058 H, *R*a = *R*b = 30 Ω, *S*a= 1.8°, *N*r = 50, *K*m = 0.8 Nm/A, *T*d = 0 Nm, *b*m = 8.10-4 Nms/rad

The motor simulation schemes were completed by schemes of simplified voltage sources, enabling control of the chosen stepper motor by whether the full step, half step, reduced (or

Just note that the time courses in Figures 18-22 were obtained from the graphical user interface of the hybrid bipolar stepper motor (explained in detail later, in the subchapter 4.5). The graphs display the motor torque *M*, the angular speed *ω*, and the angle of displacement *θ*, and there

.

**4.4. Simulation results of hybrid bipolar stepper motor at various control modes**

*dθ dt* <sup>=</sup>*<sup>ω</sup>*

*dω dt* <sup>=</sup> <sup>1</sup>

the developed motor simulation model.

shortened) step, or microstep.

Interchange of active coils results in a varying torque and angular velocity, as shown in the simulation results of half-step (Figure 20). The angle displacement step is 0.9°.

#### *4.4.4. Vector control of the motor*

In the vector control, two phases are supplied by different voltages (Figure 21). This allows the rotation of the vector of the stator magnetic field. In our case, the nominal value of the voltages *U*<sup>1</sup> and the second one has the value that ensures the constant step. In this case, this is *U*2 = 0.4*U*1.

**Figure 18.** Time courses of the hybrid bipolar stepper motor at full step and magnetizing one phase.

**Figure 19.** Time courses at the full step and magnetizing both phases.

Support for Learning of Dynamic Performance of Electrical Rotating Machines by Virtual Models http://dx.doi.org/10.5772/60723 23

**Figure 20.** Time courses for the chosen half step.

**Figure 18.** Time courses of the hybrid bipolar stepper motor at full step and magnetizing one phase.

22 E-Learning - Instructional Design, Organizational Strategy and Management

**Figure 19.** Time courses at the full step and magnetizing both phases.

**Figure 21.** Time courses for vector control and step equal to 0.45°

### *4.4.5. Microstepper of the motor*

At microstepper, one phase is supplied by the sine voltage and the second phase by the cosine voltage (Figure 22). It is possible to replace the harmonic voltage by a discrete course with a low frequency of 1.5 Hz. The achieved final step is 0.21°.

### **4.5. GUI for the hybrid stepper motors**

Similarly, like in the previous case, GUI application was developed for analyzing both the bipolar and unipolar hybrid stepper motors. The chosen supply mode is selected by a button. The application allows to implement a simple change of parameters to choose the mode of the motor run to load the motor and to visualize results in four basic charts: for the motor torque, angular speed, the angle of the rotation of the rotor and the line voltage, and the currents in the respective phases.

#### *4.5.1. Description of the screen with graphs*

The GUI screen (Figure 23) displays the motor torque *M*, the angular speed ω, the angle of displacement *θ*, and there are courses of the current and supply voltage at the bottom.

The panel *Type of Motor* (upper right) contains two buttons: Bipolar SM and Unipolar SM, where the user selects the mode of basic control of the stepper motor. After selecting the chosen mode, the button turns green.

The panel *Control Mode* (Figure 24a) contains three further subpanels. In the subpanel *Direction*, a direction of rotation is chosen; in the subpanel *Step Modes*, a value of the step is chosen from the choice: full step, half step, reduced or shortened step for the vector control, and, the last choice, microstep. In the last subpanel *Power Supply Phase*, it is possible to choose either the active one or both phases of the motor (this possibility is available only when the full step is chosen).

In the panel *Other Simulation Parameters* (Figure 24b), the user inputs further information required by some modes of control. Here the first panel box is accessible only if a reduced step is chosen in the control mode panel. This gives a possibility to choose a reduced step divided into four parts or into eight. The next panel box is available when the microstep is chosen. The choice gives a possibility to change the frequency of the input sinus-cosinus signals. By the Slider Step Size, it is possible to soften the step size. In the last panel box, it is possible to change the time of simulation *T*s, and the parameter *T*<sup>v</sup> is related to the microstepper (the text box is available only when the microstepper mode is chosen).

The tools panel and the context menu have similar meaning like in the previous case (see Table 2). At the mentioned step choice, the user can change the direction of rotation of the motor to select other cyclogram of motor supply, to choose the length of each cyclogram (by the parameter *T*v), to change the frequency of a voltage supply at the microstepper, and to choose the step size when the movement of the rotor is continuous.

Support for Learning of Dynamic Performance of Electrical Rotating Machines by Virtual Models http://dx.doi.org/10.5772/60723 25

**Figure 22.** Time courses at the microstepper with the step 0.21°.

*4.4.5. Microstepper of the motor*

the respective phases.

**4.5. GUI for the hybrid stepper motors**

*4.5.1. Description of the screen with graphs*

mode, the button turns green.

full step is chosen).

low frequency of 1.5 Hz. The achieved final step is 0.21°.

24 E-Learning - Instructional Design, Organizational Strategy and Management

available only when the microstepper mode is chosen).

the step size when the movement of the rotor is continuous.

At microstepper, one phase is supplied by the sine voltage and the second phase by the cosine voltage (Figure 22). It is possible to replace the harmonic voltage by a discrete course with a

Similarly, like in the previous case, GUI application was developed for analyzing both the bipolar and unipolar hybrid stepper motors. The chosen supply mode is selected by a button. The application allows to implement a simple change of parameters to choose the mode of the motor run to load the motor and to visualize results in four basic charts: for the motor torque, angular speed, the angle of the rotation of the rotor and the line voltage, and the currents in

The GUI screen (Figure 23) displays the motor torque *M*, the angular speed ω, the angle of displacement *θ*, and there are courses of the current and supply voltage at the bottom.

The panel *Type of Motor* (upper right) contains two buttons: Bipolar SM and Unipolar SM, where the user selects the mode of basic control of the stepper motor. After selecting the chosen

The panel *Control Mode* (Figure 24a) contains three further subpanels. In the subpanel *Direction*, a direction of rotation is chosen; in the subpanel *Step Modes*, a value of the step is chosen from the choice: full step, half step, reduced or shortened step for the vector control, and, the last choice, microstep. In the last subpanel *Power Supply Phase*, it is possible to choose either the active one or both phases of the motor (this possibility is available only when the

In the panel *Other Simulation Parameters* (Figure 24b), the user inputs further information required by some modes of control. Here the first panel box is accessible only if a reduced step is chosen in the control mode panel. This gives a possibility to choose a reduced step divided into four parts or into eight. The next panel box is available when the microstep is chosen. The choice gives a possibility to change the frequency of the input sinus-cosinus signals. By the Slider Step Size, it is possible to soften the step size. In the last panel box, it is possible to change the time of simulation *T*s, and the parameter *T*<sup>v</sup> is related to the microstepper (the text box is

The tools panel and the context menu have similar meaning like in the previous case (see Table 2). At the mentioned step choice, the user can change the direction of rotation of the motor to select other cyclogram of motor supply, to choose the length of each cyclogram (by the parameter *T*v), to change the frequency of a voltage supply at the microstepper, and to choose

**Figure 23.** GUI screen for the stepper motor.

**Figure 24.** The panels (a) for selection of the stepper motor control mode and (b) for inputting control and simulation parameters.

#### *4.5.2. The screen for inputting parameters of the bipolar stepper motor*

The GUI screen enables easy change of parameters of a chosen stepper motor. This GUI screen (Figure 25) appears after choice of bipolar motor-the button *Bipolar SM* in the panel *Type of Motor* (see the GUI main screen in Figure 23). The screen also displays differential equations of the mathematical model of the bipolar stepper motor and equivalent diagram of the motor one phase.

**Figure 25.** The GUI screen for inputting parameters for the model of bipolar hybrid stepper motor.

The parameters for any arbitrary bipolar motor are set in the bottom panel *Parameters*. After clicking the model, the Simulink model of the motor is displayed. Pushing the return button causes switch over the main screen.

#### *4.5.3. The screen for inputting parameters of the unipolar stepper motor*

*4.5.2. The screen for inputting parameters of the bipolar stepper motor*

26 E-Learning - Instructional Design, Organizational Strategy and Management

**Figure 25.** The GUI screen for inputting parameters for the model of bipolar hybrid stepper motor.

one phase.

parameters.

The GUI screen enables easy change of parameters of a chosen stepper motor. This GUI screen (Figure 25) appears after choice of bipolar motor-the button *Bipolar SM* in the panel *Type of Motor* (see the GUI main screen in Figure 23). The screen also displays differential equations of the mathematical model of the bipolar stepper motor and equivalent diagram of the motor

**Figure 24.** The panels (a) for selection of the stepper motor control mode and (b) for inputting control and simulation

After choosing the unipolar stepper motor (the button **Unipolar SM** in the main screen, Figure 22), a screen for inputting unipolar stepper motor parameters is displayed (Figure 26).

**Figure 26.** The GUI screen for inputting parameters for the model unipolar hybrid stepper motor.

#### **4.6. Integration of the realized virtual models into virtual laboratory of electrical machines**

The subject electrical machines taught in the second year of the undergraduate course is devoted to the explanation of the phenomena in the machine, which is supported by various animation models. During lectures, when explaining static and dynamic characteristics of each machine by presentation of demo pictures, animations, videos, and of course using the blackboard for derivation of the dependencies, the virtual models are briefly introduced. The students have a free access to the models through the institutional LAN (the access is also available in the student hostels).

In the laboratory, they measure the characteristics of the motors and compare them with those from virtual models. They also discuss and explain in detail the motor behavior and the influence of motor parameters on the characteristics.

The work with the virtual models saves time at virtual experimentation, but it requires a careful and detailed explanation and analysis of the obtained characteristics by the teacher-how and why is the behavior of the motor corresponding to the form of the characteristics. Otherwise, the students do not fully understand the graphs.

To get feedback from the students and their opinion of introducing the virtual models in the regular teaching, inspired by a questionnaire presented in [9] for Electrical Drives subject we have applied the questionnaire for the Electrical Machines subject and evaluated it (Table 4). Altogether, 36 full-time students of the bachelor study in four groups answered the questions.


**Table 4.** Questionnaire statements and their evaluation

The student ratings on the evaluation of incorporating the virtual models into teaching – both into lectures and prior laboratory work – are generally positive. It was observed that majority of students found it useful, interesting, and contributing to increasing knowledge about the subject.

The students works with the virtual models also in the following years in the subjects like:

