# Patent

## Title
Circuits and methods of determining position and velocity of a rotor

## Abstract

A motor controller includes a square wave voltage generator and adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor. A current monitor for monitoring the input current to the motor as a result of the square wave voltage. A device for determining the position of the rotor based on the input current.

## Background
This patent application claims priority to U.S. provisional patent application 61/819,267 filed on May 3, 2013 for INITIAL POSITION AND VELOCITY ESTIMATION ALGORITHM FOR SALIENT PERMANENT MAGNET MOTORS which is incorporated for all that is disclosed therein.


BACKGROUND
A permanent magnet motor represents a type of motor where a fixed stator causes rotation of a movable rotor. The rotor typically includes multiple magnets embedded in or connected to the rotor, and the stator typically includes multiple conductive windings. Electrical current in the windings generates a rotating magnetic field that interacts with the magnets of the rotor, causing the rotor to rotate. Because the stator has multiple windings, the input to the stator, which is the input to the motor, is inductive.
“Sensorless” motor control refers to an approach where one or more characteristics of a motor, such as motor speed or rotor position, are mathematically derived. Sensorless motor control typically avoids the use of separate speed and position sensors that are mechanically attached to a motor.
SUMMARY
A motor controller includes a square wave voltage generator and adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor. A current monitor monitors the input current to the motor as a result of the square wave voltage. A device determines the position of the rotor based on the input current.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a cross sectional view of an embodiment of a permanent magnet motor.
FIG. 2 is a diagram showing the rotor of FIG. 1 with different coordinate systems.
FIG. 3 is a block diagram of a Luenberger observer.
FIG. 4 is a graph showing the inductance of the motor of FIG. 1 as a function of the angle of the rotor.
FIG. 5 is a graph showing the magnetic flux as a function of magnetic field intensity in the motor of FIG. 1.
FIG. 6 is a graph showing another embodiment of the magnetic flux as a function of magnetic field intensity of the motor of FIG. 1.
FIG. 7 is a block diagram of an embodiment of a field oriented controller for the motor of FIG. 1.
FIG. 8 is a flowchart describing an embodiment of the operation of the motor of FIG. 1.
FIG. 9 is a flowchart describing an embodiment of the operation of the motor of FIG. 1.



