advanced
hardware
motor
autotune

Motor Setup

Motor configuration, autotune process, and motor profile setup for ASI BAC motor controllers

Levy Fleets Team12 de enero de 202515 min read

Motor Setup

This guide covers motor configuration and the autotune process for ASI BAC motor controllers.

Critical Safety Instructions

Safety Warning

Installation or setup of the ASI controller must be done by a trained technician. Failure to follow these warnings can damage the controller, computer, vehicle and/or cause serious injury or death.

Before starting motor setup:

  • Wear appropriate PPE (Personal Protective Equipment) when working with batteries or moving parts
  • Use insulated tools to protect from electric shock
  • ALWAYS use a USB isolator between the computer and controller
  • Ensure the battery or power source is disconnected before making connections
  • Keep all people, children, and pets away from the vehicle during testing
  • Ensure wheels are off the ground on an approved bike stand or jack stands
  • Alternatively, secure the motor to a workbench vice or solid stand
  • Make sure all moving parts (pedals, wheels) are clear to move in either direction

Motor Profile Configuration

Before controlling the motor, you must input the rated parameters from the motor's datasheet. Contact your motor manufacturer if you don't have this information.

Required Parameters

Navigate to the Peripheral Selection tab, then select the Motor Nameplate Ratings page.

ParameterDescriptionNotes
Rated motor powerMaximum continuous power outputSet to rated voltage × battery peak current, or lower
Rated motor currentMaximum continuous currentFrom motor datasheet
Rated motor speedMaximum RPMFrom motor datasheet
# of motor pole pairsNumber of magnetic pole pairsCount or from datasheet
Gear ratioMotor to wheel gear ratio1:1 for direct drive

Power Rating Tip

Set your Rated motor power to the Rated system voltage multiplied by your battery's peak rated current output (or lower) to avoid damaging your battery or tripping your BMS.

Configuration Steps

1

Enter Motor Parameters

Enter each parameter and press Enter after every entry, or press Write after entering each value.

2

Add Missing Parameters

Add any parameters if missing as necessary for your motor type.

3

Save to Flash

Press Save to flash in the Parameter drop-down menu to store the configuration.

Autotune Process

The autotuning process measures the motor's inductance (Ls) and resistance (Rs) via the Motor discover mode feature.

Danger - Motor Will Spin

The motor will spin for up to 20 seconds at 50% of the Rated motor speed (RPM) and high current. Ensure all moving parts are clear to move in either direction and the motor is securely mounted.

Power Requirements

This test draws the full rated motor current. Ensure your power source can supply adequate current without damage.

Autotune for Hall Sensors

For motors with Hall sensors (Motor Position Sensor Type = 0):

1

Set Sensor Type

Set Motor Position Sensor Type to 0 (Hall based).

2

Start Motor Discovery

In the Write (Temp) section, enter value 9 in Motor discover mode and press Enter or click Write.

3

Monitor Motor

The motor will spin for about 20 seconds, reaching half of the rated speed. It should run steadily in the forward direction.

To stop the test early, enter 0 in Motor discover mode.

4

Verify Results

Once stopped, press Read in the Display Only section and verify:

  • autotune rated rpm is near your entered Rated motor speed
  • autotune Rs and autotune Ls values are copied to Rs and Ls parameters
  • Hall table is valid (see validation below)
5

Save Configuration

Save to flash to store the discovered values.

Hall Table Validation

A valid Hall table consists of 8 values stored in autotune hall sector[0-7]:

Valid TableInvalid Table
[-1, 0, 4, 5, 2, 1, 3, -1][-1, -1, -1, -1, -1, -1, -1, -1] (all -1)
Two -1 values maximum[-1, 0, 4, -1, 2, 1, 3, -1] (three -1 values)
Values 0-5 appear once each[-1, 0, 4, 5, 2, 2, 3, -1] (repeated value)

Autotune for Sensorless Operation

For sensorless motor control (Motor Position Sensor Type = 2):

1

Set Sensor Type

Set Motor Position Sensor Type to 2 (Sensorless).

2

Start Motor Discovery

Enter value 9 in Motor discover mode and press Enter.

3

Monitor and Verify

After the motor stops, verify:

  • autotune rated rpm matches expected value
  • autotune Rs and autotune Ls are populated
4

Save Configuration

Save to flash.

Autotune for Hall Start + Sensorless Run

To use Hall sensors for startup and sensorless for running:

  1. Complete the Hall sensor autotune (Type 0) first
  2. After successful Hall autotune, change Motor Position Sensor Type to 1
  3. Save to flash

