Skip to content

Speed sensor

Introduction

The BAC controller can find the wheel speed in different ways:

  • From the motor speed (Hall frequency or sensorless frequency).
  • From a wheel speed sensor in the motor. This type is usual in clutched geared or direct-drive hub motors.
  • From an external wheel speed sensor. This type is usual on mid-drive systems with a variable final gear ratio.

This page gives the setup of the wheel speed sensor.

Speed sensor input and wiring

You can connect the speed sensor to one of these inputs: Cruise, Brake 1, Brake 2 or Hall A.

Usually, a speed sensor has 2 wires. Connect one wire to the input (a digital input with a pull-up) and one wire to ground. If you connect the sensor to Brake 1 or Brake 2, make sure that the pull-up for that input is enabled.

Typical 2-wire speed sensor wiring to input and ground

Speed sensor setup

Use this setup for a direct-drive motor, or for a fixed gear ratio when you do not use a wheel speed sensor.

  1. Set Wheel speed sensor pulses per revolution to 0.
  2. Set Wheel diameter.

The controller then uses motor rpm and Gear ratio to calculate the wheel speed.

  1. Set Wheel speed sensor source to the input that you connected the sensor to.
  2. Set Wheel speed sensor pulses per revolution.
  3. If the wheel speed can change independently of the motor speed (for example, the motor has a clutch), enable Motor features bit 2 Bottom bracket motor.
  4. Set Wheel diameter.
  1. Set Wheel speed sensor source to the input that you connected the sensor to.
  2. Set Wheel speed sensor pulses per revolution.
  3. Enable Motor features bit 2 Bottom bracket motor. This lets the wheel speed change independently of the Gear ratio that you set during motor setup.
  4. Set Wheel diameter.

Speed from motor and sensor

In firmware 6.021 and later, the controller can change between the external speed sensor and the motor speed. The motor current controls the change.

  1. Set Motor Current Threshold to Switch from External Sensor to Motor (address 1963).
  2. Enable Motor features bit 5 Enable speed from motor and sensor.

When the motor current is more than the threshold, the controller calculates vehicle speed (address 260) and measured wheel RPM (address 313) from the motor speed. When the motor current is less than the threshold, it calculates them from the external wheel speed sensor. controller flags2 bit 4 Speed calculation using Motor and bit 5 Speed calculation using External Sensor show the source that the controller uses.

When bit 5 is disabled, the controller calculates these values from the speed sensor setup above.

Troubleshooting

Wheel speed sensor warning on a variable gear ratio system

On a variable gear ratio system, the wheel speed and the motor speed do not change together. Enable Motor features bit 2 Bottom bracket motor. If this bit is disabled, the controller compares wheel RPM (motor based) with wheel RPM (speed sensor based). If the difference is more than 30 rpm, the controller shows the Wheel Speed Sensor warning (Warnings bit 3). It then uses the motor speed to calculate the wheel speed. This warning latches. To clear it, restart the controller.

Wheel speed sensor warning on a fixed gear ratio system

On a fixed gear ratio system, the controller shows the Wheel Speed Sensor warning (Warnings bit 3) if wheel RPM (motor based) and wheel RPM (speed sensor based) are different by more than 30 rpm. It then uses the motor speed to calculate the wheel speed.

  1. Monitor the sensor input and make sure that the speed sensor operates.
  2. Make sure that # of motor pole pairs and Gear ratio are correct.