Next Article in Journal
Deep Reinforcement-Learning-Based Air-Combat-Maneuver Generation Framework
Previous Article in Journal
Generalized Net Model of the Processes in a Petroleum Refinery—Part I: Theoretical Study
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Study on Compensation Method of Encoder Pulse Errors for Permanent Magnet Synchronous Motor Control

by
Beom-Do Park
1,
Seon-Jung Kim
2,
Ju-Hyeong Moon
2,
Dong-Woo Kang
2,*,
Sung-Chul Go
3 and
Khac-Huan Su
4
1
Youngshin Precision Co., Ltd., Anyang-si 14119, Republic of Korea
2
Department of Electronic and Electrical Engineering, Keimyung University, Daegu 42601, Republic of Korea
3
Department of Robot Engineering, Keimyung University, Daegu 42601, Republic of Korea
4
Department of Control and Automation Engineering, Eastern International University, Thu Dau Mot 820000, Binh Duong, Vietnam
*
Author to whom correspondence should be addressed.
Mathematics 2024, 12(19), 3019; https://doi.org/10.3390/math12193019
Submission received: 3 September 2024 / Revised: 21 September 2024 / Accepted: 26 September 2024 / Published: 27 September 2024

Abstract

:
In vector-controlled Permanent Magnet Synchronous Motors (PMSMs), measuring the motor flux angle, particularly the rotor position, is essential. If a pulse error occurs during motor control using an encoder, it becomes impossible to accurately estimate the rotor position, leading to incorrect position angle information being used in the coordinate transformation. This mismatch causes discrepancies between the commanded three-phase stator current and the actual current applied to the motor. As a result, the motor and inverter output and efficiency decrease, and the control performance deteriorates. Therefore, research is necessary to compensate for such errors. This paper proposes an algorithm that detects pulse errors occurring in incremental encoders and automatically switches to the Hall sensor control mode to compensate for the encoder pulse errors. The proposed algorithm, based on Hall sensors, has the advantage of not significantly affecting control delays, which could be problematic in high-speed operating ranges; thus, effective control is maintained even in such situations.

1. Introduction

The position sensors commonly used in Permanent Magnet Synchronous Motors (PMSMs) can be broadly classified into three types: resolvers, encoders, and Hall sensors. However, each of these position sensors utilizes a different method to measure or estimate the rotor position. Consequently, the advantages and disadvantages of each sensor vary. Moreover, the non-ideal characteristics, such as noise generation, faults, and output signal imbalance issues, also manifest differently depending on the sensor type [1,2].
Among these sensors, the encoder is the most susceptible to environmental factors, being particularly vulnerable to temperature and humidity, as well as noise caused by interference with its signal [3]. Since the signals output by the encoder are high-frequency digital signals with harmonics, they are highly influenced by electromagnetic interference caused by PWM switching in inverters and controllers, as well as by interference between the A and B pulse signals. Consequently, when noise affects the encoder, errors such as the omission of A, B, and Z output pulses can occur, leading to inaccuracies in the calculated motor speed and rotor position measurements. These errors can also cause phase angle discrepancies, potentially resulting in the reversal of the motor’s rotation direction, which can create significant issues in motor control [2]. This can cause an imbalance in the current waveform, resulting in a current ripple, which can cause vibration and noise in the motor. Current ripple has the potential to reduce the control reliability and stability of the motor during the current control process. Position sensors are essential components in motor control, but when these non-ideal characteristics manifest, they can lead to reduced control reliability and diminished motor performance. Furthermore, the decline in control reliability and motor characteristics can be particularly hazardous in eco-friendly vehicles, where unexpected events such as sudden stops or unintended reverse rotation during operation could occur, potentially leading to very dangerous situations. Therefore, various solutions to prevent these non-ideal characteristics have been extensively researched in numerous studies. In this paper, we also propose a method to address these issues using both encoders and Hall sensors.
In this paper, the current controller feeds back the rotor angular velocity and angle calculated by the position sensor to generate rotor d-q axis voltage commands, which ultimately apply the three-phase stator currents to the motor. When an encoder pulse error or abnormal sensing event occurs, the detection algorithm activates, calculating the error in the encoder pulse variation whenever a Hall sensor signal is detected. If the error exceeds a certain threshold, it is determined that a pulse error has occurred, and the control mode switches to Hall sensor control. Additionally, if the encoder pulse variation returns to normal while operating in the Hall sensor control mode, the system switches back to the encoder control mode. By using the proposed algorithm, abnormal signals can be detected, allowing the measurement of encoder pulse counts during Hall sensor signal changes to identify and compensate for pulse loss events. The contents of this paper were extracted from the first author’s master’s degree thesis.

2. Characteristics of Major Position Measurement Sensors

