You are on page 1of 6

Design of Motor Shaft Power Meter Based on Phase

Detection Using Improved All Phase FFT


Xinqiao Jiang1, Hongtu Xie1,*, Kang Liang1 Jintang Li1, Guoqian Wang2,*, Ni Xie3
3
1
School of Electronics and Communication Engineering, Sun School of Business, Hunan University of Science and
Yat-sen University, Guangzhou 510275, China Technology, Xiangtan 411201, China
2 *
Sun Yat-sen Memorial Hospital, Sun Yat-sen University, Hongtu Xie and Guoqian Wang are the corresponding
Guangzhou 510120, China authors. xiehongtu@mail.sysu.edu.cn

accuracy of the FFT, APFFT, and improved APFFT


2020 Chinese Automation Congress (CAC) | 978-1-7281-7687-1/20/$31.00 ©2020 IEEE | DOI: 10.1109/CAC51589.2020.9327102

Abstract—This paper presents a measurement scheme of


the motor shaft power based on the phase detection using the methods depends on the frequency resolution. Thus, the
improved all phase fast Fourier transform (APFFT). This improved APFFT method is preferring to be applied to the
method can measure the phase difference and frequency of the system design.
output signals from the torque-speed sensor connected to the The organization of this paper is listed. The hardware
motor, which are proportional to the torque and revolving design of the system is given in Section II, the software
speed, respectively. A signal processing circuit is proposed to
design of the system is presented in Section III. Second IV
stabilize the amplitude of the output signals from the torque-
speed sensor which fluctuates with the change of operating
gives the conclusion.
states of the motor. In addition, STM32 single-chip computer is
applied to sample the output signals, and an improved APFFT II. HARDWARE DESIGN OF THE SYSTEM
method is performed on this microprocessor, which can detect
the phase with a high measurement accuracy. It is proved that A. Basic structure of the system
the improved APFFT method is immune to the interference of The basic structure of the system is shown in Fig.1.
the harmonic and direct current noise, and it has a high
Firstly, the torque-speed sensor connected with the motor
accuracy when the Gaussian noise is not server. Experiment
transforms the torque and revolving speed of the motor into
results are shown to prove the validity of the proposed scheme.
the frequency and phase difference between the output
Keywords—Improved all phase fast Fourier transform signals of the sensor. The amplitude of two sinusoidal
(APFFT), motor shaft power measurement, phase detection signals from the sensor is related to the speed of the motor,
thus the amplitude of the sinusoidal signal fluctuates when
the sensor works. For this reason, it is necessary to stabilize
I. INTRODUCTION the output signals of the sensor through the signal
Motor is an important tool in the industrial production. processing circuit. Ideally, under the effect of the signal
Motor shaft power refers to the power provided to the load, processing circuit, the amplitude of the sine signals is
which plays an important role in the industrial production basically unchanged in different working states of the
assessment. However, in the practice, the calculation of the motor, which is convenient for the synchronous sampling of
motor shaft power usually depends on the experience and the sine signals. Lastly, the STM32 single-chip
estimation of the engineers, which may be inaccurate. microcomputer is used to sample the sinusoidal signals, then
the phase difference and frequency can be measured through
If the loss characteristics and input power of the motor APFFT operation performed on the obtained samples. So,
could be obtained, it is easy to calculate the shaft power. the shaft power could be computed and obtained according
Due to the difference of the loss characteristics of the actual to the value of phase difference and frequency.
motor, the measurement accuracy could not satisfy the
demand of the scientific research and practical application
[1]. Motor shaft power can also be calculated by the torque
and revolving speed obtained by the linear charge coupled
device. However, this method requires the good equipment Fig.1. Basic structure of the system
and environmental condition [2]. The existing methods are
based on the measurement of the torque and speed through
the torque-speed sensor. The measurement accuracy of this
kind of methods depends on the measurement accuracy of
the frequency and phase difference of the sine signals from
the sensor, because the frequency and phase difference are
proportional to the revolving speed and torque, respectively.
Due to the problem of the spectrum leakage, the phase
measurement error of the fast Fourier transform (FFT) is
big, which needs to be revised. The phase measurement
accuracy of the all phase FFT (APFFT) is high, whose
computation complexity is similar to that of the FFT [3] [4].
The anti-noise performance of the improved APFFT is Fig.2. Schematic diagram of JC-type torque-speed sensor
better [5] [6]. Moreover, the frequency measurement