DETAILED DESCRIPTION
Sensorless drive systems and methods of driving salient motors and/or permanent magnet motors that overcome problems associated with conventional motor drivers are described herein. The systems and methods that are used vary slightly depending on the speed of the motor. When the motor is stationary, or more specifically, when the rotor is stationary relative to the stator, the position of the rotor is determined by injecting a square wave voltage into the motor and measuring the location or phase and direction of magnetic flux. The position of the rotor refers to the angle of the rotor and the terms “rotor position” and “rotor angle” are used synonymously. When the motor is operating at low speed, the rotor velocity is determined by injecting or superimposing a square wave onto a driving voltage of the motor and measuring the current into the motor. When the motor is operating at high speed, conventional systems and methods may be used to determine the position of the rotor.
A cross sectional view of a motor 100 is shown in FIG. 1. The motor 100 includes a stator 102 and a rotor 104. The stator 102 is fixed and the rotor 104 rotates relative to the stator 104. The stator 102 has a plurality of teeth 108 extending proximate the rotor 104. Each of the teeth 108 is wound by a conductor to form a coil or winding 110 that generates an electric field when current flows in the conductor. The rotor 104 has a single magnet or a plurality of magnets attached to it. In the embodiments described herein, the rotor 104 has a single magnet attached thereto or located therein. In the embodiment of FIG. 1, the magnet in the rotor 104 has orientation denoted by its north and south poles, N and S, respectively. The motor 100 operates by changing the electric fields in the windings 110, which causes the teeth 108 to push or pull on the magnet in the rotor 104, which in turn causes the rotor 104 to rotate. Therefore, by controlling the current input to the motor 100, which is input to the stator 102, the speed and torque of the motor 100 is controlled.
The maximum torque of the motor 100 is generated when the position or phase of the input current waveform to the windings 110 is perpendicular to the position of the flux waveform in the rotor 104. For permanent magnet motors, such as the motor 100, the flux position is equal to the position of the rotor 104. As a result, the maximum torque is achieved in the motor 100 if the instantaneous position of the rotor 104 is known so that the input current can be positioned accordingly. The current position refers to the phase of the input current in the windings 110 relative to the position of the rotor 104. By using the devices and methods disclosed herein, the position of the rotor 104 is quickly determined, which enables a motor controller (not shown in FIG. 1) to maximize the torque output of the motor 100.
For reference purposes, a block diagram of the rotor 104 and different coordinate systems associated with the rotor 104 and the motor 100 are shown in FIG. 2. The coordinate systems are referenced according to currents associated with the stator 102, FIG. 1, which are referenced to the rotor 104. The currents iq and id relate to the q-axis and the d-axis of the motor 100 and are fixed with respect to the rotor 104. The d/q-axes relate to torque control of the motor 100 and are orthogonal. The iM-axis and iN-axis are arbitrary axes that are used as references for determining the position of the rotor 104. The iM and iN-axes may be predetermined axes in the motor 100 from which the position of the rotor 104 is determined. The iα-axis and the iβ-axis represent an orthogonal coordinate system where the iα-axis is aligned with the phase of a motor winding as described further below. The angle of the rotor 104 based on the angle between the iα-axis and the iM-axis is referred to as the angle θ. A rotational angle θR is defined as the angle between the iα-axis and the id-axis. As the rotor 104 rotates, the rotational angle θR changes wherein the change per unit time is equal to the velocity of the rotor 104.
Having described the motor 100, FIG. 1, the equations related to the operation of the motor 100 will now be described in order to determine the rotor position further below. The following equations relate to the motor 100 that has saliency, meaning that the inductances in the windings 110 change depending on the position of the rotor 104. More specifically, the magnet in the rotor 104 changes the inductance of the windings 110 as the position of the rotor 104, and the magnet located therein, change relative to the windings 110. The motor 100 is modeled by equation (1) as follows given that the motor 100 is salient or has saliency:




  
    
      
        
          [
          
            
              
                
                  V
                  α
                
              
            
            
              
                
                  V
                  β
                
              
            
          
          ]
        
        =
        
          
            
              R
              s
            
            ⁡
            
              [
              
                
                  
                    
                      i
                      α
                    
                  
                
                
                  
                    
                      i
                      β
                    
                  
                
              
              ]
            
          
          +
          
            
              λ
              m
            
            ⁢
            
              
                
                  d
                  
                    θ
                    R
                  
                
                
                  d
                  t
                
              
              ⁡
              
                [
                
                  
                    
                      
                        
                          -
                          sin
                        
                        ⁢
                        
                          
                        
                        ⁢
                        
                          (
                          
                            θ
                            R
                          
                          )
                        
                      
                    
                  
                  
                    
                      
                        cos
                        ⁡
                        
                          (
                          
                            θ
                            R
                          
                          )
                        
                      
                    
                  
                
                ]
              
            
          
          +
          
             
            
              
            
            ⁢
            
               
              
                 
                
                   
                  
                    
                      [
                      
                        
                      
                      ⁢
                      
                        
                          
                            
                              
                                L
                                LS
                              
                              +
                              
                                
                                  3
                                  2
                                
                                ⁢
                                
                                  L
                                  
                                    0
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    S
                                  
                                
                              
                              -
                              
                                
                                  3
                                  2
                                
                                ⁢
                                
                                  L
                                  
                                    2
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    S
                                  
                                
                                ⁢
                                
                                  cos
                                  ⁡
                                  
                                    (
                                    
                                      2
                                      ⁢
                                      
                                        
                                      
                                      ⁢
                                      
                                        θ
                                        R
                                      
                                    
                                    )
                                  
                                
                              
                            
                          
                          
                            
                              
                                -
                                
                                  3
                                  2
                                
                              
                              ⁢
                              
                                L
                                
                                  2
                                  ⁢
                                  S
                                
                              
                              ⁢
                              
                                sin
                                ⁡
                                
                                  (
                                  
                                    2
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      θ
                                      R
                                    
                                  
                                  )
                                
                              
                            
                          
                        
                        
                          
                            
                              
                                -
                                
                                  3
                                  2
                                
                              
                              ⁢
                              
                                L
                                
                                  2
                                  ⁢
                                  S
                                
                              
                              ⁢
                              
                                sin
                                ⁡
                                
                                  (
                                  
                                    2
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    
                                      θ
                                      R
                                    
                                  
                                  )
                                
                              
                            
                          
                          
                            
                              
                                L
                                ls
                              
                              +
                              
                                
                                  3
                                  2
                                
                                ⁢
                                
                                  L
                                  
                                    0
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    S
                                  
                                
                              
                              -
                              
                                
                                  3
                                  2
                                
                                ⁢
                                
                                  L
                                  
                                    2
                                    ⁢
                                    
                                      
                                    
                                    ⁢
                                    S
                                  
                                
                                ⁢
                                
                                  cos
                                  ⁡
                                  
                                    (
                                    
                                      2
                                      ⁢
                                      
                                        
                                      
                                      ⁢
                                      
                                        θ
                                        R
                                      
                                    
                                    )
                                  
                                
                              
                            
                          
                        
                      
                      ⁢
                      
                        
                      
                      ]
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                       
                      
                        
                          [
                          
                            
                              
                                
                                  
                                    d
                                    
                                      i
                                      α
                                    
                                  
                                  
                                    d
                                    t
                                  
                                
                              
                            
                            
                              
                                
                                  
                                    d
                                    
                                      i
                                      β
                                    
                                  
                                  
                                    d
                                    t
                                  
                                
                              
                            
                          
                          ]
                        
                        +
                        
                           
                          
                            
                              [
                              
                                
                                  
                                    
                                      
                                        -
                                        3
                                      
                                      ⁢
                                      
                                        L
                                        
                                          2
                                          ⁢
                                          S
                                        
                                      
                                      ⁢
                                      
                                        
                                          d
                                          
                                            θ
                                            r
                                          
                                        
                                        
                                          d
                                          t
                                        
                                      
                                      ⁢
                                      
                                        sin
                                        ⁡
                                        
                                          (
                                          
                                            2
                                            ⁢
                                            
                                              θ
                                              R
                                            
                                          
                                          )
                                        
                                      
                                    
                                  
                                  
                                    
                                      3
                                      ⁢
                                      
                                        L
                                        
                                          2
                                          ⁢
                                          S
                                        
                                      
                                      ⁢
                                      
                                        
                                          d
                                          
                                            θ
                                            R
                                          
                                        
                                        
                                          d
                                          t
                                        
                                      
                                      ⁢
                                      
                                        cos
                                        ⁡
                                        
                                          (
                                          
                                            2
                                            ⁢
                                            
                                              θ
                                              R
                                            
                                          
                                          )
                                        
                                      
                                    
                                  
                                
                                
                                  
                                    
                                      3
                                      ⁢
                                      
                                        L
                                        
                                          2
                                          ⁢
                                          S
                                        
                                      
                                      ⁢
                                      
                                        
                                          d
                                          
                                            θ
                                            R
                                          
                                        
                                        
                                          d
                                          t
                                        
                                      
                                      ⁢
                                      
                                        cos
                                        ⁡
                                        
                                          (
                                          
                                            2
                                            ⁢
                                            
                                              θ
                                              R
                                            
                                          
                                          )
                                        
                                      
                                    
                                  
                                  
                                    
                                      3
                                      ⁢
                                      
                                        L
                                        
                                          2
                                          ⁢
                                          S
                                        
                                      
                                      ⁢
                                      
                                        
                                          d
                                          
                                            θ
                                            R
                                          
                                        
                                        
                                          d
                                          t
                                        
                                      
                                      ⁢
                                      
                                        sin
                                        ⁡
                                        
                                          (
                                          
                                            2
                                            ⁢
                                            
                                              θ
                                              R
                                            
                                          
                                          )
                                        
                                      
                                    
                                  
                                
                              
                              ]
                            
                            ⁢
                            
                               
                              
                                [
                                
                                  
                                    
                                      
                                        i
                                        α
                                      
                                    
                                  
                                  
                                    
                                      
                                        i
                                        β
                                      
                                    
                                  
                                
                                ]
                              
                            
                          
                        
                      
                    
                  
                
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          1
          )
        
      
    
  




where:

    Vα, Vβ are the stator voltages in the alpha/beta coordinate system;
    iα, iβ are the stator currents in the alpha/beta coordinate system;
    RS is the stator resistance;
    λM is the magnetizing flux linkage;
    θR is the electrical angle or rotor angle of the rotor 104;
    LLS is the leakage inductance;
    L0S is the 0th order harmonic of the self-inductance;
    L2S is the 2nd order harmonic of the self-inductance; and






  
    d
    
      (
      ·
      )
    
  
  
    d
    t
  




is the time rate of change of a given parameter.

Equation (1) describes the dynamics of the motor 100 in a static alpha/beta coordinate system with respect to the stator 102, meaning that the alpha/beta coordinate system is stationary relative to the rotor 104. The first term to the right of the equal sign is the voltage drop due to the stator resistance RS, the second term is the voltage drop due to the back electromagnetic force of the motor 100, the third term is the voltage drop due to the total self-inductance, and the fourth term is the voltage drop due to the saliency of the motor 100.
In order to simplify equation (1), a common substitution is to let L0=LLS+ 3/2L0S and ΔL= 3/2L2S, which yields equation (2) as follows:




  
    
      
        
          [
          
            
              
                
                  V
                  α
                
              
            
            
              
                
                  V
                  β
                
              
            
          
          ]
        
        =
        
          
            
              R
              S
            
            ⁡
            
              [
              
                
                  
                    
                      i
                      α
                    
                  
                
                
                  
                    
                      i
                      β
                    
                  
                
              
              ]
            
          
          +
          
            
              λ
              M
            
            ⁢
            
              
                
                  d
                  
                    θ
                    r
                  
                
                
                  d
                  t
                
              
              ⁡
              
                [
                
                  
                    
                      
                        -
                        
                          sin
                          ⁡
                          
                            (
                            
                              θ
                              R
                            
                            )
                          
                        
                      
                    
                  
                  
                    
                      
                        cos
                        ⁡
                        
                          (
                          
                            θ
                            R
                          
                          )
                        
                      
                    
                  
                
                ]
              
            
          
          +
          
             
            
              
                
                  [
                  
                    
                      
                        
                          
                            L
                            0
                          
                          -
                          
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            L
                            ⁢
                            
                              
                            
                            ⁢
                            
                              cos
                              ⁡
                              
                                (
                                
                                  2
                                  ⁢
                                  
                                    θ
                                    R
                                  
                                
                                )
                              
                            
                          
                        
                      
                      
                        
                          
                            -
                            Δ
                          
                          ⁢
                          
                            
                          
                          ⁢
                          L
                          ⁢
                          
                            
                          
                          ⁢
                          
                            sin
                            ⁡
                            
                              (
                              
                                2
                                ⁢
                                
                                  θ
                                  R
                                
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        
                          
                            -
                            Δ
                          
                          ⁢
                          
                            
                          
                          ⁢
                          L
                          ⁢
                          
                            
                          
                          ⁢
                          
                            sin
                            ⁡
                            
                              (
                              
                                2
                                ⁢
                                
                                  θ
                                  R
                                
                              
                              )
                            
                          
                        
                      
                      
                        
                          
                            L
                            0
                          
                          +
                          
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            L
                            ⁢
                            
                              
                            
                            ⁢
                            
                              cos
                              ⁡
                              
                                (
                                
                                  2
                                  ⁢
                                  
                                    θ
                                    R
                                  
                                
                                )
                              
                            
                          
                        
                      
                    
                  
                  ]
                
                ⁡
                
                  [
                  
                    
                      
                        
                          
                            d
                            
                              i
                              α
                            
                          
                          
                            d
                            t
                          
                        
                      
                    
                    
                      
                        
                          
                            d
                            
                              i
                              β
                            
                          
                          
                            d
                            t
                          
                        
                      
                    
                  
                  ]
                
              
              +
              
                 
                
                  
                    [
                    
                      
                        
                          
                            
                              -
                              2
                            
                            ⁢
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            L
                            ⁢
                            
                              
                                d
                                
                                  θ
                                  R
                                
                              
                              
                                d
                                t
                              
                            
                            ⁢
                            sin
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                2
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  θ
                                  R
                                
                              
                              )
                            
                          
                        
                        
                          
                            2
                            ⁢
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            L
                            ⁢
                            
                              
                                d
                                
                                  θ
                                  R
                                
                              
                              
                                d
                                t
                              
                            
                            ⁢
                            cos
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                2
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  θ
                                  R
                                
                              
                              )
                            
                          
                        
                      
                      
                        
                          
                            2
                            ⁢
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            L
                            ⁢
                            
                              
                                d
                                
                                  θ
                                  R
                                
                              
                              
                                d
                                t
                              
                            
                            ⁢
                            cos
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                2
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  θ
                                  R
                                
                              
                              )
                            
                          
                        
                        
                          
                            2
                            ⁢
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            L
                            ⁢
                            
                              
                                d
                                
                                  θ
                                  R
                                
                              
                              
                                d
                                t
                              
                            
                            ⁢
                            cos
                            ⁢
                            
                              
                            
                            ⁢
                            
                              (
                              
                                2
                                ⁢
                                
                                  
                                
                                ⁢
                                
                                  θ
                                  R
                                
                              
                              )
                            
                          
                        
                      
                    
                    ]
                  
                  ⁡
                  
                    [
                    
                      
                        
                          
                            i
                            α
                          
                        
                      
                      
                        
                          
                            i
                            β
                          
                        
                      
                    
                    ]
                  
                
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          2
          )
        
      
    
  




