Patent Description:
As is known, various types of control systems are used to implement motor control in a variety of applications. For example, in some motor control systems, electromotive force, or back-EMF (BEMF), produced by the spinning motor is measured to determine the position and/or speed of the motor and is fed back to the controller.

In other motor control systems, referred to as vector control or Field Oriented Control (FOC) systems, stator current is controlled in order to thereby control the strength of the magnetic field within the motor to maintain the magnetic field orthogonal with respect to rotor flux. The so-called d-axis, or direct axis, can correspond to the position of the motor and the q-axis, or quadrature axis, is perpendicular to the d-axis. In order to rotate the motor, the applied magnetic field is maintained perpendicular to the d-axis. FOC improves efficiency by providing maximum torque at a given speed with minimum power consumption.

Regardless of the control methodology, some motor control systems employ separate sensors to detect the position and/or speed of the motor for use by the controller. These types of systems can be referred to as "sensor-based" systems. One motor type that generally employs a sensor-based control system is a permanent magnet synchronous motor (PMSM).

In other motor control systems, separate sensors are not used to detect the motor position and/or speed and thus, are sometimes referred to as "sensorless systems. " Such systems include electronic circuitry to estimate motor position and/or speed. One motor type that often employs sensorless control is a brushless DC motor (BLDC).

Motors and their control systems are widely used in automobiles and other safety critical applications. There are a variety of specifications that set forth requirements related to permissible motor control quality levels, failure rates, and overall functional safety.

Electric motors may occasionally stall. For example, an electric motor can become stuck in a particular position or vibrate back and forth (i.e., wobble) due to unexpected load conditions. The ability to correct a stall condition is dependent on accurate detection of the condition.

<CIT> relates to a current coordinate conversion means that converts a phase current detected by a current detection means to a current on orthogonal biaxial coordinates, and an applying voltage control means that outputs a timer value based on the output of the current coordinate conversion means, the output of a DC voltage detection means, and a speed command and d-axis current command from the outside. A PWM generation means outputs PWM signals based on the output of the applying voltage control means. An output voltage estimation means estimates a three-phase voltage outputted to a motor based on the output of the applying voltage control means and the output of the DC voltage detection means. A voltage coordinate conversion means converts the output of the output voltage estimation means to the voltage on the orthogonal biaxial coordinates, and a power consumption calculation means estimates the power consumption of the motor based on the output of the current coordinate conversion means and the output of the voltage coordinate conversion means.

<CIT> discloses a motor driver integrated circuit input/output transfer of various electronic signals used in the control of the DC motor. A voltage comparator circuit senses the operating state of the DC motor by comparing the motor current sense voltage, which is proportional to the torque of the motor, to threshold fixed reference voltages to determine whether the DC motor is running normally or is stalled. The motor driver IC stops or reverses the DC motor when it is stalled.

<CIT> discloses power conversion systems and methods to operate an inverter to drive a motor load through an intervening output filter, a transformer and a cable, including a current regulator to compute a command value according to a current reference value and a motor current feedback value, a cross-coupled feedforward component to compensate the command value by an estimated cross-coupled voltage value to compute a control output value, a cross-coupled object component to compute the motor current feedback value according to a voltage value using a plant transfer function representing the output filter, the transformer, the cable and the motor load, and a controller to provide the inverter switching control signals to control the inverter according to the control output value.

Described herein are motor control apparatus and techniques for detecting motor stall conditions in an FOC control system. Detection is based on comparison of the applied q-axis voltage Vq to one or more thresholds that are generated based on a calculated estimate of the q-axis voltage VqE. Advantages of the described arrangements include stall detection during motor wobbling, detection of inaccurate sensorless control frequency lock, independence from motor parameter variation error (since a motor inductance parameter is not used to estimate the q-axis voltage), relatively low computational intensity and complexity, and improved detection accuracy under start-up and fast transient conditions by using debounce functionality.

According to the disclosure, a motor control system is defined in the independent claim <NUM>.