To perform vector control of a Permanent Magnet Synchronous Motor (PMSM), it is necessary to measure the position of the rotor [4]. The device used to measure this position is called a position sensor, and these sensors utilize either analog or digital detection methods. Analog position sensors include synchros, resolvers, and tachogenerators, while digital position sensors include Hall sensors and rotary encoders. However, in most synchronous motors, resolvers, encoders, and Hall sensors, as shown in Figure 1, are commonly used [5].
The encoder discussed in this paper outputs a digital signal based on the rotation angle and can be broadly classified into two types. These are the absolute encoder, which can detect the rotor’s absolute position, and the incremental encoder, which detects only the rotation angle relative to the initial measurement position and provides its variation. Additionally, incremental encoders are further divided into magnetic and optical types. Typically, absolute encoders are relatively expensive; so, incremental encoders are more commonly used, with optical encoders being the most widely adopted.
The structure of an incremental encoder, as shown in Figure 2, consists of a rotating disc with slits equal in number to the pulses per revolution (PPR), a fixed plate with slits for the three pulse outputs, and a setup of light-emitting diodes (LEDs) and phototransistors. The operating principle of the sensor is that light emitted from the LEDs passes through the slits on both the rotating and fixed plates and is received by the phototransistor, converting it into an electrical signal. The electrical signal is then output as square waves (A, B, Z) with a pulse width of 50%. The phase difference between the A and B pulses indicates the motor’s rotation direction, while the Z pulse is used to set the reference position of the rotor. The abnormal phenomenon discussed in this paper refers to the case where either the A or B pulse is not detected. Incremental encoders are widely used due to their high resolution, low cost, and compact size. However, they are also susceptible to shocks, vibrations, and noise [2].

3. Existing Encoder Position Sensing Mechanism

Before explaining the detection method and compensation algorithm for encoder malfunctions, this paper first describes the position measurement method adopted using an encoder. The speed measurement techniques are all based on the vector control method of the Permanent Magnet Synchronous Motor (PMSM). The encoder primarily generates pulse signals labeled A, B, and Z, which are used to measure speed and rotor position. However, since these pulse signals have a frequency proportional to the speed, they cannot directly measure speed. Therefore, a method is required to determine rotor speed from these output pulses.
When calculating rotor speed using an encoder, one method is to use the pulse signals directly. However, for more precise control, a method that multiplies the number of pulses can be used [6]. As shown in Figure 3, generating new pulses by selecting either the rising or falling edge of the signal is referred to as 2× multiplication, while generating new pulses on both the rising and falling edges is referred to as 4× multiplication [7,8] In this paper, speed was calculated using 4× multiplication with 1024 [PPR].
The equation for calculating the angular velocity of the rotor, which is used to measure the rotor’s speed, is defined as shown in (1). By using the output pulses to calculate the rotor’s angular velocity ( ω m ) based on the angular displacement (X) and time (T), we obtain it from (1) and (2).
ω m = X T   [ r a d / s ]
The rotor’s angular velocity is then expressed in terms of the rotational speed in revolutions per minute ( N ).
N = 60 2 π X T   [ r / m i n ]
After defining the equations for rotor speed in (1) and (2), the encoder speed measurement techniques can be outlined, using three main methods. The first is the M method, which measures angular velocity based on the displacement over a fixed time interval. The second is the T method, which calculates angular velocity by measuring the time taken to cover a fixed displacement. The last is the M/T method, which combines both approaches [9].
When using the T method, higher accuracy is provided at low speeds compared to the M method. However, at higher speeds, the time between two encoder pulses becomes shorter, increasing the likelihood of measurement errors.
The M/T method, on the other hand, merges the advantages of both methods, allowing usage across a wide speed range [10]. It utilizes the T method at low speeds and the M method at high speeds. However, one drawback is the potential for errors when switching between the two methods, which can significantly reduce accuracy at the transition points [11].
In this paper, since the precision of position measurement in the high-speed range is critical, the M method encoder shown in Figure 4 was used. The M method sets a fixed detection time ( T c ), during which the number of encoder pulses is counted to measure angular displacement. The rotor’s angular velocity is then calculated using (1) and (2). This method allows speed calculations at each fixed interval ( T c ). Mathematically, if we assume that the sampling time is set to T c and the number of encoder pulses output during this time is m, the displacement (X) during the sampling time can be expressed by (3).
X = m P P R 2 π
Therefore, when using the M method, the angular velocity can be newly expressed by substituting the displacement value, measured during the sampling time, into the previously defined angular velocity equations. This results in the new expressions given in (4) and (5).
ω m = X T c = 2 π T c m P P R   [ r a d / s ]
N = 60 2 π ω m = 60 T c m P P R   [ r / m i n ]
The M method has the advantage of effectively measuring speed in high-speed ranges, but it also has the drawback that, at low speeds, accurate measurements may be difficult to obtain because the encoder pulses might not be generated within the sampling time.

4. Encoder Malfunctions

Encoders are highly susceptible to environmental factors, such as temperature and humidity, and they are particularly sensitive to noise caused by signal interference. The signals output by the encoder are high-frequency harmonic digital signals, making them prone to interference between the A and B pulse signals and to the electromagnetic interference generated by PWM switching in inverters and controllers. Consequently, as shown in Figure 5, when noise affects the encoder, errors such as the omission of A, B, and Z output pulses can occur. This can lead to inaccuracies in the calculated motor speed and rotor position measurements. These errors can cause phase angle discrepancies and potentially result in critical issues in motor control, such as the reversal of the motor’s rotation direction [12].
In addition to the pulse dropout phenomenon that occurs in the encoder, pulse errors can also be caused by noise from external electromagnetic interference, as shown in Figure 6. It can be observed that such noise causes errors in the measured angle value of the encoder, which in turn causes an imbalance in the current waveform. As a result, the reliability and stability of the current control can be reduced when an error occurs in the encoder pulse, and in this paper, the pulse dropout phenomenon of the encoder is implemented and simulated.

5. MATLAB/Simulink Modeling of Encoder and Hall Sensor

To drive a Permanent Magnet Synchronous Motor (PMSM), vector control techniques are typically applied. Since the rotor position corresponds to the flux position used as a reference in vector control, the motor can be controlled through a relatively straightforward process. Additionally, to achieve vector control, the flux and torque component currents must always maintain a spatial separation of 90 degrees, allowing their independent control. Lastly, the torque component current must be controllable instantaneously. To meet these three conditions, it is necessary to use d-q axis current commands instead of three-phase stator current commands and to then transform them into d-q axis current controllers within a synchronous coordinate system. At this point, rotor position information is required for the coordinate transformation, necessitating the use of the angles measured by the encoder and Hall sensor [13].
Therefore, the algorithm designed in this section is configured to measure the rotor position angle based on the encoder and Hall sensor and to perform coordinate transformation and vector control. To begin, the implementation of the A, B, and Z output pulses was carried out as shown in Figure 7. The encoder generates these pulses based on the mechanical angle of the rotor; so, the input was set as the angle obtained by integrating the mechanical angular velocity of the rotor. Using this angle, the A and B pulses were configured to output several pulses per revolution for each input from 0 to 2π. The outputs were restricted between input values and designed to be output as sin and cos signals. Lastly, the Z pulse was implemented to generate a fixed pulse each time the rotor completed one full revolution [14].
Therefore, as shown in Figure 7, when the A, B, and Z pulses are generated, they are used to ultimately detect the direction of rotation and measure the rotational displacement. Based on this detected rotational angle, current control is performed, and the initial rotor position for generating maximum torque can be set. In Figure 8, the system is configured to determine the direction of rotation based on the phase difference between pulses A and B, as shown in (6). A value of +1 is generated for forward rotation, and a value of −1 for reverse rotation [15]. Additionally, the system is implemented so that the signal is reset when the Z pulse is generated. Consequently, when the pulse generation, rotation direction detection, and displacement measurement algorithms are combined into a single encoder system, the configuration appears as shown in Figure 9.
O u p u t =   C W                 1             i f   I n p u t 1 C C W 1             i f   I n p u t = 1
In this section, an algorithm was designed to calculate and estimate the speed and angle of the motor using position sensors. The flowcharts representing this are shown in Figure 10. In Figure 10a, the algorithm for speed and angle calculation using an encoder is depicted, while Figure 10b shows the algorithm for speed and angle estimation using a Hall sensor. Additionally, the results calculated and estimated by the position sensors were compared to the motor’s electrical and mechanical angles. These results were then applied as inputs to the feedback portion of the current controller to verify the motor’s output.
As shown in Figure 11, the position variation over one cycle was calculated by inputting the encoder output pulse data. The speed was calculated using the M method speed calculation formula, with a sampling time of 7500 [s] and a 4× multiplication of 1024 [PPR]. Additionally, a position variation error compensation technique was applied to correct the displacement calculation error over one cycle [16].
The calculated speed values were integrated to generate the mechanical and electrical angles output by the encoder. The electrical angles were used in the coordinate transformation algorithm, and the mechanical angles were used to compare how accurately the mechanical angle of the real motor was estimated. In Figure 12, we can see that based on the encoder’s calculated speed, the RPM angle, the real motor produces a torque proportional to the three-phase currents I a b c and the d-q axis currents I d q r .
Modeling was performed to measure the absolute angle of the rotor using a Hall sensor model. Typically, three Hall sensors are mounted on the rotor side of the motor, electrically spaced 120 degrees apart. The ABC three-phase signal has a phase difference of 120 degrees, as described in (7)–(9), and θ r a d is used to calculate the angle corresponding to each phase, representing the expression of each phase in degrees in a three-phase system.
P h a s e   A = θ r a d   ·   180 π = θ d e g
P h a s e   B = θ r a d   ·   180 π 120
P h a s e   C = θ r a d   ·   180 π + 120
By combining the signals generated from these three Hall sensors, a total of six combinations can be created, which allows the absolute angle to be determined at the points where the signals change as the motor rotates [17]. The signals generated by the Hall sensors change six times during one electrical rotation, yielding six absolute angles. These six absolute angles can be determined at 60-degree intervals, specifically at 30, 90, 150, 210, 270, and 330 degrees, as expressed in (10) [18].
30 °   u 1 < 210 ° 150 °   u 1 < 330 ° u 1 270 °   o r     u 1 < 90 °
Therefore, Hall sensor modeling was conducted to measure the absolute angles as described above, as shown in Figure 13. The model was designed to calculate the positions of the three phases and generate the signals for the three Hall sensors. Ha, Hb, and Hc stand for the Hall sensor signals of a, b, and c. The values of Ha, Hb, and Hc can be either 0 or 1 depending on the conditions. These signals are then multiplied by specific weights, resulting in a constant value, as described in (11).
R e s u l t = ( 4 × H a ) + ( 2 × H b ) + ( 1 × H c )
The specific constant values calculated from these three Hall sensor signals were mapped using a six-step multiport switch, ensuring that the six absolute angles were output at 60-degree intervals. Therefore, through the Hall sensor modeling described above, the final output of the six absolute angle waveforms is obtained, as shown in Figure 14 [19].
With the Permanent Magnet Synchronous Motor (PMSM), the method for measuring speed using Hall sensors involves determining a total of six absolute angles, with the remaining information calculated by integrating the speed [20]. The Hall sensor speed can be obtained using a discrete integration method based on PI control, as shown in (12) and (13). To perform the discrete integration, the previous estimated angle from the Hall sensor is subtracted from the current estimated angle, and the result is divided by the time interval Tz to estimate the speed.
θ k = θ h a l l k θ h a l l ( k 1 )
ω h a l l = 1 T z · θ k = 1 T z · ( θ h a l l k θ h a l l ( k 1 )
Subsequently, for the discrete integration calculation, the integration was performed using the sampling time, control gain, and a term representing the previous value, denoted as Z − 1 This process is expressed in (14)–(16).
ω e r r = ω h a l l ω r _ s o
ω c o r r e c t ( k ) = 0.05 · ( K · T s z 1 · ω e r r )
ω r _ E S T k = ω r s o + ω e r r + ω c o r r e c t ( k )
By performing discrete integration on the corrected speed, the accumulated change in speed can be calculated, allowing the estimation of the speed value. Ultimately, the speed is estimated by monitoring the changes in the theta value of the Hall sensor, and the final speed is determined using the corrected value.
Thus, as shown in Figure 15, the Hall sensor speed and angle estimation modeling was carried out. The estimated speed was confirmed to be accurate, with the actual motor speed converted to electrical angular velocity being approximately 628.32 [rad/s], and the Hall sensor-estimated speed being about 628.8 [rad/s], resulting in an error of only 0.5 [rad/s]. The estimated angle is then input into the coordinate transformation as the electrical angle. Since the motor has four poles, it electrically rotates twice for every one mechanical rotation. Therefore, the Hall sensor-estimated angle occurs twice, with a temporal error of approximately 0.00044 [s] compared to the actual motor angle. Furthermore, as shown in Figure 16, the estimated speed and angle from the Hall sensor lead to the generation of three-phase current values and torque proportional to the d-q axis currents in the actual motor.

6. Design of Pulse Error Detection and Control Mode Switching Algorithm

In the following content, we establish a hypothetical scenario to verify the occurrence of encoder output pulse errors when abnormal signals arise, which subsequently degrade control performance. As shown in Figure 17, at an arbitrary time, when an encoder pulse dropout occurs, the encoder counter pulse (eQEP out) is missed, leading to a failure to reset the encoder’s estimated angle. This results in a significant position error compared to the actual motor angle. Due to this phenomenon, as illustrated in Figure 17, it is evident that the motor output also experiences a degradation in control performance compared to when normal signals are present.
In this paper, the proposed current controller uses the rotor’s angular velocity and angle, calculated by the position sensor, to feed back the rotor’s d-q axis voltage commands. This ultimately applies the three-phase stator currents to the motor. According to the flowchart presented in Figure 18, an algorithm is activated when an encoder pulse error or abnormal sensing event occurs. This algorithm calculates the error in the encoder pulse variation whenever a Hall sensor signal is detected. If the error value exceeds a predetermined threshold, the algorithm determines that a pulse error has occurred and switches the control mode to Hall sensor control. Subsequently, if the encoder pulse variation returns to normal during Hall sensor control, the system switches back to the encoder control mode.
The proposed algorithm compares the current signal with the previously detected Hall sensor signal, measuring the change in the number of encoder output pulses each time the Hall sensor signal changes. This process is performed within the position sensor pulse calculation module, where the number of and variation in the encoder output pulses (eQEP out) are calculated. Since the Hall sensor signal represents the electrical angle and the encoder signal represents the mechanical angle, the algorithm operates by calculating the number of encoder output pulses during the sampling time, as shown in Figure 19.
For instance, if the encoder has a resolution of 4096 [PPR], then for one full rotation of the rotor (360 degrees), each pulse corresponds to approximately 0.0879 degrees of resolution. Since the Hall sensor signal changes at 60-degree intervals, approximately 341.3 encoder pulses would be generated per Hall sensor signal change. At speeds of 3000 [rpm] or 1500 [rpm], a consistent number of pulses is generated based on the encoder’s resolution.
During the pulse error detection modeling process, a pulse error of approximately 27.24 pulses may occur due to sampling timing differences. To account for this, a buffer of approximately 10% was added, and the constant value was set to 30. Additionally, considering the scenario where the position does not change during the sampling time in the Hall sensor signal, two pulses could occur; so, the constant value was set to 60. If the number of pulses exceeds this value, it is recognized as a pulse error, triggering the detection mechanism.
When an error is detected, the control mode switches to Hall sensor control, and once the pulses return to normal, the control mode reverts to encoder control. This ensures that, regardless of when the pulse error occurs, the error can be detected by counting the number of encoder pulses during the Hall sensor signal change period.

7. Simulation Results

This paper provides a detailed discussion of the modeling process for the proposed pulse error detection and compensation algorithms, as well as an analysis of the pulse error detection and compensation results. The motor parameters and control constants used in the simulation are presented in Table 1. Among the inverter parameters, f sampling PWM refers to the inverter sampling period; V dc refers to the DC link voltage; and Is max refers to the phase current peak value. In the motor parameters, P represents the number of poles; T rated represents the motor’s rated torque; and Wrpm rated represents the motor’s rated speed. For the current controller parameters, Fcc refers to the current controller’s period. Additionally, R represents the stator resistance; Ld represents the d-axis inductance; and Lq represents the q-axis inductance. Furthermore, Kpd refers to the d-axis current controller’s P gain, and Kdq refers to the q-axis current controller’s I gain.
As shown in Figure 20, during the 0.02 to 0.04 s interval, an encoder pulse dropout occurred due to external disturbances. During this period, a pulse dropout can lead to an angular discrepancy of approximately 360 degrees. However, because the pulse variation is detected within a sampling time of 0.000133 s, the system can detect and compensate for the error even if the noise signal persists for an extended period.
As seen in Figure 20a,b, the control mode switched from encoder control to Hall sensor control because the number of encoder pulses during the pulse error exceeded the number specified by the detection algorithm for the given sampling time. The reason the control mode did not switch immediately at the 0.02 s mark, but instead changed after a certain delay, is that the detection algorithm required a sampling period to assess the pulse error and trigger the control mode switch. Similarly, at the point where the pulse dropout ends, there was a delay because the system needed to ensure that the number of encoder pulses remained within the set constant value during the Hall sensor signal sampling time before switching back to encoder control.
Additionally, the motor waveforms when the detection and compensation algorithms were active are shown in Figure 21. In a similar manner to the speed and angle waveforms, the control mode switched during the 0.02 to 0.04 s interval, and there was a delay component due to the compensation after the detection algorithm’s decision. As a result, when observing the motor characteristics, a slight overshoot occurred in outputs such as current and torque. This phenomenon is likely due to errors introduced by the delay component during the control mode switching process, caused by the sampling time. Therefore, it is necessary to eliminate these characteristics through further research.

8. Conclusions

This paper proposed and validated through simulation a pulse error detection and compensation algorithm to address signal anomalies in encoders and Hall sensors, which can occur during the control of Permanent Magnet Synchronous Motors (PMSMs). Encoders are particularly susceptible to environmental factors, especially noise, which can lead to signal dropouts and subsequently degrade motor control performance. To address this issue, we proposed a control technique that combines the use of both encoders and Hall sensors. The proposed algorithm operates by switching to a Hall sensor-based control mode whenever an encoder signal error is detected, thereby compensating for the encoder’s error. The simulation results demonstrated that when the encoder pulse dropouts occurred due to disturbances, the algorithm effectively compensated for the error by switching from the encoder control mode to the Hall sensor control mode. Although some overshoot in the current and torque output was observed due to the delay components introduced during the control mode switching process, this issue can likely be mitigated through further research. In conclusion, the algorithm proposed in this paper contributes to the maintenance of motor control performance in the presence of abnormal signals and plays a crucial role in achieving reliable motor control.

Author Contributions

Conceptualization, D.-W.K., S.-C.G. and K.-H.S.; Methodology, B.-D.P., J.-H.M., D.-W.K., S.-C.G. and K.-H.S.; Software, B.-D.P., S.-J.K. and S.-C.G.; Validation, B.-D.P., S.-J.K., J.-H.M., D.-W.K., S.-C.G. and K.-H.S.; Writing—original draft, B.-D.P. and S.-J.K.; Writing—review & editing, B.-D.P., S.-J.K., J.-H.M., D.-W.K. and S.-C.G.; Supervision, D.-W.K. and S.-C.G.; Project administration, D.-W.K. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

The original contributions presented in the study are included in the article, further inquiries can be directed to the corresponding author.

Conflicts of Interest

Author Beom-Do Park was employed by Youngshin Precision Co., Ltd. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript.
CWClockwise rotation of the motor.
CCWCounterclockwise rotation of the motor.
I a b c This represents the three-phase currents in the stator windings of the motor.
The three letters a , b , and c correspond to the three phases of the motor.
I d q r The result of transforming three-phase currents I a b c into a rotating reference frame for current control.
T z The time interval between consecutive samples, also referred to as the sampling period.
ω e r r The error in the estimated speed, which is the difference between the speed from the Hall sensor ( ω h a l l ) and the reference speed ( ω r s o ).
ω h a l l The angular velocity (speed) was estimated using the Hall sensor.
ω r s o The reference speed or setpoint speed used for comparison or control purposes.
ω c o r r e c t The correction term for the speed estimation, which is applied at each time step k to adjust the estimated speed.
ω r   e s t The final estimated speed at time step k , which combines the reference speed, error term, and the correction factor
θ h a l l ( k ) The estimated angle from the Hall sensor at the current time step k

References

  1. Park, N.C.; Lee, Y.K.; Kim, S.H. Initial Rotor Permanent-Magnet Synchronous Motor using Inductance Saturation. Trans. Korean Inst. Power Electron. 2011, 16, 374–381. [Google Scholar] [CrossRef]
  2. Kim, T.W.; Kim, S.R.; Kim, S.H.; Yu, J.W.; Kim, H.H.; Lee, K.C.; Hwang, Y.Y. Hall Sensor Magnetic Encoder Design based on Fault Detection Algorithm. J. Korean Soc. Manuf. Process Eng. 2022, 21, 113–120. [Google Scholar] [CrossRef]
  3. Hwang, J.H.; Chung, C.S. DSP Implementation on a Sinusoidal Encoder using linear Hall Sensor. Trans. Korean Inst. Electr. Eng. 2012, 61, 298–302. [Google Scholar] [CrossRef]
  4. Bai, H.; Yu, B.; Ouyang, W.; Yan, X.; Zhu, J. HF-Based Sensorless Control of a FTPMM in Ship Shaftless Rim-Driven Thruster System. IEEE Trans. Intell. Transp. Syst. 2022, 23, 16867–16877. [Google Scholar] [CrossRef]
  5. Bourogaoui, M.; Jlassi, I.; El Khil, S.K.; Attia Sethom, H.B. An effective encoder fault detection in PMSM drives at different speed ranges. In Proceedings of the 2015 IEEE 10th International Symposium on Diagnostics for Electrical Machines, Power Electronics and Drives (SDEMPED), Guarda, Portugal, 1–4 September 2015; pp. 90–96. [Google Scholar]
  6. Tsoumanis, K.; Axelos, N.; Moschopoulos, N.; Zervakis, G.; Pekmestzi, K. Pre-Encoded Multipliers Based on Non-Redundant Radix-4 Signed-Digit Encoding. IEEE Trans. Comput. 2016, 65, 670–676. [Google Scholar] [CrossRef]
  7. Chun, T.W.; Ahn, J.R.; Lee, H.H.; Kim, H.G.; Nho, E.C. Design of Filter for Output Signals in Incremental Encoder for Detecting Speed and Position of Motors. Trans. Korean Inst. Power Electron. 2005, 10, 290–295. [Google Scholar]
  8. Vázquez-Gutiérrez, Y.; O’Sullivan, D.L.; Kavanagh, R.C. Small-Signal Modeling of the Incremental Optical Encoder for Motor Control. IEEE Trans. Ind. Electron. 2020, 67, 3452–3461. [Google Scholar] [CrossRef]
  9. Kavanagh, R.C. Performance analysis and compensation of M/T-type digital tachometers. IEEE Trans. Instrum. Meas. 2001, 50, 965–970. [Google Scholar] [CrossRef]
  10. Ilmiawan, A.F.; Wijanarko, D.; Arofat, A.H.; Hindersyah, H.; Purwadi, A. An easy speed measurement for incremental rotary encoder using multi stage moving average method. In Proceedings of the 2014 International Conference on Electrical Engineering and Computer Science (ICEECS), Kuta, Indonesia, 24–25 November 2014; pp. 363–368. [Google Scholar] [CrossRef]
  11. Chen, Y.; Yang, M.; Long, J.; Xu, D.; Blaabjerg, F. M/T method based incremental encoder velocity measurement error analysis and self-adaptive error elimination algorithm. In Proceedings of the IECON 2017—43rd Annual Conference of the IEEE Industrial Electronics Society, Beijing, China, 29 October–1 November 2017; pp. 2085–2090. [Google Scholar]
  12. Oh, J.Y.; Oh, Y.G.; Choi, J.W. Improvement Position Measurement Method for control of Synchronous Motor based on Incremental Encoder with noise. In Proceedings of the Power Electronics Conference, Kyeongju, Republic of Korea, 5–7 July 2022. [Google Scholar]
  13. Lee, J.H.; Lee, T.K.; Kim, Y.R.; Won, C.Y. Control Algorithm for PMSM using Rectangular Two Hall Sensors Compensated by Sensorless Control Method. J. Korean Inst. Illum. Electr. Install. Eng. 2012, 26, 40–47. [Google Scholar] [CrossRef]
  14. Baek, S.K.; Lee, J.W. An Improved Speed Measurement Method using Incremental Encoders. Trans. Korean Inst. Electr. Eng. 1998, 47, 1681–1686. [Google Scholar]
  15. Lee, J.W.; Ha, J.I. Variable Sampling Time Speed Observer for Precise Rotor Speed and Position Estimation at Low-Resolution Hall-Effect Sensor System. In Proceedings of the Power Electronics Conference, Buan, Republic of Korea, 6–8 July 2021. [Google Scholar]
  16. Hu, J.; Zou, J.; Xu, F.; Li, Y.; Fu, Y. An Improved PMSM Rotor Position Sensor Based on Linear Hall Sensors. IEEE Trans. Magn. 2012, 48, 3591–3594. [Google Scholar] [CrossRef]
  17. Crescentini, M.; Syeda, S.F.; Gibiino, G.P. Hall-Effect Current Sensors: Principles of Operation and Implementation Techniques. IEEE Sens. J. 2022, 22, 10137–10151. [Google Scholar] [CrossRef]
  18. Aguado-Rojas, M.; Pasillas-Lépine, W.; Loría, A.; De Bernardinis, A. Acceleration Estimation Using Imperfect Incremental Encoders in Automotive Applications. IEEE Trans. Control Syst. Technol. 2020, 28, 1058–1065. [Google Scholar] [CrossRef]
  19. Ryu, D.Y.; Lee, B.C.; Choe, S.B.; Cho, K.G. Implementation of a Noise Immune Interpreter for a Rotary Encoder in Electronic Circuits. J. Inst. Electron. Inf. Eng. 2018, 55, 32–39. [Google Scholar]
  20. Boggarpu, N.K.; Kavanagh, R.C. New Learning Algorithm for High-Quality Velocity Measurement and Control When Using Low Cost Optical Encoders. IEEE Trans. Instrum. Meas. 2010, 59, 565–574. [Google Scholar] [CrossRef]
Figure 1. Position measurement sensors: (a) resolver, (b) encoder, (c) Hall sensor.
Figure 1. Position measurement sensors: (a) resolver, (b) encoder, (c) Hall sensor.
Mathematics 12 03019 g001
Figure 2. Structure and operating principle of the encoder.
Figure 2. Structure and operating principle of the encoder.
Mathematics 12 03019 g002
Figure 3. Pulse multiplication method of the encoder.
Figure 3. Pulse multiplication method of the encoder.
Mathematics 12 03019 g003
Figure 4. Incremental encoder M method speed measurement.
Figure 4. Incremental encoder M method speed measurement.
Mathematics 12 03019 g004
Figure 5. Pulse dropout in incremental encoders.
Figure 5. Pulse dropout in incremental encoders.
Mathematics 12 03019 g005
Figure 6. Current waveform imbalance caused by encoder pulse errors.
Figure 6. Current waveform imbalance caused by encoder pulse errors.
Mathematics 12 03019 g006
Figure 7. Pulse output modeling using MATLAB Simulink R2023B.
Figure 7. Pulse output modeling using MATLAB Simulink R2023B.
Mathematics 12 03019 g007
Figure 8. Rotation direction detection modeling using MATLAB Simulink R2023b.
Figure 8. Rotation direction detection modeling using MATLAB Simulink R2023b.
Mathematics 12 03019 g008
Figure 9. Incremental encoder modeling using MATLAB Simulink R2023b.
Figure 9. Incremental encoder modeling using MATLAB Simulink R2023b.
Mathematics 12 03019 g009
Figure 10. Position sensor speed and angle calculation/estimation flowchart: (a) encoder speed/angle calculation flowchart, (b) Hall sensor speed/angle estimation flowchart.
Figure 10. Position sensor speed and angle calculation/estimation flowchart: (a) encoder speed/angle calculation flowchart, (b) Hall sensor speed/angle estimation flowchart.
Mathematics 12 03019 g010
Figure 11. Encoder speed calculation modeling using MATLAB Simulink R2023b.
Figure 11. Encoder speed calculation modeling using MATLAB Simulink R2023b.
Mathematics 12 03019 g011
Figure 12. Motor output waveform based on encoder-estimated speed and angle.
Figure 12. Motor output waveform based on encoder-estimated speed and angle.
Mathematics 12 03019 g012
Figure 13. Hall sensor modeling and absolute angle detection using MATLAB Simulink R2023b.
Figure 13. Hall sensor modeling and absolute angle detection using MATLAB Simulink R2023b.
Mathematics 12 03019 g013
Figure 14. Hall sensor modeling and absolute angle detection waveform using MATLAB Simulink R2023b.
Figure 14. Hall sensor modeling and absolute angle detection waveform using MATLAB Simulink R2023b.
Mathematics 12 03019 g014
Figure 15. Hall sensor speed/angle estimation modeling using MATLAB Simulink R2023b.
Figure 15. Hall sensor speed/angle estimation modeling using MATLAB Simulink R2023b.
Mathematics 12 03019 g015
Figure 16. Motor output waveform based on Hall sensor-estimated speed and angle.
Figure 16. Motor output waveform based on Hall sensor-estimated speed and angle.
Mathematics 12 03019 g016
Figure 17. Waveform of motor output degradation due to encoder pulse counter pulse dropout.
Figure 17. Waveform of motor output degradation due to encoder pulse counter pulse dropout.
Mathematics 12 03019 g017
Figure 18. Flowchart of encoder pulse error detection and control mode switching technique.
Figure 18. Flowchart of encoder pulse error detection and control mode switching technique.
Mathematics 12 03019 g018
Figure 19. Pulse error detection algorithm modeling using MATLAB Simulink R2023b.
Figure 19. Pulse error detection algorithm modeling using MATLAB Simulink R2023b.
Mathematics 12 03019 g019
Figure 20. Speed/angle after pulse error detection and compensation algorithm operation: (a) control mode switching speed graph, (b) control mode switching angle graph.
Figure 20. Speed/angle after pulse error detection and compensation algorithm operation: (a) control mode switching speed graph, (b) control mode switching angle graph.
Mathematics 12 03019 g020
Figure 21. Motor output waveforms: (a) encoder counter pulse dropout, (b) after pulse error detection and compensation algorithm operation.
Figure 21. Motor output waveforms: (a) encoder counter pulse dropout, (b) after pulse error detection and compensation algorithm operation.
Mathematics 12 03019 g021
Table 1. Simulation parameters and control constants.
Table 1. Simulation parameters and control constants.
ContentUnitValue
Simulation Parameter
Stop time[s]0.7
Inverter Parameter
f sampling PWM[Hz]10,000
V d c [V]400
Is max[A]250
Motor Parameter
P-4
T rated[Nm]70
Wrpm rated[rpm]3000
R s [ohm]0.00931498
Magnetic Flux[Wb]0.0668
L d [uH]29.3
L q [uH]36
J m [kg·m2]0.23
Current Controller Parameter
Fcc[Hz]7500
K p d -3
K i d -0.3
K d q -4
K i q 10
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Park, B.-D.; Kim, S.-J.; Moon, J.-H.; Kang, D.-W.; Go, S.-C.; Su, K.-H. Study on Compensation Method of Encoder Pulse Errors for Permanent Magnet Synchronous Motor Control. Mathematics 2024, 12, 3019. https://doi.org/10.3390/math12193019

AMA Style

Park B-D, Kim S-J, Moon J-H, Kang D-W, Go S-C, Su K-H. Study on Compensation Method of Encoder Pulse Errors for Permanent Magnet Synchronous Motor Control. Mathematics. 2024; 12(19):3019. https://doi.org/10.3390/math12193019

Chicago/Turabian Style

Park, Beom-Do, Seon-Jung Kim, Ju-Hyeong Moon, Dong-Woo Kang, Sung-Chul Go, and Khac-Huan Su. 2024. "Study on Compensation Method of Encoder Pulse Errors for Permanent Magnet Synchronous Motor Control" Mathematics 12, no. 19: 3019. https://doi.org/10.3390/math12193019

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop