Abstract:
Method for control of synchronous electrical motors that enables determining the instantaneous motor load angle and rotor speed without using rotor position sensors. The method is realized with solving the set of differential equations that govern the currents in the stator windings of the motor for the time intervals between each two consecutive crossings of the currents in the windings of their set values and deriving relationships between the induced in the windings back-electromotive force voltages and the parameters of the Pulse Width Modulation. The parameters of the Pulse Width Modulation are measured and stored in a memory and based on the derived relationships the values of the back-electromotive force voltages are calculated continuously in time. From the values of the back-electromotive force voltages the motor load angle and rotor speed are calculated and used as feedback signals for the closed-loop control of the motor.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    The present invention describes a method for control of synchronous electrical motors with application to Stepper Motors and Brushless Direct Current Motors for which the currents in their stator windings are regulated with Pulse Width Modulation. The invention enables continuous in time sensorless determination of the load angle and the angular speed of the motor and consequently it enables sensorless closed-loop motor control. 
         [0002]    A method for stepper motor control is known where the back-electromotive force voltages induced in the stator windings of the motor are measured only in the time intervals when there is no current flowing through them. During every full electrical period of the currents in the stator windings of a two-phase bipolar stepper motor there are four time intervals when there is no current in one of the two windings. The voltages on the stator windings&#39; terminals during these time intervals are measured and the measured values are compared with a given set value. If these voltages are greater than the set value it is assumed that the rotor of the motor is moving, if these voltages are smaller than the set value it is assumed that the rotor is stalled. This method relies on measuring the back-electromotive force voltages induced by the moving rotor in the stator windings where these voltages can be measured only in the intervals of time when there is no current through the windings. 
         [0003]    One of the shortcomings of the above method is that the monitoring of the rotor rotation can be done only in the time intervals when there is no current through one of the stator windings. When there is current flowing through the windings it is not possible to monitor the rotor rotation. Also from the measured values of the back-electromotive force voltages it is not possible that the load angle of the motor is determined, which does not allow controlling the motor speed depending on the motor loading. 
         [0004]    A method for control of brushless direct current motors is also known where the currents in the stator windings of the motor are controlled depending on the rotor position, which in turn is determined with Hall sensors. Depending on the position of the rotor magnetic field, the Hall sensors generate logical signals zero or one at their outputs. Using these logical signals the rotor position is determined and the currents in the stator windings are controlled in order to maintain a certain load angle of the motor. 
         [0005]    A shortcoming of this method is the necessity of using Hall sensors or other means for rotor position monitoring which leads to higher complexity and higher price. 
       BRIEF SUMMARY OF THE INVENTION 
       [0006]    The goal of the present invention is to create a method for control of synchronous electrical motors which allows determining the motor load angle and speed of rotation continuously in time without using sensors for the rotor position. 
         [0007]    According to the present invention this goal is achieved with the method for control of synchronous electrical motors where the shape of the currents in the stator windings of the motor is monitored. The resistances, the inductances and the mutual inductances between the windings of the motor are determined and stored in a memory. The supply voltage of the motor is measured and its value is also stored in the memory. The durations of the time intervals when the stator windings are connected to the supply voltage and when they are short-circuited between each two consecutive crossings of the currents in the windings of their set values are measured and stored in the memory. The total durations of the time intervals between the two consecutive crossings of the currents in the windings of their set values are calculated from the measured and stored durations of the said time intervals and these total durations are stored in the memory. The set values of the currents in the windings during the said time intervals are also stored in the memory. From all the stored values and based on determined relationships the values of the induced in the windings back-electromotive force voltages u bemf1  and u bemf2  are calculated. From the calculated values of the back-electromotive force voltages u bemf1  and u bemf2 , the instantaneous values of the motor load angle θ and the angular rotor speed ω are calculated. A given set value of the load angle is set and the control of the motor is realized where if the current value of the load angle is greater than the set one, either the motor operating currents are increased, or the motor speed is decreased, or both actions are carried out together. If the current value of the load angle is smaller than the set one, either the motor operating currents are decreased or the motor speed is increased or both actions are carried out together. If the current values of the back-electromotive force voltages u bemf1  and u bemf2  become zero or close to zero, motor stall condition is detected. 
         [0008]    The advantages of the present method for control of synchronous electrical motors are that the load angle of the motor and the motor speed are calculated continuously at every moment of time. There is no need that additional sensors for the rotor position and speed are used. The method realizes closed-loop sensorless control of the motor where the calculated load angle and rotor speed serve as feedback signals for the closed-loop control. 
     
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
         [0009]    The present invention is described with more details with an exemplary device for control of synchronous electrical motors using Pulse Width Modulation, which device realizes the method and is given on the following figures where: 
           [0010]    On  FIG. 1  a principal electrical diagram of the device that controls the currents through the stator windings of an electrical motor using Pulse Width Modulation is given; 
           [0011]    On  FIG. 2  the waveform of the current through one of the stator windings of the electrical motor is given; 
           [0012]    On  FIG. 3  the waveforms of the currents through both stator windings of the electrical motor are given, together with the set values of these currents and the durations of the time intervals of increasing and decreasing of these currents, all needed for calculation of the induced back-electromotive force voltages; 
           [0013]    On  FIG. 4  the waveforms of the currents in the stator windings, the induced back-electromotive force voltages in the stator windings and the load angle of a stepper motor are given. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0014]    One of the principles of control of stepper and brushless direct current motors that has found most widespread application is regulation of the currents in the stator windings of the motor using Pulse Width Modulation. 
         [0015]    Current regulation with Pulse Width Modulation is realized through switching on and off of certain switching devices (usually bipolar or field-effect transistors) that connect the stator windings of the motor to a constant voltage supply source or short-circuit them. When a given winding is connected to the supply source the current through it increases, and when the same winding is short-circuited the current through it decreases. In this way, with constantly changing the winding&#39;s connection, the current through it is regulated around a given set value. The set values of the currents through the stator windings are chosen in such a way in time that a rotating magnetic field is generated in the stator. This rotating magnetic field in turn drags with itself the rotor and forces it to rotation. 
         [0016]    An example of a motor driver that uses this principle for a two phase stepper or brushless direct current motor is given on  FIG. 1 . The driver includes a supply source  1  and two H-bridges  2  and  3 . The H-bridges  2  and  3  consist of four switching devices each, respectively  21 ,  22 ,  23 ,  24  and  31 ,  32 ,  33 ,  34 . The motor  4  is shown with its two stator windings  41  and  42 , each of them connected to one of the diagonals of the H-bridges  2  and  3 . The supply source  1  is connected to the other diagonal of the H-bridges  2  and  3 . 
         [0017]    The H-bridges allow that the currents through the two stator windings of the motor are regulated with Pulse Width Modulation. When for example the switching devices  21  and  24  of the first H-bridge are switched on, the respective winding  41  is connected between the positive and the negative terminal of the supply source  1  and the current through this winding increases. When the switching devices  23  and  24  of the same H-bridge are switched on, the winding  41  is short-circuited and the current through it decreases. In this way the current through the winding  41  of the motor is regulated around the chosen set value. The same way the current through the other winding  42  of the motor is regulated also. Thus currents with certain values are driven through the stator windings of the motor, these currents in turn generate magnetic field in the stator. The set values of the currents are chosen in such a way in time that they generate a rotating magnetic field. It is well known that in order to create rotating magnetic field the set values of the two currents should follow sinusoidal waveforms that have to be phase-shifted between each other with 90 degrees. 
         [0018]    On  FIG. 2  the waveform of one of the currents in the stator windings is shown. At time t 0  the switching devices of the respective H-bridge connect the winding to the supply source. The current through the winding starts to increase. At time t 1  the current through the winding has reached its set value I 1  and the switching devices short-circuit the winding. The current starts to decrease until time t 2  when the switching devices again connect the winding to the supply source. The current starts to increase again until time t 3  when it reaches again its set value. On the figure a change in the set value is shown, it changes from I 1  to I 2  and after t 2  the current continues to increase until the new set point I 2  is reached. The time difference t PWM =t 2 −t 0  between t 0  and t 2  is called period of the Pulse Width Modulation and is usually a constant value. The time difference t OFF =t 2 −t 1  is called switch-off time and the time difference t ON =t 3 −t 2  is called switch-on time of the Pulse Width Modulation. 
         [0019]    The mathematical relationships of the currents in the stator windings of a two-phase synchronous electrical motor can be given with the following set of differential equations: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         L 
                          
                         
                           
                              
                             
                               i 
                               1 
                             
                           
                           
                              
                             t 
                           
                         
                       
                       + 
                       
                         Ri 
                         1 
                       
                       + 
                       
                         M 
                          
                         
                           
                              
                             
                               i 
                               2 
                             
                           
                           
                              
                             t 
                           
                         
                       
                     
                     = 
                     
                       
                         
                           a 
                           1 
                         
                          
                         E 
                       
                       - 
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           1 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         L 
                          
                         
                           
                              
                             
                               i 
                               2 
                             
                           
                           
                              
                             t 
                           
                         
                       
                       + 
                       
                         Ri 
                         2 
                       
                       + 
                       
                         M 
                          
                         
                           
                              
                             
                               i 
                               1 
                             
                           
                           
                              
                             t 
                           
                         
                       
                     
                     = 
                     
                       
                         
                           a 
                           2 
                         
                          
                         E 
                       
                       - 
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           2 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   1 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where L and R are the inductance and resistance of the stator windings, M is the mutual inductance between the two windings, E is the supply source voltage, i 1  and i 2  are the two currents in the windings, u bemf1  and u bemf2  are the back-electromotive force voltages induced in the two windings and a 1  and a 2  are coefficients equal respectively to 1 or 0 depending on whether the windings are connected to the supply source or are short-circuited. 
         [0020]    The present invention consists of a method for calculating the values of the back-electromotive force voltages u bemf1  and u bemf2 , provided that we know the mathematical relationships (1) of the currents in the windings, the time durations t OFF  and t ON  of the Pulse Width Modulation, the set values of the currents I 1  and I 2 , the supply source voltage E, and the parameters of the motor—the resistance R, the inductance L and the mutual inductance M of the windings. 
         [0021]    The procedure implementing the method starts with the moment in time when the current through a winding, for example i 1  has reached its set value—this is time t 1  from  FIG. 2 . At this moment the value of the current i 1  is known and it is equal to I 1 . The set of differential equations (1) describing the currents in the windings is solved for the time interval between t 1  and t 2 . The common integral for i 1  is derived from the set of differential equations (1) and the particular solution i 1 (t) is determined from the initial condition i 1 (0)=I 1 . After that the value of the current i 1 (t OFF ) for t=t OFF  is determined. The set of differential equations (1) is once more solved for i 1  this time in the interval between t 2  and t 3 . The common integral is again derived and the particular solution i 1 (t) is this time determined from the new initial condition i 1 (0)=i 1 (t OFF ). Now if we find the value of i 1  for t=t ON  we come to an equation i 1 (t ON )=I 2  where all variables except the back-electromotive force voltages u bemf1  and u bemf2  are known. In the same way (1) is solved for the other current i 2  and we come to two independent equations from which the values of the two back-electromotive force voltages u bemf1  and u bemf2  can be determined. While solving for u bemf1  and U bemf2  we have made the assumption that the back-electromotive force voltages are constant for the time intervals between t 1  and t 3  which is valid because the period of the back-electromotive force voltages is much longer than the time interval between t 1  and t 3 . 
         [0022]    A practical application of the method is presented below. 
         [0023]    For the cases when the influence of the mutual inductance M between the windings can be neglected, the set of differential equations (1) transforms to two separate differential equations. For example for the current i 1  in the time interval between t 1  and t 2  the following equation is valid: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       L 
                        
                       
                         
                            
                           
                             i 
                             1 
                           
                         
                         
                            
                           t 
                         
                       
                     
                     + 
                     
                       Ri 
                       1 
                     
                   
                   = 
                   
                     - 
                     
                       u 
                       
                         bemf 
                          
                         
                             
                         
                          
                         1 
                       
                     
                   
                 
               
               
                 
                   ( 
                   2 
                   ) 
                 
               
             
           
         
       
     
         [0000]    The coefficient a 1  for this time interval is equal to 0 because the winding is short-circuited. After solving of (2) for the interval between t 1  and t 2 , knowing that the value of i 1  at time t 1  is equal to I 1  we find that i 1  at time t 2  is equal to: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       i 
                       1 
                     
                      
                     
                       ( 
                       
                         t 
                         2 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             I 
                             1 
                           
                           + 
                           
                             
                               u 
                               
                                 bemf 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                             
                             R 
                           
                         
                         ) 
                       
                        
                       
                          
                         
                           
                             - 
                             
                               t 
                               OFF 
                             
                           
                           / 
                           τ 
                         
                       
                     
                     - 
                     
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       R 
                     
                   
                 
               
               
                 
                   ( 
                   3 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where τ=L/R is the time constant of the electrical circuit. 
         [0024]    For the time interval between t 2  and t 3  the following differential equation is valid: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       L 
                        
                       
                           
                       
                        
                       
                         
                            
                           
                             i 
                             1 
                           
                         
                         
                            
                           t 
                         
                       
                     
                     + 
                     
                       Ri 
                       1 
                     
                   
                   = 
                   
                     E 
                     - 
                     
                       u 
                       
                         bemf 
                          
                         
                             
                         
                          
                         1 
                       
                     
                   
                 
               
               
                 
                   ( 
                   4 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where the coefficient a 2  for this interval is equal to 1 because the winding is connected to the supply source. After solving of (4) for the interval between t 2  and t 3 , knowing that i 1  at time t 2  is equal to (3) we find that i 1  at time t 3  is equal to: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       i 
                       1 
                     
                      
                     
                       ( 
                       
                         t 
                         3 
                       
                       ) 
                     
                   
                   = 
                   
                     
                       
                         ( 
                         
                           
                             
                               ( 
                               
                                 
                                   I 
                                   1 
                                 
                                 + 
                                 
                                   
                                     u 
                                     
                                       bemf 
                                        
                                       
                                           
                                       
                                        
                                       1 
                                     
                                   
                                   R 
                                 
                               
                               ) 
                             
                              
                             
                                
                               
                                 
                                   - 
                                   
                                     t 
                                     OFF 
                                   
                                 
                                 / 
                                 τ 
                               
                             
                           
                           - 
                           
                             E 
                             R 
                           
                         
                         ) 
                       
                        
                       
                          
                         
                           
                             - 
                             
                               t 
                               ON 
                             
                           
                           / 
                           τ 
                         
                       
                     
                     + 
                     
                       
                         E 
                         - 
                         
                           u 
                           
                             bemf 
                              
                             
                                 
                             
                              
                             1 
                           
                         
                       
                       R 
                     
                   
                 
               
               
                 
                   ( 
                   5 
                   ) 
                 
               
             
           
         
       
     
         [0000]    If we take in mind that i 1 (t 3 )=I 2  from (5) we get one equation with one unknown variable—u bemf1 . After solving this equation for the back-electromotive force voltage u bemf1  we obtain: 
         [0000]    
       
         
           
             
               
                 
                   
                     u 
                     
                       bemf 
                        
                       
                           
                       
                        
                       1 
                     
                   
                   = 
                   
                     
                       
                         E 
                          
                         
                           ( 
                           
                             1 
                             - 
                             
                                
                               
                                 
                                   - 
                                   
                                     t 
                                     
                                       ON 
                                        
                                       
                                           
                                       
                                        
                                       1 
                                     
                                   
                                 
                                 / 
                                 τ 
                               
                             
                           
                           ) 
                         
                       
                       + 
                       
                         
                           RI 
                           11 
                         
                          
                         
                            
                           
                             
                               - 
                               
                                 ( 
                                 
                                   
                                     t 
                                     
                                       ON 
                                        
                                       
                                           
                                       
                                        
                                       1 
                                     
                                   
                                   + 
                                   
                                     t 
                                     
                                       OFF 
                                        
                                       
                                           
                                       
                                        
                                       1 
                                     
                                   
                                 
                                 ) 
                               
                             
                             / 
                             τ 
                           
                         
                       
                       - 
                       
                         RI 
                         12 
                       
                     
                     
                       1 
                       - 
                       
                          
                         
                           
                             - 
                             
                               ( 
                               
                                 
                                   t 
                                   
                                     ON 
                                      
                                     
                                         
                                     
                                      
                                     1 
                                   
                                 
                                 + 
                                 
                                   t 
                                   
                                     OFF 
                                      
                                     
                                         
                                     
                                      
                                     1 
                                   
                                 
                               
                               ) 
                             
                           
                           / 
                           τ 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   6 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where I 11  and I 12  are the set values for the current in the first winding at the moments of time t 1  and t 3 , and t ON1  and t OFF1  are the switch-on and the switch-off times of the current in the first winding ( FIG. 2 ). 
         [0025]    In the same way the value of the back-electromotive force voltage u bemf2  in the second winding can be derived: 
         [0000]    
       
         
           
             
               
                 
                   
                     u 
                     
                       bemf 
                        
                       
                           
                       
                        
                       2 
                     
                   
                   = 
                   
                     
                       
                         E 
                          
                         
                           ( 
                           
                             1 
                             - 
                             
                                
                               
                                 
                                   - 
                                   
                                     t 
                                     
                                       ON 
                                        
                                       
                                           
                                       
                                        
                                       2 
                                     
                                   
                                 
                                 / 
                                 τ 
                               
                             
                           
                           ) 
                         
                       
                       + 
                       
                         
                           RI 
                           21 
                         
                          
                         
                            
                           
                             
                               - 
                               
                                 ( 
                                 
                                   
                                     t 
                                     
                                       ON 
                                        
                                       
                                           
                                       
                                        
                                       2 
                                     
                                   
                                   + 
                                   
                                     t 
                                     
                                       OFF 
                                        
                                       
                                           
                                       
                                        
                                       2 
                                     
                                   
                                 
                                 ) 
                               
                             
                             / 
                             τ 
                           
                         
                       
                       - 
                       
                         RI 
                         22 
                       
                     
                     
                       1 
                       - 
                       
                          
                         
                           
                             - 
                             
                               ( 
                               
                                 
                                   t 
                                   
                                     ON 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                 
                                 + 
                                 
                                   t 
                                   
                                     OFF 
                                      
                                     
                                         
                                     
                                      
                                     2 
                                   
                                 
                               
                               ) 
                             
                           
                           / 
                           τ 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   7 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where I 21  and I 22  are the set values for the current in the second winding and t ON2  and t OFF2  are the switch-on and the switch-off times of the current in the second winding. 
         [0026]    From the theory of the two-phase synchronous motors it is known that the back-electromotive force voltages in the windings are given with the following relationships: 
         [0000]        u   bemf1   =U   m  cos β= k ω cos β
 
         [0000]        u   bemf2   =U   m  sin β= k ω sin β  (8)
 
         [0000]    where U m  is the amplitude of the back-electromotive force voltages, ω is the angular speed of the rotor, K is a coefficient that depends on the motor and can be determined from the datasheet parameters of the motor and β is the angular position of the rotor in respect to the chosen zero position. If we know the values of the back-electromotive force voltages u bemf1  and u bemf2  from the set of equations (8) we can determine the angular speed ω and the angular position β of the rotor. From the other hand the angular position α of the vector of the stator magnetic field is also known at any moment of time. The difference between the angular position α of the stator magnetic field vector and the rotor angular position β is the load angle θ of the motor: 
         [0000]      θ=α−β  (9)
 
         [0027]    If the load angle θ or the angular speed ω of the rotor are known, it is possible to realize a closed-loop control of the motor where the load angle or the angular speed serve as feedback signal of the closed-loop control. 
         [0028]    A closed-loop control of the motor based on the load angle will be realized by setting a set value for the load angle and if the current load angle becomes bigger than the set one, the motor currents have to be increased or the motor speed has to be decreased or both actions can be done simultaneously. If the current load angle becomes smaller than the set one, the motor currents have to be decreased or the motor speed has to be increased or both actions can be done simultaneously. 
         [0029]    Following the method described above it is possible to realize devices for sensorless motor control where it is not necessary to have additional sensors for the rotor position or speed. 
         [0030]    In order that the calculations are simplified, the relationships (6) and (7) can be expanded in Taylor series. If we limit the expansion to first order terms only, we have: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       u 
                       
                         bemf 
                          
                         
                             
                         
                          
                         1 
                       
                     
                     = 
                     
                       
                         E 
                          
                         
                             
                         
                          
                         
                           
                             t 
                             
                               ON 
                                
                               
                                   
                               
                                
                               1 
                             
                           
                           
                             
                               t 
                               
                                 ON 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                             
                             + 
                             
                               t 
                               
                                 OFF 
                                  
                                 
                                     
                                 
                                  
                                 1 
                               
                             
                           
                         
                       
                       - 
                       
                         RI 
                         11 
                       
                       - 
                       
                         
                           L 
                            
                           
                             ( 
                             
                               
                                 I 
                                 12 
                               
                               - 
                               
                                 I 
                                 11 
                               
                             
                             ) 
                           
                         
                         
                           
                             t 
                             
                               ON 
                                
                               
                                   
                               
                                
                               1 
                             
                           
                           + 
                           
                             t 
                             
                               OFF 
                                
                               
                                   
                               
                                
                               1 
                             
                           
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       u 
                       
                         bemf 
                          
                         
                             
                         
                          
                         2 
                       
                     
                     = 
                     
                       
                         E 
                          
                         
                             
                         
                          
                         
                           
                             t 
                             
                               ON 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                           
                             
                               t 
                               
                                 ON 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                             
                             + 
                             
                               t 
                               
                                 OFF 
                                  
                                 
                                     
                                 
                                  
                                 2 
                               
                             
                           
                         
                       
                       - 
                       
                         RI 
                         21 
                       
                       - 
                       
                         
                           L 
                            
                           
                             ( 
                             
                               
                                 I 
                                 22 
                               
                               - 
                               
                                 I 
                                 21 
                               
                             
                             ) 
                           
                         
                         
                           
                             t 
                             
                               ON 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                           + 
                           
                             t 
                             
                               OFF 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   10 
                   ) 
                 
               
             
           
         
       
     
         [0031]    These simplified relationships can be used where it is possible to make a compromise with the accuracy of u bemf1  and u bemf2  calculation in order to gain speed in the microprocessor device that controls the motor. The expansion in Taylor series can be done up to second and higher-order terms depending on the constraints for accuracy and speed of calculations. 
         [0032]    The above derivations were made with the assumption that the mutual inductance M between the windings can be neglected. In cases when the mutual inductance can not be neglected the above method can still be applied where for the values of the back-electromotive force voltages u bemf1  and u bemf2  their average values from several consecutive calculations are taken. Since the influence of the mutual inductance in two consecutive time intervals where the current changes from increasing to decreasing is approximately equal in magnitude and opposite in sign, if we average enough values of u bemf1  and u bemf2 , the influence of the mutual inductance will be reduced. The more values we average the better will be the accuracy of calculation. From the other hand the averaging will lead to filtration of fast changes of u bemf1  and u bemf2 , therefore the number of the values averaged has to be chosen as a trade-off between the necessary accuracy and the sensitivity to fast changes in the particular application. 
         [0033]    An approach for calculating u bemf1  and u bemf2  in cases when the mutual inductance M can not be neglected and the averaging does not give satisfactory results is given bellow. The set of differential equations (1) can not be separated into two independent equations. In general it represents a first order set of linear differential equations. For this type of sets of differential equations there exists a methodology for exact analytical solving. When this methodology is applied and in the same way as in the above description the differential set is solved for the time intervals between every two consecutive moments of time when the currents reach their set values, it is possible to derive two independent equations from which the values of the back-electromotive force voltages u bemf1  and u bemf2  can be calculated. After finding u bemf1  and u bemf2  from (8) and (9) the load angle and the angular speed of the motor can be determined. Because the solution of the differential set is too long it is not presented in this description. 
         [0034]    In this description a simplified solution to the differential set (1) when the mutual inductance M can not be neglected will be presented. In this solution some assumptions for simplification have been done but they give the necessary accuracy of u bemf1  and u bemf2  calculation. If we write down (1) in the following way: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         L 
                          
                         
                             
                         
                          
                         
                           
                              
                             
                               i 
                               1 
                             
                           
                           
                              
                             t 
                           
                         
                       
                       + 
                       
                         M 
                          
                         
                             
                         
                          
                         
                           
                              
                             
                               i 
                               2 
                             
                           
                           
                              
                             t 
                           
                         
                       
                     
                     = 
                     
                       
                         
                           a 
                           1 
                         
                          
                         E 
                       
                       - 
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       - 
                       
                         Ri 
                         1 
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         L 
                          
                         
                             
                         
                          
                         
                           
                              
                             
                               i 
                               2 
                             
                           
                           
                              
                             t 
                           
                         
                       
                       + 
                       
                         M 
                          
                         
                           
                              
                             
                               i 
                               1 
                             
                           
                           
                              
                             t 
                           
                         
                       
                     
                     = 
                     
                       
                         
                           a 
                           2 
                         
                          
                         E 
                       
                       - 
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           2 
                         
                       
                       - 
                       
                         Ri 
                         2 
                       
                     
                   
                 
               
               
                 
                   ( 
                   11 
                   ) 
                 
               
             
           
         
       
     
         [0000]    and assume that the currents i 1  and i 2  at the right hand side of the equations are equal at any moment of time to their set values respectively I 1i  and I 2i  (i=1, 2, . . . ) ( FIG. 3 ), then (11) becomes an algebraic set of equations from which the time derivatives of the two currents can be determined: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                          
                         
                           i 
                           1 
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           E 
                            
                           
                             ( 
                             
                               
                                 La 
                                 1 
                               
                               - 
                               
                                 Ma 
                                 2 
                               
                             
                             ) 
                           
                         
                         + 
                         
                           
                             u 
                             
                               bemf 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                            
                           M 
                         
                         - 
                         
                           
                             u 
                             
                               bemf 
                                
                               
                                   
                               
                                
                               1 
                             
                           
                            
                           L 
                         
                         + 
                         
                           R 
                            
                           
                             ( 
                             
                               
                                 MI 
                                 2 
                               
                               - 
                               
                                 LI 
                                 1 
                               
                             
                             ) 
                           
                         
                       
                       
                         
                           L 
                           2 
                         
                         - 
                         
                           M 
                           2 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                          
                         
                           i 
                           2 
                         
                       
                       
                          
                         t 
                       
                     
                     = 
                     
                       
                         
                           E 
                            
                           
                             ( 
                             
                               
                                 La 
                                 2 
                               
                               - 
                               
                                 Ma 
                                 1 
                               
                             
                             ) 
                           
                         
                         + 
                         
                           
                             u 
                             
                               bemf 
                                
                               
                                   
                               
                                
                               1 
                             
                           
                            
                           M 
                         
                         - 
                         
                           
                             u 
                             
                               bemf 
                                
                               
                                   
                               
                                
                               2 
                             
                           
                            
                           L 
                         
                         + 
                         
                           R 
                            
                           
                             ( 
                             
                               
                                 MI 
                                 1 
                               
                               - 
                               
                                 LI 
                                 2 
                               
                             
                             ) 
                           
                         
                       
                       
                         
                           L 
                           2 
                         
                         - 
                         
                           M 
                           2 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   12 
                   ) 
                 
               
             
           
         
       
     
         [0000]    The assumption that the currents are equal to their set values is valid because the Pulse Width Modulation is regulating the currents close to their set values. If we now substitute the derivatives in (1) but only in the terms that describe the influence of the mutual inductance we come to the following set: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       
                         L 
                          
                         
                           
                              
                             
                               i 
                               1 
                             
                           
                           
                              
                             t 
                           
                         
                       
                       + 
                       
                         Ri 
                         1 
                       
                     
                     == 
                     
                       
                         
                           a 
                           1 
                         
                          
                         E 
                       
                       - 
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       - 
                       
                         
                           M 
                           
                             
                               L 
                               2 
                             
                             - 
                             
                               M 
                               2 
                             
                           
                         
                          
                         
                           ( 
                           
                             
                               E 
                                
                               
                                 ( 
                                 
                                   
                                     La 
                                     2 
                                   
                                   - 
                                   
                                     Ma 
                                     1 
                                   
                                 
                                 ) 
                               
                             
                             + 
                             
                               
                                 u 
                                 
                                   bemf 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                                
                               M 
                             
                             - 
                             
                               
                                 u 
                                 
                                   bemf 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                               
                                
                               L 
                             
                             + 
                             
                               R 
                                
                               
                                 ( 
                                 
                                   
                                     MI 
                                     1 
                                   
                                   - 
                                   
                                     LI 
                                     2 
                                   
                                 
                                 ) 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       
                         L 
                          
                         
                           
                              
                             
                               i 
                               2 
                             
                           
                           
                              
                             t 
                           
                         
                       
                       + 
                       
                         Ri 
                         2 
                       
                     
                     == 
                     
                       
                         
                           a 
                           2 
                         
                          
                         E 
                       
                       - 
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           2 
                         
                       
                       - 
                       
                         
                           M 
                           
                             
                               L 
                               2 
                             
                             - 
                             
                               M 
                               2 
                             
                           
                         
                          
                         
                           ( 
                           
                             
                               E 
                                
                               
                                 ( 
                                 
                                   
                                     La 
                                     1 
                                   
                                   - 
                                   
                                     Ma 
                                     2 
                                   
                                 
                                 ) 
                               
                             
                             + 
                             
                               
                                 u 
                                 
                                   bemf 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                               
                                
                               M 
                             
                             - 
                             
                               
                                 u 
                                 
                                   bemf 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                                
                               L 
                             
                             + 
                             
                               R 
                                
                               
                                 ( 
                                 
                                   
                                     MI 
                                     2 
                                   
                                   - 
                                   
                                     LI 
                                     1 
                                   
                                 
                                 ) 
                               
                             
                           
                           ) 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   13 
                   ) 
                 
               
             
           
         
       
     
         [0000]    This way (1) is transformed again into two independent linear differential equations and the above described method for u bemf1  and u bemf2  calculation can be applied again. After applying this method for u bemf1  and u bemf2  we find: 
         [0000]    
       
         
           
             
               
                 
                   
                     
                       u 
                       
                         bemf 
                          
                         
                             
                         
                          
                         1 
                       
                     
                     = 
                     
                       
                         ( 
                         
                           A 
                           + 
                           pB 
                         
                         ) 
                       
                       
                         ( 
                         
                           1 
                           - 
                           
                             p 
                             2 
                           
                         
                         ) 
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     
                       u 
                       
                         bemf 
                          
                         
                             
                         
                          
                         2 
                       
                     
                     = 
                     
                       
                         ( 
                         
                           B 
                           + 
                           
                             p 
                              
                             
                                 
                             
                              
                             A 
                           
                         
                         ) 
                       
                       
                         ( 
                         
                           1 
                           - 
                           
                             p 
                             2 
                           
                         
                         ) 
                       
                     
                   
                 
               
               
                 
                   ( 
                   14 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where A and B are given with the following formulas: 
         [0000]    
       
         
           
             
               
                 
                   
                     A 
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                 I 
                                 
                                   1 
                                    
                                   f 
                                 
                               
                               - 
                               
                                 
                                   I 
                                   
                                     1 
                                      
                                     s 
                                   
                                 
                                  
                                 
                                    
                                   
                                     
                                       - 
                                       
                                         t 
                                         
                                           tot 
                                            
                                           
                                               
                                           
                                            
                                           1 
                                         
                                       
                                     
                                     / 
                                     τ 
                                   
                                 
                               
                             
                             ) 
                           
                            
                           
                             R 
                              
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   p 
                                   2 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           S 
                           
                             1 
                              
                             n 
                           
                         
                       
                       
                         
                            
                           
                             
                               - 
                               
                                 t 
                                 
                                   tot 
                                    
                                   
                                       
                                   
                                    
                                   1 
                                 
                               
                             
                             / 
                             τ 
                           
                         
                         - 
                         1 
                       
                     
                   
                    
                   
                     
 
                   
                    
                   
                     B 
                     = 
                     
                       
                         
                           
                             ( 
                             
                               
                                 I 
                                 
                                   2 
                                    
                                   f 
                                 
                               
                               - 
                               
                                 
                                   I 
                                   
                                     2 
                                      
                                     s 
                                   
                                 
                                  
                                 
                                    
                                   
                                     
                                       - 
                                       
                                         t 
                                         
                                           tot 
                                            
                                           
                                               
                                           
                                            
                                           2 
                                         
                                       
                                     
                                     / 
                                     τ 
                                   
                                 
                               
                             
                             ) 
                           
                            
                           
                             R 
                              
                             
                               ( 
                               
                                 1 
                                 - 
                                 
                                   p 
                                   2 
                                 
                               
                               ) 
                             
                           
                         
                         + 
                         
                           S 
                           
                             2 
                              
                             m 
                           
                         
                       
                       
                         
                            
                           
                             
                               - 
                               
                                 t 
                                 
                                   tot 
                                    
                                   
                                       
                                   
                                    
                                   2 
                                 
                               
                             
                             / 
                             τ 
                           
                         
                         - 
                         1 
                       
                     
                   
                 
               
               
                 
                   ( 
                   15 
                   ) 
                 
               
             
           
         
       
     
         [0000]    S 1n  and S 2m  are given with the following recursive formulas: 
         [0000]        S   10 =0 
         [0000]        S   1i   =S   1i-1   e   −t     1i     /τ +( Ea   1i   −pEa   2i   −p   2   RI   1i   +pRI   2i )( e   −t     1i     /τ −1)
 
         [0000]        i= 1  . . . n   (16)
 
         [0000]      and 
         [0000]        S   20 =0 
         [0000]        S   2j   =S   2j-1   e   −t     2j     /τ +( Ea′   2j   −pEa′   1j   −p   2   RI′   2j   +pRI′   1j )( e   −t     2j     /τ −1)
 
         [0000]        j= 1  . . . m   (17)
 
         [0000]    where p=M/L, I 1f  and I 2f  ( FIG. 3 ) are the set values of the two currents at the end of the time interval of solving the equations, I 1s  and I 2s  are the set values of the two currents at the beginning of the time interval of solving the equations, t tot1  and t tot2  are the total durations of the time intervals between the two consecutive moments when the currents reach their set values, t 1i  and t 2j  are the durations of the consecutive time intervals during which the windings are connected to the supply source or are short-circuited, a 1i , a′ 1j ; and a 2i , a′ 2j  are the coefficients in the respective time intervals that signify whether the respective winding is connected to the supply source or is short-circuited (in general a 1i  and a′ 1j ; also a 2i  and a′ 2j  may not be equal because they may represent different time intervals), I 1i , I′ 1j  and I 2i , I 2j  are the set values of the currents in the respective windings for the respective time intervals of calculation (in general I 1i  and I′ 1j  also I 2i  and I′ 2j  may not be equal because they may represent different time intervals), n and m are the total number of intervals that t tot1  and t tot2  consist of. 
         [0035]    This way we can calculate u bemf1  and u bemf2  in cases when the effect of the mutual inductance M between the windings can not be neglected. After finding u bemf1  and u bemf2 , according to (8) and (9) we can determine the load angle and the angular speed of the motor and the control of the motor can be realized. 
         [0036]    Another approach for eliminating the effect of the mutual inductance M while solving (1) is to chose time intervals when one of the currents i 1  or i 2  is zero. For most of the algorithms for stepper motor control such time intervals exist. 
         [0037]    On  FIG. 4  the waveforms of the set values for the two stator currents in a two-phase stepper motor are shown. It is shown that for every full period of the currents there exist two time intervals when the set value of the current is zero. In these time intervals the differential set (1) will be simplified to only one differential equation that can be solved with the described method for the respective back-electromotive force voltage u bemf1  or u bemf2  (see formulas (6) and (7)). On  FIG. 4  the waveforms of the back-electromotive force voltages u bemf1  and u bemf2  are shown. The load angle θ that determines the phase shift between the currents and the back-electromotive force voltages is also shown on the same figure. 
         [0038]    Let&#39;s assume that from (6) we have found the back-electromotive force voltage in the first winding u bemf1  at a moment of time when the current i 2  in the second winding is zero. Because at this moment we have only one of the equations (8), it is not possible only from this equation to find the two independent variables—the angular position β and the angular speed of the rotor ω. However, if we assume that the rotor rotates synchronously with the stator magnetic field, then one of the variables will be known—the rotor angular speed ω will be equal to the angular speed of rotation of the stator magnetic field ω st , which is known. From the datasheet parameters of the motor or with measurements it is also possible to determine the value of the coefficient k in (8). This way we come to only one unknown variable in the equation—the angular position β of the rotor. Then this angle is found with the following formula: 
         [0000]    
       
         
           
             
               
                 
                   
                     cos 
                      
                     
                         
                     
                      
                     β 
                   
                   = 
                   
                     
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       
                         U 
                         m 
                       
                     
                     = 
                     
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           1 
                         
                       
                       
                         k 
                          
                         
                             
                         
                          
                         
                           ω 
                           st 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   18 
                   ) 
                 
               
             
           
         
       
     
         [0000]    where ω st  is the angular speed of the stator magnetic field. 
         [0039]    If we have found the value of the back-electromotive force voltage in the second winding u bemf2 , in the same way the angular position β of the rotor is found with the following formula: 
         [0000]    
       
         
           
             
               
                 
                   
                     sin 
                      
                     
                         
                     
                      
                     β 
                   
                   = 
                   
                     
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           2 
                         
                       
                       
                         U 
                         m 
                       
                     
                     = 
                     
                       
                         u 
                         
                           bemf 
                            
                           
                               
                           
                            
                           2 
                         
                       
                       
                         k 
                          
                         
                             
                         
                          
                         
                           ω 
                           st 
                         
                       
                     
                   
                 
               
               
                 
                   ( 
                   19 
                   ) 
                 
               
             
           
         
       
     
         [0040]    From the angular position of the rotor β, using (9), we can find the load angle θ. 
         [0041]    If the back-electromotive force voltage in one of the windings, calculated when the current in the other winding is zero, becomes equal or close to zero, it will mean that the rotor has stopped rotating. This way stall detection of the motor can be realized. 
         [0042]    Another way of calculating the rotor angular position β and the rotor angular speed ω is to write down the first equation from (8) for two different moments in time, for example t 1  and t 2  ( FIG. 4 ) in the time interval when the current in the second winding is zero. If we assume that the speed of the rotor is one and the same for both moments, we come to the following set of equations: 
         [0000]        u   bemf11   =k ω cos β
 
         [0000]        u   bemf12   =k ω cos(β+ωΔ t )  (20)
 
         [0000]    where Δt=t 2 −t 1  is the time interval between t 1  and t 2 . It the time interval Δt is mush shorter than the period of u bemf1 , the assumption that the speed of the rotor does not change between t 1  and t 2  is valid. The set (20) has two independent equations with two independent variables and can be solved for the rotor angular position β and the rotor angular speed ω. 
         [0043]    Respectively for the back-electromotive force voltage in the second winding we will have the following set: 
         [0000]        u   bemf21   =k ω sin β
 
         [0000]        u   bemf22   =k ω sin(β+ωΔ t )  (21)
 
         [0044]    From (20), (21) and (9) the rotor angular position A the rotor angular speed ω and the motor load angle θ can be found. After these variables are found the motor can be controlled with a closed-loop control as described above.