Features may include one or more of the following individually or in combination with other features. The stall detector may include a threshold generator configured to generate a high threshold and a low threshold based on the estimate of the q-axis voltage for comparison to the applied q-axis voltage. The stall detector may further include a timer and the stall detector may be configured to reset the timer if the applied q-axis voltage becomes less than the high threshold or greater than the low threshold. The stall detector can be configured to generate a stall signal indicating the stall condition of the motor in response to detection of the stall condition. The stall detector can include a debounce filter configured to generate the stall signal. The stall detector can be configured to calculate the estimated q-axis voltage according to the following: <MAT> R Iq + WrKt, where Wr is an observed motor speed, Kt is a BEMF constant, Iq is the applied q-axis current, and R is a motor phase resistance. The FOC controller can include a position and frequency observer configured to generate a motor position estimate Θ and the observed motor speed Wr. A current measurement circuit can be coupled to one or more of the plurality of windings to measure a current through the windings. Each of the d-axis control loop and the q-axis control loop of the FOC controller can include a Proportional-Integral (PI) unit.

Also described is a method as defined in the independent claim <NUM>.

Features may include one or more of the following individually or in combination with other features. The method may further include generating the threshold based on programable variables. Generating the threshold may include generating a high threshold based on a high programmable variable and generating a low threshold based on a low programmable variable. Detecting the stall condition may include resetting a timer when the applied q-axis voltage becomes less than the high threshold or greater than the low threshold. The method may further include generating a stall signal indicating detection of the stall condition. Generating the stall signal can include using a debounce filter. Calculating the estimated q-axis voltage may include using the following: <MAT> where Wr is an observed motor speed, Kt is a BEMF constant, Iq is the applied q-axis current, and R is a motor phase resistance.

Also described is a motor control system for controlling operation of a motor having a plurality of windings, the motor control system including a Field Oriented Control (FOC) controller configured to generate a PWM signal for coupling to the gate driver based on a received demand signal and including a d-axis control loop configured to generate an applied d-axis voltage and a q-axis control loop configured to generate an applied q-axis voltage and means for detecting a stall condition of the motor based on an estimate of the q-axis voltage. The stall condition detecting means may include means for calculating an estimate of the q-axis voltage, means for generating a threshold based on the estimate of the q-axis voltage, and means for comparing the applied q-axis voltage to the threshold.

The foregoing features may be more fully understood from the following description of the drawings. The drawings aid in explaining and understanding the disclosed technology. Since it is often impractical or impossible to illustrate and describe every possible embodiment, the provided figures depict one or more illustrative embodiments. Accordingly, the figures are not intended to limit the scope of the broad concepts, systems and techniques described herein. Like numbers in the figures denote like elements.

Referring to <FIG>, a motor control system <NUM> includes an FOC controller <NUM>, an inverter and current sensing block <NUM>, and a stall observer <NUM> arranged control a motor <NUM>. Motor <NUM> has a plurality of windings and voltages <NUM> are applied to the windings by the inverter block <NUM>. The FOC controller <NUM> includes a d-axis control loop configured to generate an applied d-axis voltage Vd <NUM> and a q-axis control loop configured to generate an applied q-axis voltage Vq <NUM>. A gate driver of the FOC controller <NUM> can include a Space Vector Pulse Width Modulation (SVPWM) block <NUM> that provides control signals <NUM> (i.e., PWM signals) to switches of the inverter block <NUM> to control the motor winding voltages <NUM> in order to achieve a desired speed corresponding to a user-provided speed demand signal Wr* <NUM>.

According to the disclosure, stall observer <NUM> (referred to herein alternatively as stall detector <NUM>) is configured to calculate an estimate of the q-axis voltage VqE, generate one or more thresholds based on the estimated q-axis voltage, and compare the applied q-axis voltage Vq to a threshold in order to detect a stall condition of the motor. The stall detector <NUM> can include a threshold generator configured to generate a high threshold VqEH and a low threshold VqEL for comparison to the applied q-axis voltage Vq. With this arrangement, stall conditions of the motor can be detected and a stall condition signal, or simply stall signal <NUM> can be generated to provide an indication of whether or not a stall condition has occurred. The stall signal <NUM> can be provided to circuits and systems configured to take action, such as turn off and/or restart the motor.

