Systems and methods for determining motor parameters

The present disclosure provides a system and method to determine at least one parameter of a motor, such as an inductance. The inductance can be determined, such as based on one or more digitally sampled motor winding currents. A digital filter can be applied to the digital samples such as to determine a slope of the motor winding currents. The digital filter can include a least squares fit that can be applied to the digital samples, such as to determine a slope of the motor winding currents. The least squares fit can be determined based on a computation of central tendencies such as an average value of time, an average value of current, an average value of the square of time, and the average value of the product of time and current. The average values can be determined recursively to provide improved computational speed.

FIELD OF THE DISCLOSURE

The present disclosure relates to systems and methods for determining one or more motor parameters such as the inductance in an AC motor such as to provide improved motor control.

BACKGROUND

AC motors are used in wide variety of industrial and consumer applications. A motor converts electrical energy into rotational mechanical energy. An alternating current (AC) motor can include motor windings located on a stationary stator and a rotor that includes current-carrying conductors, permanent magnets, or other means for producing a rotating magnetic field. During operation, alternating currents can be supplied to the motor windings to generate magnetic fields, which in turn can cause the rotor to rotate, such as for turning a motor shaft. In certain motor systems a current control loop can ensure proper operation of a motor, for example by ensuring that a phase current follows a reference. The tuning of parameters in the current control loop can be based on motor parameters such as inductance, resistance, or magnetization. However, since the motor parameters are often unknown, it is often not possible to optimize tuning of the current control loop.

SUMMARY OF THE DISCLOSURE

The present inventors have recognized, among other things, that there exists a need for a technique to quickly and accurately determine motor parameters such as to provide optimal tuning of a current control loop during operation of the motor. For example, a rise time, overshoot, or settling time can be optimized based on the determined motor parameters. Non-linear behavior of the motor can be compensated for based on the determined motor parameters. For example, the torque produced by the motor can be a non-linear function of the motor current because of saturation of the inductance of the motor. In such an example where the inductance is determined, the torque produced by the motor can be compensated to always have a linear relationship with the motor current. Such compensation for non-linear behavior can be important in automotive applications or hoist/crane applications. In certain systems, the current or voltage in the motor windings can be monitored and a fault condition can be triggered if the average value of current or voltage exceeds a threshold so that the motor can be de-energized to avoid unsafe conditions. In many systems, average values of voltage and current can be determined based on sampling once per pulse with modulation (PWM) period and are sufficient for protection. However, in high performance systems, a first derivative of current or voltage may be needed to improve performance. The slope of current in the motor winding currents can indicate when fault conditions exist, because usually, the inductance of the windings limits the slope of the winding current. If a winding is shorted, the inductance of the winding will decrease, thereby increasing slopes of currents and thereby indicating a fault condition. However, the slope of the winding current is prone to noise at high frequency and electrical noise from the power inverter can couple into the feedback path and contribute to errors. The slope of the winding current is, in the general case, not suitable for inductance estimation so alternative approaches that can be used can include AC signal injection, or separate current derivative sensors such as a Rogowski coils. The present inventors have recognized, among other things, that there is a need for an improved technique for determining the slope of current in motor windings and in determining one or more motor parameters such as inductance.

The present disclosure can provide, among other things, an improved technique of determining a motor parameter based on oversampling the current in the motor windings such as to provide optimal tuning of a current control loop during operation of the motor and overload protection.

In an aspect, the disclosure can feature a method for determining at least one motor parameter such as using an adaptive filter in a motor control system. The method can include sampling at least one phase current being supplied to at least one motor winding to form a set of sampled data points. The method can also include analyzing the set of sampled data points with a fitting function. The method can also include selecting at least one fitting window based on at least one phase voltage being switched on and off to the at least one motor winding. The at least one fitting window can be selected to exclude at least one transient component of the at least one phase current and including a subset of the sampled data points. The method can also include filtering the subset of sampled data points corresponding to the at least one fitting window, to determine at least one parameter of the fitting function. The method can also include determining the at least one motor parameter based on the determined at least one parameter of the fitting function. The fitting function can be a linear function. The at least one parameter of the fitting function can include a slope of the linear function. The at least one parameter of the fitting function can include an offset of the linear function. The method can also include determining the slope and offset of the linear function such as based on central tendencies respectively of phase current, time, the product of phase current and time, and the square of time, such as wherein the central tendencies are determined recursively. The method can also include determining the slope and offset of the linear function such as based on a square of a mean value of time, a mean value of a square of time, a product of a mean value of time and a mean value of phase current, and mean value of a product of time and phase current. The at least one fitting window can be determined based on a pulse width modulation synchronization pulse. The at least one fitting window can be further determined based on a switching state of the at least one motor winding. Filtering the subset of sampled data points can include performing a least squares fit. The phase current can be oversampled at a rate of at least two samples per pulse width modulation period. The method can also include determining a phase current for sampled data points corresponding to the at least one transient component based on the fit. The at least one motor parameter can include one or more of an inductance, a resistance, or a magnetization.

In an aspect, the disclosure can feature a motor control system such as for determining at least one motor parameter such as using an adaptive filter. The motor control system can include power circuitry that can be configured to deliver a phase voltage to a motor winding, the phase voltage causing a phase current to flow in the motor winding. The motor control system can also include a current sensor that can be configured to sense the phase current flowing in the motor winding. The motor control system can also include sampling circuitry that can be configured to convert the sensed phase current into a set of sampled data points. The motor control system can also include pulse width modulation timing circuitry such as for controlling the timing of the phase current delivered to the motor winding, the pulse width modulation timing circuitry determining at least one fitting window, the at least one fitting window excluding at least one transient component and including a subset of the sampled data points. The motor control system can also include an adaptive filter that can be configured to filter the subset of sampled data points corresponding to the at least one fitting window, the filtering determining at least one parameter of a fitting function. The motor control system can also include a motor controller that can be configured to determine the at least one motor parameter such as based on the determined at least one parameter of the fitting function. The fitting function can be a linear function. The at least one parameter of the fitting function can include a slope of the linear function. The at least one parameter of the fitting function can include an offset of the linear function. The adaptive filter can be configured to determine the slope and offset of the linear function such as based on central tendencies respectively of phase current, time, the product of phase current and time, and the square of time, such as wherein the central tendencies can be determined recursively. The at least one motor parameter can include one or more of an inductance, a resistance or a magnetization. The at least one motor parameter can include a flux linkage.

In an aspect, the disclosure can feature a method for determining at least one motor parameter such as using an adaptive filter in a motor control system. The method can include sampling at least one phase current being supplied to at least one motor winding to form a set of sampled data points. The method can also include selecting at least one fitting window based on at least one phase voltage being switched on and off between the at least one motor winding, the at least one fitting window selected to exclude at least one transient component of the at least one phase current and including a subset of the sampled data points. The method can also include filtering the subset of sampled data points corresponding to the at least one fitting window, to determine one or more of a slope and offset of a linear function. The method can also include determining the at least one motor parameter based on the determined at least one parameter of the fitting function. The method can also include determining a motor state based on the determined at least one motor parameter. The method can also include determining one or more of the slope and offset of the linear function such as can be based on one or more central tendencies respectively of phase current, time, the product of phase current and time, and the square of time, wherein the central tendencies can be determined recursively.

In an aspect, the disclosure can feature a motor control system for determining at least one motor parameter. The motor control system can include a means for sampling at least one phase current being supplied to at least one motor winding, such as to form a set of sampled data points. The means for sampling can include sampling circuitry, such as inverter feedback circuitry130, analog-to-digital converter155, and/or sample timers140, such that as shown inFIG. 1. The motor control system can also include a means for analyzing the set of sampled data points, such as with a fitting function. The means for analyzing can include an adaptive filter, such as digital filter150, such as that shown inFIG. 1. The motor control system can also include a means for determining at least one motor parameter, such as based on the determined at least one parameter of the fitting function. The means for determining can include motor control circuitry185, such as that shown inFIG. 1.

Further features of the disclosure are provided in the detailed description and the appended claims, which features may optionally be combined with each other in any permutation or combination, unless expressly indicated otherwise elsewhere in this document.

DETAILED DESCRIPTION OF EMBODIMENTS OF THE DISCLOSURE