Solving for the time rate of change in the current [diα/dt diβ/dt] as a function of the input voltage yields equation (3), which is the state space form of the permanent magnet (PM) model of the motor 100 with saliency.




  
    
      
        
          [
          
            
              
                
                  
                    d
                    
                      i
                      α
                    
                  
                  
                    d
                    t
                  
                
              
            
            
              
                
                  
                    d
                    
                      i
                      β
                    
                  
                  
                    d
                    t
                  
                
              
            
          
          ]
        
        =
        
          
            
              1
              
                
                  L
                  0
                  2
                
                -
                
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    L
                    2
                  
                
              
            
            ⁡
            
              [
              
                
                  
                    
                      
                        L
                        0
                      
                      +
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        L
                        ⁢
                        
                          
                        
                        ⁢
                        
                          cos
                          ⁡
                          
                            (
                            
                              2
                              ⁢
                              
                                θ
                                R
                              
                            
                            )
                          
                        
                      
                    
                  
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      L
                      ⁢
                      
                        
                      
                      ⁢
                      
                        sin
                        ⁡
                        
                          (
                          
                            2
                            ⁢
                            
                              θ
                              R
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      L
                      ⁢
                      
                        
                      
                      ⁢
                      
                        sin
                        ⁡
                        
                          (
                          
                            2
                            ⁢
                            
                              θ
                              R
                            
                          
                          )
                        
                      
                    
                  
                  
                    
                      
                        L
                        0
                      
                      -
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        L
                        ⁢
                        
                          
                        
                        ⁢
                        
                          cos
                          ⁡
                          
                            (
                            
                              2
                              ⁢
                              
                                θ
                                R
                              
                            
                            )
                          
                        
                      
                    
                  
                
              
              ]
            
          
          ⁢
          
            {
            
              
                [
                
                  
                    
                      
                        V
                        α
                      
                    
                  
                  
                    
                      
                        V
                        β
                      
                    
                  
                
                ]
              
              -
              
                
                  R
                  S
                
                ⁡
                
                  [
                  
                    
                      
                        
                          i
                          α
                        
                      
                    
                    
                      
                        
                          i
                          β
                        
                      
                    
                  
                  ]
                
              
              -
              
                
                  λ
                  M
                
                ⁢
                
                  
                    
                      
                        d
                        
                          θ
                          R
                        
                      
                      
                        d
                        t
                      
                    
                    ⁡
                    
                      [
                      
                        
                          
                            
                              -
                              
                                sin
                                ⁡
                                
                                  (
                                  
                                    θ
                                    R
                                  
                                  )
                                
                              
                            
                          
                        
                        
                          
                            
                              cos
                              ⁡
                              
                                (
                                
                                  θ
                                  R
                                
                                )
                              
                            
                          
                        
                      
                      ]
                    
                  
                  --
                
                ⁢
                2
                ⁢
                Δ
                ⁢
                
                  
                
                ⁢
                Ld
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                Rdt
                ⁢
                
                  
                
                ⁢
                sin
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                R
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                Δ
                ⁢
                
                  
                
                ⁢
                L
                ⁢
                
                  
                
                ⁢
                d
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                Rdt
                ⁢
                
                  
                
                ⁢
                cos
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                R
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                Δ
                ⁢
                
                  
                
                ⁢
                Ld
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                Rd
                ⁢
                
                  
                
                ⁢
                t
                ⁢
                
                  
                
                ⁢
                cos
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                R
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                Δ
                ⁢
                
                  
                
                ⁢
                Ld
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                R
                ⁢
                
                  
                
                ⁢
                d
                ⁢
                
                  
                
                ⁢
                t
                ⁢
                
                  
                
                ⁢
                sin
                ⁢
                
                  
                
                ⁢
                2
                ⁢
                
                  
                
                ⁢
                θ
                ⁢
                
                  
                
                ⁢
                R
                ⁢
                
                  
                
                ⁢
                i
                ⁢
                
                  
                
                ⁢
                α
                ⁢
                
                  
                
                ⁢
                i
                ⁢
                
                  
                
                ⁢
                β
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          3
          )
        
      
    
  




The position of the rotor 104 relative to the stator 102 is determined by injecting a signal into the motor 100, which induces a current in the windings 110 in the stator 102. In the following embodiments, the injected signal is a high frequency signal. Because the rotor 104 is not moving relative to the stator 102 when the signal is injected, equation (3) simplifies to equation (4) as follows:




  
    
      
        
          [
          
            
              
                
                  
                    d
                    
                      i
                      α
                    
                  
                  
                    d
                    t
                  
                
              
            
            
              
                
                  
                    d
                    
                      i
                      β
                    
                  
                  
                    d
                    t
                  
                
              
            
          
          ]
        
        =
        
          
            
              1
              
                
                  L
                  0
                  2
                
                -
                
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    L
                    2
                  
                
              
            
            ⁡
            
              [
              
                
                  
                    
                      
                        L
                        0
                      
                      +
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        L
                        ⁢
                        
                          
                        
                        ⁢
                        
                          cos
                          ⁡
                          
                            (
                            
                              2
                              ⁢
                              
                                θ
                                R
                              
                            
                            )
                          
                        
                      
                    
                  
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      L
                      ⁢
                      
                        
                      
                      ⁢
                      
                        sin
                        ⁡
                        
                          (
                          
                            2
                            ⁢
                            
                              θ
                              R
                            
                          
                          )
                        
                      
                    
                  
                
                
                  
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      L
                      ⁢
                      
                        
                      
                      ⁢
                      
                        sin
                        ⁡
                        
                          (
                          
                            2
                            ⁢
                            
                              θ
                              R
                            
                          
                          )
                        
                      
                    
                  
                  
                    
                      
                        L
                        0
                      
                      -
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        L
                        ⁢
                        
                          
                        
                        ⁢
                        
                          cos
                          ⁡
                          
                            (
                            
                              2
                              ⁢
                              
                                θ
                                R
                              
                            
                            )
                          
                        
                      
                    
                  
                
              
              ]
            
          
          ⁡
          
            [
            
              
                
                  
                    V
                    α
                  
                
              
              
                
                  
                    V
                    β
                  
                
              
            
            ]
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          4
          )
        
      
    
  








  (
  
    
      e
      .
      g
      .
      
        
      
      ⁢
      
        
          d
          
            (
            
              θ
              R
            
            )
          
        
        
          d
          t
        
      
    
    =
    0
  
  )




Because the speed of the rotor 104 is zero and the stator resistance RS acts as a low pass filter, there is a minimal voltage drop across the resistance in the stator 102 at high frequency. Based on the foregoing, the stator voltages represented in the static alpha/beta coordinate system, FIG. 2, are related to the stator voltages represented in the arbitrary M/N coordinate system by the following Park transformation:




  
    
      
        
          [
          
            
              
                
                  V
                  M
                
              
            
            
              
                
                  V
                  N
                
              
            
          
          ]
        
        =
        
          
            [
            
              
                
                  
                    
                      
                    
                    ⁢
                    
                      cos
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                
                
                  
                    sin
                    ⁡
                    
                      (
                      θ
                      )
                    
                  
                
              
              
                
                  
                    -
                    
                      sin
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                
                
                  
                    cos
                    ⁡
                    
                      (
                      θ
                      )
                    
                  
                
              
            
            ]
          
          ⁡
          
            [
            
              
                
                  
                    V
                    α
                  
                
              
              
                
                  
                    V
                    β
                  
                
              
            
            ]
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          5
          )
        
      
    
  




