# Patent

## Title
Motor control system having common-mode voltage compensation

## Abstract

A motor control system is provided, and includes a motor, at least one differential amplifier configured to monitor phase current applied to the motor, and a current compensation controller. The current compensation controller is in communication with the at least one differential amplifier, and is configured to periodically determine a common-mode voltage of the at least one differential amplifier. The current compensation controller is also configured to determine a corrected phase current value based on the common mode voltage.

## Background
FIELD OF THE INVENTION
The present invention relates to a control system for a motor, and more particularly to a control system for a motor that determines a corrected phase current value based on a common-mode voltage of a differential amplifier.
BACKGROUND OF THE INVENTION
Closed loop current mode control of a permanent magnet synchronous motor (PMSM), a surface permanent magnet (SPM) motor, or an interior permanent magnet (IPM) motor generally requires relatively accurate measurement of the phase current in order to maintain torque ripple created by the motor within specific limits. The phase current may be measured using a precision shunt resistor and a current sense differential amplifier. However, differential amplifiers not only amplify the differential voltage, but also some amount of common-mode voltage at the inputs. Therefore, when the phase current is calculated using the output voltage of the differential amplifier, the resulting current measurement has error due to the common-mode voltage present at the inputs at the time of the measurement.
If an anti-alias filter is used at the output of the differential amplifier, the effects of the common-mode voltage will vary as a function of a pulse width modulation (PWM) cycle. It should also be noted that the amount of common-mode voltage varies from part to part, and may be different depending on a specific differential amplifier. All of these factors present challenges when attempting to compensate for the common-mode voltage in a differential amplifier.
SUMMARY OF THE INVENTION
In one embodiment, a motor control system is provided, and includes a motor, at least one differential amplifier configured to monitor phase current applied to the motor, and a current compensation controller. The current compensation controller is in communication with the at least one differential amplifier, and is configured to periodically determine a common-mode voltage of the at least one differential amplifier. The current compensation controller is also configured to determine a corrected phase current value based on the common mode voltage.
In another embodiment, a method of controlling a motor, is provided. The method includes periodically determining a common-mode voltage of at least one differential amplifier by a current compensation controller. The at least one differential amplifier is configured to monitor phase current applied to the motor. The method includes determining a corrected phase current value based on the common mode voltage by the current compensation controller.
These and other advantages and features will become more apparent from the following description taken in conjunction with the drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
The subject matter which is regarded as the invention is particularly pointed out and distinctly claimed in the claims at the conclusion of the specification. The foregoing and other features, and advantages of the invention are apparent from the following detailed description taken in conjunction with the accompanying drawings in which:
FIG. 1 is a block diagram of a motor control system in accordance with an exemplary embodiment of the invention;
FIG. 2 is a dataflow diagram illustrating an exemplary current compensation controller, in accordance with another exemplary embodiment of the invention;
FIG. 3. is an alternative embodiment of a dataflow diagram illustrating an exemplary current compensation controller, in accordance with yet another exemplary embodiment of the invention; and
FIG. 4 is an exemplary look-up table generated during an end-of-line calibration, in accordance with another exemplary embodiment of the invention.



