A New Flux Linkage Estimation with Drift Cancellation Technique for Switched Reluctance Machines

: Assessing the ﬂux linkage is an important feature for electric machines, including switched reluctance machines. However, sensor calibration errors and noise impose a problem known as drift, which is caused by the integration process used to estimate the ﬂux linkage. This paper proposes a ﬂux linkage estimation with a drift cancellation technique. The technique accounts for the switched reluctance machine’s working and driving principles. Simulation and experimental results are used to validate the proposed method. Additionally, a goodness-of-ﬁt analysis is performed to support the outcomes. A R 2 factor of 0.9823 is found between the experimentally and simulation-estimated ﬂux linkage. The results indicate that the method works properly and may be further used in control techniques and iron losses estimation. analysis, M.V.d.P.; Funding acquisition, Investigation, M.V.d.P.; Methodology, M.V.d.P. and T.A.d.S.B.; Project administration, Resources, T.A.d.S.B.; Software, M.V.d.P.; Supervision, T.A.d.S.B.; Visualization,


Introduction
In the past years, switched reluctance machines (SRMs) have increasingly drawn attention for various applications, especially those that require wide speed range operation, such as wind power systems [1] and electric vehicles [2]. The increased activity with SRMs arises from their advantages in industry applications such as low cost, simple structure without windings or rare earth materials in the rotor, ease of construction, high ruggedness, good fault-tolerance ability, and wide speed range operation. However, SRMs also present some disadvantages inherent to their structure and drive principle, such as acoustic noise, high torque ripple, and elevated losses compared to other machines of the same segment. Mitigating these disadvantages has been the focus of many studies, as presented hereafter.
Knowing the stator flux linkage in SRMs is important for many tasks, such as in instantaneous torque control methods based on flux vector orientation [3] and in the assessment of iron losses in SRMs as in [4]. For instance, a classic instantaneous torque control method named direct torque control (DTC) is based on controlling the instantaneous torque and the flux vector magnitude. Some variations of the DTC method have recently been proposed in the literature. In [5] two torque control methods for SRMs are presented and compared, where one of the methods directly uses flux linkage estimation. The authors of [6] apply a fuzzy adaptive DTC, while the authors in [7] optimize the voltage vectors to minimize torque ripple. Furthermore, in [8] a variable flux reference is proposed to enhance the DTC method, and in [9] a model predictive DTC is proposed to reduce torque ripple in SRMs. However, none of these works focus on the difficulties encountered in implementing the method experimentally, such as sensor signal white noise and calibration offset that lead to drift and large flux estimation errors.
Signal drift is a known problem that has been confronted in numerous research fields. Particularly, the authors of [10] proposed an adaptive filter based on least mean square (LMS) is no magnetic coupling between phases, the eddy currents and hysteresis losses are negligible, and the phase resistance is constant. Thus, the equivalent circuit for one SRM phase is derived as in Figure 1. From the equivalent circuit, the voltage equation for one SRM phase may be derived as in Equation (1), where V k , R k and i k are the terminal voltage, electric resistance, and current flowing in the phase k, and λ(θ, i k ) is the position (θ) and current dependent flux linkage.
The second term of Equation (1) may be expanded, resulting in Equation (2), where L k is the phase k inductance and ω is the mechanical speed.
The instantaneous electromagnetic torque produced by one SRM phase (T e,k ) can be calculated as in Equation (3): The total electromagnetic torque (T e ) produced by the machine is given by the sum of the torques produced by all phases as in Equation (4), where m is the number of phases: The torque appears when voltage is applied to the phase terminals of the machine and tends to align the closest rotor pole to the energized stator pole. The coordination of this process leads to rotational acceleration.
Considering the voltage across the phase terminals as given in Equation (1), intuitively, the flux linkage may be estimated with a pure integrator in the form of Equation (5), where λ i is the initial value of the flux linkage in the integration period.

