Skip to main content
Firmware Stable

Motor sensor for VECTOR

Sensor selection

This page covers motor sensor types and their settings.

info

Hereby described variables are located in the folder /driver.

prest [-]

Preferred rotor position estimation mode.

prestnameAlternatives
-1Driver is deinitialized, powerstage is in HiZ
0Asynchronous mode
1Sensoreless mode128 - alternate mode (experimental)
2Three Hall sensors66 - disable input holdoff filter
3Sin-Cos sensor
4Resolver
5digital sensor, SSI 16-bit protocol21 - AS5048 mode; 149 - AS5048 mode with chip-select ; 37 - error detection override
6digital sensor, BiSS protocol70 - skip CDS bit
8digital sensor, 18-bit SSI32 for ZETTLEX sensors
10Incremental encoder26 - reference (Z) input; 58 - reference (Z) and PWM duty cycle homing input
info

If the prest is changed the driver must be restarted or the reinit command must be run. Also, the command identrun must be run to identify the new sensor type.

warning
  • Un-identified sensor type may cause unexpected motor spinning, even with the stop command issued and/or any other freewheeling mode!
  • The controller hardware never supports all the sensors listed in the table. Please check the hardware documentation for the supported sensor types.
  • The firmware may not support all the sensors. As a reason, there are more firmware variants and you need to choose the correct one. Check you application documentation and the "Firmware Mods" section.
danger

For motor with permanent magnets, you must use a sensor with absolute position output. Incremental encoders (AB, ABZ) are meant for asynchronous motors.


REST (Rotor position ESTimator) algorithm

Rotor position ESTimator (REST) is a module responsible for providing the reliable estimate of the rotor position from various sources for the vector drive (FOC). Generally, the REST can be configured as sensored or sensorless.

Signal diagram of sensored mode

sensored REST

Signal diagram of sensorless mode

sensorless REST

info

Hereby described variables are located in the folder /driver/rest.

warning

Wrong settings in this folder may cause unexpected motor spining, even with in the stop command issued and/or any other freewheeling mode! Proceed with caution.

tip

The VECTOR algorithm supports multiple motor sensors. Not all parameters are used for every sensor type.

State variables

eangle [rad]

Estimated electrical angle position output (after the processing).

mangle [rad]

Mechanical angle (intermediate state) after the sensor mapping (available only with certain sensor types).

b1 and b2

Mechanical angle represented in trigonometric coordinates (sin, cos) (intermediate state) after the sensor mapping (available only with certain sensor types).

hall

Mapped hall sensor reading. This variable is available only with the hall sensor mode.

ValueDescription
0All hall sensors are off - Error value
7All hall sensors are on - Error value
1-6Hall sensor position

Sensor mapping configuration

tip

The sensor parameters may be automatically identified with the identrun procedure.

omega

The meaning and unit depend on the motor class declared in psi and on prest:

Motor class (psi)prestMeaningUnit
PMSM (positive)0Rotation speed of the forced magnetic field (the electrical angle is not coupled to the shaft angle)erad/s
ACIM (negative)0U/f ratio: the electrical frequency per volt of applied stator voltage (sensorless)erad/s per V
ACIM (negative)otherNot used: with a sensor the slip frequency follows from iq, the excitation current and the rotor time constant given as the magnitude of psi-

See the ACIM guide for the sensored set-up.

warning

(Driver 5 and below) With a sensor on an ACIM, omega set the slip gain. In driver 6 the slip follows from the rotor time constant given as the magnitude of psi; omega is not used in that mode.

hinv [-]

UVW hall sensor polarity inversion.

A bitwise parameter that allows the user to flip polarity of the selected hall input. The inversion is useful e.g. with 60° hall sensor.

This picture depicts the schematic of two possible hall sensor configurations: 60° and 120°. With 60° configuration, the hall_W must be inverted:

Colors of the hall sensors are usually used on MSENS wires.

warning

This parameter is not automatically detected during identification procedure and must be set manually. For the most common variant with 120°, use the default, zero value.

hvar [-]

Hall sensor connection variant. This parameter maps the hall sensor inputs to the motor coils.

roff1 [LSB]

Rest Offset 1 (SIN) input offset.

roff2 [LSB]

Rest Offset 2 (COS) input offset.

rpole []

Rest Pole Defines the number of electrical revolutions per one sensor revolution.

rangle [rad]

Rest Angle Sensor-to-electrical angle offset

ppr [edges]

Pulses Per Revolution (total count of quadrature signal edges) per one sensor revolution. If PWM homing is used, sign of this parameter inverts the PWM duty cycle versus the slope of the quadrature signal.

warning

(Driver 5 and below) This parameter is not automatically detected during identification procedure and must be set manually. For the most common variant with 120°, use the default, zero value.

New in driver 6

ppr (magnitude and sign) is identified automatically during identrun for encoders/resolvers with a reference (index) input. Without the reference input, set it manually as before.


Estimator configuration

The position estimator smooths out sensor errors and misreadings without adding delay, and can even compensate the intrinsic delay of the sensor hardware. The parameters below control how much the estimator trusts the sensor. Tuning up the estimator is an intensive topic and will be covered elsewhere.

esk [-]

The Estimator Speed Coefficient - the higher the number, the more the estimator 'trusts' the speed measured by the sensor. From ESCx 5.0 and above, this applies for sensorless mode as well.

eak [-]

The Estimator Angle Coefficient - the higher the number, the more the estimator 'trusts' the angle measured by the sensor. From ESCx 5.0 and above, this applies for sensorless mode as well.

eca [rad]

The Estimator Clip Angle used in the hall sensor mode only.

ect [s]

The Estimator Clip Time constant used in the hall sensor mode only.

edc [s]

The Estimator Delay Compensation can be used to compensate the time delay in the sensor hardware.

Changed in driver 6

From driver 6 a default sensor delay compensation is applied internally and edc trims on top of it. If you migrate a configuration tuned on an older driver, re-check the edc value.


Automatic sensorless mode (fail-safe) configuration

The assl / assh pair defines a speed-based handover between two rotor position estimation modes. Which two modes are involved depends on the selected prest:

  • Sensored prest (hall, sin-cos, resolver, ...) - the sensor is used at low speed, and the sensorless mode takes over above assh. This is the fail-safe use case: some sensors have problems at high speeds, and the sensorless estimation is more reliable there.
  • Sensorless prest - at low speed, the estimation optimized for low speed and startup is used (it provides the full startup torque). Above assh, the estimator prefers the high-speed observer, which is less reliant on precise motor parameters and more robust at high speed. This is the same observer as selected permanently by prest = 128.

Between the two thresholds, the current mode is kept (hysteresis). The decision follows the filtered motor speed /driver/rpmf. If assl is set to zero, this function is disabled.

Independently of the speed, a detected sensor fault also switches the drive into the sensorless mode (as long as the function is enabled), and the switchback happens when the speed drops below assl and the sensor reads valid again.

tip

Most useful with bad hall sensors - hall sensors are used at low speeds, and sensorless mode is used at high speeds.

assl [RPM]

Auto SensorlesS Lo mode low threshold.

If motor speed /driver/rpmf is below this value, the mode selected with the prest parameter is activated (the sensored mode, or the low-speed sensorless estimation).

assh [RPM]

Auto SensorlesS Hi mode high threshold.

If motor speed /driver/rpmf is above this value, the high-speed sensorless observer is forced.

New in driver 6
  • Ratio thresholds - values below 1 are interpreted as a ratio of the maximum motor RPM (so the thresholds track the battery voltage); values of 1 and above stay absolute RPM. Do not mix a ratio assl with an absolute assh (or vice versa). Existing absolute configurations behave unchanged. While the maximum RPM is not known (e.g. the motor is not identified yet), the current mode is held.
  • Sensorless-to-sensorless handover - with a sensorless prest, the thresholds switch between the low-speed estimation (full startup torque) and the high-speed observer (robust at high speed, less dependent on precise motor parameters). Previously the thresholds only made sense with a sensored prest.
  • Smooth handover - the estimator takeover is phase-continuous in both directions, with no torque glitch, and robust to rapid switching around the thresholds.
  • Hall fault hold-off - the switchback to the sensored mode is skipped while a hall sensor problem is pending, so the drive stays safely sensorless until the sensor recovers.