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.

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.
- Set
Wheel speed sensor pulses per revolutionto 0. - Set
Wheel diameter.
The controller then uses motor rpm and Gear ratio to calculate the wheel speed.
- Set
Wheel speed sensor sourceto the input that you connected the sensor to. - Set
Wheel speed sensor pulses per revolution. - If the wheel speed can change independently of the motor speed (for example, the motor has a clutch), enable
Motor featuresbit 2 Bottom bracket motor. - Set
Wheel diameter.
- Set
Wheel speed sensor sourceto the input that you connected the sensor to. - Set
Wheel speed sensor pulses per revolution. - Enable
Motor featuresbit 2 Bottom bracket motor. This lets the wheel speed change independently of theGear ratiothat you set during motor setup. - 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.
- Set
Motor Current Threshold to Switch from External Sensor to Motor(address 1963). - Enable
Motor featuresbit 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.
- Monitor the sensor input and make sure that the speed sensor operates.
- Make sure that
# of motor pole pairsandGear ratioare correct.