A current control loop can ensure proper operation of a motor, for example by ensuring that a phase current follows a reference. The tuning of parameters in the current control loop can be based on motor parameters such as inductance, resistance, or magnetization. However, since the motor parameters are often unknown, it is often not possible to optimize tuning of the current control loop. Described below is a method to determine motor parameters such as to provide optimal tuning of a current control loop during operation of the motor.FIG. 1shows an example of a motor control system100. Motor control system100can include a motor105, one or more sensors110, a power inverter115, one or more gate drivers120, control circuitry125, inverter feedback circuitry130, and motor control circuitry185. The power inverter can include one or more transistors116. The inverter control circuitry can include one or more pulse width modulation timers135, one or more sample timers140, a data port145, one or more digital filters150, and an analog-to-digital converter155. The DC bus can be electrically coupled to the power inverter115and the transistors116. The transistors116can be electrically coupled to windings of the motor105. The sensors110can be coupled to the electrical connection between the power inverter115and the motor105. The current sensors can be electrically coupled or magnetically coupled to the connection between the power inverter115and the motor105. Additionally, the current sensors can be electrically coupled to inverter feedback circuitry130. The inverter feedback circuitry130can be electrically coupled to the control circuitry125. The control circuitry125can be electrically coupled to gate drivers120and to motor control circuitry185. The gate drivers120can be electrically coupled to the gates of transistors116. The PWM timers135, sample timers140, data port145, and digital filters150can be electrically connected to one another such as via a common bus. The analog-to-digital converter155can be electrically coupled to the digital filters150and the inverter feedback circuitry130. During operation, the transistors116may receive DC power from the DC supply bus and provide AC power to the motor105. The control circuitry125can provide one or more control signals to the gate drivers120and the gate drivers120can energize the gates of transistors116such as to provide a sequence of electrical pulses to the windings of the motor105such as to cause the rotor of motor105to turn. The sensors110can sense a current or voltage associated with the motor windings and provide the sensed signal to inverter feedback circuitry130. The inverter feedback circuitry130can provide the sensed signal to the analog-to-digital converter155. The analog-to-digital converter155can convert the sensed signal into digital samples. The analog-to-digital converter155can be configured to oversample the sensed signal. The oversampling can include sampling the sensed signal more than once every PWM period. The digital filters150may receive the digital samples and may apply a digital filter to the digitized sensed signal. For example, the digital filters can apply a least mean squares fit to the received signal. The sample timers140may generate timing signals for the PWM timers135, the data port145, the analog-to-digital converter155, and the digital filters150. The sample timer can make use of PWM timing information such as to avoid noise generated by switching of transistors116. The motor control circuitry185can provide high level control algorithms to the control circuitry125such as via the data port145.

FIG. 2shows an example of motor windings200. The motor windings200may include a first motor winding210, a second motor winding220, and a third motor winding230. In an example, the motor200can include any number of windings. The first motor winding may include an inductance La, a resistance Rs, and an electromotive force ea. The second motor winding may include an inductance Lb, a resistance Rs, and an electromotive force eb. The third motor winding may include an inductance Lc, a resistance Rs, and an electromotive force ec. During operation, the PMW timers135may provide one or more timing signals to the gate drivers120, such as which can control the transistors116such as to adjust the voltages applied to the motor windings210,220, and230such as to cause a current to flow in the motor windings, which in turn, causes the rotor of motor105to turn. For example, a motor having three motor windings may have several switching states corresponding to various voltage vectors, including those shown inFIG. 3.FIG. 3shows a table300of voltage vectors and corresponding applied voltages to the motor windings200. For example,FIG. 3shows a voltage vector V100that corresponds to applying a voltage Vdcto the first motor winding210, and applying a voltage of zero to the second motor winding220and the third motor winding230.FIG. 4Ashows an example of a voltage vector V100being applied to the motor windings200, where a voltage Vdcis applied to the first motor winding210, and a voltage of zero volts is applied to the second motor winding220and the third motor winding230.FIG. 4Bshows an example of a voltage vector V110being applied to the motor windings200, where a voltage Vdcis applied to the first motor winding210and the second motor winding220, and a voltage of zero volts is applied to the third motor winding230.FIG. 4Cshows an example of a voltage vector V000being applied to the motor windings200, where a voltage of zero volts is applied to the first motor winding210, the second motor winding220, and the third motor winding230.

