Skip to content

Position Sensor Tuning

Introduction

Position sensors can undergo significant amounts of electromagnetic interference. Accelerated Systems controllers have parameters that allow you to tune your position sensors to provide higher accurance and filtering for high noise applications.

Configuration

The Hall interpolation start frequency corresponds to the Hall sensor frequency above which starts interpolating rotor angle transitions to form a smooth triangle wave based on interpolating the time between Hall sensor edges instead of the six-step Hall transitions. The interpolation is averaged over the number of Hall Interpolation Transitions. Hall interpolation stops interpolating below the Hall interpolation stop frequency.

The parameters can be used to reduce the chatter and noise associated with Hall sensor commutated motors when operating at low speeds. Typically, the Hall interpolation start frequency is set at twice the value of the Hall interpolation stop frequency to prevent rough motor operation. It is recommended that the lower the interpolation frequencies can be set the better. This is particularly true with high pole count direct drive motors.

This tuning process is iterative and will require some trial and error in order to get it to feel right. The most important factors in determining how much chatter can be felt at low speeds are system backlash like spoke tightness and how much power the controller is providing to the wheel. For some applications, it is not possible to completely eliminate low-speed chatter.

Setting Hall interpolation start frequency and Hall interpolation stop frequency above the expected peak motor electrical frequency, effectively disables this feature.

Tip

Hover over the status light in PC BACDoor® or go to Live Feed and scroll to the top to Faults and Warnings to see the details of faults or warnings.

Troubleshooting

Hall vs Sensorless position Fault

Your Motor position sensor type is set to 0 (Hall based) or 1 (Hall start and sensorless run) and it is throwing an error as a result. Set this value to 2 (sensorless) for the motor speed autotune.

  • Set Motor position sensor type to 2 (Hall Based)
  • Or for mobile set Motor Position Sensor Type to 0 (Sensorless).

Hall table issues

  • Hall tables of all -1 indicate the sensors have either no ground, no power, no sensors connected at all, or all of the above. Verify your sensors are connected to Hall 5V and Hall GND. Verify the sensors are connected to Hall A, Hall B and Hall C.
  • Hall tables with repeating values or more than two -1 values indicate that one or more of the hall sensors is not connected, verify Hall A, Hall B and Hall C are connected.
  • Hall Tables with repeating values may be due to a combination of high rpm and low signal quality, leading to repeating values being read by the controller.

Motor power

Hall sensor discovery requires that Rated motor power (Race mode Throttle power) be filled in with at least the motors rated power for Analyze Hall wiring, offset and Rated Motor speed to work.

Encoder Position Sensor Setup

Note

This feature is not capable of running at switching frequencies higher than 12kHz. It is recommended to change the controller switching frequency to 10kHz, save, and power cycle the controller prior to performing this process. Switching frequencies below 13kHz will cause you to lose BT connectivity. Perform this action over TTL or CAN.**

  • Enter Parameter access code: 15350 (or for newer dictionaries, enter Parameter access code 1: 3BF6, which is 15350 in HEX) to get user access level 1 to be able to change the Switching frequency. Note that you can potentially brick the controller if switching is set too high, and must be returned to ASI to unlock. After you configure your encoder, you can change the Switching frequency back to 13kHz and Baud rate port2 back to 115200 to recover BT if applicable.

  • Ensure that the Encoder Cos V Source (parameter 1961) and Encoder Sin V Source (parameter 1960) are configured to match the two analog sinusoidal controller inputs of the encoder (autotune will detect and correct if they are swapped, but both sources must be mapped to these parameters).

    • Allowed sources are all analog inputs as long as they are pulled down. E.g. Throttle, ABMS, Brake 1 with Features2 bit 6 disabled or Brake 2 with Features2 bit 7 disabled.
      • Features2 bit 6 disabled or Brake 2 with Features2 bit 7 disabled only works on TTL-CAN and CAN-BT controllers.

Low-speed noise threshold

Low-speed noise threshold for encoder inputs to allow reducing encoder angle fluctuations due to analog input noise below a configurable motor speed.

    • Configure the Encoder Noise Frequency Threshold (parameter 1989) to the desired electrical frequency below which the Encoder analog noise threshold (parameter 1867) will be utilized/active.
    • To convert an rpm value into electrical Hz, divide by 60 and multiply by the number of pole pairs.

    Setup:

    • e.g. For a threshold of 50RPM, with 6 electrical pole pairs, the *Encoder Noise Frequency would be 5Hz (50 divided by 60, then multiplied by 6).

    • Configure the Encoder analog noise threshold (parameter 1867) to a value in volts that will an encoder input value to change by, before updating.

  • Behaviour:

    • Above the Encoder Noise Frequency Threshold, the encoder angle will update every PWM loop, regardless of how much or little the encoder analog inputs have changed.

    • Below the Encoder Noise Frequency Threshold, the encoder angle will only update when either of the analog input voltages has changed by at least the voltage defined by the Encoder analog noise threshold since the last encoder angle update.

Fault range

Exposed fault range parameters, added in 6.025. Fault ranges are the range above and below Encoder Sine/Cos High/Low Voltage that will trigger a fault. Measured values within this range are considered as the min/max voltage for that input and exist to allow tolerance for system-level measurement errors.

  • Encoder Sin Fault Range (Address 1803)

  • Encoder Cos Fault Range (Address 1815)

Sensorless Tuning

Motor startup response and feel is best adjusted by modifying Sensorless open loop starting current and the Sensorless closed loop enable frequency.

This diagram represents one motor phase current waveform to illustrate the function of each sensorless motor startup parameter.

  1. Sensorless open loop injection current ramp time (=200 ms) at Sensorless open loop starting current (=0.5 pu A)

  2. Sensorless open loop dc current hold time (=15 ms) since Sensorless open loop starting current reached.

  3. Sensorless closed loop enable frequency (=20 Hz) at Sensorless open loop freq ramp time ms (=1500 ms) since Sensorless open loop starting current reached.

Sensorless open loop starting current: This is the amount of AC current relative to Rated motor current injected into the motor phases during the sensorless self-start. A higher current will force the motor to turn with more torque during the alignment and self-starting routines. So it's common for this current to be pretty high, about 50% or more of the max phase current.

Sensorless open loop injection current ramp time: Duration of time it takes to reach Sensorless open loop starting current.

Sensorless open loop dc current hold time: This is the duration of time for which a DC current is injected into the motor in order to force the motor into a known position.

Sensorless open loop freq ramp time ms: This is the amount of time taken by the motor to spin from 0rpm to the Sensorless closed loop enable frequency. The shorter the time, then the quicker the motor is running closed-loop and the shorter the overall startup delay. However, it is important that the motor has enough time to get up to the Sensorless closed loop enable frequency with a loaded bike; if it tries to accelerate too quickly it may lose step with the magnets.

Sensorless closed loop enable frequency: This is the endpoint RPM of the sensorless start routine where the controller switches over to closed-loop regulation. It should be as low as possible while still producing enough back-emf voltage for stable closed-loop operation. Motors with higher RPM/V constants will usually need a correspondingly higher RPM for closed-loop control. Generally, approximately 10% of the motor rated electrical frequency is a good starting point.