Current <NUM> through the motor windings can be measured by current sensing circuitry of block <NUM>. Various circuity is possible for this purpose. For example, one or more sense resistors can measure the current <NUM> through one more motor windings. Such a so-called "shunt resistor" has a relatively low resistance to avoid significant effects on the motor current. It will be appreciated that it is not necessary to measure all three phase currents since the sum of the three phase currents equals zero and thus, the third current can be calculated as the negative sum of two measured winding currents.

The d-axis control loop of the FOC controller <NUM> can include a converter <NUM> responsive to the measured phase current <NUM> and also to an observed motor position signal Θr <NUM>, a summation element <NUM>, and a Proportional-Integral (PI) control unit <NUM> in order to generate the applied d-axis voltage Vd <NUM>. The observed motor position signal Θr <NUM> is described further below, but suffice it to say here that this signal is representative of an estimate of the observed rotor position. The d-axis feedback current Id <NUM> can be coupled to summation element <NUM> with which a d-axis reference current signal <NUM> Id* can be summed with the feedback current (i.e., a difference is determined); however, in applications in which field weakening is not applied, the d-axis reference current signal <NUM> Id* can be set to zero. An output of the summation element <NUM> provides a signal <NUM> for coupling to the PI control unit <NUM>. PI control unit <NUM> is configured to apply proportional integral control to signal <NUM> in order to generate the applied d-axis voltage signal Vd <NUM>. Thus, when the d-axis reference current signal <NUM> Id* is zero, the signal <NUM> is equal to the d-axis feedback current Id <NUM> and the applied d-axis voltage <NUM> is a proportional integral representation of the d-axis feedback current Id <NUM>.

The q-axis control loop of the FOC controller <NUM> can include converter <NUM>, a summation element <NUM>, and PI control unit <NUM> in order to generate the applied q-axis voltage signal Vq <NUM>. More particularly, converter <NUM> generates a q-axis feedback current Iq <NUM> that controls motor torque output and can be coupled to summation element <NUM> with which a q-axis reference current signal Iq* <NUM> is compared to the q-axis feedback current signal Id <NUM> (i.e., a difference is determined) in order to generate a signal <NUM> for coupling to the PI control unit <NUM>. The q-axis reference current signal <NUM> Iq* can be generated by taking a difference (e.g., with a summation element <NUM>) between the speed demand signal Wr* <NUM> and an observed speed signal Wr <NUM>. PI control unit <NUM> is configured to apply proportional integral control to signal <NUM> in order to generate the applied q-axis voltage signal Vq <NUM>.

Converter <NUM> can implement Clarke transformation or other processing in order to convert the motor winding current Ia, b, c <NUM> into two-dimensional orthogonal stationary quantities iα, iβ and can also apply a Park transformation to convert the two-axis stationary system iα, iβ into a two-axis rotating system iq, id, where the d-axis current is aligned with the rotor flux and the q-axis current (the torque-producing component) is orthogonal to the rotor flux. The observed motor position signal Θr <NUM> is used by the converter <NUM> for the transformation from the three-phase motor winding current Ia, b, c <NUM> into the two-dimensional quantities iα, iβ.

A converter <NUM> is coupled to receive the applied d-axis voltage Vd <NUM>, the applied q-axis voltage Vq <NUM>, and the observed motor position signal Θr <NUM> and is configured to convert these control signals from the d, q domain into three-phase motor control signals <NUM> for coupling to the SVPWM block <NUM>. For example, converter <NUM> can implement an inverse Park transform to convert the two-axis rotating signals Vq, Vd into a stationary two-axis system and ultimately into three axis signals <NUM>. With this arrangement, the outputs of the PI control unit <NUM> (i.e., the applied d-axis voltage signal Vd <NUM> and the applied q-axis voltage signal Vq <NUM>) are rotated back into the stationary reference frame using the transformation angle to obtain quadrature voltage values, Vα and Vβ. Voltages Vα and Vβ are then mathematically transformed back into three phase-voltages Va, Vb, and Vc, which determine the new PWM duty-cycle. The observed motor position signal Θr <NUM> is used by the converter <NUM> for the transformation from the two-dimensional quantities Vα and Vβ into the three-phase voltages Va, Vb, and Vc <NUM>.