DETAILED DESCRIPTION
Referring now to the Figures, where the invention will be described with reference to specific embodiments, without limiting same, FIG. 1 is an exemplary block diagram of a motor control system 10. The motor control system 10 includes a command current controller 20, a d-axis proportional plus integral gain (PI) controller 22, a q-axis PI controller 23, a polar conversion controller 24, a duty cycle calculation controller 26, an inverter 28, a DC power source 30, a motor 32, a position sensor 34, a speed sensor 36, a transform controller 38, an a-axis differential amplifier 40 (the differential amplifier may also be referred to as an operational amplifier), a b-axis differential amplifier 42, an a-axis analog to digital converter (ADC) 44, a b-axis ADC 46, and a current compensation controller 48. In one embodiment, the motor 32 may be a permanent magnet synchronous motor (Surface permanent magnet (SPM) motor or an interior permanent magnet (IPM) motor) motor, however it is to be understood that any type of electric motor that is controlled using phase current may be used as well.
In the embodiment as shown in FIG. 1, the inverter 28 is connected to the DC power source 30, where the DC power source 30 may be, for example, a battery. The DC power source 30 may be connected to the inverter 28 by DC input lines 49. A transducer 51 may be used to monitor a bridge voltage Vecu across the DC input lines 49. A control signal 53 representing the bridge voltage Vecu may be sent to the command current controller 20 and the duty cycle calculation controller 26. In the exemplary embodiment as shown, the inverter 28 transmits three alternating current (AC) phase currents to the motor 32 (e.g., ia, ib, and ic) by line 50, line 52, and line 54 for operation and control of the motor 32.
For feedback control purposes, the phase currents ia and ib transmitted to the motor 32 by lines 50 and 52 may be detected to determine the instantaneous current flow to the motor 32. Specifically, a transducer 56 may be used to monitor the phase current ia on the line 50, and a transducer 58 may be used to monitor the phase current ib on the line 52. It should be noted that although transducer 56 and transducer 58 are illustrated, only one of the lines 50 or 52 may be monitored to measure either phase current ia or phase current ib. A control signal 60 representing the measured phase current ia may be sent to the a-axis differential amplifier 40 from the transducer 56, and a control signal 62 representing the measured phase current ib may be sent to the b-axis differential amplifier 42 from the transducer 58. An augmented or amplified value of the phase current ia is then sent to the a-axis ADC 44 from the a-axis differential amplifier 40, and an amplified value of the phase current ib 62 is sent to the b-axis ADC 46 from the b-axis differential amplifier 42. The a-axis ADC 44 converts the amplified value of the phase current ia into a digital value 64. The digital value 64 represent the magnitude of the phase current ia. The b-axis ADC 46 converts the amplified value of the phase current ib into a digital value 66. The digital value 66 represents the magnitude of the phase current ib.
The current compensation controller 48 receives as input the digital value 64 from the ADC 44 and the digital value 66 from the ADC 46 (which represent the phase current ia on the line 50 and the phase current ib on the line 52, respectively), the bridge voltage Vecu, and duty cycle values Da and Db from the duty cycle calculation controller 26. The duty cycle calculation controller 26 generates the duty cycles values Da and Db (the duty cycle values Da and Db are described in detail below). The current compensation controller determines a corrected a-axis phase current value IA—CORRECTED and a corrected b-axis phase current value IB—CORRECTED, which is described in detail below. The corrected a-axis phase current value IA—CORRECTED compensates for offset voltage error in current measurement due to common-mode voltage in the a-axis differential amplifier 40, and the corrected b-axis phase current value IB—CORRECTED compensates for offset voltage error due to common-mode voltage in the b-axis differential amplifier 42.
The transform controller 38 receives as input corrected a-axis phase current value IA—CORRECTED and the corrected b-axis phase current value IB—CORRECTED from the current compensation controller 48. In one embodiment, the transform controller 38 is a three-phase to two-phase transformation controller where measured values for the AC current (e.g., the input corrected a-axis phase current value IA—CORRECTED and the corrected b-axis phase current value IB—CORRECTED) are converted into equivalent measured currents, which are a measured d-axis current IdMEASURED and a measured q-axis current IqMEASURED. The measured d-axis current IdMEASURED is sent to a subtractor 70 and the measured q-axis current IqMEASURED is sent to a subtractor 72.
The command current controller 20 receives as input a torque reference command Te, an angular speed ωm, and the control signal 53 representing the bridge voltage Vecu from the transducer 51. The torque reference command Te represents a commanded torque value, and may be derived from another controller (not shown), or may correspond to a torque value generated by an operator. The angular speed ωm is measured by the speed sensor 36. The speed sensor 36 may include, for example, an encoder and a speed calculation circuit for calculating the angular speed of a rotor (not shown) of the motor 32 based on a signal received by the encoder. The command current controller 20 calculates a reference d-axis current Id—REF and a reference q-axis current Lq—REF based on the torque command Te, the bridge voltage Vecu, and the angular speed ωm. For example, in one embodiment, the reference d-axis current Id—REF and the reference q-axis current Iq—REF may be calculated using a look-up table. However, it is understood other approaches may be used as well to determine the reference d-axis current Id—REF and the reference q-axis current Iq—REF. The reference d-axis current Id—REF is sent to the subtractor 70, and the reference q-axis current Lq—REF is sent to the subtractor 72.
The subtractor 70 receives the measured d-axis current IdMEASURED and the reference d-axis current Id—REF. The subtractor 70 determines a d-axis error signal 74 based on the measured d-axis current IdMEASURED and the reference d-axis current Id—REF. The d-axis error signal 74 represents the error between the measured d-axis current IdMEASURED and the reference d-axis current Id—REF. The subtractor 72 receives the measured q-axis current IqMEASURED and the reference q-axis current Iq—REF. The subtractor 72 determines a q-axis error signal 76 based on the measured q-axis current IqMEASURED and the reference q-axis current Iq—REF. The q-axis error signal 76 represents the error between the measured q-axis current IqMEASURED and the reference q-axis current Iq—REF.
The d-axis PI controller 22 receives as input the d-axis error signal 74 from the subtractor 70. The d-axis PI controller 22 calculates a d-axis voltage signal VD. The d-axis voltage signal VD is based on a d-axis proportional gain KP, and a d-axis integral gain Ki. Likewise, the q-axis PI controller 23 receives as input the q-axis error signal 76 from the subtractor 72. The q-axis PI controller 23 calculates a q-axis voltage signal VQ. The q-axis voltage signal VQ is based on a q-axis proportional gain KP, and a q-axis integral gain K.
The polar conversion controller 24 receives as input the d-axis voltage signal VD from the d-axis PI controller 22 and the q-axis voltage signal VQ from the q-axis PI controller 23. Based on the inputs, the polar conversion controller 24 determines a voltage command Vcmd and a phase advance angle δ. The duty cycle calculation controller 26 receives as inputs the voltage command Vcmd and the phase advance angle δ from the polar conversion controller 24. The duty cycle calculation controller 26 also receives a rotor angle value θr measured by the motor position sensor 34. In one exemplary embodiment, the duty cycle calculation controller 26 may include an over-modulation space vector PWM unit to generate three respective duty cycle values Da, Db, and Dc. The duty cycle values Da, Db, and Dc are used to drive gate drive circuits (not shown) of the inverter 28 that energize phases of the of the motor 32.
Determining the corrected a-axis phase current value IA—CORRECTED and the corrected b-axis phase current value IB—CORRECTED by the current compensation controller 48 will now be discussed. Turning now to FIG. 2, a dataflow diagram illustrates one exemplary embodiment of the current compensation controller 48 of FIG. 1 used to determine the corrected a-axis phase current value IA—CORRECTED and the corrected b-axis phase current value IB—CORRECTED. In one example, the current compensation controller 48 includes a common-mode voltage look-up table 80, and a current correction module 82.
The common-mode voltage look-up table 80 stores values for an offset voltage from the a-axis differential amplifier 40, and an offset voltage from the b-axis differential amplifier 42. Specifically, the common-mode voltage look-up table 80 stores data collected during an end-of-line test of the motor control system 10. Specifically, during production, the motor control system 10 is operated at an end-of-line calibration. During end-of-line calibration, values for the offset voltage based on the duty cycle are generated and stored in memory of the current compensation controller 48 as the common-mode voltage look-up table 80.
FIG. 4 is an exemplary illustration of the common-mode voltage look-up table 80 generated during end-of-line calibration. In the embodiment as shown in FIG. 3, the x-axis is the duty cycle (measured in counts) of the duty cycle Da or duty cycle Db, and the y-axis represents the offset voltage. Specifically, Line A represents the offset voltage for the a-axis differential amplifier 40 (FIG. 1), and Line B represents the offset voltage for the b-axis differential amplifier 42 (FIG. 1). It should be noted that although values for both the a-axis differential amplifier 40 and the b-axis differential amplifier 42 are illustrated, only values corresponding to one of the differential amplifiers 40 or 42 may be stored in the common-mode voltage look-up table 80 as well.
Referring now to both FIGS. 2 and 4, the common-mode voltage look-up table provides an a-axis common-mode voltage VCM—VOLTAGE—A based on the duty cycle Da, and/or a b-axis common mode voltage VCM—VOLTAGE—B based on the duty cycle Db. For example, referring to FIG. 4, if the duty cycle value is about 500 counts (10% duty cycle) for the a-axis differential amplifier 40, then the a-axis common-mode voltage VCM—VOLTAGE—A is about 2.499 Volts. The value of the a-axis common-mode voltage VCM—VOLTAGE—A and/or the b-axis common mode voltage VCM—VOLTAGE—B is then sent to the current correction module 82.
The current correction module 82 also receives as input the digital value 64 from the ADC 44 (shown in FIG. 1) and/or the digital value 66 from the ADC 46 (also shown in FIG. 1), which represent the phase current ia on the line 50 and the phase current ib on the line 52, respectively. The current correction module 82 may then periodically determine the corrected a-axis phase current value IA—CORRECTED and/or the corrected b-axis phase current value IB—CORRECTED based on the inputs. In one embodiment, the corrected a-axis phase current value IA—CORRECTED and/or a corrected b-axis phase current value IB—CORRECTED may be determined by Equation 1:

