Skip to content

Position sensor tuning

Tune how the controller reads the motor position sensor. This decreases chatter and noise at low speed. You can also adjust how sensorless motors start. At the end, the motor operates smoothly at low speed.

Prerequisites

Prerequisites

  • Motor setup is complete, and motor discovery ran successfully.
  • You know the # of motor pole pairs and the rated electrical frequency of the motor.

How it works

Position sensors can pick up much electromagnetic interference. The controller has parameters that filter the sensor signals and increase accuracy in high-noise applications. The applicable parameters depend on Motor position sensor type:

  • Halls (0 or 1): Hall interpolation, Hall position compensation and 60° Hall sensors.
  • Sine Cos Encoder (3): encoder input noise filtering and fault ranges.
  • Sensorless (1 or 2): the open-loop start-up routine, and the open-loop stop for sensorless motors.

Tuning is an iterative procedure, and you must try different values. At low speed, the chatter that you feel depends mostly on the system backlash (for example, spoke tightness). It also depends on the power that the controller supplies to the wheel. In some applications, you cannot remove all low-speed chatter.

Configure position sensor tuning

Hall interpolation

Above Hall interpolation start frequency, the controller interpolates the rotor angle from the time between Hall sensor edges. It does not use the six-step Hall transitions. This gives a smooth angle that decreases chatter and noise at low speed. The controller calculates the average over the number of transitions in Hall Interpolation Transitions. Below Hall interpolation stop frequency, the controller stops the interpolation.

Hall sensor interpolation graph

  1. Set Hall interpolation stop frequency. Lower interpolation frequencies are better, especially on direct-drive motors with many poles.
  2. Set Hall interpolation start frequency. Usually, set it to 2 times Hall interpolation stop frequency. This prevents rough motor operation.
  3. Do a test of the motor at low speed. Do steps 1 to 3 again until the motor operates smoothly.
  4. Save the parameters to flash.

To disable Hall interpolation, set Hall interpolation start frequency and Hall interpolation stop frequency above the peak electrical frequency that you expect for the motor.

Hall position compensation

Firmware

Available in firmware 6.026 and later.

Hall position compensation corrects the mechanical differences in the Hall sensor positions at higher speeds. We recommend that you always enable it.

  1. Enable Motor features bit 7 Hall Position Compensation.
  2. Save the parameters to flash.

Hall and sensorless transition

When Motor position sensor type is 1 (Hall start and sensorless run):

  • In firmware 6.026 and later, Sensorless closed loop enable frequency sets the transition from Halls to sensorless, and Sensorless to Hall Transition Frequency sets the transition back to Halls. Set them to different values to give hysteresis between the two transitions.
  • In firmware 6.025 and earlier, only Sensorless closed loop enable frequency exists. The controller changes from Halls to sensorless, and back, at this one frequency. If the sensorless speed estimate is slightly different from the Hall speed, the controller can change between the two many times.

60° Hall sensors

Firmware

Available in firmware 6.027 and later, as a beta function.

The controller uses 120° Hall sensors by default. To use 60° Hall sensors, enable Motor features bit 8. The controller then inverts the Hall B signal, so that the 60° signals have the same pattern as 120° signals.

WARNING

This function is a beta function. Do a test of the function with your motor before you use it in a product. We are interested in your test results. Send them to your ASI sales representative.

  1. Enable the BETA: 60-degree halls bit (Bit 8) of Motor features.
  2. Save the parameters to flash.
  3. Run motor discovery. Refer to Motor setup.

Encoder inputs

Set Encoder Sine V Source and Encoder Cos V Source to the two analog inputs that the encoder is connected to. Encoder discovery finds and corrects interchanged inputs, but you must set the two inputs. For encoder discovery, refer to Motor setup.

You can use all analog inputs that have a pull-down, for example:

  • 1 (Throttle)
  • 2 (ABMS)
  • 3 (Brake1), with Features2 bit 6 Brake 1 Pullup enable disabled
  • 4 (Brake2), with Features2 bit 7 Brake 2 Pullup enable disabled

You can use Brake1 or Brake2 as an encoder input only on TTL-CAN and CAN-BT controllers.

Low-speed noise threshold

Below a set motor speed, the controller can ignore small changes in the encoder inputs that analog input noise causes. This decreases encoder angle fluctuations at low speed.

  • Above Encoder Noise Frequency Threshold, the controller updates the encoder angle at each PWM cycle, for all input changes.
  • Below Encoder Noise Frequency Threshold, the controller updates the encoder angle only when one of the input voltages changes by Encoder analog noise threshold or more, from the last update.

  • Set Encoder Noise Frequency Threshold to the electrical frequency below which the noise threshold applies. To convert the motor speed to electrical frequency, divide the speed in RPM by 60. Then multiply by # of motor pole pairs. For example, for a threshold of 50 RPM with 6 pole pairs: 50 / 60 × 6 = 5 Hz.

  • Set Encoder analog noise threshold. The voltage change on an input must be more than this value before the angle updates.
  • Save the parameters to flash.

Fault range

Firmware

Available in firmware 6.025 and later.

Encoder Sin Fault Range and Encoder Cos Fault Range set the permitted range above and below the calibrated high and low voltages (Encoder Sine High Voltage, Encoder Sine Low Voltage, Encoder Cos High Voltage, and Encoder Cos Low Voltage). If an input goes outside this range, the controller sets a fault. If an input is in this range, the controller uses the calibrated minimum or maximum voltage for that input. This gives a tolerance for measurement errors in your system.

Sensorless start-up

To adjust the start-up response and feel, use Sensorless open loop starting current and Sensorless closed loop enable frequency.

The diagram shows one motor phase current during start-up, with example values:

  1. The current increases during Sensorless open loop injection current ramp time (200 ms) to Sensorless open loop starting current (0.5 pu).
  2. The controller holds a DC current for Sensorless open loop dc current hold time (15 ms) after the current gets to Sensorless open loop starting current.
  3. The motor gets to Sensorless closed loop enable frequency (20 Hz) at Sensorless open loop freq ramp time ms (1500 ms) after the current gets to Sensorless open loop starting current.

Sensorless motor startup current waveform

  • Sensorless open loop starting current: the AC current, relative to Rated motor current, that the controller injects into the motor phases during start-up. A higher current turns the motor with more torque during alignment and start-up. Usually, this value is high: approximately 50% or more of the maximum phase current.
  • Sensorless open loop injection current ramp time: the time to reach Sensorless open loop starting current.
  • Sensorless open loop dc current hold time: the time that the controller holds a DC current in the motor, to move the rotor to a known position.
  • Sensorless open loop freq ramp time ms: the time for the motor to go from 0 RPM to Sensorless closed loop enable frequency. A shorter time gives a shorter start-up delay. Give the motor sufficient time to get to Sensorless closed loop enable frequency at full load (for example, a bike with a load). If the speed increases too quickly, the motor can lose step with the magnets.
  • Sensorless closed loop enable frequency: the electrical frequency at which the controller changes to closed-loop control. Set it as low as possible, but the motor must still make sufficient back-EMF (electromotive force) for stable closed-loop operation. Motors with a higher RPM/V constant usually must have a higher value. Approximately 10% of rated electrical frequency is a good starting value.

Save the parameters to flash.

Loop close timeout

Firmware

Available in firmware 6.027 and later.

By default, the controller makes one attempt to close the sensorless loop at the end of the open-loop frequency ramp. If the conditions are not correct at that time, the motor stalls. With a loop close timeout, the open-loop frequency continues to increase at the same rate, and the controller continues to try to close the loop. If it closes the loop in the timeout, the start-up continues.

When Sensorless Loop Close Timeout is not zero, the controller uses Sensorless Loop Close Max Freq Diff and Sensorless Loop Close Max Angle Diff as the conditions to close the loop. These values can be tighter or looser than the default conditions.

  1. Set Sensorless Loop Close Timeout to the maximum time that your system can add to the start-up. Usually, 50 ms to 1500 ms.
  2. Set Sensorless Loop Close Max Freq Diff: the maximum frequency difference between the sensorless and open-loop frequencies. Usually, 3 Hz to 50 Hz.
  3. Set Sensorless Loop Close Max Angle Diff: the maximum angle difference between the sensorless and open-loop angles. Usually, 10° to 40°.
  4. Save the parameters to flash.

Open loop stop

Firmware

Available in firmware 6.027 and later, as a beta function.

Use open loop stop with a fully sensorless motor (Motor position sensor type 2), in remote speed control. Below Sensorless closed loop enable frequency, the sensorless position estimate is not accurate. Open loop stop then stops the motor in a controlled sequence:

  1. When the motor speed decreases below Sensorless closed loop enable frequency, the controller changes to open-loop control.
  2. The controller decreases the frequency linearly to zero during Sensorless Stop Braking Time.
  3. During this time, the controller applies a constant braking current of Sensorless Stop Braking Current.

If the braking current or the braking time is too low, the motor can slip: it does not follow the open-loop frequency and does not stop correctly. A higher current, a longer time, or the two together decrease the risk of slip.

WARNING

This function is a beta function. Do a test of the function with your motor and load before you use it in a product. Make sure that the motor stops in the time that your safety requirements give. We are interested in your test results. Send them to your ASI sales representative.

  1. Configure the sensorless start-up. Refer to Sensorless start-up.
  2. Set Sensorless Stop Braking Current to a current that is safe for your motor.
  3. Set Sensorless Stop Braking Time.
  4. Enable the Beta: Open Loop Stop bit (Bit 9) of Features5.
  5. Save the parameters to flash.
  6. Stop the motor from full speed, with the load connected. Monitor the motor.
  7. If the motor slips or does not stop smoothly, increase Sensorless Stop Braking Time or Sensorless Stop Braking Current in small steps. Do step 6 again after each change.

Verify

Make sure that:

  • The motor starts and operates smoothly at low speed, without too much chatter or noise.
  • Halls with sensorless run: the motor changes between Halls and sensorless without surges.
  • Open loop stop: the motor stops smoothly, without slip, in the necessary time.
  • No position sensor faults or warnings are set. Refer to Faults and warnings.

Troubleshooting

A position sensor fault or warning appears

Look at the active faults and warnings. In BACDoor® PC, put the cursor on the status light. Or, go to Live Feed, and scroll to Faults and Warnings at the top. Then refer to Faults and warnings.

Problems during motor discovery

For these problems, refer to Motor setup troubleshooting:

  • A Hall table that is not valid
  • A Hall vs Sensorless position fault during discovery
  • Hall discovery that does not operate

Fault and warning settings

These settings apply when you use Hall sensors (Motor position sensor type 0 or 1).

  • Motor Hall sensor fault (Faults bit 5): to change to sensorless operation and not set a fault, set Motor position sensor type to 1 (Hall start and sensorless run). Then enable Motor features bit 1 Fault tolerant hall. The controller changes to sensorless immediately when it detects a Hall fault. To stop the use of the Hall sensors, set Motor position sensor type to 2 (Sensorless).
  • Hall Sensor, Hall Illegal sector and Hall illegal transition (Warnings bits 1, 5 and 6), and Hall vs Sensorless position (Faults2 bit 9): you cannot disable these while you use Hall sensors.
  • Hall stall: refer to Hall stall fault.

Parameters

Parameter Address Units Description
Motor position sensor type 77 0: Hall based. 1: Hall start and sensorless run. 2: Sensorless. 3: Sine Cos Encoder.
Hall interpolation start frequency 88 Hz Electrical frequency above which Hall interpolation starts.
Hall interpolation stop frequency 89 Hz Electrical frequency below which Hall interpolation stops.
Sensorless open loop starting current 106 pu A AC current injected during sensorless start-up, relative to Rated motor current.
Sensorless open loop injection current ramp time 107 ms Time to reach Sensorless open loop starting current.
Sensorless closed loop enable frequency 108 Hz Electrical frequency for the switch to closed-loop sensorless control, or from Halls to sensorless.
Sensorless open loop freq ramp time ms 109 ms Time to go from DC to Sensorless closed loop enable frequency.
Sensorless open loop dc current hold time 110 ms Time a DC current is held in the motor windings during start-up.
Motor features 127 Bit field. Bit 1: Fault tolerant hall. Bit 7: Hall Position Compensation. Bit 8: BETA: 60-degree halls (firmware 6.027 and later).
Hall Interpolation Transitions 128 Number of Hall transitions the interpolation is averaged over.
Features2 174 Bit field. Bit 6: Brake 1 Pullup enable. Bit 7: Brake 2 Pullup enable.
rated electrical frequency 429 Hz Read only. # of motor pole pairs × Rated motor speed / 60.
Encoder Sin Fault Range 1803 V Allowed tolerance beyond the calibrated sine input range.
Encoder Cos Fault Range 1815 V Allowed tolerance beyond the calibrated cosine input range.
Encoder analog noise threshold 1867 V Input voltage change needed to update the angle below Encoder Noise Frequency Threshold.
Sensorless to Hall Transition Frequency 1903 Hz Frequency at which the controller switches from sensorless back to Halls. Firmware 6.026 and later.
Encoder Sine High Voltage to Encoder Cos Low Voltage 1956 to 1959 Calibrated encoder input voltages, set by encoder discovery.
Encoder Sine V Source, Encoder Cos V Source 1960, 1961 1: Throttle. 2: ABMS. 3: Brake1. 4: Brake2.
Encoder Noise Frequency Threshold 1989 Hz Electrical frequency below which Encoder analog noise threshold applies.
Features5 2006 Bit field. Bit 9: Beta: Open Loop Stop (firmware 6.027 and later).
Sensorless Stop Braking Time 2309 ms Time of the linear frequency ramp-down to zero during open loop stop. Firmware 6.027 and later.
Sensorless Stop Braking Current 2310 % Constant braking current during open loop stop, as a % of Rated motor current. Firmware 6.027 and later.
Sensorless Loop Close Max Freq Diff 2311 Hz Maximum frequency difference to close the sensorless loop, when the timeout is not zero. Firmware 6.027 and later.
Sensorless Loop Close Max Angle Diff 2312 Degrees Maximum angle difference to close the sensorless loop, when the timeout is not zero. Firmware 6.027 and later.
Sensorless Loop Close Timeout 2313 ms Time that the controller continues to try to close the sensorless loop. 0: one attempt only. Firmware 6.027 and later.

Parameters used on this page