978-1-7281-7687-1/20/$31.00
Authorized licensed use limited 2020 IEEE Del Norte Biblioteca. Downloaded
to: Universidad 6288on August 27,2023 at 21:07:37 UTC from IEEE Xplore. Restrictions apply.
B. Torque-speed sensor At last, the amplitude is adjusted to the level suitable for the
JC-type torque-speed sensor is used in the system, which sampling through the fixed gain amplifier circuit.
is given in Fig.2. As the signal gear rotates along the elastic In the peak detection circuit, the TCL372CD is an open-
axle, the air gap permeance changes periodically, and then drain output comparator. Pin 1 will be connected to pin 2, if
the magnetic flux inside the coil also changes periodically, the voltage of pin 3 is greater than the voltage of pin 4. Pin 1
which makes the coil produce an alternating current (AC) will show a high resistance state, if the voltage of pin 3 is
signal whose waveform is nearly sinusoidal. The faster the less than the voltage of pin 4. In this circuit, pin 2 is
gear revolves, the higher the frequency of the sine wave. connected to the voltage V1 (i.e., -15V voltage source). As
The phase of the AC signal is related to the torque and its the peak detection circuit is presented, if the instantaneous
direction. And, the greater the torque, the greater the phase voltage of the input signal is greater than that of the output
difference between the two sine signals. Thus, this sensor signal, a charging path will be constituted by voltage V1,
could measure the torque and speed of a motor precisely. resistance R7 and capacitor C2, to charge the capacitor C2
(i.e., voltage-holding capacitor). If the instantaneous voltage
C. Signal processing circuit of the input signal is less than the output voltage, pin 1 will
The signal processing circuit includes the peak detection show a high resistance state, which corresponds to a break-
circuit, automatic gain control (AGC) circuit and fixed gain off state. Under this situation, the capacitor C2, resistance
amplifying circuit, shown in Fig.3. This circuit controls the R8 and pin 2 of the LM358 constitute a discharge path, and
on-off of the device according to the input signal amplitude the capacitor C2 discharges through the resistance R8. After
measured by the peak detection circuit. If the input signal a continuous charging and discharging process, the circuit
amplitude is appropriate, the device would be turned on, will reach a dynamic balance, and then the voltage of the
otherwise the device would be turned off, to realize the capacitor C2 could approach the peak voltage of the input
protection of the device. When the device is turned on, the signal. A voltage follower is connected to the output pin of
AGC circuit can adjust the gain of the circuit according to the LM358 to isolate the circuit, which can improve the load
the amplitude of the input signal, to stabilize the amplitude. carrying capacity of the circuit.

Fig.3. Signal processing circuit

In the AGC circuit, the VCA610 is a gain adjustable


amplifier. The relationship between the control voltage and
gain of the VCA610 is given in Fig.4. First, the high-speed
voltage comparator AD8561 transforms the sine signal S1
into a periodic rectangular pulse signal S2, and the pulse
width of the signal S2 is positively related to the amplitude
of the input sinusoidal signal. Second, the RC low-pass filter
transforms the signal S2 into a direct current (DC) signal S4,
which is positively related to the pulse width of the signal
S2. Finally, the signal S4 passes through the subtraction
circuit and becomes a negative voltage S5 input into the pin
7 (i.e., the gain control pin of the VCA610), to control the
voltage gain. It is seen that a negative feedback effect is
formed to stabilize the output signal amplitude.

Fig.4. Gain vs control voltage

6289on August 27,2023 at 21:07:37 UTC from IEEE Xplore. Restrictions apply.
Authorized licensed use limited to: Universidad Del Norte Biblioteca. Downloaded
The simulation results of the measurement accuracy of STM32 first stores the collected data, and then performs
the peak detection circuit are shown in Table I. And then, APFFT operation on these data to calculate the frequency
the simulation results of the frequency characteristics of this and phase difference of the signals. Therefore, it can be easy
circuit are shown in Table II. to get the shaft power of the motor.

TABLE I. MEASUREMENT RESULTS OF PEAK DETECTION CIRCUIT III. SOFTWARE DESIGN OF THE SYSTEM
WHEN SIGNAL FREQUENCY IS 10 KHZ AND AMPLITUDE IS VARIOUS

Real amplitude (mV) 100 500 1000 3000 5000 A. Motor shaft power measurement
Detection value (mV) 102.1 501.3 999.7 2976.2 4961
The calculation formula of the motor shaft power is
P = 2π TS , where T is the torque and S is the revolving
speed. The phase difference between two sine signals from
TABLE II. MEASUREMENT RESULTS OF PEAK DETECTION CIRCUIT torque-speed sensor is proportional to the torque, and the
WHEN AMPLITUDE IS 1 V AND FREQUENCY IS VARIOUS
frequency and amplitude is proportional to the revolving
Signal frequency (kHz) 0.5 1 5 10 20 speed. That is, T = K1D and S = K 2 F , where D is the phase
Detection value (mV) 993.2 1005 999.7 999.2 1000.6 difference between the two sine signals, F is the frequency,
K1 and K 2 are constants depending on the characteristics of

The measurement accuracy of the peak detection circuit the specific sensor.
is relatively high, and the circuit can reach stability within Suppose that the APFFT operation results of the two
0.5s. And, the frequency of the signal has little effect on the sinusoidal signals are X ap1 (k) and X ap 2 (k) . X ap1 (m) and
performance of the circuit. This circuit has a wide amplitude
detection range, ranging from 0.1V to 10V, which can X ap 2 (m) are the spectrum lines with the largest amplitude
satisfy the demand of the system. in X ap1 (k) and X ap 2 (k) , respectively. Then, the frequency
Simulation results of the dynamic gain characteristics of of the sine signal is given by
this AGC circuit are shown in Table III. And the experiment
is performed under the condition that the signal frequency is fs (1)
F =m
20 kHz. The simulation results of the amplitude-frequency N
characteristics of this AGC circuit are shown in Table IV.
And the experiment is performed under the condition that where, f s is the sampling frequency, and N is the
the signal amplitude is 1V. sampling number. And, X ap1 (m) and X ap 2 (m) can be
described as
TABLE III. DYNAMIC GAIN CHARACTERISTICS OF AGC CIRCUIT
­° X ap1 (m) = a1 + jb1 (2)
Input signal amplitude (mV) 100 300 500 1000 2000 ®
°̄ X ap 2 (m) = a 2 + jb2
Output signal amplitude (mV) 293.8 306.3 310.4 314.5 315.7
The phase difference between two sine signals is given by
TABLE IV. AMPLITUDE-FREQUENCY CHARACTERISTICS OF AGC b1 b (3)
CIRCUIT D =| θ1 − θ 2 |=| arctan( ) − arctan( 2 ) |
a1 a2
Signal frequency (kHz) 0.5 1 5 10 20
Thus, the shaft power of the motor could be calculated as
Output signal amplitude (mV) 313.2 309.4 315.1 312.4 314.5
P = 2π TS
= 2π K 1 K 2 DF (4)
According to the results, the AGC circuit could keep the b b f
signal amplitude at about 300 mV. And, with the change of = 2π K 1 K 2 | arctan( 1 ) − arctan( 2 ) | m s
a1 a2 N
input signal amplitude, the output signal amplitude slightly
fluctuates. But, in general, the working state of the motor is It is found that the measurement accuracy of the shaft power
relatively stable, and there will be no instantaneous drastic depends on the phase difference detection accuracy and
change. Therefore, the amplitude of the output signal of the frequency resolution. To improve the measurement accuracy
sensor will not fluctuate strongly, and the amplitude of the of the shaft power is equivalent to improve the phase
sine signal after processing is basically unchanged. difference detection accuracy and frequency resolution.

D. Data acquisition and processing based on STM32 B. Phase detection through FFT
STM32F407 is a 32-bit microprocessor with the strong The phase of the digital sine sequence can be calculated
computing capability and fast operation speed, which is easily through its spectrum. And, the spectrum can be
designed by STMicroelectronics. Analog-digital converters calculated by the discrete time Fourier transform (DFT).
inserted in the microprocessor can sample the sine signals However, the length of the sampled digital sequence is
with small error and high sampling frequency. In addition, limited, which is equivalent to multiplying the sine sequence
the digital signal processing function library is provided by by the ideal window function. Thus, the calculated spectrum
STMicroelectronics, which could reduce the complexity of is the convolution of the spectrum of the sine sequence and
program design. Therefore, it is proper to apply it in this the spectrum of the window function. Thus, the phase of the
system to sample the two sine signals synchronously, with a sine signal cannot be obtained by this frequency spectrum.
sampling frequency depending on the signal frequency. The

6290on August 27,2023 at 21:07:37 UTC from IEEE Xplore. Restrictions apply.
Authorized licensed use limited to: Universidad Del Norte Biblioteca. Downloaded
The following is the problem in calculating the signal The theoretical basis for the phase measurement through
phase using the fast Fourier transform (FFT) algorithm, with the APFFT algorithm is illustrated below, using the complex
2π f 2π f
j( n +θ ) j( n +θ )
the complex exponential sequence x (n) = e N as the exponential sequence x (n) = e N as the research
research object. N-point DFT operation on the complex object. Based on the all phase preprocessing method
exponential series can be given by introduced above, we can equate the N-length sequence to
the overlay of the N subsequences, which is described as
1 N −1 jθ j 2πN f n − j 2Nπ k n
X (k) = ¦e e e
N n =0 1 N −1

1 sin(π ( f − k))
1
j [θ + (1− )π ( f − k)]
(5) xap (n) =
N
¦ x (n) '
i
(7)
= e N i =0
N sin(π ( f − k) / N)
where xi' (n) = xi [(n + i)]N , xi (n) = x(n − i) . According to
E = (1 −
1
)π ( f − k ) (6)
N the circular displacement property of DFT:
2π ki
j
It can be found that if f ≠ k , the calculated phase value, the .
X i' (k) = X i (k)e N Then, the spectrum of x(n)
phase of the spectrum line, will not equal to the true value after all phase preprocessing is
θ . And, the calculated phase value is related to the offset 1 N −1
2π ki

¦
j
X ap (k) = Xi (k)e N
between the signal frequency and corresponding frequency N i=0
of the spectrum line. The phase measurement error is given 1 jθ N −1 N −1 j 2π (n −Ni)( f − k)
in (6). It could be eliminated according to (5), if the target = e ¦¦e (8)
N2 i=0 n=0
signal frequency has been known beforehand. However, it is
1 jθ sin (π ( f − k))
2
obviously impractical. = e
N2 π
sin 2 ( ( f − k))
N
C. Phase detection through APFFT
The APFFT algorithm is proposed in [3] for the phase Observed form (8), it is easy to find that the calculated
measurement, which is able to achieve a good measurement phase value of the signal after all phase processing is equal
2π m
accuracy. Performing the APFFT operation on the data is to the true phase value of x (n) = e j ( N n + θ ) . Therefore, in the
equivalent to preprocessing the data and then performing the actual calculation, merely the spectrum line of the target
FFT operation. The process of the all-phase preprocessing is signal, the one with the largest amplitude, is needed. The
shown in Fig.5 (N=3, as an example). true phase value of the signal can be obtained by calculating
the phase value of this spectrum line. Compared with (5), it
can be found that the amplitude spectrum of the signal is the
square of the amplitude spectrum of the signals without all
phase preprocessing, which means that the all phase
preprocessing has a good suppressive effect on the leaked
spectral components.

D. Phase detection through improved APFFT


In the process of FFT and APFFT operations described
above, the ideal window function is used to truncate the
sampling sequence. However, the ideal window function has
a wide spectrum bandwidth, which makes the spectrum
leakage relatively serious. In [6], a window function with a
Fig.5. All-phase preprocessing example (N=3) narrower bandwidth could be used to truncate the sampling
sequence, thus that the spectral leakage of the signal is less
In order to find the initial phase of the sine signal, 2N-1 severe. This improved APFFT algorithm using the Hanning
data points are needed to sample. These 2N-1 samples will window is illustrated in Fig.7.
be transformed into a N-length sequence after the all phase
preprocessing. N-point FFT operation should be performed
on this N-length sequence to calculate the phase value of the
midpoint sample of the 2N-1 samples. This algorithm can be
described in Fig.6.

Fig.7. Improved APFFT flow chart (N=3)

E. Simulation results
To prove the validity of the improved APFFT method,
Fig.6. APFFT flow chart (N=3) the FFT and APFFT algorithms are used for the comparison

6291on August 27,2023 at 21:07:37 UTC from IEEE Xplore. Restrictions apply.
Authorized licensed use limited to: Universidad Del Norte Biblioteca. Downloaded
in this Section. Assume that the output signals of the torque-
speed sensor are x1(t) = 5cos(2π ft + θ ) and x2 (t) = 5cos(2π ft) .
N=2048, the sampling frequency is 5 kHz, and the range of
the signal frequency f varies from 1kHz to 2kHz. Besides,
assume θ varies from 0 to 2π . Because the measurement
accuracy of the signal frequency of three methods depend
on the frequency resolution and their calculated values are
same, thus the calculated value is substituted by the ideal
frequency value in the simulation below, in order to analyze
the contribution of the phase difference to the shaft power.
When there is no noise interference, the average relative
shaft power measurement error of every set of signals with
the different phase θ under every specific frequency are
shown in Fig.8. It is found that the shaft power measurement
accuracy of the APFFT and improved APFFT methods
greatly improve compared with the traditional FFT method. Fig.8. Average relative measurement error without noise interference
Besides, the shaft power measurement error of the improved
APFFT method is greatly smaller than that of the APFFT
algorithm. Due to the bad performance of the FFT method
in the noise-free condition, the anti-noise performance of the
FFT method is not analyzed in the subsequent experiments.
In actual, the harmonic interference often occurs when
the motor is working. When the signals interfered by the DC
and harmonic noise, the mixed signals are described as

­y1(t) = 5cos(2π ft+θ ) + 0.1cos(4π f t − a) + 0.1


® (9)
¯y2 (t) = 5cos(2π ft) + 0.1cos(4π f t − b) + 0.1
The results of the relative shaft power measurement errors
of the APFFT and improved APFFT methods under the
interference of the DC and harmonic noise are shown in
Fig.9. It is easy to find that the DC noise and harmonic noise
have little influence on the APFFT and improved APFFT
algorithms, and the improved APFFT algorithm has a higher
motor shaft power measurement accuracy than that of the
APFFT method. Fig.9. Average relative measurement error under the harmonic and DC
noise interference

Fig.10. Average relative measurement error under the Gaussian noise interference

6292on August 27,2023 at 21:07:37 UTC from IEEE Xplore. Restrictions apply.
Authorized licensed use limited to: Universidad Del Norte Biblioteca. Downloaded
To analyze the relationship between the measurement system immunes to the interferences of the harmonic and DC
accuracy of two algorithms and the interference of Gaussian noise, which frequently occur as motor is running. Besides,
noise, a simulation can be designed. Assume that the output this algorithm could detect the phase of the sine signal
signals of the torque-speed sensor are x1(t) = 5cos(2π ft + θ ) accurately in the case of the high SNR, which is not complex
and x2 (t) = 5cos(2π ft) , and the number of the samples and could be realized in the STM32F407. The frequency
resolution should be improved as much as possible, to
N=2048. The signals are sampled at a fixed sampling improve the accuracy of the motor shaft power measurement.
frequency of 5kHz. The average value of this set of the shaft Finally, the device cost is not high, therefore it is conductive
power measurement errors is taken to represent the to the production.
measurement accuracy at this specific signal-to-noise ratio
(SNR). When the frequency is 1kHz and 2kHz, the
measurement results are shown in Fig.10, where the ordinate ACKNOWLEDGMENT
represents the logarithm of the average value of relative This work has been co-supported by the National Natural
shaft power measurement error. The abscissa is the intensity Science Foundation of China under Grants 61801510 and
of the Gaussian noise. 61871397, by the Open Foundation of Engineering Research
Center for Metallurgical Automation and Measurement
It is easy to find that the two algorithms are sensitive to Technology of Ministry of Education under the Grant
Gaussian noise, the measurement accuracy decreases rapidly MADTOF2019B02, by the National Science Foundation of
as the SNR decreases. The improved APFFT algorithm has Hubei Province under Grant 2019CFB263, and by the
a higher measurement accuracy in the case of the high SNR, National Defense Research Nurture Project of Sun Yat-sen
while it has little difference with the APFFT method in the University (Research of the bistatic forward-looking low
measurement accuracy in the case of the low SNR. The frequency UWB SAR imaging system and technology).
computational complexity of the improved APFFT method Hongtu Xie and Guoqian Wang are corresponding authors.
is similar to that of the APFFT algorithm. Therefore, it is
reasonable to apply the improved APFFT algorithm to the
system, as the SNR is relatively high as the motor is REFERENCES
running. [1] W.Z. Xu, H.L. Chen and H. Huang, “A real-time measurement
method for motor shaft power without torque meter”, Compressor
However, it is must be noticed that the accuracy of the Blower & Fan Technology, vol.56, no.s1, pp.41-44,2014.
phase difference measurement is far higher than that of the [2] B. Liu, S. L. Shen and J.D. Yan, “Research on a portable laser
frequency measurement in the improved APFFT method. If measurement method of motor shaft power and its application”,
the phase difference measurement error can be ignored, the Journal of Electronic Measurement and Instrucmentation, vol.32,
no.5, pp.50-58, 2018.
relative measurement error of the motor shaft power is
[3] Z.H. Wang, X.D. Huang, and W. Yang , “The measuring phase
fs (10) method of all-phase FFT”, World SCI-TECH R&D, vol.29, no.04,
E= pp.28-32, 2007.
Nf
[4] Z.H. Wang, Z.X. Hou and F. Su, “All-phase FFT spectral analysis”,
where, f s is the sampling frequency, f is the signal Journal on Communications, vol.24, no.11A, pp.6-19, 2003.
[5] X.D. Huang and Z.H. Wang, “Anti-noise performance of All-phase
frequency and N is the sampling number. So, the sampling FFT phase measuring method” Journal of Data Acquisition &
frequency needs to be adjusted to a proper value according Processing, vol.26, no.03, pp.286-291, 2011.
to the signal frequency to reduce the measurement error. [6] K.Y. Chen, “A research on phase difference measurement based on
Assume that f s = cf , c > 2 , then the relative shaft power improved DFT algorithm”, Microcomputer Information, vol.28,
no.04, pp.142-144, 2012.
measurement error is described as
[7] G.R. Li, J. Wang, and Y.M. Zhen, “The design of the peak detection
c circuit based on the Op Amp CA3140”, Computer and Information
E= (11) Technology, vol.18, no.06, pp.47-48, 2010.
N [8] H. Liu, “Design on experiment of automatic gain control circuit”,
Thus, the shaft power measurement accuracy depends on Experimental Technology Management, vol.35, no.08, pp.55-59,
2018.
the sampling number N. The larger the number N, the
[9] J.H. Dong, “Design of peak detector based on open-drain output
smaller the measurement error, the higher the computing comparator”, Journal of Xiamen University of Technology, vol.24,
capability the processor needed. no.01, pp.42-46, 2016.
[10] J.J. Zhang, X.Y. Zhang, Q. Chen, et al, “High precision dielectric loss
IV. CONCLUSION angle measurement based on improved all-phase algorithm”,
Transactions of China Electrotechnical Society, vol.35, no.14,
The measurement scheme of the motor shaft power is pp.3097-3104, 2020.
proposed in the paper, which could satisfy the demand of the [11] Q.Y. Xu, J.X. Liu, J.W. Wang, et al, “Design of high-precision phase
industry production and scientific research. In the hardware measuring instrument based on all phase FFT method”, Journal of
design, the signal processing circuit for the output signals of Henan University of Science and Technology (Natural Science),
vol.40, no.5, pp.25-30, 2019.
the torque-speed sensor could stabilize the amplitude of the
sine signal perfectly and then protect the whole device. In the
software design, the improved APFFT method applied in this

6293on August 27,2023 at 21:07:37 UTC from IEEE Xplore. Restrictions apply.
Authorized licensed use limited to: Universidad Del Norte Biblioteca. Downloaded

You might also like