ICORRECTED=(ADCmtr—curr—volts−VCM—Voltage)*GainAmps—per—Volt  Equation 1

where ICORRECTED is either the corrected a-axis phase current value IA—CORRECTED or the corrected b-axis phase current value IB—CORRECTED, ADCmtr—curr—volts is the output of either the ADC 44 or the ADC 46 shown in FIG. 1 (i.e., either the phase current ia or the phase current ib), and GainAmp—per—volt is a gain parameter that is used to convert the voltage into current.

FIG. 3 is an alternative embodiment of a current compensation controller 148 including memory 180, a common-mode voltage module 182, and a current correction module 184. The memory 180 stores a gain common-mode value Gcm, the bridge voltage Vecu—Cal—Time, a 10% duty cycle duty10%, and a common-mode voltage VCM(10% dutyCycle). Vecu,calTime represents the bridge voltage measured during end-of-line calibration, duty10% represents a 10% duty cycle during end-of-line calibration, and VCM(10% dutycycle) represents the common-mode voltage during end-of-line calibration at 10% duty cycle. The gain common-mode value Gcm is calculated by the current compensation controller 182 during end-of-line calibration of the motor control system 10 (FIG. 1), and is stored in the memory 180 of the current compensation controller 148.
An exemplary approach to determine the gain common-mode value Gcm will now be described. Referring now to both FIGS. 3 and 4, Line A represents the offset voltage created the a-axis differential amplifier 40 (FIG. 1) during end-of line calibration, and Line B represents the offset voltage created by the b-axis differential amplifier 42 (FIG. 1) during end-of line calibration. A first point of data 90A and a second point of data 92A are sampled for the a-axis differential amplifier 40, and a first point of data 90B and a second point of data 92B are sampled for the b-axis differential amplifier 42. The first point of data 90A and the second point of data 92A are used to determine a slope m of Line A (where the equation of a line is expressed as y=mx+b, and m is the slope). Likewise, the first point of data 90B and the second point of data 92B are used to determine a slope m of Line B. The first points of data 90A and 90B may be taken during a beginning portion of the duty cycle. For example, in the embodiment as shown, the first points of data 90A and 90B are taken at 500 counts (at about 10% duty cycle). The second points of data 92A and 92B are taken during an end portion of the duty cycle. For example, in the embodiment as shown, the second points of data 92A and 92B are taken at 4000 counts (at about 80% duty cycle). While 500 counts and 4000 counts are disclosed, it is to be understood that other values of the duty cycle may be used as well to determine the slope of either Line A or Line B to best fit the system to this linear question.
The values for the first points of data 90A or 90B may be expressed as (90Ax, 90Ay) or (90Bx, 90By), where the x coordinate represents the duty cycle count and the y coordinate represents the offset voltage. The values for the second points of data 92A or 92B may be expressed as (92Ax, 92Ay) or (92Bx, 92By). The current compensation controller 182 determines the gain common-mode value Gcm for the a-axis amplifier 40 (FIG. 1) based on the first point of data 90A and the second point of data 92A. Alternatively, or in addition to the a-axis amplifier 40, the current compensation controller 182 determines the gain common-mode value Gcm for the b-axis amplifier 42 (FIG. 1) based on the first point of data 90B and the second point of data 92B. Specifically, the gain common-mode value Gcm represents the slope m of either Line A or Line B (e.g., for either the a-axis differential amplifier 40 and the b-axis differential amplifier 42), where the a-axis gain common-mode value GCM—A determined by Equation 2 and the b-axis gain common-mode value GCM—B is determined by Equation 3:




  
    
      
        
          G
          CM_A
        
        =
        
          
            
              92
              ⁢
              
                
              
              ⁢
              
                A
                y
              
            
            -
            
              90
              ⁢
              
                
              
              ⁢
              
                A
                y
              
            
          
          
            
              92
              ⁢
              
                
              
              ⁢
              
                A
                x
              
            
            -
            
              90
              ⁢
              
                
              
              ⁢
              
                A
                x
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        3
      
    
  
  
    
      
        
          G
          CM_B
        
        =
        
          
            
              92
              ⁢
              
                
              
              ⁢
              
                B
                y
              
            
            -
            
              90
              ⁢
              
                
              
              ⁢
              
                B
                y
              
            
          
          
            
              92
              ⁢
              
                
              
              ⁢
              
                B
                x
              
            
            -
            
              90
              ⁢
              
                
              
              ⁢
              
                B
                x
              
            
          
        
      
    
    
      
        Equation
        ⁢
        
          
        
        ⁢
        4
      
    
  




