Patent Publication Number: US-6992452-B1

Title: Dynamic current limiting

Description:
This present application claims priority from U.S. Provisional Application No. 60/430,217, filed Dec. 2, 2002, the full disclosure of which is hereby incorporated by reference herein. 

   BACKGROUND OF THE INVENTION 
   The invention relates to dynamically setting limits on commanded current, particularly with respect to motors. 
   Current limits are used in electronic circuitry in order to prevent excessive currents that may result in catastrophic failure of electronic components. Typically, if current is wildly excessive for a brief time or is high for an extended period of time, an electronic component can overheat resulting in failure. A maximum current level for each component can be determined for safe operation under all conditions. Unfortunately, by setting such a universally applicable current limit, higher power operation above that limit is prevented even when the component is cool or for otherwise acceptable short durations of time. For an electronic circuit controlling the operation of a motor, for example, such a limit may prevent high power brief duration maneuvers that would otherwise be desirable for the motorized unit being controlled. One way to overcome the limitation of such current limits is to provide larger and more expensive electronic components. 
   SUMMARY OF THE INVENTION 
   A method of an embodiment of the present invention generates commands for current and prevents the commands from exceeding a dynamically determined limit. The limit is determined as a function of power dissipation in a component as estimated from a measured current level and as a function of a measured temperature proximate to the component. In particular embodiments, the component may be motor windings or one or more power transistors, for example. A predetermined maximum temperature for the component may be used in setting the dynamic limit. The commands for current may be further prevented from exceeding a fixed limit or a second limit dynamically determined relative to a second component. 
   In a system issuing commands for current, a further embodiment of the invention includes determining a plurality of safe current levels and preventing current from exceeding the lowest of the levels. This can be accomplished by dynamically determining a first level of current that will not overheat a first component and dynamically determining a second level of current that will not overheat a second component. This system issues commands that are limited so as to prevent the commands from requesting current in excess of any of the first and second dynamically determined levels. The system may further prevent the commands from requesting current in excess of a fixed limit. 
   The system may be applied to motors where the components being considered may be motor windings and one or more power transistors. Dynamically determining a level based upon the motor windings includes dynamically determining power dissipation in the motor windings estimated from a measure of amount of a motor drive current. The safe current level is a function of estimated temperature of the motor windings. The estimated temperature is determined as a function of a measured temperature and as a function of estimated power dissipation in the motor windings. Dynamically determining power dissipation in the motor windings may be further estimated as a function of the estimated temperature of the motor windings. Using a predetermined maximum temperature for the motor windings, a safe current level can be set. In a particular embodiment, the motor is a brushless motor. 
   A safe current level for one or more power transistors is a function of estimated temperature of a transistor case. The estimated temperature is determined as a function of a temperature measured proximate the power transistor and as a function of estimated power dissipation in the power transistor. Dynamically determining power dissipation in power transistors is estimated from a measure of transistor current and is further estimated as a function of the estimated temperature of a transistor case. Using a predetermined maximum temperature for a power transistor junction, a safe current level can be set. 
   The system may be summarized in terms of measured quantities. A first safe current level for a motor is dynamically determined as a function of measured motor current and as a function of a measured temperature proximate the motor. In a three-phase motor where field-oriented control is used; the direct and quadrature currents may be calculated from the measured phase currents and along with measured temperature proximate the motor may be used to estimate motor winding temperature and, in turn, a safe current limit. A second safe level is dynamically determined as a function of the measured phase currents and as a function of measured temperature proximate the transistors. Again calculations can be performed using direct and quadrature current in the determination of the second safe level for three-phase motors. The commands for current are prevented from requesting current in excess of any of the first and second dynamically determined safe levels. In the case of the three phase motor, commands for direct and quadrature current are limited in magnitude to the lower of the two dynamically determined safe levels. 
   Dynamically determining a first safe level more specifically includes estimating temperature of the motor windings as a function of the measured temperature proximate the motor and as a function of the dynamically determined power dissipation in the motor windings and examining the estimated temperature relative to a predetermined maximum temperature for the motor windings. Dynamically determining power dissipation in the motor windings can be further refined so as to make it a function of the estimated temperature of the motor windings. 
   Dynamically determining a second safe level based on the power transistors more specifically includes estimating temperature for a transistor case as a function of the measured temperature proximate the transistor and as a function of the dynamically determined power dissipation in the transistors and using the estimated case temperature to get a safe current level to prevent the transistor junctions from exceeding a predetermined maximum temperature. Dynamically determining power dissipation in the transistors can be further refined so as to make it a function of the estimated temperature of the transistor case. If available, the determination may be a function of estimated transistor junction temperature. 
   Embodiments of the invention may be implemented using analog circuitry, a digital microprocessor or a computer program product. For example, a computer program product embodiment of the invention for use in controlling commands for motor current is a computer usable medium having computer readable code thereon. The computer readable program code includes program code for dynamically determining a first safe current level as a function of estimated temperature of motor windings, program code for dynamically determining a second safe current level as a function of estimated temperature of a power transistor, and program code for preventing the commands for motor current from requesting more than any of the first and second dynamically determined current levels. In addition, there may be program code for preventing the commands for motor current from exceeding a fixed limit. 
   A computer program product embodiment of the invention can be further viewed in terms of measured quantities. Computer readable program code includes program code for dynamically determining a first safe current level as a function of measured motor current and as a function of a measured temperature proximate the motor, program code for dynamically determining a second safe current level as a function of the measured motor current and as a function of measured temperature at the heat sink for the power transistors; and program code for preventing the commands for current from requesting more than any of the first and second dynamically determined current levels. 
   In a vehicle having a left wheel and a right wheel each separately driven by its respective motor, a particular embodiment of the invention dynamically determines a current command limit for each respective motor by applying a lowest of the dynamically determined current command limits to each of the respective motors so that current commands to each of the respective motors are subject to the same current command limit. This avoids unintentional turning of the vehicle due to unequal limits. 
   By allowing the command limit to be changed dynamically, higher currents may be permitted than would otherwise be possible if a fixed limit were all that was relied upon. Other objects and advantages of the present invention will become apparent during the following description of the presently preferred embodiments of the invention taken in conjunction with the drawings. 

   
     BRIEF DESCRIPTION OF THE DRAWINGS 
       FIG. 1  is a flow chart of an embodiment of the present invention producing commands for current. 
       FIG. 2  is a flow chart of an embodiment of the present invention dynamically determining the limits on commands. 
       FIGS. 3   a –c show graphically over time how the command limit is set as component currents and temperatures vary. 
       FIG. 4  is a schematic diagram of a three phase motor for use in an embodiment of the present invention. 
       FIG. 5  is a schematic block diagram of a dynamically current limited motor in accordance with an embodiment of the present invention. 
       FIG. 6  is an exploded view of a motor chassis and motor control electronics incorporating an embodiment of the present invention. 
       FIG. 7  is a perspective view of a two wheeled self-balancing vehicle that may incorporate the dynamic current limiting of the present invention. 
       FIG. 8  is a flow chart of an embodiment of the present invention for use with a left and right wheeled vehicle. 
   

   DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS 
   Referring to  FIG. 1 , a flow chart provides an overview of embodiments of methods of the present invention. Current commands may be generated  10  for and provided to any of a variety of components. In one particular embodiment, current commands are used for controlling a motor. A motion controller or speed control loop may be used in a known manner to generate current commands. The current commands regulate current through one or more power transistors which provide current to the motor windings. Any number of different devices may be operated by current commands in accordance with the present invention. 
   It is desirable to prevent the components from overheating and possibly failing as a result thereof. It is often difficult and expensive to obtain direct measurements of temperatures for the components of concern. Fortunately, a proxy for the temperature of the components of concern can be estimated. These estimates are used in accordance with embodiments of the invention to dynamically set a limit for current commands so as to permit high currents to be requested when the components are relatively cool and to impose stricter limits on current requests when the components become hot. In a motor drive, for example, this allows the drive to operate continuously, albeit at a reduced performance level, instead of causing the drive to be shut down, when components are nearing excessive temperatures. 
   In order to obtain an estimate of the component temperatures, current is measured  12  to provide a magnitude of current through the component of concern. Since current is directly related to the power through the component, an estimate of power dissipation in the component can be obtained  14 . As a general matter, power dissipation is a function of the current through the component and the current waveform duty cycle and a voltage applied to the component P diss =f (I A , V bus , D A ) where I is current, V bus  is voltage (for transistor V bus  is the voltage applied across the transistor), D is duty cycle (the fraction of time that the transistor is turned on). Embodiments of the present invention may use any reasonable estimate of power dissipation based at least upon the current in the component. A specific estimation formula that has been found suitable for use in estimating power dissipation (P diss ) in a power MOSFET for driving a motor is that the power dissipation would be at worst a constant (K) times the current (I) squared times the duty cycle (D) times the on resistance of the transistor junction R dson .
 
P diSS ≦K·I 2 ·D·R dson (T)
 
Switching losses which vary as a function of the bus voltage are approximated as a fraction of the I 2 R losses. Thus, a constant K is used to account for the I 2  R losses and the switching losses. Although switching losses are not computed directly, the approximation is made sufficiently conservative to avoid overheating of components. As the on resistance (R) of the transistor varies with temperature (T), this formula can be refined, if desired, by feeding back an estimate of the component temperature so as to modify the value of on resistance used in the formula.
 
   Temperature has a great influence on the amount of current a component can handle. Therefore, in dynamically determining a safe current limit, an estimate of the component temperature is determined  18 . The component temperature estimated will typically be either the hottest temperature in the component of concern or the temperature of a close thermal element that has a large thermal capacitance. When the hottest temperature is expected in an area that changes temperature rapidly relative to the measurement and processing rate of the temperature estimation system, such as in a semiconductor junction, the latter is preferred. It is preferable to be relying upon a slower moving temperature and therefore a temperature at an area of large thermal capacitance. Since the safe current level will depend on the hottest temperature which in turn depends on the current limit, there is potential for an unstable feedback loop which is avoided if temperature for a thermal element with large thermal capacitance is estimated. In the case of motor windings, the temperature of the windings is estimated. In the case of a power transistor, the transistor case temperature is estimated. 
   A temperature is measured proximate to the component  16 , somewhere as close as can conveniently be obtained, such as on the circuit board. For example, the temperature may be taken at a mount for a heat sink used in conjunction with the component of concern. In other examples, temperature may be obtained directly from the component simplifying the determination of the estimated temperature. Given the measured temperature, an estimate of the component temperature can be determined from which a safe current level can be set. Most often, the component temperature is estimated  18  as a function of the measured temperature proximate the component and the estimate of power dissipation in the component. These temperature estimators can be derived using conventional thermal modeling techniques. 
   A component&#39;s estimated temperature can be used to determine  20  a safe current level in view of a maximum desired temperature. The safe current level is dynamically determined because it changes over time as the estimated temperature changes. If the component heats up slowly, a standard proportional (P) or proportional-integral (PI) feedback loop can be used to calculate the current limit. The current limit is set as a function of maximum temperature for the component minus the estimated temperature for the component. For example, a safe current level for motor windings can be calculated as:
 
I mLIM =√{square root over (K(T max −Test))}.
 
   If the component includes a portion of concern that heats up quickly, it may be preferable to calculate what current would cause the portion of concern to heat up to the maximum desired temperature. This calculation would take into account the power dissipation estimated in the component. Thus, to determine a current limit, the maximum temperature T max  of the portion of concern would be
 
T max =T est +P max ·R th  
 
where T est  is an estimated temperature for the nearest slowly-heating portion of the component, P max  is the maximum power dissipation, and R th  is the thermal resistance between the portion of concern and the portion whose temperature has been estimated. This equation can be solved for P max . Assuming the relationship between power dissipation P max  and the current limit I lim  is known, this can be solved for I lim  as a function of the maximum temperature (T max ), the estimated temperature (T est ), and the thermal resistance. Such an equation can be solved directly or through using iterative techniques.
 
   A safe current level for a set of power transistors can be calculated as I sLIM =√{square root over ((T MAX −Test)/R SJC R seff )} where T MAX  is the maximum desired temperature for the semiconductor junction, T est  is the estimated temperature of the transistor case, R SJC  is the junction-to-case thermal resistance and R seff  is the effective transistor on resistance. The dynamically determined safe current level may then be used to limit current commands issued by an external motion controller (e.g. speed control loop). When the generated current commands request a magnitude greater than the dynamic current limit, the magnitude of the command is cut or reduced to the value determined by the limit  22 . For example, if the current limit were 17A at one particular time instant, commands greater than 17A would be reduced to 17A and commands less than −17A would be changed to −17A, while commands between −17A and 17A would be left unchanged. The thus-limited command is output  24 . 
   In a typical application there may be more than one component of concern with respect to the quantity of current and potential component failure. In such a case, current limits may be obtained from calculations with respect to each of the components of concern. The lowest current limit from any of these calculations would be used to set the limit on the current commands. If desired a further determinant of a limit can be a fixed limit based upon a maximum current above which the current should never rise. The fixed limit used in conjunction with dynamically determined limits may be higher than would otherwise have been possible without the dynamic limits used to protect the components when they get hot. When a fixed limit is used among the selected limits, the applied limit would be the lowest from among the fixed limit and any of the dynamic limits set by the calculations for the components of concern. 
   In a particular application in which current limits are being set in conjunction with control of a motor, components of concern may include the power transistors, the motor windings, motor connectors, and other conductors. Referring now to  FIG. 2 , a temperature of the motor windings is estimated for use in determining a dynamic limit  30 . Similarly for the power transistors, a limit is dynamically determined as a function of an estimated temperature of a worst case power transistor  32 . These estimates may be obtained by using current measurements and/or temperature measurements proximate the components. Generated commands requesting motor drive current may be limited by the limits determined with respect to the motor windings and power transistors  34 . The value of the commands are limited to request no more than the lowest from among the limit determined from the estimated temperature of motor windings, the safe current level determined from the estimated power transistor temperature and, if desired, a fixed limit. Thus, the limit on the current commands may be adjusted dynamically as the motor operates. 
   The graphs of  FIGS. 3   a –c help illustrate the dynamic current command limits in operation.  FIG. 3   a  exemplifies the dynamically changing limits over time. A fixed limit is shown along with each of two dynamically determined limits. For example, one of the limits may be set in response to estimated transistor temperature. The other of the limits may be determined by the motor windings&#39; estimated temperature. 
   In  FIG. 3   b , a generated command (I cmd ) requesting current is changing over time. The lowest limit at every given point in time for the three limits shown in  FIG. 3   a  is applied to the generated command to prevent the command from requesting more current than any of the three limits would permit. The limited command (I cmdL ) is illustrated.  FIG. 3   c  shows the various changing temperatures over time including the estimated temperature of a power transistor case (T case ), the estimated temperature of the semiconductor junction in the power transistor (T j ), the estimated temperature of the motor windings (T winding ) and the estimated temperature of the motor housing (T housing ). The dynamic limits in  FIG. 3   a  are responsive in part to the temperatures exhibited in  FIG. 3   c.    
   While the methods of the invention may be used in a wide variety of applications, one embodiment shall be described herein in detail. A brushless motor can be controlled using the principles described above. Field oriented control circuits are known for use in controlling three-phase brushless motors. A field oriented current controller handles motor currents and voltages in the d-q (direct and quadrature) reference frame of the rotor. The three measured motor currents from the three-phase state reference frame of the windings are mathematically transformed to the two-axis rotating d-q reference frame, prior to processing by the PI controller. Similarly, voltages applied to the motor are mathematically transformed from the d-q frame of the rotor to the three phase reference frame of the windings before they can be used by a pulse width modulator. A processor implementing dynamic current limit setting may be used in conjunction with field oriented control to limit the generated current commands. A computer program on computer readable medium is accessed by the processor to calculate the limits and apply them to the generated commands for motor current. 
   Referring now to  FIGS. 4 and 5 , a brushless motor has three pairs  40 ,  42 ,  44  of two power transistors in a 3-phase bridge configuration  54  for providing current to each of three motor windings  48 . Referring to  FIG. 5 , a command (I cmd ) for motor torque is intended for a motor drive current controller  52 . In the embodiment of  FIG. 5 , the controller  52  is a field oriented controller. This command (I cmd ) represents the currents that are desired to be delivered to each of the windings depending upon the relative location of the windings at a given instant in time. It is this command for motor current that will be dynamically limited. 
   Limiting is performed to avoid overheating any of the power transistors  40 ,  42 ,  44  or the motor windings  48 . Although there are six power transistors, sufficient accuracy has been achieved when reducing the power dissipation estimate to a single worstcase power dissipation for all of the six power transistors. The currents through each pair of transistors are measured and provided to an adaptive current limit controller  60  in the form of an effective current I o . I o  is the magnitude of the motor drive current. 
   The derivation of a single estimate for power dissipation in power transistors of a brushless three phase motor shall now be explained. The derivation assumes that the three phase currents are measured and that the transistor switches are pulse width modulated. A simple model for power loss in each switch is conduction loss. This is represented as:
         P SW =(I SW   2 R SW )·D SW      P SW =average power dissipation during a given switching cycle   D SW =duty cycle of switch   I SW =current through switch when switch is on   R SW =switch on-resistance
 
Each of the three pairs of transistors A, B, and C include a high side (H) and a low side (L) transistor and therefore the following six equations describe power loss in each transistor:
 
P AH =I A   2 R SW D A  P AL =I A   2 R SW (1−DA)
 
P BH =I B   2 R SW D B  P BL =I B   2 R SW (1−D B )
 
P CH =I C   2 R SW D C  P CL =I C   2 R SW (1−D C )
 
Where D A , D B, and  D C  are the duty cycles of the low-side transistors and I A , I B , and I C  are the motor phase currents.
       

   These could be used in six separate thermal estimators, with fairly high accuracy (assuming the loss equation is fairly well-characterized). These equations can be reduced, however, to a more conservative estimate, in several ways. The duty cycle may be very conservatively estimated as 1 since 0≦D≦1. In this case:
 
P AH , P AL ≦P A =I A   2 R SW  
 
P BH , P BL ≦P B =I B   2 R SW  
 
P CH , P CL ≦P C =I C   2 R SW  
 
This then reduces the system to three “worst-case” transistors (with duty cycle 1), one in each phase leg. This can be off by at worst a factor of 2.0 if D A =½ then the power loss P AH =P AL =½ I A   2 R SW .
 
   A less conservative duty cycle estimate takes the worst case duty cycle for each phase leg.
 
P AH , P AL ≦P A =I A   2 R SW  MAX (D A , 1−D A )
 
P BH , P BL ≦P B =I B   2 R SW  MAX (D B , 1−D B )
 
P CH , P CL ≦P C =I C   2 R SW  MAX (D C , 1−D C )
 
   In a three-phase system, we often use a synchronous reference frame modeling the currents and voltages in terms of direct and quadrature components. Using this model produces currents, voltages, and duty cycles I d , I q , V d , V q , D d , D q , such that 
     I a =I q  cos θ e +I d  sin θ e =I o  cos (θ e −Φ O )         I   b     =           I   q     ⁢     cos   ⁡     (       θ   e     -       2   ⁢   π     3       )         +       I   d     ⁢     sin   ⁡     (       θ   e     -       2   ⁢   π     3       )           =       I   o     ⁢     cos   ⁡     (       θ   e     -       2   ⁢   π     3     -     Φ   0       )                         I   c     =           I   q     ⁢     cos   ⁡     (       θ   e     -       4   ⁢   π     3       )         +       I   d     ⁢     sin   ⁡     (       θ   e     -       4   ⁢   π     3       )           =       I   o     ⁢     cos   ⁡     (       θ   e     -       4   ⁢   π     3     -     Φ   0       )                         where 
           I   o   2     =       I   d   2     +     I   q   2         ,       Φ   0     =       tan     -   1       ⁢       I   d       I   q               
   and Φ e  is the electrical phase angle of the rotor field&#39;s back-emf relative to phase A.
 
similarly
       
     D a =D q  cos θ e +D d  sin θ e +D n =D o  COS (θ e −Φ o )+D n           D   b     =           D   q     ⁢     cos   ⁡     (       θ   e     -       2   ⁢   π     3       )         +       D   d     ⁢     sin   ⁡     (       θ   e     -       2   ⁢   π     3       )         +     D   n       =         D   o     ⁢     cos   ⁡     (       θ   e     -       2   ⁢   π     3     -     Φ   0   ′       )         +     D   n                       D   c     =           D   q     ⁢     cos   ⁡     (       θ   e     -       4   ⁢   π     3       )         +       D   d     ⁢     sin   ⁡     (       θ   e     -       4   ⁢   π     3       )         +     D   n       =         D   o     ⁢     cos   ⁡     (       θ   e     -       4   ⁢   π     3     -     Φ   0   ′       )         +     D   n                       where 
           D   o   2     =       D   d   2     +     D   q   2         ,       Φ   0   ′     =       tan     -   1       ⁢       D   d       D   q               
 
The system can be simplified on the basis that any given phase current I a , I b , and I c  is less in amplitude than I o , the amplitude of the modeled current in the d-q reference frame.
 
|I a |, |I b |, |I c |≦I o =√{square root over (I d   2 =I q   2 )}
 
Therefore, we can consider a worst case switch to have current I o  giving maximum power dissipation of (I d   2 +I q   2 ) R SW  if duty cycle is conservatively estimated at one or (I d   2 +I q   2 ) R SW  D MAX  if duty cycle is taken as D MAX =MAX(D A , 1−D A , D B , 1−D B , D C , 1−D C ). The average value of I a   2  over the commutation cycle is &lt;I a   2 &gt;=&lt;I o   2  cos (θ e −Φ o )&gt;=I o   2 &lt;cos (θ e −Φ o )&gt;=½I o   2 . Therefore using I o  for current is over conservative by at worst a factor of 2 relative to the individual phase currents.
       
   Further simplification of the dissipation estimate can be achieved by averaging over a well-chosen time interval. If we are using the power dissipation estimate for a thermal model with slow dynamics (e.g., a long time constant), then we get the same results from an instantaneous, power estimate as we do an average power estimate. The average is taken over a time interval T av  where T av &lt;&lt;τ, τ being the shortest time constant in the thermal model. A good rule of thumb would be 
         T   av     &lt;       1   20     ⁢     τ   .           
 
If the same assumptions are made, the same result for temperature will be obtained averaging an instantaneous power dissipation estimates over a time interval T av  as for calculating temperature using an estimate of average power over time T av . But it is possible to make additional assumptions for an estimate of average power. For instance, if I A   2 =I O   2 (cos 2 ωt), and |ωT av |&gt;1, then I A   2  oscillates between zero and I o   2  while &lt;I A   2 &gt; over time T av  hovers no higher than ½ I o   2 . The upper bound for &lt;I A   2 &gt; depends on ωT av  but if |ωT av |&gt;1, this drops closer to ½ I o   2  thereby recovering some of the conservativeness of the previous simplifications. The exact formula for an upper bound for &lt;I A   2 &gt; is I o   2 
       &lt;     I   A   2     &gt;           ⁢     is   ⁢             ⁢             ⁢       I   0   2     ·     (       1   /   2     +            sin   ⁢           ⁢   ω   ⁢           ⁢     T   av         2   ⁢           ⁢   ω   ⁢           ⁢     T   av                )             
 
which can be approximated by linear and/or quadratic functions of ω.
 
   These approaches can be combined into a single power dissipation estimate:
         P worst-case =(&lt;(I d   2 +I q   2 )·α D &gt;·f(ω e ·T av ))·R SW  
 
where
   α D =either 1 (easy, brute force upper bound) or max (D A , 1−D A , D B , 1−D B , D C , 1−D C )   f(x) is a convenient upper bound so that 
         f   ⁡     (   x   )       ≥       1   /   2     +            sin   ⁢           ⁢   x       2   ⁢   x                  
         ω   e     =       ⅆ     θ   e         ⅆ   t           
 
is the electrical frequency or commutation frequency of the system.
 
As an example, f(x)=max(1−0.245 x 2 , 0.64−0.0063|x|) can be used for f(x).
       

   The transistor thermal estimator  62  computes a power dissipation estimate P diss , as discussed above or some other way, and uses it to estimate temperature of a transistor case (T sc ). To avoid overheating, this will be a worst case estimate for any of the six power transistors. A temperature sensor  58  is located in close thermal proximity to a heat sink  56  for the power transistors. Thus, a measured heat sink temperature (T ss ) proximate a power transistor can be used in the temperature estimate. The estimated temperature for a switching transistor case equals
 
H 1 (s)Tss+H 2 (s)P diss =T sc  
 
where H 1 (s) and H 2 (s) are system transfer functions that can be calculated for a particular system using standard thermal modeling techniques. A thermal model is used to arrive at specific equations for calculating transistor (or “switch”) case temperature. For example, one such linear system thermal model is as follows: 
           C   sc     ⁢       ⅆ     T   sc         ⅆ   t         =       P   diss     +         T   ss     -     T   sc         R   scs             
 
Here in accordance with the model, the thermal capacitance of the component&#39;s case (C sc ) when multiplied by the rate of change of the case temperature (T sc ) is equal to the power dissipation (P diss ) at the transistor junction representing heat transferred from the junction to the case minus heat removed from the case by the heat sink. The heat lost to the heat sink is shown in the second term as the difference in temperature between the measured heat sink temperature (T ss ) and the case temperature (T sc ) divided by the thermal resistance between the case and the heat sink (R scs ). In each dynamic interval, the previously estimated case temperature and junction temperature are used to calculate a new estimate.
 
   A current limit (I SLIM ) is determined  64  such that the transistor junctions are prevented from overheating. Using the maximum desired temperature for the transistor junction, the power dissipation must be kept small enough to avoid going beyond that temperature.
 
T MAX =T SC +P LIM  R SJC .
 
T MAX  is the maximum desired junction temperature, T SC  is the estimated case temperature, P LIM  is the maximum acceptable power dissipation given T SC , R SJC  is the switch junction-case thermal resistance. Solving this equation for P LIM  we get (T MAX −T SC )/R SJC . We also use the relationship between power dissipation and current, P LIM =KI 2   LIM R   SEFF . R SEFF  is the effective on resistance of the power transistors. We solve for I SLIM  and substitute the terms determined for P LIM .
 
I SLIM =√{square root over (P LIM /KR SEFF )}=√{square root over ((T MAX −T S ) /KR SJC R SEFF )}
 
Given the conservative estimates, I SLIM  will be a safe current level for the transistors at the instant when case temperature is estimated to be T SC .
 
   Because the motor windings have a relatively large thermal capacitance, calculation of a safe current level for the windings is a little more straightforward. The motor current is obtained from the measured phase currents using the synchronous reference frame to supply I o . The thus measured motor current is used to estimate power dissipation in the windings.
 
P m =R MEFF I o   2  
 
where P M  is the power dissipation in the windings, R MEFF  is the effective electrical resistance of the windings, I o  is the effective motor drive current. If desired, R MEFF , could be allowed to vary with temperature.
 
   A temperature sensor  68  placed in thermal contact with the motor body or chassis provides a measure of temperature that can be used to help get an estimate of the motor housing temperature and motor winding temperature. It is assumed in this embodiment that the motor  66  includes a motor housing in good thermal contact with a chassis and windings contained within the motor housing. A linear system thermal model suitable for the motor housing may be used. 
         Cmh   ⁢       ⅆ     T   mh         ⅆ   t         =           T   mw     -     T   mh         R   mwh       +         T   mc     -     T   mh         R   mhc             
 
where Cmh=thermal capacitance of the motor housing, T mh =temperature of the motor housing, T mw =temperature of the motor windings, T mc =measured temperature of the chassis, R mwh =thermal resistance between the motor windings and the motor housing, R mhc =thermal resistance between the motor housing and chassis. The first term represents heat flowing from the windings to the housing and the second term represents heat flowing from the chassis flowing to the housing. A further relationship to complete the model for the motor windings is as follows: 
           C   mw     ⁢       ⅆ     T   mw         ⅆ   t         =           T   mh     -     T   mw         R   mwh       +     P   m           
 
where C mw =thermal capacitance of the motor winding and P m  is the estimated power dissipation in the motor windings. The first term represents heat flowing from the housing to the windings. As discussed above, power dissipation is estimated as a function of measured current. The motor housing and motor windings are thermally coupled, therefore these equations are solved together to arrive at estimated temperatures  70 .
 
   Once the winding temperature estimate is provided, a safe current level for the windings that will keep them from overheating is calculable  72 . The following equation gives the safe current level as
 
I mLIM =√{square root over (K(T WMAX −T MW ))}
 
where I MLIM  is the dynamically-determined safe current level as a function of motor winding temperature estimate T MW , K is an empirically-determined constant and T WMAX  is the maximum desired temperature for the windings.
 
   The safe current levels determined for the windings and the transistors are used to limit the commands requesting motor current. The commands are prevented from requesting more current than would be acceptable to either the windings or the transistors. Since it is the magnitude of the current that is being limited it can be efficient to consider the square of the transistor current and the square of the motor current limit so as to select the smaller of the squares  74 . The selected minimum is then subjected to a square root calculation  76  to produce the limit to be applied to the externally-generated current command. A fixed limit on the command may also be included in limiting the command. In selecting the minimum limit, the fixed limit can be considered along with the dynamically determined limits. Thus, even when the unit is cool, the fixed limit prevents currents in excess of acceptable levels to the components. By relying on dynamically determined limits, the fixed limit may be higher than it would be if it were the only restriction on current level. 
   Referring now to  FIG. 6 , a motor taking advantage of dynamic current limit setting may be arranged for relatively simple assembly. The circuit board  82  would typically include a mounting port for use in securing the electronic circuit board to a motor chassis  84 . Rather than obtaining a direct measure of temperature of the motor windings, in accordance with embodiments of the present invention, a thermal sensor  68  may be located for making thermal contact with the chassis  84 . A thermally conductive interface material  69  with suitable mechanical compliance may be inserted between the thermal sensor  68  and the chassis  84 . The measured temperature can be used in estimating temperature of the motor housing  86  and motor windings. A second thermal sensor  58  is located in the proximity of a heat sink  56  for the power transistors  40 ,  42 ,  44  to provide a second temperature. A thermally conductive, mechanically compliant interface material  57  may be inserted between the power transistors and their heat sink  56 . Current sensors on the circuit board provide a measure of the amount of motor phase currents. These motor phase currents are converted to the direct and quadrature terms by a frame-of-reference translator that uses the rotor position measured by an encoder or other position sensing device. A processor receives the current and temperature information. Responsive to the temperature measured near the motor chassis  84 , the temperature near the heat sink  56  for the power transistors, and the measure of the motor drive current, the processor dynamically sets a limit on current commands that control the amount of motor drive current. The issuance of current commands may be generated in accordance with any number of well known motion control or speed control techniques. Protective current limits are set on the basis of a variety of concerns. The current limit determined by the processor may be the lowest from among any of a fixed current limit, a current limit dynamically determined with respect to the power transistors and a current limit dynamically determined with respect to the motor windings. 
   In a particular embodiment of the invention, current limiting can be employed for use in a motorized vehicle  90  having at least a left  92  and a right  94  wheel, as shown by example in  FIG. 7 . The example is a self-balancing human transporter as described in U.S. Pat. Nos. 6,288,505 and 6,367,817 which may be adapted to incorporate such current limiting. The full disclosure of both of these patents is hereby incorporated by reference herein. With a motor driving the left wheel  92  and a motor driving the right wheel  94 , the vehicle may undesirably turn if one wheel is prevented from being driven at the same speed as the other wheel. Thus, if one wheel&#39;s motor gets hot, dynamic current limiting may impose a lower current limit on that motor. If a high current to both wheels is called for, the hot motor may get less current due to the current limit thus slowing that wheel. To prevent undesired response by the vehicle due to unequal heating, it is advantageous for the two motors to share current limit signals. Referring to  FIG. 8 , each motor can calculate and determine  96 ,  98  a lowest limit for current commands for itself as described above. In addition, the two motors can be sharing a processor or can facilitate communication between their respective processors. The lowest current limit  100  as between the left motor and the right motor can be applied  102  to both motors. In this way, lopsided control of the two wheels is avoided. The same current limit is thus applied  102  to both motors. 
   The adaptive current limit control methods of the invention may be embodied in many different forms, including, but in no way limited to, computer program logic for use with a processor (e.g., a microprocessor, microcontroller, digital signal processor, or general purpose computer), programmable logic for use with a programmable logic device (e.g., a Field Programmable Gate Array (FPGA) or other PLD), discrete components, integrated circuitry (e.g., an Application Specific Integrated Circuit (ASIC)), or any other means including any combination thereof. 
   Computer program logic implementing all or part of the functionality previously described herein may be embodied in various forms, including, but in no way limited to, a source code form, a computer executable form, and various intermediate forms (e.g., forms generated by an assembler, compiler, linker, or locator.) Source code may include a series of computer program instructions implemented in any of various programming languages (e.g., an object code, an assembly language, or a high-level language such as Fortran, C, C++, JAVA, or HTML) for use with various operating systems or operating environments. The source code may define and use various data structures and communication messages. The source code may be in a computer executable form (e.g., via an interpreter), or the source code may be converted (e.g., via a translator, assembler, or compiler) into a computer executable form. 
   The computer program may be fixed in any form (e.g., source code form, computer executable form, or an intermediate form) either permanently or transitorily in a tangible storage medium, such as a semiconductor memory device (e.g., a RAM, ROM, PROM, EEPROM, or Flash-Programmable RAM), a magnetic memory device (e.g., a diskette or fixed disk), an optical memory device (e.g., a CD-ROM), a PC card (e.g., PCMCIA card), or other memory device. The computer program may be fixed in any form in a signal that is transmittable to a computer using any of various communication technologies, including, but in no way limited to, analog technologies, digital technologies, optical technologies, wireless technologies, networking technologies, and internetworking technologies. The computer program may be distributed in any form as a removable storage medium with accompanying printed or electronic documentation (e.g., shrink wrapped software or a magnetic tape), preloaded with a computer system (e.g., on system ROM or fixed disk), or distributed from a server or electronic bulletin board over the communication system (e.g., the Internet or World Wide Web.) 
   Hardware logic (including programmable logic for use with a programmable logic device) implementing all or part of the functionality previously described herein may be designed using traditional manual methods, or may be designed, captured, simulated, or documented electronically using various tools, such as Computer Aided Design (CAD), a hardware description language (e.g., VHDL or AHDL), or a PLD programming language (e.g., PALASM, ABEL, or CUPL.) 
   Of course, it should be understood that various changes and modifications to the preferred embodiments described above will be apparent to those skilled in the art. For example, a number of mathematical equations may be used to substitute for those described in order to obtain the desired estimates. Moreover, the locations of the temperature measurements may vary depending upon the structure and arrangement of any given circuit board. Indeed, numerous various modifications will be apparent to those skilled in the art. It is, therefore, intended that all such changes and modifications be covered by the following claims.