Speed demand signal Wr* <NUM> can be a user provided input received from an external device and, in general, is indicative of a requested speed of motor <NUM>. Speed demand signal Wr* <NUM> can be provided in a variety of formats, for example, a Single Edge Nibble Transmission (SENT) format, a Serial Peripheral Interface (SPI) format, a Local Interconnect Network (LIN) format, a CAN (Controller Area Network) format, an Inter-Integrated Circuit (I<NUM>C) format, or other signal formats. Speed demand signal Wr* <NUM> can be a voltage signal having a selected voltage value indicative of a desired speed of motor <NUM>. Speed demand signal Wr* <NUM> may also be a pulse width modulated (PWM) signal having a selected duty cycle that represents the desired speed of motor <NUM>. In embodiments in which speed demand signal Wr* <NUM> is a PWM signal, the duty cycle of the PWM control signals <NUM> may be proportional to the duty cycle of speed demand signal. Further, speed demand signal Wr* <NUM> can be a digital signal having a digital value representative of the desired speed of motor <NUM>.

A position and frequency observer <NUM> can generate the observed motor position signal Θr <NUM> and the observed speed signal Wr <NUM> in response to the applied d-axis voltage <NUM> and the applied q-axis voltage <NUM>, the d-axis feedback current Id <NUM> and the q-axis feedback current Iq <NUM>, and also in response to a motor resistance value R and a motor reluctance value L (labeled collectively <NUM>). The motor resistance R and motor reluctance L can be user programmable, as may be based on specifications of the motor <NUM>. Observer <NUM> may include neural network based "on-line" learning, a model reference adaptive system (MRAS), Kalman filters, an adaptive non-linear flux observer, and/or a sliding mode observer. As noted above, the observed motor position signal Θr <NUM> can be used by converter <NUM> to provide a transformation angle for the signal conversions and the observed speed signal Wr <NUM> can be used to generate the q-axis reference current signal <NUM> Iq*.

As noted above, stall detector <NUM> is configured to calculate an estimate of the q-axis voltage VqE, generate one or more thresholds based on the calculated estimate of the q-axis voltage, and compare the applied q-axis voltage Vq <NUM> to the threshold in order to detect a stall condition of the motor. To this end, stall detector <NUM> can be responsive to the applied q-axis voltage Vq <NUM>, the q-axis feedback current Iq <NUM>, and also to a motor winding resistance value R and a bemf constant Kt (collectively labeled <NUM>) as explained below.

Stall detector <NUM> can include a processor <NUM> with which the estimate of the q-axis voltage VqE is calculated. The q-axis voltage VqE can be estimated based on equation (<NUM>): <MAT> where R represents the resistance of a motor phase in ohms, Iq is the q-axis current <NUM> in amps, Wr is provided by the observed rotor speed signal <NUM> in radians/second, Ld is the d-axis inductance of one motor phase in Henrys as may be a user programmable value, Id is the d-axis current <NUM> in amps, Kt is a bemf constant in V/(rad/s) as may be a user programmable value, Lq is the q-axis inductance of one motor phase in Henrys as may be a user programmable value, and ρ represents the rate of change (i.e., the derivative) of the product of Lq and Iq.

Equation (<NUM>) can be simplified by not applying field weaking (i.e., by setting Id* = <NUM>) and by assuming no change in the Iq parameter at steady state (i.e., ρ is approximately zero). The resulting simplified calculation of the estimate of the q-axis voltage VqE is given by the following equation (<NUM>): <MAT> Advantageously, simplification of the calculation of the estimate of the q-axis voltage VqE in this manner can minimize processing complexity and time in the microcontroller <NUM>. It will be appreciated by those of ordinary skill in the art however, that the additional terms of equation (<NUM>) that drop out of equation (<NUM>) could, alternatively be used if desired.

Stall detector <NUM> can compute the estimate of the q-axis voltage VqE at various times and rates, such as once per motor control cycle (i.e., PWM cycle). In an example embodiment, such an update rate can be between approximately <NUM> and <NUM>. It will be appreciated by those of ordinary skill in the art however, that this range is an example only and can be varied to suit particular application requirements. The q-axis voltage estimate thus computed can be stored in a memory, such as an EEPROM.

Processor <NUM> can generate one or more thresholds, or threshold values to which the applied q-axis voltage Vq <NUM> can be compared. For example, processor <NUM> can generate a high threshold VqEH and a low threshold VqEL based on the estimated q-axis voltage VqE. In embodiments, the high and low thresholds can be generated as follows: <MAT> <MAT> where KH and KL are high and low threshold variables, respectively. As an example, KH can be between <NUM> and <NUM> and KL can be less than one. In some embodiments, the high and low threshold variables KH and KL can be tuned during manufacture. For example, these variables KH and KL can be adjusted until there is no detection of a stall condition during normal operation. The thresholds thus generated VqEH and VqEL can be stored in EEPROM.

As used herein, the terms "processor" and "controller" are used to describe electronic circuitry that performs a function, an operation, or a sequence of operations. The function, operation, or sequence of operations can be hard coded into the electronic circuit or soft coded by way of instructions held in a memory device. The function, operation, or sequence of operations can be performed using digital values or using analog signals. In some embodiments, the processor or controller can be embodied in an application specific integrated circuit (ASIC), which can be an analog ASIC or a digital ASIC, in a microprocessor with associated program memory and/or in a discrete electronic circuit, which can be analog or digital. A processor or controller can contain internal processors or modules that perform portions of the function, operation, or sequence of operations. Similarly, a module can contain internal processors or internal modules that perform portions of the function, operation, or sequence of operations of the module.

Processor <NUM> is configured to compare the applied q-axis voltage Vq <NUM> to the thresholds VqEH and VqEL in order to detect a stall condition of the motor and thus, may be considered to include a so-called comparator. More particularly, processor <NUM> determines whether or not the applied q-axis voltage <NUM> is greater than the high threshold VqEH or lower than the low threshold VqEL. It will be appreciated by those of ordinary skill in the art that the comparison function can be comprised of a digital circuit (e.g., processor <NUM>) having an output signal with at least two states indicative of an input signal being above or below a threshold level, respectively, or a digital value being above or below a digital threshold value (or another digital value), respectively. Alternatively, such comparison function can be implemented with an analog comparator having a two-state output signal indicative of an input signal being above or below a threshold level.

Stall detector <NUM> can further include a timer <NUM> and a debounce filter <NUM> for use in generating stall condition signal <NUM>. As will be explained further below, a stall condition of the motor can be detected if the applied q-axis voltage Vq <NUM> remains greater than the high threshold VqEH or less than the low threshold VqEL for more than a predetermined timeout interval of the timer <NUM>. By "predetermined" it is meant that the value is set, or fixed, in the factory at the time of manufacture, or by external means, e.g., programming, thereafter. For example, the timeout interval may be user programmable. The stall detector <NUM> can be configured to reset the timer <NUM> if the applied q-axis voltage Vq <NUM> having been greater than the high threshold VqEH then falls below the high threshold or if the applied q-axis voltage having been less than the low threshold VqEL increases to exceed the low threshold.

Use of the debounce filter <NUM> can prevent misdetection of stall conditions during start-up and fast transient conditions when conditions may cause the applied q-axis voltage Vq <NUM> to exceed the high threshold VqEH or fall below the low threshold VqEL spuriously for reasons other than an actual motor stall condition. Debounce functionality will be described further below in connection with <FIG>. Suffice it to say here that during start-up and under fast transient conditions, the applied q-axis voltage Vq <NUM> can rise quickly (e.g., because the applied q-axis voltage Vq is based in part on the estimated rotor position signal Θr <NUM> and such estimate may not be accurate immediately following power up or during a transient) and the computed estimate of the q-axis voltage VqE can lag slightly. Transient conditions can include but are not limited to going from a low speed to a maximum speed or a fast deceleration to a slow speed from a high speed for example. The combination of high threshold VqEH and debounce filter time can prevent false detection of a stall condition during transient and start-up.