where the value of 92Ax-90Ax and 92Bx-92Bx are multiplied by the bridge voltage Vecu measured during end-of-line calibration to convert the values from duty cycle to equivalent voltage values.

Turning back to FIG. 3, the gain common-mode value Gcm is sent to the common-mode voltage module 182. The common-mode voltage module 182 also receives as input the bridge voltage Vecu, the duty cycle value (e.g., Da and/or Db) during operation, the bridge voltage Vecu, stored in memory during end-of-line calibration, and the duty cycle value duty, stored during end-of-line calibration. The common-mode voltage module 182 determines a common-mode voltage (either an a-axis common mode voltage VCM—VOLTAGE—A and/or a b-axis common mode voltage VCM—VOLTAGE—B) periodically during operation of the motor control system 10. The a-axis common-mode voltage VCM—VOLTAGE—A represents the common-mode voltage of the a-axis differential amplifier 40, and the b-axis common mode voltage VCM—VOLTAGE—B represents the common-mode voltage of the b-axis differential amplifier 42 (FIG. 1). In one embodiment, the common-mode voltage (either a-axis common-mode voltage VCM—VOLTAGE—A or the b-axis common mode voltage VCM—VOLTAGE—B) is determined by Equation 5:

VCM—VOLTAGE=[GCM*(Vecu*Di−Vecu,calTime*duty10%)]+VCM(10% Dutycycle)  Equation 5

where VCM—VOLTAGE represents either the a-axis common-mode voltage or the b-axis common mode voltage, Vecu, is the instantaneous bridge voltage that is measured during operation of the motor control system 10, Di is the instantaneous duty cycle (e.g., either Da and/or Db) in counts commanded during operation of the motor control system 10, Vecu,calTime is the bridge voltage stored in the memory 180, duty10% represents the 10% duty cycle during end-of-line calibration stored in memory 180, and VCM(10% DutyCycle) represents the common-mode voltage of data points 90A (FIG. 4) and 90B (FIG. 4) captured and stored in memory 180 during end-of-line calibration.

The common-mode voltage VCM—VOLTAGE is then sent to the current compensation module 184. The current compensation module 184 also receives as input the digital value 64 from the ADC 44 (shown in FIG. 1) and/or the digital value 66 from the ADC 46 (also shown in FIG. 1). The current compensation module 184 may then determine the corrected a-axis phase current value IA—CORRECTED and/or the corrected b-axis phase current value IB—CORRECTED based on the inputs using Equation 1 as described above.
Referring now to FIGS. 1-4, the current compensation module 48 and 148 as described above determines a corrected phase current that generally compensates for offset error due to common-mode voltage in the a-axis differential amplifier 40, the b-axis differential amplifier 42, or both the a-axis differential amplifier 40 and the b-axis differential amplifier 42. In particular, the current compensation module 48 and 148 may determine the corrected phase current value (the corrected a-axis phase current value IA—CORRECTED and/or the corrected b-axis phase current value IB—CORRECTED) periodically. Thus, the approach as described above dynamically compensates for the offset voltage error caused by the differential amplifiers 40 and 42.
While the invention has been described in detail in connection with only a limited number of embodiments, it should be readily understood that the invention is not limited to such disclosed embodiments. Rather, the invention can be modified to incorporate any number of variations, alterations, substitutions or equivalent arrangements not heretofore described, but which are commensurate with the spirit and scope of the invention. Additionally, while various embodiments of the invention have been described, it is to be understood that aspects of the invention may include only some of the described embodiments. Accordingly, the invention is not to be seen as limited by the foregoing description.

## Claims

1. A motor control system, comprising:
a motor;
at least one differential amplifier configured to monitor phase current applied to the motor;
a current compensation controller in communication with the at least one differential amplifier, the current compensation controller configured to:
periodically determine a common-mode voltage of the at least one differential amplifier, the common-mode voltage is determined by:


VCM—VOLTAGE=[GCM*(Vecu*Di−Vecu, calTime*duty10%)]+VCM(10% DutyCycle) 


where VCM—VOLTAGE represents the common-mode voltage, GCM is a gain common-mode value, Vecu is an instantaneous bridge voltage, Di is an instantaneous duty cycle, Vecu,calTime is a bridge voltage during end-of-line calibration, duty10% represents a 10% duty cycle during end-of-line calibration, and VCM(10% DutyCycle) represents the common-mode voltage during end-of-line calibration at 10% duty cycle; and

determine a corrected phase current value based on the common mode voltage.

2. A motor control system, comprising:
a motor;
at least one differential amplifier configured to monitor phase current applied to the motor;
a current compensation controller in communication with the at least one differential amplifier, the current compensation controller configured to:
periodically determine a common-mode voltage of the at least one differential amplifier, the corrected the phase current value is determined by:


ICORRECTED=(ADCmtr—curr—volts−VCM—Voltage)*GainAmps—per—Volt 


where ICORRECTED is either the corrected a-axis phase current value IA—CORRECTED or the corrected b-axis phase current value IB—CORRECTED, ADCmtr—curt—volts represents the phase current monitored by the differential amplifier, and GainAmp—per—volt is a gain parameter; and

determine a corrected phase current value based on the common mode voltage.

3. A method of controlling a motor, comprising:
periodically determining a common-mode voltage of at least one differential amplifier by a current compensation controller, at least one differential amplifier configured to monitor phase current applied to the motor, the common-mode voltage is determined by:


VCM—VOLTAGE=[GCM*(Vecu*Di−Vecu, calTime*duty10%)]+VCM(10% Dutycycle) 

where VCM—VOLTAGE represents the common-mode voltage, GCM is a gain common-mode value, Vecu is an instantaneous bridge voltage, Di is an instantaneous duty cycle, Vecu,calTime is a bridge voltage during end-of-line calibration, duty10% represents a 10% duty cycle during end-of-line calibration, and VCM(10% DutyCycle) represents the common-mode voltage during end-of-line calibration at 10% duty cycle; and
determining a corrected phase current value based on the common mode voltage by the current compensation controller.

4. A method of controlling a motor, comprising:
periodically determining a common-mode voltage of at least one differential amplifier by a current compensation controller, at least one differential amplifier configured to monitor phase current applied to the motor, the corrected the phase current value is determined by:


ICORRECTED=(ADCmtr—curr—volts−VCM—Voltage)*GainAmps—per—Volt 


where ICORRECTED is either the corrected a-axis phase current value IA—CORRECTED or the corrected b-axis phase current value IB—CORRECTED, ADCmtr—curr—volts represents the phase current monitored by the differential amplifier, and GainAmp—per—volt is a gain parameter; and
determining a corrected phase current value based on the common mode voltage by the current compensation controller.