where VM, VN are the stator motor voltages in the arbitrary M/N coordinate system. When the rotor 104 is moving at a constant speed, the time rate of change of the current in the static alpha/beta coordinate system can be translated to the arbitrary M/N coordinate system using the same Park transformation as used in equation (5) to yield the relationship of equation (6):




  
    
      
        
          [
          
            
              
                
                  
                    d
                    
                      i
                      M
                    
                  
                  
                    d
                    t
                  
                
              
            
            
              
                
                  
                    d
                    
                      i
                      N
                    
                  
                  
                    d
                    t
                  
                
              
            
          
          ]
        
        =
        
          
            [
            
              
                
                  
                    cos
                    ⁡
                    
                      (
                      θ
                      )
                    
                  
                
                
                  
                    sin
                    ⁡
                    
                      (
                      θ
                      )
                    
                  
                
              
              
                
                  
                    -
                    
                      sin
                      ⁡
                      
                        (
                        θ
                        )
                      
                    
                  
                
                
                  
                    cos
                    ⁡
                    
                      (
                      θ
                      )
                    
                  
                
              
            
            ]
          
          ⁡
          
            [
            
              
                
                  
                    
                      d
                      
                        i
                        α
                      
                    
                    
                      d
                      t
                    
                  
                
              
              
                
                  
                    
                      d
                      
                        i
                        β
                      
                    
                    
                      d
                      t
                    
                  
                
              
            
            ]
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          6
          )
        
      
    
  




Based on the foregoing equations of transformed voltages and current relationships, the high frequency model of the motor 100 is given by equation (7) as follows:




  
    
      
        
          [
          
            
              
                
                  
                    d
                    
                      i
                      M
                    
                  
                  
                    d
                    t
                  
                
              
            
            
              
                
                  
                    d
                    
                      i
                      N
                    
                  
                  
                    d
                    t
                  
                
              
            
          
          ]
        
        =
        
          
            1
            
              
                L
                0
                2
              
              -
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  L
                  2
                
              
            
          
          ⁢
          
             
            
              
                [
                
                  
                    
                      
                        
                          L
                          0
                        
                        +
                        
                          Δ
                          ⁢
                          
                            
                          
                          ⁢
                          L
                          ⁢
                          
                            
                          
                          ⁢
                          
                            cos
                            ⁡
                            
                              (
                              
                                2
                                ⁢
                                
                                  (
                                  
                                    
                                      θ
                                      R
                                    
                                    -
                                    θ
                                  
                                  )
                                
                              
                              )
                            
                          
                        
                      
                    
                    
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        L
                        ⁢
                        
                          
                        
                        ⁢
                        
                          sin
                          ⁡
                          
                            (
                            
                              2
                              ⁢
                              
                                (
                                
                                  
                                    θ
                                    R
                                  
                                  -
                                  θ
                                
                                )
                              
                            
                            )
                          
                        
                      
                    
                  
                  
                    
                      
                        Δ
                        ⁢
                        
                          
                        
                        ⁢
                        L
                        ⁢
                        
                          
                        
                        ⁢
                        
                          sin
                          ⁡
                          
                            (
                            
                              2
                              ⁢
                              
                                (
                                
                                  
                                    θ
                                    R
                                  
                                  -
                                  θ
                                
                                )
                              
                            
                            )
                          
                        
                      
                    
                    
                      
                        
                          L
                          0
                        
                        -
                        
                          Δ
                          ⁢
                          
                            
                          
                          ⁢
                          L
                          ⁢
                          
                            
                          
                          ⁢
                          
                            cos
                            ⁡
                            
                              (
                              
                                2
                                ⁢
                                
                                  (
                                  
                                    
                                      θ
                                      R
                                    
                                    -
                                    θ
                                  
                                  )
                                
                              
                              )
                            
                          
                        
                      
                    
                  
                
                ]
              
              ⁡
              
                [
                
                  
                    
                      
                        V
                        M
                      
                    
                  
                  
                    
                      
                        V
                        N
                      
                    
                  
                
                ]
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          7
          )
        
      
    
  




By evaluating the high frequency motor model in the arbitrary M/N coordinate system, it can be seen that the dynamics are related to the error between the actual rotor angle θR and the angle θ denoting the location of the arbitrary M/N coordinate system. By picking a proper input voltage wave form and monitoring the time rate of change of the current, the position of the rotor 104 can be determined. The embodiments described herein use a square wave for injection into the motor, which has many advantages over other waveforms. For example, the use of a square wave does not require demodulation as is required with a sinusoidal wave. An embodiment of a square wave is shown by equation (8) as follows:

VM=VSQ·sgn(sin(ωSQt))  Equation (8)

where: VM is the voltage in the M direction of the M/N reference frame; VSQ is the voltage magnitude of the square wave; sgn(·) is a sign function; sin(·) is a sine function; ωSQ is the square wave frequency; and t is time. The square wave of equation (8) is substituted into equation (7), which yields the high frequency motor model of equation (9) as follows:





  
    
      
        
          [
          
            
              
                
                  
                    d
                    
                      i
                      M
                    
                  
                  
                    d
                    t
                  
                
              
            
            
              
                
                  
                    d
                    
                      i
                      N
                    
                  
                  
                    d
                    t
                  
                
              
            
          
          ]
        
        =
        
          
            
              
                V
                SQ
              
              ·
              
                sgn
                ⁡
                
                  (
                  
                    sin
                    ⁡
                    
                      (
                      
                        
                          ω
                          SQ
                        
                        ⁢
                        t
                      
                      )
                    
                  
                  )
                
              
            
            
              
                L
                0
                2
              
              -
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  L
                  2
                
              
            
          
          ⁡
          
            [
            
              
                
                  
                    
                      L
                      0
                    
                    +
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      L
                      ⁢
                      
                        
                      
                      ⁢
                      
                        cos
                        ⁡
                        
                          (
                          
                            2
                            ⁢
                            
                              (
                              
                                
                                  θ
                                  R
                                
                                -
                                θ
                              
                              )
                            
                          
                          )
                        
                      
                    
                  
                
              
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    L
                    ⁢
                    
                      
                    
                    ⁢
                    
                      sin
                      ⁡
                      
                        (
                        
                          2
                          ⁢
                          
                            (
                            
                              
                                θ
                                R
                              
                              -
                              θ
                            
                            )
                          
                        
                        )
                      
                    
                  
                
              
            
            ]
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          9
          )
        
      
    
  








  
    
      
        d
        i
      
      
        d
        t
      
    
    ≈
    
      
        Δ
        ⁢
        
          
        
        ⁢
        i
      
      
        Δ
        ⁢
        
          
        
        ⁢
        t
      
    
  
  ,




Approximating the time rate of change in current as the change in current can be approximated by equation (10) as follows:




  
    
      
        
          [
          
            
              
                
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    i
                    M
                  
                
              
            
            
              
                
                  Δ
                  ⁢
                  
                    
                  
                  ⁢
                  
                    i
                    N
                  
                
              
            
          
          ]
        
        ≈
        
          
            
              
                
                  V
                  SQ
                
                ·
                Δ
              
              ⁢
              
                
              
              ⁢
              
                T
                ·
                
                  sgn
                  ⁡
                  
                    (
                    
                      sin
                      ⁡
                      
                        (
                        
                          
                            ω
                            SQ
                          
                          ⁢
                          t
                        
                        )
                      
                    
                    )
                  
                
              
            
            
              
                L
                0
                2
              
              -
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  L
                  2
                
              
            
          
          ⁡
          
            [
            
              
                
                  
                    
                      L
                      0
                    
                    +
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      L
                      ⁢
                      
                        
                      
                      ⁢
                      
                        cos
                        ⁡
                        
                          (
                          
                            2
                            ⁢
                            
                              (
                              
                                
                                  θ
                                  R
                                
                                -
                                θ
                              
                              )
                            
                          
                          )
                        
                      
                    
                  
                
              
              
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    L
                    ⁢
                    
                      
                    
                    ⁢
                    
                      sin
                      ⁡
                      
                        (
                        
                          2
                          ⁢
                          
                            (
                            
                              
                                θ
                                R
                              
                              -
                              θ
                            
                            )
                          
                        
                        )
                      
                    
                  
                
              
            
            ]
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          10
          )
        
      
    
  




As a result, the current change in the N direction can be written as shown by equation (11) as follows:




  
    
      
        
          Δ
          ⁢
          
            
          
          ⁢
          
            i
            N
          
        
        ≈
        
          
            
              
                
                  V
                  SQ
                
                ·
                Δ
              
              ⁢
              
                
              
              ⁢
              
                T
                ·
                Δ
              
              ⁢
              
                
              
              ⁢
              
                L
                ·
                
                  sgn
                  ⁡
                  
                    (
                    
                      sin
                      ⁡
                      
                        (
                        
                          
                            ω
                            SQ
                          
                          ⁢
                          t
                        
                        )
                      
                    
                    )
                  
                
              
            
            
              
                L
                0
                2
              
              -
              
                Δ
                ⁢
                
                  
                
                ⁢
                
                  L
                  2
                
              
            
          
          ⁢
          
            sin
            ⁡
            
              (
              
                2
                ⁢
                
                  (
                  
                    
                      θ
                      R
                    
                    -
                    θ
                  
                  )
                
              
              )
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          11
          )
        
      
    
  




The rotor angle θR can be estimated from the equation (11) by using the equation (12) as follows:




  
    
      
        
          θ
          R
        
        ≈
        
          
            
              1
              2
            
            ⁢
            
              
                sin
                
                  -
                  1
                
              
              ⁡
              
                (
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      
                        i
                        N
                      
                      ·
                      
                        (
                        
                          
                            L
                            0
                            2
                          
                          -
                          
                            Δ
                            ⁢
                            
                              
                            
                            ⁢
                            
                              L
                              2
                            
                          
                        
                        )
                      
                    
                  
                  
                    
                      
                        V
                        SQ
                      
                      ·
                      Δ
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      T
                      ·
                      Δ
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      L
                      ·
                      
                        sgn
                        ⁡
                        
                          (
                          
                            sin
                            ⁡
                            
                              (
                              
                                
                                  ω
                                  SQ
                                
                                ⁢
                                t
                              
                              )
                            
                          
                          )
                        
                      
                    
                  
                
                )
              
            
          
          +
          θ
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          12
          )
        
      
    
  




Equation (12) is computationally intensive and requires knowledge of the inductance variation of the motor 100, FIG. 1, as the position of the rotor 104 changes relative to the stator 102. As stated above, in a salient motor, the inductances of the windings 110 change with the position of the rotor 104.
Another approach to determine rotor position, other than using equation (12), is to use a Luenberger observer 300 as shown in FIG. 3 and let a system that controls the motor 100, FIG. 1, drive the error eθ between the rotor angle θR, FIG. 2, and the arbitrary angle θ to zero. When the Luenberger observer 300 drives the error eθ to zero, the arbitrary angle θ is equal to the rotor angle θR, and thus the output of the Luenberger observer (θ) is the rotor angle θR.
The constants K1, K2, and K3 are observer gains that are set so that the poles of the Luenberger observer 300 are stable. Mathematically, the poles of the transfer function of the Luenberger observer 300 are analyzed to make sure that they are in the left half plane of the s-domain, which assures stability. Because the Luenberger observer 300 is stable, the error eθ is guaranteed to go to zero in a finite amount of time. The term b is a viscous damping term that represents any resistive torque in the motor 100, FIG. 1, wherein the torque is proportional to angular velocity ω. The term J is the rotational inertia experienced by the motor 100 and is derived from the rotor shaft and any drive train in a conventional manner. Using small angle approximations and the Luenberger observer 300, the error eθ can be written as shown by equation (13) as follows:




  
    
      
        
          
            
              
                e
                θ
              
              =
              
              ⁢
              
                
                  θ
                  R
                
                -
                θ
              
            
          
        
        
          
            
              ≈
              
              ⁢
              
                
                  
                    
                      L
                      0
                      2
                    
                    -
                    
                      Δ
                      ⁢
                      
                        
                      
                      ⁢
                      
                        L
                        2
                      
                    
                  
                  
                    
                      2
                      ·
                      
                        V
                        SQ
                      
                      ·
                      Δ
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      T
                      ·
                      Δ
                    
                    ⁢
                    
                      
                    
                    ⁢
                    
                      L
                      ·
                      
                        sgn
                        ⁡
                        
                          (
                          
                            sin
                            ⁡
                            
                              (
                              
                                
                                  ω
                                  SQ
                                
                                ⁢
                                t
                              
                              )
                            
                          
                          )
                        
                      
                    
                  
                
                ⁢
                Δ
                ⁢
                
                  
                
                ⁢
                
                  i
                  n
                
              
            
          
        
        
          
            
              =
              
              ⁢
              
                K
                ⁢
                
                  
                    Δ
                    ⁢
                    
                      
                    
                    ⁢
                    
                      i
                      N
                    
                  
                  
                    sgn
                    ⁡
                    
                      (
                      
                        sin
                        ⁡
                        
                          (
                          
                            
                              ω
                              SQ
                            
                            ⁢
                            t
                          
                          )
                        
                      
                      )
                    
                  
                
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        
          (
          13
          )
        
      
    
  




where the constant K is defined as





  K
  =
  
    
      
        
          L
          0
          2
        
        -
        
          Δ
          ⁢
          
            
          
          ⁢
          
            L
            2
          
        
      
      
        
          2
          ·
          
            V
            SQ
          
          ·
          Δ
        
        ⁢
        
          
        
        ⁢
        
          T
          ·
          Δ
        
        ⁢
        
          
        
        ⁢
        L
      
    
    .
  




By using the Luenberger observer 300, the system is guaranteed to converge if the poles of the observer are correctly designed. It is noted that the inductance variance is very small, so the term ΔL is a small value and will not have a very significant effect on the value of K. In some embodiments, the inductance is measured as a function of rotor angle θR, so that the value of ΔL is measured.

The methods and circuits described above cannot determine the north/south orientation of the rotor 104 with respect to the magnetic field being generated by the permanent magnet and the voltage to the stator 102. Reference is made to FIG. 4, which is a graph showing the motor inductance L as a function of the rotor angle θR of the rotor 104. The inductance L goes thru two periodic cycles for every one periodic cycle of the rotor angle θR. This relationship results in uncertainty as to the north-south orientation of the rotor 104. The methods and circuits described below determine the initial orientation of the rotor 104.
The magnetic flux density B and the magnetic field strength H are used to determine the orientation of the rotor 104. The relationship between magnetic flux density B with units of tesla, (1 tesla=1 Wb/m2) and magnetic field strength H with units of A/m is shown by the graph of FIG. 5. The graph shows how the magnetic flux density B varies as a function of magnetic field strength H. It is noted that the flux density B is proportional to voltage (Wb=V·sec) and that the field strength H is proportional to current. As shown by the graph, there is a linear region, a nonlinear region, and a saturation region for both positive and negative magnetic field strengths H. For permanent magnet motors, the operating point on the B-H curve is determined by the flux generated by these magnets, as shown by the point (Hmag,Bmag). The exact location of the operating point depends on the relative field strength of the magnet compared to the overall field strength of the core of the rotor 104, FIG. 1, over the entire range of operating current.
An algorithm is used to determine the north-south orientation of the rotor 104 with respect to the motor stator windings 110 based on the non-linear relationship between the magnetic flux density B and the magnetic field strength H. The above-described square wave of equation (8) is applied to the motor stator windings 110 in an arbitrary M-direction. In some embodiments, the magnitude of the square wave, VSQ, is chosen so that it produces a magnetic field large enough to drive the stator 102 into saturation via the resultant current in the stator windings 110.
FIG. 5 also shows the minimum and maximum points on the B-H curve during the square wave voltage VM excitation when a positive voltage drives the stator 102, FIG. 1, into saturation. In FIG. 5, the term H+ is the magnetic field strength achieved during the positive portion of the square wave VM and the term H− is the magnetic field strength achieved during the negative portion of the square wave VM. The term B+ is the flux density achieved during the positive portion of the square wave VM and the term B− is the flux density achieved during the negative portion of the square wave VM. As described in greater detail below, the change in voltage due to the square wave VM causes a change in current which produces variations in the magnetic field strength. By measuring the current levels in the stator 102, the north/south orientation of the rotor 104 is readily determined.
When a positive voltage drives the stator 102 into the saturation region, it is assumed that the magnetic field strength H+ produced by the current in the stator windings 110 is aligned with the magnetic field HMAG produced by the permanent magnet in the rotor 104. The difference between the positive and negative flux densities (B+ and B−) during the square wave voltage VM injection and the flux density BMAG due to the permanent magnet in the rotor 104 are the same. However, the difference between the positive and negative magnetic field strengths (H+ and H−) and the field strength HMAG due to the permanent magnet in the rotor 104 are not the same because the operating point is near the nonlinear portion of the B-H curve. The resulting magnetic field strengths are described by equation (14) as follows:

H+−Hmag>Hmag−H−  Equation (14)

Because the magnetic field strength H is proportional to current in the windings 110 and a positive voltage is assumed to generate a positive current in the windings 110, equation (14) becomes equivalent to I+>−I−. More specifically, the magnitude of the current achieved during the positive portion of the square wave VM is greater than the magnitude of the current achieved during the negative portion of the square wave VM when the magnetic fields are aligned.
FIG. 6 shows the minimum and maximum points on the B-H curve during the excitation by the square wave VM when a negative voltage drives the stator 104 into saturation. When a negative voltage drives the stator 102, FIG. 1, into the saturated region, it is assumed that the magnetic field produced by the current in the stator windings 110 is opposed to the magnetic field HMAG produced by the permanent magnet in the rotor 104. The difference between the positive and negative flux densities (B+ and B−) during the square wave VM and the flux density BMAG due to the permanent magnet is the same. However, the difference between the positive and negative field strengths (H+ and H−) and the field strength HMAG due to the permanent magnet is not the same because the operating point is near the nonlinear portion of the B-H curve. The resulting magnetic field strengths are described by equation (15) as follows:

H−−HMAG>HMAG−H+  Equation (15)

As described above, the magnetic field strength H is proportional to the current flow in the windings 110, FIG. 1, and no current results from the magnetic field HMAG produced by the permanent magnets. Therefore, equation (15) is equivalent to −I−>I+. This current relationship implies that the magnitude of the current achieved during the negative portion of the square wave VM is greater than the magnitude of the current achieved during the positive portion of the square wave VM when the magnetic fields are opposed.
The behavior of the current magnitude for different orientations of the magnet in the rotor 104 with respect to the stator windings 110 is used to determine the orientation of the rotor 104. In some embodiments, the average current value during the voltage square wave VM is calculated. For the case when the average current is greater than zero, the rotor 104 is aligned with the stator 102 because I++I−>0. For the case when the average current is less than zero, the rotor 104 is opposed to the stator 102 because I++I−<0. In the case where the rotor 104 is opposed to the stator 102, the rotor angle θR should be adjusted by π. By combining this algorithm with the Luenberger observer algorithm described above, the absolute initial electrical rotor angle θR is determined.
The integration of the initial position detection (IPD) described above into a conventional field oriented control (FOC) controller 700 is shown by the block diagram in FIG. 7. The controller 700 includes a speed controller 702 that receives a speed input ωD from a user or external source. The speed controller 702 compares the speed input ωD to the speed ω output from the Luenberger observer 300, FIG. 3. The output of the speed controller 702 is a reference current in the q axis that is reduced by the measured current in the q axis by an adder 704. The output of the adder 704 is an error signal that is input to an Iq controller 706 that generates the q axis voltage Vq. An input Id—in is also received from an external source and is reduced by the measured current Id by an adder 710. The output of the adder 710 is an error signal that is input to an Id controller 712 to generate a driving voltage that in conventional controllers would be the d axis voltage Vd. In the controller 700, the output of the Id controller 712 has the square wave VM added to it by an adder 714. The output of the adder 714 is the voltage Vd.
The voltages Vq and Vd are input to a conventional inverse Park transform device 718 that generates the voltages in the alpha/beta domain Vαβ, which are input to a space vector generator 720. The space vector generator 720 generates a three phase driving signal for the motor 100. The output of the space vector generator 720 is input to a pulse width modulator (PWM) driver 722. In some embodiments, the PWM driver 722 is a hardware device. The PWM driver 722 outputs PWM signals that are amplified by a power driver 724, which are then transmitted to a three phase inverter 726 to drive the motor 100.
Current sensors 730 monitor the current into the motor 100. In some embodiments, one of the three phases is monitored and in other embodiments, two or three phases are monitored. The current values are analog values and are input to an analog to digital converter (ADC) 732, which outputs digital values representing the measured currents. The digital values of the current are input to a Clarke transform device 736 that outputs the alpha/beta domain currents Iαβ or representations of the currents Iαβ. The currents Iαβ are input to a Park transform device 740 that performs a Park transform as described above. The rotor angle θR is input to the Park transform 740 as described below. Prior to the rotation of the rotor 104, FIG. 1, the initial position of the rotor 104 is input to the Park transform device 740.
The Park transform device 740 generates the currents iq and id, or values representing the currents, as described above. The Park transform device 740 uses the rotor angle θR in determining or calculating the currents iq and id. The output currents of the Park transform device 740 are input to an initial position detector (IPD) 742. The IPD 742 generates the rotor angle θR and the velocity ω per the Luenberger observer 300, FIG. 3. The Luenberger observer 300 operates on the error signal eθ defined by equation (13). Thus, it operates on the ΔiN current value, which is the change in current level in the iN direction due to the square wave voltage VM. As the Luenberger observer 300 drives the error signal eθ to zero, the angle θ goes to θR, the iM axis aligns with the id axis and the iN axis aligns with the iq axis.
An embodiment of the descriptions related to determining the rotor position and velocity are described by the flowchart 800 of FIG. 8. In block 802, the square wave VM is injected into the motor 100. In block 804, the average current input to the motor 100 is measured. As described above, the average input current is used to determine the orientation of the rotor 104 or the north/south direction of the magnet in the rotor 104. In block 806, the offset angle of the rotor 104 is determined. In block 808, the Luenberger observer 300, FIG. 3, is run as described above. In block 810, the initial rotor angle, position, and velocity are determined based on the Luenberger observer 300.
An embodiment for determining the rotor position is shown by the flowchart 900 of FIG. 9. In Step 902, a square wave is injected into the stator 102 of the motor 100. In step 904, the average current input to the motor 100 is measured. In step 906, the north/south orientation of the rotor 104 in response to the average current is determined.
While illustrative and presently preferred embodiments of integrated circuits have been described in detail herein, it is to be understood that the inventive concepts may be otherwise variously embodied and employed and that the appended claims are intended to be construed to include such variations except insofar as limited by the prior art.

## Claims

1. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor runs a Luenberger observer; and
wherein the Luenberger observer operates on an error of the rotor angle and forces the error to zero.

2. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor runs a Luenberger observer; and
wherein the Luenberger observer operates on a current that is the result of the square wave voltage.

3. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor runs a Luenberger observer; and
wherein the Luenberger observer operates on an error of the rotor angle and forces the error to zero, wherein the error of the rotor angle is multiplied by a plurality of observer gains so that poles of the observer are stable.

4. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor runs a Luenberger observer; and
wherein the Luenberger observer includes feedback that is proportional to a viscous damping term that represents at least some of the resistive torque in the motor, wherein the torque is proportional to angular velocity of the motor.

5. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor runs a Luenberger observer; and
wherein the Luenberger observer includes multiplication that is proportional to the inverse of the rotational inertia experienced by the motor.

6. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor runs a Luenberger observer; and
wherein the rotational inertia is related to the mass of the rotor and components attached to the rotor.

7. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the device for determining the position of the rotor compares the average input current flowing in a first direction to the average input current flowing in a second direction that is opposite the first direction to determine the north south orientation of the rotor.

8. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the square wave induces a magnetic field that forces the magnetic flux density in the stator into a nonlinear region.

9. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
wherein the rotor is determined to be in a first orientation in response to the input current flowing in the first direction being greater than current flowing in the second direction.

10. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
further comprising an inverse Park transform device, wherein the square wave voltage is an input to the inverse Park transform device.

11. A motor controller comprising:
a square wave voltage generator;
adding circuitry for adding the square wave voltage to a first drive voltage that is connectable to the stator windings of a motor;
a current monitor that monitors the input current to the motor as a result of the square wave voltage;
a device for determining the position of the rotor based on the input current;
further comprising a Clarke transform device coupled to the current monitor, wherein Clarke transform device performs a Clarke transform on the measured input current to the motor.

12. The controller of claim 11 and further comprising a Park transform device coupled to the Clarke transform device, wherein the Park transform device performs a Park transform on the output of the Clarke transform device, and wherein the output of the Park transform device is used at least in part to run a Luenberger observer that determines the position of the rotor.