FIG. 5shows a conceptual example of a sequence of voltage vectors being applied to the motor windings200to cause the rotor of motor105to turn. The upper portion510ofFIG. 5illustrates voltage vectors that may be applied to the motor windings200plotted as a function of time. The lower portion520ofFIG. 5illustrates the current that may flow in the first motor winding210in response to the applied voltage vectors. In a first region A, a voltage vector V000is applied to the motor windings by applying zero volts to the first motor winding210, zero volts to the second motor winding220, and zero volts to the third motor winding230. In a second region B and a sixth region F, a voltage vector V100is applied to the motor windings by applying a voltage Vdcto the first motor winding210, zero volts to the second motor winding220, and zero volts to the third motor winding230. In a third region C and a fifth region E, a voltage vector V110is applied to the motor windings by applying a voltage Vdcto the first motor winding210, a voltage Vdcto the second motor winding220, and zero volts to the third motor winding230. In a fourth region D, the voltage vector V111is applied to the motor windings by applying a voltage Vdcto the first motor winding210, the second motor winding220, and the third motor winding230.

FIG. 6shows a conceptual example600of a least mean squares fit being applied to a set of digital samples610such as to determine the slope and offset of a phase current travelling through a motor winding. The digital samples610may have a time value (e.g., t0. . . tM) and a phase current value (e.g., Y0. . . YM), and a sampling period of Ts. The digital samples may be provided to the digital filters150by the analog-to-digital converter155. The digital filters150may be configured to determine a slope and an offset of a linear equation having parameters α0and α1. The digital filters150may determine the offset and slope based on the following relationships:

α1=∑k=0M⁢(tk·Yk-(t_)⁢(Y_))∑k=0M⁢(tk2-t_2)α0=Y_-α1·t_
For example, the slope α1can be determined based on the square of an average of time, the average value of time squared, the average value of the product of time and phase current, and a product of the average value of current and the average value of time. The offset α0can be determined based on the average value of phase current, and average value of time, and the determined slope α1. The slope and offset may be determined recursively. The average value of current can be provided to the motor control circuitry185such as for purposes of motor control. The determined slope α1, and the determined offset α0can be provided to the motor control circuitry185, and the motor control circuitry185can determine at least one motor parameter, such as based in part on the provided slope α1, and offset α0. In an example, the time values of the digital samples can be defined such thatt=0. In such an example wheret=0, the offset and slope can be determined by the following relationships:

FIG. 7illustrates an example of a motor winding current waveform during a full PWM switching cycle. The motor winding current waveform700can include digital samples710. The motor winding current waveform can have six distinct regions, each corresponding to a switching state of the power inverter, such as a switching state shown inFIG. 2. Each region of digital samples can be fitted to a linear equation715, such as using a least squares fit. The least squares fit can be applied to a subset of each region such as to avoid including transients associated with changing the voltages being applied to the motor windings200. Motor parameters may be determined based on the determined slope of the motor winding current.

FIG. 7Aillustrates an example of a motor winding current waveform750corresponding to a switching state of the power inverter, such as that shown in region D ofFIG. 7. The motor winding current waveform can include digital samples710, transient regions735, a blanking window736, and a sampling window720. The transients735can occur during a change in a switching state of the power inverter and can adversely affect a least squares fit if applied to a set of digital samples that include the transients735. The blanking window736can define a region, such as where transients may be present in the measured phase current and the sampling window720can be selected to define a region where transients may not be present. Digital samples710can be collected during sampling window720, but not during the blanking window736, such as to avoid transients being included in the digital samples710. A fitting window, such as where a least squares fit can be applied, can include the digital samples710acquired during the sampling window.

FIG. 8illustrates a graph800of a least squares fit to digital samples of a motor winding current. The graph800includes a collection of digital samples810and a line820having a slope and an offset based on the results of the least squares fit.

FIG. 9shows a method of operation of motor control system100for determining at least one motor parameter. The analog-to-digital converter155may oversimple the winding currents provided by the inverter feedback circuitry130such as to acquire digital samples (step910). For example, oversampling can include sampling the winding currents more than once for each switching state of the power inverter115. A fitting window may be determined for each switching state of the power inverter115(step920). The fitting windows may be selected to exclude transient behavior such as can be induced by changes in the transistors116of the power inverter115. A least squares fit may performed on the digital samples (step930). For example, a least squares fit may be performed for each fitting window corresponding to a switching state of the power inverter115. In some embodiments, a slope of the winding current may be determined based on the least squares fit (step940). The least squares fit may be implemented recursively based on a recursive calculation of average values. For example, an average value can be recursively calculated based on the following equation:

