National High-Tech Enterprise IEC 61000 EMC · IEC 60730 Class B · RoHS ISO 9001 certified Jinhua, Zhejiang · around 200 staff · 25 in R&D
TECHNICAL NOTE 18 / 22

FOC Motor Control - Square-Wave High-Frequency Injection

Sailike R&DFOC technical notes 中文原文

At zero speed and low speed, the back-EMF of a permanent magnet synchronous motor is small and the signal-to-noise ratio is low, so position observation methods based on the back-EMF model cannot estimate the rotor position accurately. The high-frequency signal injection method superimposes a high-frequency voltage signal on the stator windings and extracts rotor position information from the saliency of the motor, including structural saliency and saturation saliency; it is an effective means of achieving sensorless control at zero and low speed. Compared with sinusoidal injection, square-wave high-frequency injection offers a fast dynamic response, simple signal processing and low sensitivity to inverter nonlinearity.

a. Basic principle

For an interior permanent magnet synchronous motor, the high-frequency voltage equation in the stationary αβ frame can be approximated as:

[uαhuβh]=[L0+L1cos2θL1sin2θL1sin2θL0–L1cos2θ]ddt[iαhiβh]

where L0=(Ld+Lq)/2 , L1=(Ld–Lq)/2 , and θ is the rotor position angle. The inductance matrix therefore contains the rotor position information. A high-frequency square-wave voltage is injected in the estimated synchronous rotating frame d^q^ , the corresponding high-frequency current response is extracted, and the rotor position error is obtained after signal demodulation, so that position tracking can be achieved through a phase-locked loop.

b. Square-wave injection and current response

In the estimated rotating frame d^q^ , the injected high-frequency square-wave voltage usually takes the following form:

[ud^huq^h]=[Vh·(−1)k0]

where Vh is the injected voltage amplitude and k is the switching period index, that is, +Vh and −Vh are injected alternately in each carrier period to form a high-frequency square-wave sequence. The injection frequency is usually half the switching frequency, so that it does not conflict with the bandwidth of the current controller.

Because the injection frequency is far higher than the fundamental frequency, the motor model can be simplified to a pure inductance model. In the d^q^ frame, the relationship between the high-frequency current response and the injected voltage can be expressed as:

[id^h(k)iq^h(k)]=Ts2[1Ld^001Lq^][ud^h(k)uq^h(k)]+[id^h(k−1)iq^h(k−1)]

where Ts is the switching period and Ld^,Lq^ are the equivalent inductances in the estimated frame. In practice, the instantaneous change of the high-frequency current is usually sampled directly to improve immunity to interference.

c. Signal extraction and demodulation

In a practical control system, the high-frequency injection signal and the fundamental control signal are superimposed on the same voltage command, so the high-frequency response component and the fundamental component must be separated after current sampling, for use in position demodulation and in current closed-loop control respectively.

Fundamental component extraction: The fundamental component is extracted by a moving average, taking the arithmetic mean of the current sample of this control cycle and the fundamental estimate of the previous cycle, that is:

ibase(k)=i(k)+ibase(k−1)2

where i(k) is the current sample of this cycle and ibase(k−1) is the fundamental component extracted in the previous cycle. This method requires no additional filter, is simple to compute and introduces little delay, and it preserves the dynamic response of the fundamental component.

High-frequency component extraction: The high-frequency component is obtained directly by subtracting the fundamental component extracted in the current cycle from the current sample of this cycle:

ih(k)=i(k)–ibase(k)

Because the fundamental component changes slowly, this subtraction separates the high-frequency response quickly and avoids the phase delay introduced by a filter, which makes it particularly suitable for high-frequency current processing under square-wave injection.

Envelope extraction: The envelope of the high-frequency current response contains the rotor position error information. The envelope is extracted by synchronous demodulation, multiplying the high-frequency current component by the polarity of the injected voltage to obtain the DC component that reflects the position error. For square-wave injection, the demodulation process can be expressed as:

ε=iq^h(k)·sign(ud^h)

where iq^h is the high-frequency current on the q^ axis and sign(ud^h) is the polarity sign of the injected voltage. The operation uses the correlation between the high-frequency current and the polarity of the injected voltage directly, so the position error signal is obtained without a low-pass filter, which gives an excellent dynamic response.

d. Position tracking and polarity determination

Quadrature phase-locked loop: The demodulated error signal ε is approximately proportional to the rotor position error Δθ . Feeding this error into a quadrature phase-locked loop (PLL) achieves closed-loop tracking of the rotor speed and position. A typical PLL structure contains a proportional-integral (PI) controller and an integrator:

{ω^=(kp+kis)·εθ^=1sω^

where kp and ki are the proportional and integral gains of the PI controller. By designing the PLL bandwidth appropriately, high-frequency noise is filtered out while fast position tracking is maintained.

Convergence points and N/S polarity determination: When the square-wave high-frequency injection method runs at zero and low speed, the position error usually has four possible convergence points, that is, within every 180∘ of electrical angle there are two stable convergence points and two unstable convergence points. Specifically, for an interior permanent magnet synchronous motor, because Ld<Lq , the minimum of the current response amplitude under high-frequency voltage injection corresponds to the d axis direction of the rotor magnetic pole, so the convergence points lie in the positive or the negative direction of the d axis, 180∘ of electrical angle apart. However, saliency alone cannot distinguish the N pole from the S pole, and an additional polarity determination step is required.

A common polarity determination method is based on magnetic circuit saturation: when a short voltage pulse is injected along the d axis, a large current slope means that the field direction coincides with the injection direction, that is, the flux is reinforced, which corresponds to the N pole; conversely, a small current slope corresponds to the S pole. In a concrete implementation, a short positive voltage pulse is applied along the estimated d axis and the magnitude of the d axis current response to that pulse is compared. A fast current change indicates the N pole in that direction, and a slow change indicates the S pole. According to the result, the estimated angle is corrected to the correct magnetic pole direction, so that the absolute rotor position within 0~360∘ is obtained.

Another engineering method injects pulses of equal width at the four candidate angles during initial positioning and determines the magnetic polarity by comparing the current peaks, which gives fast and reliable initial position identification. Once polarity determination is complete, the convergence point is locked uniquely to the N pole direction, ensuring correct torque output when the motor starts from zero speed.

e. Random square-wave frequency injection

Conventional square-wave high-frequency injection uses a fixed injection frequency, so its harmonic energy is concentrated near the switching frequency and its multiples, forming a discrete spectrum of spikes. This concentrated high-frequency harmonic energy excites the motor stator through electromagnetic force and produces high-frequency noise, and the audible noise is particularly pronounced in applications with strict acoustic requirements, such as home appliances and servo drives.

Principle of random frequency modulation: Random square-wave frequency injection randomizes the switching period or the injection period, so that the frequency of the injected square wave varies randomly within a bandwidth and the concentrated harmonic energy is spread over a wider band. Common randomization schemes include:

  • Random period modulation: each injection period is Th(k)=T0+ΔT·r(k) , where T0 is the fundamental period, ΔT is the amplitude of the random perturbation, and r(k) is a random number with a uniform or normal distribution;
  • Random carrier frequency: randomization is introduced at the switching period level, so that the switching frequency of the inverter varies randomly within a range and the injection frequency consequently varies randomly as well.

Power spectrum distribution: Under fixed-frequency injection, the power spectral density (PSD) of the current and voltage consists of discrete lines, with energy concentrated at the injection frequency finj and its odd harmonics:

Sii(f)=∑n=1,3,5,…An·δ(f–nfinj)

where An is the power amplitude of the n th harmonic and δ(·) is the Dirac delta function.

With random frequency modulation, the power spectral density changes from a discrete spectrum to a continuous spectrum, with its energy distributed over the bandwidth B=fmax–fmin :

Sii(f)=PtotalB·W(f)+残余离散分量

where Ptotal is the total power of the injected signal and W(f) is the normalized power spectrum envelope, which is usually close to a uniform distribution. The effectiveness of randomization depends on the entropy of the random sequence and on the ratio of the perturbation amplitude ΔT/T0 ; when the perturbation ratio is large enough, usually greater than 10% , the discrete lines are effectively weakened and the peak energy can be reduced by 10~20 dB.

Noise reduction principle: The human ear is far more sensitive to narrow-band spike noise than to broadband continuous noise. Random frequency injection spreads the discrete harmonic energy and lowers the sound pressure amplitude at each frequency point, so the peak sound pressure level drops significantly. Randomization also breaks the synchronous excitation between the injection signal and the natural frequencies of the motor structure, which prevents resonance noise. From the viewpoint of electromagnetic force, once the radial electromagnetic force harmonics acting on the stator are randomized, their periodicity in time is destroyed and they cannot accumulate to excite structural modes, which effectively suppresses high-frequency whine.

Weighted randomization strategy: Human perception of sound follows the equal-loudness contour, the A-weighting curve, being most sensitive to noise in the 1~5 kHz range and less sensitive at low frequencies ( <500 Hz) and high frequencies ( >8 kHz). The randomization strategy should therefore make the power spectrum as flat and spread out as possible within the sensitive band and may allow some energy concentration in bands where the ear is insensitive. The implementation is as follows:

  • The probability density function p(f) of the random injection frequency is set inversely proportional to the auditory sensitivity of the human ear, that is:
p(f)∝1A(f)

where A(f) is the A-weighting coefficient. This means that in the sensitive band around 2~4 kHz the random frequency occurs with higher probability, so the energy is spread more evenly, while at low frequencies ( <500 Hz) the randomization amplitude is reduced to keep energy out of the low-frequency region, where the ear is more sensitive.

  • A logarithmic uniform distribution is used instead of a linear uniform distribution, so that the frequency is uniformly distributed on an octave scale, which better matches the frequency resolution of the human ear.

Frequency hopping strategy: A purely random frequency may at times fall on a mechanical resonance of the system and excite severe noise. A frequency hopping strategy avoids this problem:

  • In advance, M candidate frequencies are collected into a set F={f1,f2,…,fM} ; each candidate avoids the structural resonance frequencies of the motor and the frequencies to which the inverter dead-time effect is sensitive.
  • In each injection period, one frequency is selected at random from the set according to a probability distribution. The distribution can be designed to depend on the noise characteristics of the candidate frequencies, preferring frequencies with a small noise contribution.
  • To preserve the convergence of the position observer, the frequency step between adjacent periods should not be too large and is usually limited to within ±20% to avoid observer gain mismatch.

Key to avoiding a louder result after randomization: An unsuitable randomization strategy can lead to the following situations:

  • Generation of subharmonics: if random period modulation has insufficient randomness, for example a periodically repeated pseudo-random sequence, subharmonic components below the injection frequency appear, and these low-frequency subharmonics are more audible than the original discrete spikes.
  • Long dwell at a resonance: if the random distribution gives a resonance frequency an excessively high probability, the noise peak remains pronounced.

Countermeasures:

  • Use high-entropy true random numbers or a high-performance pseudo-random number generator, such as the Mersenne Twister, to avoid periodicity.
  • Introduce forbidden zones in the random frequency distribution, setting the bands around the system resonance frequencies as low-probability or fully forbidden zones.
  • Add a dwell time limit: no frequency may appear for more than Nmax consecutive periods, and a hop is forced to prevent resonance from building up.

Injection voltage variation with random frequency: If the injected voltage amplitude Vh is held constant while the frequency varies, the volt-second product Vh·Th of the injection changes with frequency, which makes the high-frequency current amplitude fluctuate and degrades the stability and consistency of position demodulation. The injection voltage must therefore be adapted to the frequency to keep the high-frequency current amplitude constant.

From the high-frequency current response equation:

|Δih|≈VhThLeq

where Th=1/(2fh) is the half injection period and Leq is the equivalent inductance. For |Δih| to remain constant, the injected voltage amplitude should satisfy:

Vh(f)=Vh0·fhfh0

That is, the voltage amplitude is proportional to the injection frequency. When the frequency rises, the injection voltage increases accordingly, and when the frequency falls, the voltage decreases. This adjustment keeps the high-frequency current response amplitude constant over the whole random band, ensures consistent observer gain, and avoids a low signal-to-noise ratio caused by too low a voltage at low injection frequencies or overmodulation caused by too high a voltage at high injection frequencies.

In a practical implementation, a frequency-to-voltage mapping table can be computed in advance and looked up online to update the injection voltage command, or the formula can be evaluated in real time. The response speed of the voltage adjustment should match the speed of the frequency hops, and updating before the start of the next injection period is usually sufficient.

f. Deterministic frequency hopping map

Although randomization spreads discrete spikes into a continuous spectrum, over a finite time the statistics of a random sequence can still show accidental clustering, with a given frequency repeating in a short interval; the instantaneous energy then concentrates at that frequency and audible noise still appears. A better engineering approach therefore exists: abandon true randomness and use a deterministic frequency hopping sequence, that is, compute an optimal frequency transition map in advance and execute it cyclically.

Principle of deterministic frequency hopping: Unlike random modulation, deterministic frequency hopping does not rely on a probability distribution; a frequency sequence Fseq=[f1,f2,…,fN] is constructed directly and injected cyclically in a fixed order. The sequence is designed to achieve the following goals:

  • In the frequency domain, make the power spectrum as flat as possible within the target band, with no pronounced peaks;
  • In the time domain, avoid consecutive repetition of the same frequency and prevent periodic beating between adjacent frequencies.

Construction of the optimal frequency transition map:

  1. Optimal frequency set based on the equal-loudness contour: The frequency points are sampled non-uniformly according to the A-weighting sensitivity distribution so that the cumulative distribution function satisfies ∫fminfkA(f)df=kN∫fminfmaxA(f)df , that is, the points are denser in the sensitive band and sparser at low and high frequencies.
  2. Adjacent frequency transition based on Gray code: A maximum step constraint |fk+1–fk|≤Δfmax is imposed and the frequencies are ordered by Gray code, so that the transition along the frequency axis is smooth and periodic beating is broken.
  3. Resonance avoidance: The structural resonance frequencies of the motor are identified and removed, together with their neighbourhoods, from the frequency set. If the resonance region must be covered, the total time spent in it within any M consecutive periods is kept below a set threshold.

Deterministic sequence versus random strategy:

Aspect| Random frequency injection| Deterministic frequency hopping ---|---|--- Spectral uniformity| Uniform on a long-term average in theory, but clustering may occur over finite time| Strictly follows the designed distribution, with no risk of clustering Worst-case noise| Accidental loud periods are possible| Predictable, and the worst case is guaranteed to be better than random Observer stability| Gains must adapt to statistical variations, so the design is conservative| The sequence is known, so optimal gains can be precomputed and stability is higher Implementation complexity| Random number generator with real-time computation| Sequence constructed offline and looked up at run time Adaptability| Cannot adapt to changes in the resonance frequencies| The sequence can be tailored to a specific motor

Implementation recommendations:

  • Sequence length: Choose N≥64 , covering a time window of several hundred milliseconds to a few seconds, so that the frequency cycle cannot be perceived by the ear.
  • Sequence storage and cycling: The constructed frequency sequence is stored in read-only memory; one frequency is taken per injection period and the index is incremented. The cycle period Tcycle=N·Tinj should exceed the temporal integration constant of the ear, about 200 ms.
  • Gain scheduling: The observer gains for each frequency, such as the PLL bandwidth and the voltage compensation coefficient, are computed in advance and scheduled by table lookup at run time, so that the dynamic performance is consistent across the band.

Conclusion: A deterministic frequency hopping map is better suited than a purely random strategy to engineering applications with strict noise requirements. It removes at the root the accidental noise concentration that randomization can produce, and provides better observer stability and predictability. Its core is a frequency sequence constructed offline that satisfies the equal-loudness distribution, resonance avoidance and smooth transition constraints, executed cyclically at run time. The additional implementation cost is one read-only table, the computational overhead is comparable to random modulation, and both the noise reduction and the system robustness improve significantly.

This article was compiled by AI and calibrated manually.