Autotune for Sine-Cosine Encoders

Switching Frequency Limitation

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

1

Set Sensor Type

Set Motor Position Sensor Type to 3 (Encoder).

2

Discover Rs and Ls

Set Motor discover mode to 1 to discover motor resistance and inductance.

3

Copy Values

Copy discovered values from autotune Rs and autotune Ls to the Rs and Ls parameters.

4

Discover Encoder Parameters

Set Motor discover mode to 5 to discover encoder parameters.

5

Verify Results

Read the encoder angle parameters and confirm autotune offset error (parameter 357) is less than 3 degrees.

The following parameters update automatically:

  • Encoder Sine/Cos High/Low Voltage
  • Encoder offset
  • Encoder Sine/Cos V Source
6

Save and Power Cycle

Save to flash. If switching frequency was lowered, raising it again may require a power cycle.

Troubleshooting

Controller Won't Power On

High-power controllers have larger capacitors that require charging during initial power-up. This can cause some BMS systems to trip due to overcurrent.

Solution: Use a pre-charge circuit to prevent damage to the controller and battery.

Connection/Communication Issues

If the controller is powered on (solid or blinking LED):

For PC BACDoor:

  1. Remove all peripherals (displays, throttle, etc.)
  2. Verify the controller LED is lit (solid or flashing)
  3. Remove unnecessary computer peripherals to isolate the correct port
  4. Ensure Network Baud rate is set to 115200 (default)
  5. If not connecting, try 9600 as the baud rate may have been changed
  6. Once connected, set both Baud rate and Baud rate port2 to 115200
  7. Save to flash and power cycle

For BACDoor Mobile:

  1. Verify your controller has Bluetooth (part number includes "BT")
  2. Ensure Bluetooth is ON on your device
  3. Look for "e-Bike" or "ASI devices" in the connection list
  4. Place phone close to controller and refresh to identify by signal strength
  5. Disconnect any peripherals (especially displays)

Ls and/or Rs Are Negative

Negative values indicate wiring issues or internal motor problems:

Possible CauseSolution
Insufficient battery currentLower Rated motor current and retry
Current too low for measurementIncrease Rated motor current
Rated motor rpm too highLower the value
Phase wire shortingVerify no external shorts
Internal phase shortMay require motor replacement
Disconnected phaseCheck all connections

Motor/Wheel Does Not Spin

Possible CauseSolution
Controller faultedCheck LED flash code, see Faults and Warnings
Loose phase wiresVerify all connections
Freewheeling motor spinning backwardsSwap phases (see below)
Brakes enabledCheck eBike flags bit 0 (Brake) and bit 1 (cut-out)
Power settings too lowIncrease Rated motor current and power
Sensorless frequency too highSet Sensorless closed loop enable frequency to 10% of rated electrical frequency
EN controller requires pedal inputProvide pedal input per legislation

Motor Spins in Wrong Direction

If the motor spins in reverse:

Option 1 - Physical Swap: Swap phase wires A (Green) and C (Blue) physically.

Option 2 - Digital Swap: Enable Motor features bit 0 in BACDoor to swap phases digitally.

Motor Does Not Spin Fast Enough

Possible CauseSolution
Inaccurate Rated motor speedUse autotune Rated rpm value if motor runs stably
Firmware behaviorFW 6.016+ runs discovery at ~20% electrical frequency (was 50%)
Wrong pole pairsVerify # of motor pole pairs setting
Sensorless frequency too highSet to 10% of rated electrical frequency

Motor Speed Is Unsteady

Possible CauseSolution
Disconnected phase wireCheck all connections
Rated motor speed incorrectDouble or halve the value and retry
Wrong pole pairsVerify and correct setting
Sensorless frequency too highSet to 10% of rated electrical frequency

Hall vs Sensorless Position Fault

If you get this error with Motor Position Sensor Type set to 0 or 1:

Solution: Set Motor Position Sensor Type to 2 (Sensorless) for the motor speed autotune, then change back after completion.

Key Parameters Reference

AddressParameterFunction
69Rated motor powerMaximum continuous power (W)
70Rated system voltageNominal battery voltage (V)
71Rated motor currentMaximum continuous current (A)
72Rated motor speedMaximum RPM
73# of motor pole pairsMagnetic pole pairs
74Gear ratioMotor to wheel ratio
75RsStator resistance (Ω)
76LsStator inductance (H)
77Motor Position Sensor Type0=Hall, 1=Hall+Sensorless, 2=Sensorless, 3=Encoder
78Motor discover modeAutotune trigger (9=start, 0=stop)

Next Steps