Integration Drift
In SRMs, ideally, the flux linkage of each phase returns to zero at every electric cycle. Thus, λ i is always equal to zero, as can be seen in Figure 2. Figure 2 shows the phase currents, voltages, and flux linkages of a three-phase SRM operating in hysteresis current control with soft-chopping.  However, in order to estimate the flux linkage in real systems, current and voltage sensors must be used along with signal conditioning circuits. These sensors and circuits insert an offset and noise to the real current and voltage values. When this offset and noise are integrated through an electric cycle, the flux linkage does not return to zero and this error is carried to the next integration period as λ i . This gradual change in the signal is known as drift, and may be either positive or negative depending on the offset between the real value and the sensed value.
For instance, consider an SRM operating in the same conditions as in Figure 2. Now let the current and voltage sensor signals have a low-power white noise added to it. Additionally, let an offset proportional to 0.2 A (1.06% of the nominal value) be added to the current sensor signal and an offset proportional to 2 V (2.5% of nominal value) be added to the voltage sensor signal in order to simulate small errors in calibration as presented in Figure 3. If the same flux estimation technique is applied, the flux linkage signal drifts upward as presented in Figure 3. The drift variation depends directly on the offset amplitude and noise power. The long-term drift is caused by the offset, while the short-term variations are caused by the noise. Table 1 There are several solutions for PMSM flux linkage signal drift presented in the literature [14,15,17]. The most basic solution is to take advantage of the cyclic behavior of the flux linkage and add a reset to the pure integrator at every cycle. Although this strategy mitigates the long-term drift, the drift still occurs between the reset cycles, implying that the method is not efficient during transients or highly dynamic operation. Additionally, the rotor position must be measured.
Another common solution is to use an LPF instead of an integrator for estimating the flux. However, this solution is not effective for SRM flux linkage estimation by itself because of the range of frequencies that compose the electric current and terminal voltage.
More complex solutions such as the extended Kalman filter (EKF) are widely applied to mitigate the signal drift problem. The EKF method is capable of eliminating a great part of the white noise influence and completely negates the drift problem, returning a signal with small error [11]. However, it requires knowledge of the machine model to predict the next state of the machine. In the case of SRMs, the model is highly nonlinear and complex, and thus the method requires more computational effort and becomes more challenging to design.
In this paper, a modification to the existing methods is proposed considering the SRM working principle and aiming to achieve straightforward implementation. Simulation and experimental results are presented and discussed to evaluate the method's effectiveness.

Proposed Solution for the Drift Problem
In this section, the adaptations of some of the previously mentioned flux linkage estimation techniques for SRM as well as the proposed method are addressed. Simulation results are presented to evaluate the method's performance.

Resettable Integrator
In order to implement the resettable integrator, a cyclical variable is needed. In this case, since the problem involves a rotational machine, the most reliable variable is the rotor position. The reset action must occur during the moment in which the expected value of flux linkage is zero. This moment may deviate according to the SRM operation (motor or generator), control technique implemented, and operation speed. Thus, the moment of the reset must be carefully chosen.
For a three-phase 12/8 (number of stator/rotor poles) SRM, the electric cycle (T ele ) is 45 • . Considering that the inductance derivative is negative between 0 • and 22.5 • and positive in the other half of the electric cycle. For motor operation the phase should not be energized in the negative derivative of the inductance, that is, energization should occur only between 22.5 • and 45 • . However, depending on the control method applied, the phase might be energized slightly before or after this period.
For this reason, in this paper the integrator resets when the phase position relative to the rotor is greater than 18 • ; this angle is denoted θ rst hereafter.
A simulation was conducted in the same conditions presented in Section 3. The simulation results are presented in Figure 4. Note that the flux linkage signal was kept from drifting in the long term, but between the reset instants the drift still occurred, forcing the flux to deviate from zero according to the voltage and current offsets, which would lead to severe errors in iron loss estimation and control algorithms.

Low-Pass Filters
As suggested in the literature [13], first-order low-pass filters can be applied as integrators with a gain for frequencies much higher than the cutoff frequency (ω >> ω c ).
The LPF filter structure for estimating the flux linkage is presented in Equation (6) Figure 5a shows the estimated flux linkage for the 12/8 three-phase SRM with different cutoff frequencies. From top to bottom, ω c was set to 5000 rad/s, 500 rad/s, 5 rad/s, and 0.5 rad/s. Figure 5b presents a detailed vision of the waveforms contained in the circled area of Figure 5a. The detail images are presented beside their originating figures.  The flux linkage estimate is very sensitive to the choice of cutoff frequency. A low cutoff frequency will lead to an estimator with high settling time, which is undesirable. As the cutoff frequency is increased, the estimation tends to settle in less time, but desired information will be lost if the cutoff frequency is excessively high. Furthermore, low cutoff frequencies lead to offsets in the estimated flux, while high cutoff frequencies lead to negative values of flux linkage. This characteristic makes the usage of LPFs alone inappropriate for flux linkage estimation in SRMs.

