HFI in VESC: Starting a sensorless motor at zero speed
Without sensors, a FOC (Field-Oriented Control) controller estimates the rotor position based on the voltage produced by the motor as it rotates. When the motor is stationary, there is no voltage to read, which is why sensorless starts can sometimes be hesitant, especially under load. High Frequency Injection (HFI) overcomes this problem: the controller sends small voltage pulses into the motor and deduces the rotor position from how the current reacts. However, this only works if the motor is compatible.
The essentials
- The HFI (Hall Effect Sensor) setting is selected within the Motor Settings, under the FOC section, in the General parameters, using the Sensor Mode option.
- It only works with motors whose inductance varies with the position of the rotor (a characteristic known as saliency).
- There are several variants: HFI, VSS, and so-called "silent" versions.
- The HFI (High-Frequency Inverter) only activates at low speeds; beyond that, the standard sensorless observer takes over.
- For a motor equipped with Hall sensors that are in good working order, the Hall sensors remain the simplest solution.
The issue with sensorless starting
When operating without sensors, the VESC uses an observer: a calculation that estimates the position of the rotor based on voltages and currents, relying on the back-EMF, the voltage that the motor generates when rotating. This voltage is proportional to the speed: at standstill, it is zero, and the observer has nothing to observe. The startup is then performed in open-loop mode, by imposing a rotating magnetic field, which works well with no load but can cause jerks or a hesitant start under load. Our guide on the sensorless observer details this mechanism.
The principle of HFI
In many motors, the inductance is not the same depending on whether it is measured along the axis of the magnets (D-axis) or at a 90-degree angle (Q-axis). This difference, known as saliency, is particularly prevalent in motors with internal magnets. By injecting a small alternating voltage at a high frequency and measuring the resulting current, the controller can identify the axis with the lowest inductance, which corresponds to the rotor, even when the motor is stationary.
A remaining challenge is that this measurement does not distinguish between the north and south poles. The HFI (Hall Effect Interface) can be off by 180 electrical degrees, and the motor could start spinning in the wrong direction. Therefore, this ambiguity must be resolved at startup by exploiting the magnetic saturation of the iron: this is the role of the HFI Ambiguity Resolve Mode setting.
The VESC Tool stores the measured saliency in the parameter Motor Inductance Difference (Lq - Ld). Its help documentation specifies that the measure_ind command in the terminal performs this measurement, although the standard detection wizard does not yet display it. A very small difference indicates a difficult HFI (High Frequency Induction) setup.
The proposed variations are:
| Sensor Mode | Principle according to the VESC Tool help documentation |
|---|---|
| HFI | The control system adjusts the motor's position until it reaches zero speed by injecting voltage pulses. This requires a sufficient difference between the Ld and Lq inductance values |
| VSS | Vedder Sensorless Start: Uses the HFI (Hall Effect Interface) only during startup to determine the initial position, then allows the observer to track the motor's rotation; can be helpful for motors with weak Hall signals |
| 45-degree V0V7 HFI (Silent) | Silent operation is possible if the switching frequency is high enough, and it offers greater stability under heavy loads. However, it requires carefully measured inductance and shunts on the phases |
| 45-degree V0 HFI | The same principle applies, measuring along a single vector |
| Coupled V0V7 HFI (Silent) | Injects current on the D-axis and measures it on the Q-axis; less susceptible to inductance errors, but performs less well under heavy loads |
| Coupled V0 HFI | The same principle applies, measuring along a single vector |
The original HFI mode produces an audible hiss: this is the injection process itself. Silent variants eliminate this when the hardware allows.
Settings for the HFI tab
In the Motor Settings section, the FOC tab, the HFI section groups together:
- Sensorless ERPM HFI: The electrical speed at which the HFI (High Frequency Inverter) is used; above this speed, the standard observer takes over.
- HFI Start Voltage: The voltage injected at startup to resolve any ambiguity; it must generate enough current to induce saturation.
- HFI Run Voltage and HFI Max Voltage: The voltage injected during operation, which increases from the first value to the second value with the motor current. Higher voltage improves tracking but can generate more noise and losses.
- HFI Samples: The number of measurements per electrical revolution (8, 16, or 32).
- HFI Start Samples: The number of measurements taken at startup; during this time, the throttle does not have any effect.
- HFI Ambiguity Resolve Mode: Six Vectors (the older method, fast, suitable for most hobby motors), Id Single Pulse or Id Double Pulse (current pulse in the D-axis, more reliable on large iron rotors). The pulse modes use HFI Ambiguity Resolve Current.
- HFI Observer Override Time: A short period during which the observer maintains control during the transition, to prevent oscillations between the two methods.
And what about a scooter motor?
Electric scooter hub motors typically have magnets glued to the surface of the rotor. These motors generally have low saliency, which makes Hall Field Initialization (HFI) uncertain. Our guide on interior and surface-mounted magnet motors explains the difference. However, they almost always have Hall sensors, which provide a clean start without requiring delicate adjustments. HFI is primarily justified when there are no Hall sensors, when the sensors are a source of failures (exposed cables, humidity), or on interior magnet motors. To compare the solutions, see our guide on motor position sensors.
The method for trying..
- Perform a clean FOC sensorless motor detection and verify that the motor spins correctly at a medium speed.
- Measure the saliency using the `measure_ind` command in the terminal.
- For wheelie setups, choose either VSS or HFI in the Sensor Mode and test low-current starts.
- If the motor sometimes spins in the wrong direction, adjust the HFI Ambiguity Resolve Mode and the HFI Start Voltage.
- Increase the load gradually: the HFI (Hall effect sensor) is most likely to lose its position under high torque at low speeds.
Workshop tip
A jerky or erratic start, especially under load, is dangerous for a vehicle. Only use the HFI (Hall Sensor Failure Imitation) after you have successfully performed dozens of wheelie starts and low-speed starts under load. If your Hall sensors are working, repair them instead of replacing them with HFI. For repairs to the wiring between the motors and controllers, see our "Plug & Play Motor to Controller Installation" service (https://rage-mechanics.com/en/contact-us), or our hourly labor rate (https://rage-mechanics.com/en/our-products/1529-labor-30-minutes.html).
Frequently Asked Questions
Does the HFI (High Frequency Inverter) technology work with all motors?
No. It requires a difference in inductance between the D and Q axes. Surface-mounted permanent magnet motors often have very little of this difference; VESC can sometimes help some of them to start.
Why is my motor whistling when using the HFI?
This is high-frequency voltage injection. Silent modes reduce this noise, provided that the hardware supports them, particularly shunts on the phases.
Sometimes the motor starts spinning in the wrong direction. What settings should I adjust?
It's an ambiguity issue of 180 degrees. Try a different HFI Ambiguity Resolve Mode, or a higher HFI Start Voltage to reveal the saturation.
Does the HFI replace Hall sensors?
It is possible, but only on motors that are compatible. For most electric scooter motors, Hall sensors in good condition remain a simpler and more reliable solution.
Does the HFI consume power?
Yes, to some extent: injection creates losses. That's why the injected voltage is adjustable, and that's why the HFI (High Frequency Injection) stops working above the sensorless ERPM (Electromagnetic Rotor Position Measurement) HFI range.