Stall detection in the described manner provides several advantages including, but not limited to stall detection during motor wobbling, detection of inaccurate sensorless control frequency lock, independence from motor parameter variation error (since a motor inductance parameter is not used), relatively low computational intensity and complexity, and improved detection accuracy under start-up and fast transient conditions by using debounce functionality.

It will be appreciated by those of ordinary skill in the art that the illustrated delineation of blocks and their functionality are illustrative only and that implementation of the stall detector <NUM> can be varied according to design considerations. Further, while electronic circuits shown in figures herein may be shown in the form of analog blocks or digital blocks, it will be understood that the analog blocks can be replaced by digital blocks that perform the same or similar functions and the digital blocks can be replaced by analog blocks that perform the same or similar functions. Analog-to-digital or digital-to-analog conversions may not be explicitly shown in the figures, but should be understood.

It will also be appreciated by those of ordinary skill in the art that components of the motor control system <NUM> can be implemented in various forms. For example, in some embodiments, the FOC controller <NUM> and the stall detector <NUM> are implemented in an integrated circuit (IC) as shown in the example motor controller of <FIG>.

Referring also to <FIG>, a flow diagram of a method <NUM> for detecting a motor stall condition is shown. The method begins at bock <NUM> in which stall control commences and a timer (e.g., timer <NUM> in <FIG>) is reset. The first time the method <NUM> is performed is when a command to run the motor is initiated. As noted, the stall detection process <NUM> can be performed at various times and at rates. For example, the process <NUM> can be performed once per motor control period.

At block <NUM>, an estimate of the q-axis voltage VqE is calculated as explained above in connection with equation (<NUM>). After the first time that the process <NUM> is performed (i.e., after the first PWM cycle), the process <NUM> commences with block <NUM> (i.e., the timer is not initiated again in block <NUM>).

At block <NUM>, one or more thresholds are generated. For example, high and low thresholds VqEH and VqEL may be generated based on the estimate of the q-axis voltage VqE as described above in connection with equations (<NUM>) and (<NUM>), respectively.

At block <NUM>, it is determined whether or not a timeout has occurred (i.e., whether or not the timer has reached a predetermined time). In an example embodiment, the timeout interval can be on the order of five PWM cycles. The timeout interval can be user programmable or predetermined or preset.

If the timeout has occurred, then a stall condition is detected at block <NUM>, following which the stall control process terminates at block <NUM>. Detection of the stall condition may include generating the stall signal <NUM> (<FIG>).

If it is determined at block <NUM> that the timeout has not occurred, then the applied q-axis voltage Vq <NUM> (<FIG>) is compared to the high and low thresholds VqEH, VqEL at block <NUM> to determine if the applied q-axis voltage Vq <NUM> is greater than the high threshold VqEH or less than the low threshold VqEL. If the applied q-axis voltage Vq <NUM> is not greater than the high threshold VqEH and is not less than the low threshold VqEL, then the timer is reset at block <NUM>. On the other hand, if it is determined at block <NUM> that the applied q-axis voltage Vq <NUM> is greater than the high threshold VqEH or less than the low threshold VqEL, then the stall control process terminates at block <NUM>.

With the described process <NUM>, if the applied q-axis voltage Vq <NUM> is higher than high threshold VqEH or lower than the low threshold VqEL for longer than the programmable timeout period or interval, then a stall condition is detected; whereas, if the condition changes before the timeout period, then the timer is reset (at block <NUM>), and a stall condition needs to be persistent for another full timeout period before detection of the stall condition is triggered. In this way, the method <NUM> provides a debounce function in order to avoid falsely detecting a stall condition, such as may be particularly likely to occur at start-up or in response to a transient condition.