Wherex[n], is an average value based on the first through nthdigital samples and n can be in the range of 1 to M, where M is the number of acquired digital samples andx[1]=x[1]. A motor parameter may be determined based on the determined slopes of the winding currents (step950). A system of equations can be determined for each of the applied voltage vectors during operation of the motor105. An inductance of the motor windings can be determined based on the slope of current in the motor windings for two switching states voltage vectors V100and V000). The slope of current in the motor windings may be determined by digitally sampling the current in the motor windings and applying a least squares fit. For a voltage vector V100, the following equations may describe the system shown inFIG. 4A:

For voltage vector V000, the following equations may describe the system shown inFIG. 4C:

The resistance of the motor windings may be neglected and the back emf voltages may be assumed to be the same for the two switching states corresponding to the voltage vectors V100and V000(e.g., eaV000=eaV100=ea, ebV000=ebV100=eb, and ecV000=ecV100=ec). Based on this assumption, the equations describing the system for an applied voltage vectors V100and V000may be simplified as follows:

These equations may be further simplified by defining the following differences in current derivatives:

Based on the defined differences in the current derivatives, the equations describing the system for applied voltage vectors V100and V000may be further simplified as follows:

FIG. 9Bshows a table990of a set of equations for inductances La, Lb, and Lccorresponding to the 6 active voltage vectors.

Where the motor has no saliency, La=Lb=Lc=L, and the inductance may be determined from any of the above simplified equations as follows:

Where the motor has a saliency, La, Lb, and Lcare not equal and an inductance of the motor windings can be determined based on the switching states corresponding to one active voltage vector and V000and by taking into account a position of the rotor. The rotor position can be assumed constant between the two switching states corresponding to applied voltage vectors. The inductances can be expressed as follows:

La=L0+Δ⁢⁢L·cos⁡(2·PP·θr)=L0+Δ⁢⁢L·kaLb=L0+Δ⁢⁢L·cos⁡(2·PP·θr-2⁢π3)=L0+Δ⁢⁢L·kbLc=L0+Δ⁢⁢L·cos⁡(2·PP·θr-4⁢π3)=L0+Δ⁢⁢L·kc
where θrrepresents an angle of the rotor, and PP represents a number of pole pairs. The expressions for the inductances can be further simplified as follows:

La=L0+Δ⁢⁢L·ka=Ld+Lq2+Ld-Lq2·ka=Ld·(1+ka)+Lq⁡(1-ka)2Lb=L0+Δ⁢⁢L·kb=Ld+Lq2+Ld-Lq2·kb=Ld·(1+kb)+Lq⁡(1-kb)2Lc=L0+Δ⁢⁢L·kc=Ld+Lq2+Ld-Lq2·kc=Ld·(1+kc)+Lq⁡(1-kc)2
where Ldrepresents an inductance when the rotor is aligned with the motor windings, and Lqrepresents an inductance when the rotor is aligned with gaps between the motor windings. The above equations describing the inductances can be further simplified as follows:
La=Ld·kad+Lq·kaq
Lb=Ld·kbd+Lq·kbq
Lc=Ld·kcd+Lq·kcq

where

In examples where the rotor position is not known, an inductance of the motor windings can be determined based on the slope of current in the motor windings for three switching states (e.g., voltage vectors V100, V000, and V110). The slope of current in the motor windings may be determined by digitally sampling the current in the motor windings and applying a least squares fit. For a voltage vector V110, the following equations may describe the system shown inFIG. 4B:

The resistance of the motor windings may be neglected and the back emf voltages may be assumed to be the same for the three switching states corresponding to the voltage vectors V100, V000, and V110(e.g., eaV000=eaV100=eaV110=ea, ebV000=ebV100=ebV110=eb, and ecV000=ecV100=ecV110=ec). Based on this assumption, the equations describing the system for applied voltage vectors V110and V000may be simplified as follows:

These equations may be further simplified by defining the following differences in current derivatives:

Based on the defined differences in the current derivatives, the equations describing the system for applied voltage vectors V110and V000may be further simplified as follows:

The three equations above, combined with the three equations determined previously for applied voltage vectors V100and V000may be used to determine the inductances of the motor windings based on the slope of the current in the motor windings and the applied voltage as follows:

If the inductance is changing as a function of current it may indicate a saturation condition. The determined inductances may be used to detect a fault condition such as rotor demagnetization, isolation failure, and winding shorts. Higher order (e.g., non-linear) adaptive filters can be used to fit a non-linear function to the motor winding current such as to determine second order effects on the motor winding current such as one or more switching transients such as can be due to cable capacitance and magnetic core losses.

A resistance of the motor windings, and back emf voltages of the motor windings can be determined based on the following equations:

van=ea+Ra⁢ia+La⁢diadtvbn=eb+Rb⁢ib+Lb⁢dibdtvcn=ec+Rc⁢ic+La⁢dicdt
where vanrepresents the voltage across a first motor winding, such as motor winding210as shown inFIG. 2, iarepresents a current flowing in the first motor winding, earepresents a back emf in the first motor winding, Rarepresents a resistance of the first motor winding, Larepresents an inductance of the first motor winding,

diadt
represents a slope of the current in the first motor winding, vbnrepresents the voltage across a second motor winding, such as motor winding220as shown inFIG. 2, ibrepresents a current flowing in the second motor winding, ebrepresents a back emf in the second motor winding, Rbrepresents a resistance of the second motor winding, Lbrepresents an inductance of the second motor winding,

dibdt
represents a slope of the current in the second motor winding, vcnrepresents the voltage across a third motor winding, such as motor winding230as shown inFIG. 2, icis a current flowing in the third motor winding, ecrepresents a back emf in the third motor winding, Rcrepresents a resistance of the third motor winding, Lcrepresents an inductance of the third motor winding,

dicdt
represents a slope of the current in the third motor w winding. The inductances La, Lb, and Lccan be determined as described above, the currents, voltages, and slopes of currents can be measured as described above, the resistances in the motor windings can be assumed to be equal (e.g., Ra=Rb=Rc) and the back emf in each winding can be expressed as follows:

ea=ke·PP·ωr·sin⁡(PP·θr)eb=ke·PP·ωr·sin⁡(PP·θr-2⁢π3)ec=ke·PP·ωr·sin⁡(PP·θr-4⁢π3)
where ωrrepresents the angular speed of the rotor, θrrepresents the angular position of the rotor and PP represents the number of pole-pairs. Based on the above equations, the resistances R and the back emfs, ea, eb, and eccan be determined. In such an example where motor parameters, such as resistance, inductance, and back emf can be determined, a current control loop of the motor can be tuned, such as based on the determined motor parameters to provide optimal tuning of the current control loop. For example, a rise time, overshoot, or settling time can be optimized based on the determined motor parameters. In such an example where motor parameters, such as resistance, inductance, and back emf can be determined, non-linear behavior of the motor can be compensated for based on the determined motor parameters. For example, a torque produced by the motor can be determined based on the determined inductance and the current control loop can be tuned accordingly to compensate. The above described methods can be used to determine the motor parameters during operation of the motor and can allow for a periodic adjustment of the current control loop parameters to compensate for changes in the motor parameters, such as due to temperature or age.

FIG. 10is a diagram showing an implementation of an adaptive filter1000such as for performing a least squares fit to a set of digital samples of a motor winding current. The linear function may have a slope α1and offset α0. The adaptive filter1000can include an analog-to-digital converter (ADC)1010, summers1020, multipliers1030, combination multiplier and summer1040, and decimator1050. C1and C2can be scalar multipliers and can be equal to 1/(M+1) and 12/(M*(M+1)*(M+2)), respectively, where M is the number of acquired digital samples. During operation, the winding current can be sampled by the ADC1010and converted to a set of digital samples. The digital samples can then be processed by the adaptive filter1000such as to perform a least squares fit such as in accordance with the diagram shown inFIG. 10. The slope α1and offset α0of the linear function can be provided as outputs of the adaptive filter1000where α0and α1can be calculated as follows:

FIG. 11is a diagram showing an implementation of an adaptive filter1100for performing a least squares fit to a set of digital samples of a motor winding current. The linear function may have a slope α1and offset α0. The adaptive filter1100can include an analog-to-digital converter (ADC)1110, one or more summers1120, one or more multipliers1130, and decimator1040. C0, C1and C2can be scalar multipliers and can be equal to 1/(M+1), 12/(M*(M+1)*(M+2)), and M/2 respectively, such as where M is the number of acquired digital samples. During operation, the winding current can be sampled by the ADC1110and converted to a set of digital samples. The digital samples can then be processed by the adaptive filter1100such as to perform a least squares fit such as in accordance with the diagram shown inFIG. 11. The slope α1and offset α0of the linear function can be provided as outputs of the adaptive filter1100where α0, and α1can be calculated as follows: