advanced
hardware
sensors
hall

Position Sensor Tuning

Hall sensor interpolation, encoder setup, and sensorless motor tuning for ASI BAC motor controllers

Levy Fleets Team12 de enero de 202512 min read

Position Sensor Tuning

Position sensors can experience significant electromagnetic interference. ASI BAC controllers provide parameters to tune position sensors for higher accuracy and filtering in high-noise applications.

Hall Sensor Configuration

Hall Interpolation

Hall interpolation smooths motor operation by interpolating rotor angle transitions instead of using discrete six-step Hall transitions.

ParameterFunction
Hall interpolation start frequencyFrequency above which interpolation begins
Hall interpolation stop frequencyFrequency below which interpolation stops
Hall Interpolation TransitionsNumber of transitions averaged

How Interpolation Works

  1. Above the start frequency: Controller interpolates rotor angle based on time between Hall sensor edges
  2. Creates smooth triangle wave instead of six-step transitions
  3. Below the stop frequency: Interpolation stops

Tuning Guidelines

  • Set Hall interpolation start frequency at twice the Hall interpolation stop frequency
  • Lower interpolation frequencies are generally better
  • This is especially true for high pole count direct drive motors
  • Tuning is iterative and requires trial and error

Disabling Interpolation

Setting both Hall interpolation frequencies above the expected peak motor electrical frequency effectively disables this feature.

Factors Affecting Low-Speed Chatter

FactorImpact
System backlashSpoke tightness affects vibration
Power outputHigher power increases chatter potential
Motor designSome applications cannot fully eliminate low-speed chatter

Hall to Sensorless Transition

Firmware 6.026+: Use Sensorless to Hall Transition Frequency to tune the transition point between Hall-based and sensorless operation.

Troubleshooting Hall Sensors

Hall vs Sensorless Position Fault

Problem: Motor Position Sensor Type is set to 0 (Hall) or 1 (Hall start + sensorless run) and throws an error.

Solution: Set Motor Position Sensor Type to 2 (Sensorless) for motor speed autotune, then restore original setting.

Hall Table Issues

SymptomCauseSolution
All -1 valuesNo ground, power, or sensors connectedVerify Hall 5V, Hall GND, and sensor connections
Repeating valuesOne or more sensors not connectedVerify Hall A, B, C connections
Repeating values at high RPMHigh RPM + low signal qualityReduce autotune speed or improve wiring

Motor Power Requirement

Hall sensor discovery requires Rated motor power (Race mode Throttle power) to be filled in with at least the motor's rated power for:

  • Analyze Hall wiring
  • Offset calibration
  • Rated motor speed analysis

Sine-Cosine Encoder Setup

Switching Frequency Limitation

Encoder configuration cannot run at switching frequencies higher than 12 kHz. Lower to 10 kHz before this process. Frequencies below 13 kHz disable Bluetooth connectivity—use TTL or CAN instead.

Prerequisites

1

Unlock Access Level 1

Enter Parameter access code: 15350

For newer dictionaries: Enter Parameter access code 1: 3BF6 (hexadecimal for 15350)

2

Lower Switching Frequency

Change Switching frequency to 10 kHz, save, and power cycle.

Brick Warning

Setting switching frequency too high can brick the controller, requiring return to ASI to unlock.

3

Configure Encoder Sources

Ensure Encoder Cos V Source and Encoder Sin V Source are configured to match your encoder's analog inputs.

Allowed sources (must be pulled down):

  • Throttle
  • ABMS
  • Brake 1 (with Features2 bit 6 disabled)
  • Brake 2 (with Features2 bit 7 disabled)

Note: Brake input options only work on TTL-CAN and CAN-BT controllers.

Low-Speed Noise Threshold

Reduces encoder angle fluctuations from analog input noise at low motor speeds.

ParameterFunction
Encoder Noise Frequency ThresholdElectrical frequency below which noise filtering activates
Encoder analog noise thresholdVoltage change required before angle updates

Converting RPM to Electrical Hz:

Electrical Hz = (RPM ÷ 60) × Pole Pairs

Example: For 50 RPM threshold with 6 pole pairs:

Encoder Noise Frequency = (50 ÷ 60) × 6 = 5 Hz

Noise Threshold Behavior

SpeedBehavior
Above thresholdEncoder angle updates every PWM loop
Below thresholdAngle only updates when input voltage changes by at least the noise threshold

Encoder Fault Range (FW 6.025+)

Fault ranges define the tolerance above and below Encoder Sine/Cos High/Low Voltage that triggers a fault.

ParameterFunction
Encoder Sin Fault RangeTolerance for sine input
Encoder Cos Fault RangeTolerance for cosine input

Values within this range are considered min/max voltage to allow for system-level measurement errors.

Post-Configuration

After encoder setup, you can restore:

  • Switching frequency to 13 kHz
  • Baud rate port2 to 115200

This recovers Bluetooth connectivity if applicable.

Sensorless Motor Tuning

Sensorless operation eliminates Hall sensors by detecting motor position through back-EMF. Motor startup response is adjusted through two key parameters:

  • Sensorless open loop starting current
  • Sensorless closed loop enable frequency

Sensorless Startup Sequence

The startup sequence consists of four phases:

Phase 1: Current Ramp
└── Duration: Sensorless open loop injection current ramp time (default 200ms)
└── Target: Sensorless open loop starting current (default 0.5 pu)

Phase 2: DC Current Hold
└── Duration: Sensorless open loop dc current hold time (default 15ms)
└── Purpose: Force motor into known position

Phase 3: Frequency Ramp
└── Duration: Sensorless open loop freq ramp time ms (default 1500ms)
└── Target: Sensorless closed loop enable frequency (default 20 Hz)

Phase 4: Closed-Loop Operation
└── Controller switches to closed-loop regulation

Sensorless Parameters

ParameterFunctionTypical Value
Sensorless open loop starting currentAC current relative to rated motor current50%+ of max phase current
Sensorless open loop injection current ramp timeTime to reach starting current200 ms
Sensorless open loop dc current hold timeDC injection duration for positioning15 ms
Sensorless open loop freq ramp time msTime to reach closed-loop frequency1500 ms
Sensorless closed loop enable frequencyTransition point to closed-loop~10% of rated electrical frequency

Tuning Guidelines

Sensorless open loop starting current:

  • Higher current = more startup torque
  • Common setting: 50% or more of max phase current
  • Increase if motor fails to start under load

Sensorless open loop freq ramp time:

  • Shorter time = quicker startup
  • Too short = motor may lose synchronization under load
  • Balance between responsiveness and reliability

Sensorless closed loop enable frequency:

  • Should be as low as possible while maintaining stable back-EMF
  • Motors with higher RPM/V constants need higher transition frequency
  • Starting point: ~10% of rated electrical frequency

Starting Point

Set Sensorless closed loop enable frequency to approximately 10% of the motor's rated electrical frequency as an initial value.

Key Parameters Reference

Hall Sensor Parameters

AddressParameterFunction
79Hall interpolation start frequencyFrequency to begin interpolation (Hz)
80Hall interpolation stop frequencyFrequency to stop interpolation (Hz)
81Hall Interpolation TransitionsNumber of transitions to average
82-89Hall Sectors 0-7Hall table values
90Hall offset angleHall angle offset (degrees)

Encoder Parameters

AddressParameterFunction
91Encoder Cos V SourceCosine signal input source
92Encoder Sin V SourceSine signal input source
93Encoder Noise Frequency ThresholdLow-speed noise filter threshold (Hz)
94Encoder analog noise thresholdVoltage change for angle update (V)
95Encoder Sin Fault RangeSine input fault tolerance (V)
96Encoder Cos Fault RangeCosine input fault tolerance (V)
97Encoder offsetEncoder angle offset (degrees)

Sensorless Parameters

AddressParameterFunction
100Sensorless open loop starting currentStartup current (pu of rated)
101Sensorless open loop injection current ramp timeCurrent ramp duration (ms)
102Sensorless open loop dc current hold timeDC hold duration (ms)
103Sensorless open loop freq ramp time msFrequency ramp duration (ms)
104Sensorless closed loop enable frequencyTransition frequency (Hz)
105Sensorless to Hall Transition FrequencyHall-sensorless transition (Hz)

Next Steps