When a motor stall condition occurs, the estimated q-axis voltage VqE can be substantially higher or lower than the applied q-axis voltage Vq <NUM>. Further, the q-axis current Iq <NUM> generally will be much higher than under normal operating conditions for a given applied q-axis voltage Vq. Thus, in this stall scenario, the q-axis voltage <NUM> will fall below the low threshold VqEL and therefore the stall condition will be detected. In another scenario in which the applied motor speed is lower than the sensorless estimation, and the controller fails to see it (i.e., as may occur due to inaccurate sensorless control frequency lock), the estimated q-axis voltage VqE will be large again (as it is based in part on the estimated motor speed according to equation <NUM>) and therefore, the applied q-axis voltage Vq will fall below VqEL again, thereby triggering a stall condition detection.

In a motor wobbling scenario in which the motor <NUM> wobbles back and forth, the q-axis current Iq <NUM> will be much higher than under normal operating conditions since the motor needs much higher torque each time the rotation direction changes. This scenario results in the applied q-axis voltage Vq <NUM> falling below the low threshold VqEL, thereby triggering a stall condition detection.

As noted above, during start-up and under fast transient conditions, the applied q-axis voltage Vq <NUM> can rise quickly (e.g., because the applied q-axis voltage Vq is based in part on the estimated rotor position signal Θr <NUM> and such estimate may not be accurate immediately following power up or during a transient) and the computed estimate of the q-axis voltage VqE can lag slightly. Under these conditions, the applied q-axis voltage Vq can exceed the high threshold VqEH, thereby triggering a stall detection.

It will be appreciated that the rectangular elements (typified by element <NUM>) are herein denoted "processing blocks" and the diamond-shaped elements (typified by element <NUM>) are herein denoted "decision blocks" and either or both may represent computer software instructions or groups of instructions. It should be noted that the flow diagram of <FIG> represents an example embodiment disclosed herein and variations which generally follow the process outlined, are considered to be within the scope of the concepts, systems and techniques described and claimed herein. Some or all of the blocks may represent operations performed by functionally equivalent circuits. Also, some blocks may be manually performed while other blocks may be performed by machine. The flow diagram does not depict the syntax of any particular programming language. Rather, the flow diagram illustrates the information one of ordinary skill in the art requires to fabricate circuits and/or to generate computer software to perform the processing required of the particular apparatus. It should be noted that many routine program elements, such as initialization of loops and variables and the use of temporary variables are not shown. It will be appreciated by those of ordinary skill in the art that unless otherwise indicated herein, the particular sequence described is illustrative only and in instances can be varied without departing from the spirit of the concepts described and/or claimed herein. Thus, unless otherwise stated, the processes described below are unordered meaning that, when possible, the actions shown in the diagrams can be performed in any convenient or desirable order, including simultaneously.

Referring also to <FIG>, an example motor control system <NUM> includes an FOC controller <NUM>, an inverter <NUM>, and a stall observer <NUM> arranged to control a motor <NUM>. Motor control elements of the system <NUM> can be implemented in the form of an integrated circuit as represented by box <NUM> having connections (e.g., pins or terminals) for providing and receiving signals to and from other parts of the control system and to other external circuits and systems. The FOC controller <NUM> can be the same as or similar to FOC controller <NUM> of <FIG> and the stall observer <NUM> can be the same as or similar to stall observer <NUM> of <FIG>. It will be appreciated by those of ordinary skill in the art that the delineation of which elements are internal versus external with respect to controller IC <NUM> can be varied.

Motor <NUM> has a plurality of windings and voltages are applied to the windings by the inverter <NUM>. Although shown as a three-phase motor, motor <NUM> could include more or fewer phases, in which case motor controller <NUM> can be adapted to control a motor with more or fewer than three phases. The illustrated inverter <NUM> includes a plurality of switches Q1 - Q6 (e.g., Field Effect Transistors, or FETs) arranged in half-bridge configurations, with each half-bridge (i.e., Q1/Q2, Q3/Q4, and Q5/Q6) generating a drive signal for a corresponding phase of the motor. A gate driver <NUM> can be the same as or similar to SVPWM circuit <NUM> of <FIG> and thus, provides control signals (i.e., PWM signals) to switches Q1 - Q6 of the inverter <NUM> to control current through the motor windings in order to achieve a desired speed. PWM control signals can be selectively coupled to gate terminals of the switches Q1 - Q6 through high side gate drive output terminal GHx and low side gate drive output terminal GLx. More particularly, power is provided to motor <NUM> by turning on an upper transistor (e.g., one of transistors Q1, Q3 and Q5) in a given half-bridge circuit to couple supply voltage VBB through the upper transistor to the motor, and turning on a lower transistor (e.g., one of transistors Q2, Q4 and Q6) in another half-bridge circuit to couple ground voltage GND through the lower transistor to motor, thereby allowing current to flow through a corresponding winding of motor.

The desired speed can be a user input provided at a speed control terminal PWM/SPD in the form of a PWM_in signal (as may be the same as or similar to speed demand signal Wr* <NUM> of <FIG>). The PWM_in signal can be stored in EEPROM <NUM> and can be coupled to additional blocks <NUM> with which a selectable speed control mode is controlled. For example, in a PWM mode, motor speed can be controlled by a duty cycle of the PWM_in signal, in an analog mode, motor speed can be controlled by the amplitude of the analog voltage applied to the PWM/SPD pin, in a clock mode, motor speed can be controlled by the frequency of the input clock, and in a standby mode, all circuitry (other than the charge pump and VREG) can be turned off. Controller IC <NUM> can include a terminal LSS for coupling to the low side source of the switches, as shown.

Motor phase current can be sensed by a sense resistor <NUM> for coupling to the controller IC <NUM> at inputs SENP and SENN. A current amplifier <NUM> can amplify the sensed motor current for coupling the sensed current (that may be the same as or similar to current signal <NUM> of <FIG>) to the FOC controller <NUM>.

Controller IC <NUM> can receive a supply voltage at a VBB terminal as may be provided by an external +48V source. The supply voltage can also be coupled to a VIN terminal for coupling to a power loss brake unit <NUM> that can operate to slow down the motor <NUM> if there is a loss of input power. A bias voltage can be generated by an external inductor and capacitor and can be coupled to one or more regulators <NUM> through a VBIAS terminal. For example, the VBIAS terminal can be coupled to an external Buck regulator <NUM> including an inductor and capacitor as shown. A switch terminal SW can be coupled to a switch (not shown) of the Buck regulator <NUM>. Regulators <NUM> can generate regulated voltages for powering on-chip circuitry and also for providing a reference volage at a VREF terminal.

Controller IC <NUM> can include a memory and control logic block <NUM> as may include EEPROM or other type of non-volatile memory to store parameters related to operation of the motor <NUM> and control logic to store various values and parameters and control certain functions. Additional terminals of the controller IC <NUM> can include an FG/RD output at which speed information (FG) or rotation detection information (RD) can be provided based on a selectable function that can be programmed through EEPROM <NUM>. An Nbrake terminal can receive an external signal to control motor braking function. A system clock reference signal can be received at an ROSC terminal for coupling to an internal system clock unit <NUM>.

Faults can be reported at an nFLT terminal in response to signals from control logic <NUM>. For example, stall detection can be reported at the nFLT terminal based on operation of the stall observer <NUM>. Other faults may also be detected and reported, such as overcurrent, overvoltage, and undervoltage conditions.

Claim 1:
A motor control system (<NUM>) for controlling operation of a motor (<NUM>) having a plurality of windings, the motor control system (<NUM>) comprising:
a gate driver (<NUM>) to provide a control signal to one or more switching elements (Q1 - Q6) controlling a voltage applied to the plurality of windings;
a Field Oriented Control (FOC) controller (<NUM>) configured to generate a PWM signal for coupling to the gate driver (<NUM>), wherein the FOC controller (<NUM>) comprises a d-axis control loop configured to generate an applied d-axis voltage and a q-axis control loop configured to generate an applied q-axis voltage; characterized in that
a stall detector (<NUM>) configured to calculate an estimate of the q-axis voltage and compare the applied q-axis voltage to a threshold based on the estimate in order to detect a stall condition of the motor (<NUM>),
wherein the stall detector (<NUM>) comprises a timer (<NUM>) and the stall condition of the motor is detected if the applied q-axis voltage remains greater than a high threshold or less than a low threshold for more than a predetermined timeout interval of the timer.