Proposed Drift Cancellation Method
As mentioned in Section 3.1.1, the integrator reset nullifies the long-term drift, but the drift between the reset instants remains. Additionally, note in Figure 4 that the short-term drift has an approximately constant slope. The short-term drift's influence in the real signal is determined as the flux linkage value immediately before the integrator reset (λ(θ − rst )). This value can be calculated and compensated during the next integration cycle. The drift's influence in the (n − 1) th period (∆λ n−1 ) is quantified in Equation (7).
A first approach to diminishing the short-term drift is made by adding this value to the calculated flux linkage value (λ c (θ)). However, this will lead to offset values of flux at the beginning of the electric period (T ele ). This happens because the calculated drift influence is added as a constant value to the estimated flux linkage, becoming an offset to the flux linkage value. As a matter of fact, the drift affects the signal not as a constant offset, but as a constant rate change.
Thus, the proposed drift cancellation method consists of calculating the rate of change in the flux linkage value caused by the drift and using it to infer the value that should be added to the estimated flux linkage in each control period (T c ) of the the next integration period (T λ ) in order to cancel the drift effect.
Thus, after calculating the ∆λ n−1 , this value is divided by the number of control periods (N o T ) that fit inside the next integration period to find the incremental offset (g) that should be added at each control period as expressed in Equation (8) The incremental gain addition must guarantee that the flux linkage error is rooted within the next integration period.
The value of N o T depends directly on the machine's angular speed. Nonetheless, consider that the speed change of the machine has a much slower dynamics than the electric period. Therefore, the angular speed of the machine in one electric period (ω T ) can be considered as a constant value during the integration period.
Then, the period T λ can be calculated as in Equation (9): where ∆θ is the angular variation during the integration period. Note that for the implementation, ∆θ is always shorter than the electric angular period (T ele ) of 45 • by ∆θ 0 . During this period, as stated in Section 3.1.1, the expected value of the flux linkage is null, and thus the calculated flux linkage value is set to zero. The value of ∆θ 0 must be sufficiently large to guarantee that the control system has enough time to calculate the incremental gain for the next T λ . Equation (10) shows how ∆θ 0 is calculated, where ω max is the maximum speed of the machine in rad/s and c is a safety coefficient with value greater than 1. In this work, the control period used was 50 µs and the SRM maximum speed was 2000 rpm or 209.44 rad/s. The coefficient c was set to 1.1, resulting in a ∆θ 0 equal to 0.66 • .
Furthermore, at each electric period, the incremental gain must be recalculated. The new gain must consider the gain from the previous iteration. Thus, considering that and substituting Equations (10) and (9) into Equation (8) results in Equation (11): Figure 6 shows the main quantities used in the proposed drift cancellation method. In the figure, λ r is the flux linkage estimated value immediately after the resettable integrator, d ∆λ (θ) is the function that describes the drift effect in the calculated flux linkage value over time, g n is the discrete function that represents the incremental gain that is added to the flux linkage value (λ r ), and λ c is the corrected flux linkage value. Additionally, to minimize the noise effect, an LPF is inserted cascaded to the end of the structure. The cutoff frequency of the LPF has to be high enough to avoid filtering the signal of interest-that is, the frequency must be higher than the maximum switching frequency of the SRM. The final structure has the form presented in Figure  The waveforms of the filtered calculated flux linkage and of the real flux linkage present uncanny similarity. There are small differences in the final portion of some integration cycles, indicating that the influence of noise and offset over the calculated flux linkage changed. Nonetheless, after one integration period, the drift influence (∆λ n−1 ) becomes zero again, indicating that the method works properly.

Implementation Algorithm
In order to implement the proposed method, the integrator and LPF were discretized using the Tustin method [23]. After that, the inverse Z-transform was applied to find the microcontroller implementation form. The implemented integrator had the form presented in Equation (12) and the LPF had the form presented in Equation (13).
The algorithm for implementation is presented in Figure 9. In the algorithm, the flag is used to guarantee that the incremental gain is calculated only once per integration period T λ .  The algorithm is capable of calculating the flux linkage for one SRM phase. To calculate the flux linkage for more phases, the algorithm must be repeated for each phase. That assure that even if the drift effect is different among the SRM phases, the flux calculation for all phases will return an accurate value.

Experimental Evaluation of the Proposed Algorithm
In order to evaluate the proposed algorithm, an experimental bench was assembled. The bench and its components are presented in Figure 10 and divided in two parts. Part (a) shows a DC source set to provided constant 60 V, voltage and current sensors, a three-phase asymmetric half bridge converter, and an oscilloscope to observe the quantities of interest. The communication with the oscilloscope was established through a 12-bit parallel digital-to-analog converter (DAC). The control system was embedded in a DSP TMS320F28335 from Texas Instruments© (Dallas, TX, USA). The control frequency (T c ) was set to 20 kHz. The voltage and current sensors used were the LV20-P and LA55-P, respectively, both from LEM©. Part (b) shows the used SRM, the absolute encoder from RLS©used to acquire position, a torque transducer, and a DC machine (DCM) that could be used as load. A human-machine interface (HMI) was developed in LabView© to control the system. The used SRM had the following parameters: nominal power (P n ) = 1. For better elucidation of the experimental setup, a block diagram of the mounted bench is presented in Figure 11. Note that the DCM was connected to the SRM through a torque transducer in the axle but, since it was not required for the experiment, the DCM imposed no load. The same setup is illustrated in Figure 10. The electric current and voltage from the three phases were acquired by the sensors and these quantities were used to estimate the flux linkage. The entire experiment could be controlled using the HMI. An open loop current hysteresis with soft-chopping control was implemented to validate the proposed method. For the experiment, the turn-on angle (θ on ) was set to 25 • and the turn-off angle (θ o f f ) was set to 44 • . The reference electric current was set to 3.3 A. The DC source was maintained at a constant value of 60 V. The current hysteresis bands were set to ±0.3 A.
In order to experimentally test the proposed method, an offset error was incorporated to the calibration function in the microcontroller. A 0.2 A offset was added to the phase current value and a 2 V offset was added to the phase terminal voltage value. Thus, as the DC source provided constant 60 V, the maximum apparent measured value in the voltage sensor was 62 V and the minimum was 58 V. Similarly, the current observed by the hysteresis controller was 3.3 A, but the actual phase current was 3.1 A.
Firstly, the experiment was realized only with the resettable integrator implemented as discussed in Section 3.1.1. The results are presented in Figure 12. The figure shows the electric current, terminal voltage, position, and calculated flux linkage for phase A. The current was controlled around the reference. The terminal voltage waveform shows that the soft-chopping was working properly. As expected, the long-term drift was mitigated by the integrator reset, but the short-term still remained, causing the baseline of the flux linkage value to increase at a constant rate until the reset occurred. After that, while maintaining the same offset level in the electric current and terminal voltage values, the proposed algorithm for drift cancellation was implemented. The results are presented in Figure 13. The calculated flux linkage had the expected waveform and amplitude, with constant baseline, demonstrating that the method worked properly. With the aim of further examining the performance of the proposed method, three cases are compared in Figure 14: the calculated flux of phase A from the experiment (λA exp), the calculated flux of phase A from the simulation (λc f A sim), and the machine flux when there was no noise and calibration offset from the simulation (λA sim). In order to quantify the performance of the proposed method, a statistical analysis among the waveforms presented in Figure 14 was performed. The analysis comprised the mean absolute error (MAE), the mean squared error (MSE), the R-squared factor (R 2 ), the root mean square error (RMSE) and the sum of squared errors (SSE). The first comparison (named C1 in Table 2) involved the λc f A sim and the λA sim. The results show that the drift problem was mitigated accordingly. The small discrepancies that appeared were generated by the white noise inserted in the simulation.
The second comparison (named C2) was performed between λc f A sim and λA exp. The results are also displayed in Table 2. As expected, this analytical comparison displayed a much larger discrepancy. The main reason for the observed difference is that the model used in the simulation disregarded the mutual inductance between the SRM phases. Figure 15 presents the terminal voltages of phase A (VA) and phase B (VB). Note that when there was a voltage variation in phase B terminals, a proportional voltage was induced in phase A, which is the main contribution of the difference between simulation and experimentally calculated flux linkage. There was also a small discrepancy between the noise present in the experiment and the noise inserted in the simulation. This difference also contributed to the small disparity in the waveforms.
Thus, a third statistical analysis (named C3) was performed, which mostly disregarded the mutual inductance effect by comparing the waveforms only in the time interval between 0.03 s and 0.0357 s. The results are presented in Table 2. The returned values show that during the period where there was a minimal influence of the mutual inductance, the experimentally estimated flux was accurately described by the simulation, inferring that the proposed method had suitable operation.

Conclusions
This paper presented a new flux linkage calculation with a drift cancellation method for switched reluctance machines based on the machine's working principles and characteristics. The method has an easy implementation algorithm and requires low computational effort. A thorough explanation was presented regarding the proposed method and other solutions in the literature. The goodness-of-fit analysis between the flux acquired from machine terminal and the estimated flux, both from the simulation, showed that the method had a good performance, reaching an R 2 of 0.9949. When comparing the estimated flux from simulation and from the experiment, the R 2 was 0.9472, illustrating a much lower similarity. This divergence between the simulation and experimental results comes mostly from not considering the SRM's mutual inductance in the simulation model, but also from the difference between the experimental noise and the simulation noise that was manually inserted. Thus, a third statistical analysis considering the time interval where the mutual inductance influence was minimal showed that the experimentally estimated flux linkage was depicted by the simulation with an R 2 of 0.9823. This and the other goodness-of-fit results indicate that the proposed method works properly and may be used to implement control techniques that require the flux linkage and to assess the iron losses of switched reluctance machines. Furthermore, the method could be modified and implemented in other machine topologies that have an expected zero flux linkage at some point of the electric cycle, such as synchronous reluctance machines.

Conflicts of Interest:
The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analysis, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations
The following abbreviations were used in this manuscript: