Pedal Sensors
Introduction
Pedal sensors form part of the Pedal Assist System (PAS) of eBikes. Pedal sensors read the pedal cadence speed and/or torque to determine when and how much motor assistance to provide.
Supported Pedal Sensors
Pedal Sensor type value | Pedal Sensor type | Direction | Notes |
---|---|---|---|
0 | Single Hall | Duty cycle directional | >50% duty cycle is forward |
1 | Single Hall | Non-directional | |
3 | Quadrature Speed & Torque | PFS leads Cruise input is forward | Duty cycle 50:50 |
4 | Quadrature Speed only | PFS leads Cruise input is forward | Duty cycle 50:50 |
5 | Axle Torque | Non-directional | Simple torque only |
6 | Single Hall | Inverted duty cycle Directional | <50% duty cycle is forward |
7 | Single Hall and Torque | Logical input Directional | Cruise input active is forward |
8 | Single Hall and Torque | Non-directional | |
9 | Dyname torque | Non-directional | Refined torque only |
Wiring
Single output sensors typically have 3 wires: 5V or 12V, GND and signal. The signal wire must be wired to PFS/Digital input 2.
Single output with direction sensors typically have 4 wires: 5V or 12V, GND and signal and direction. The signal wire must be wired to PFS/Digital input 2. The direction wire must be wired to Cruise/Digital input 1.
Two signal pedal speed sensors typically have 4 wires: 5V or 12V, GND, Sine signal and Cosine Signal. The Sine signal must be wired to PFS/Digital input 2 and the Cosine signal to Cruise/Digital input 1.
The Axle torque is a legacy configuration that only supports the Throttle analog input as a source. All other pedal torque sensor inputs use any available analog input, e.g. Throttle, Brake1, Brake2, ABMS or remote throttle voltage
.
Configuration
Danger
Ensure vehicle is secured in case the motor engages unexpectedly while manually configuring your pedal sensor.
TIP
Make a backup copy of the parameter file often by saving it to file as shown before. It can be sent to ASI for support or you can revert if strange behaviour occurs.
TIP
Set Control command source
to 0 / Serial stream to prevent the motor from accidentally spinning while manually setting the pedal sensor.
Configuration:
- Set
Pedal sensor type
as appropriate. - Enter your
Pedal speed sensor pulses per revolution
. Note: Quadrature pedal typesPedal speed sensor pulses per revolution
is the sum of both PFS/sine and Cruise/cosine pulses up to 6.026. 6.027 and higher it's the sum of PFS/Sine only. - Set
Control command source
to 2 / Pedal Sensor or 4 / throttle OR pedal sensor based on application. This step will enable your pedal sensor. - Ensure you do not have any faults, and test that when rotating the pedals in the forward direction, the motor spins up, and when no longer rotating or spinning the pedals backwards the motor coasts to a stop. If not see troubleshooting.
- Perform the Average pedal speed test to ensure the pedal sensor is set up correctly.
Tuning:
The pedal speed sensor parameters that have the largest effect in terms of changing bike feel are the Pedalec positive motoring torque
and Pedalec negative motoring torque
ramps, and the Pedal speed map end
and Pedal speed map offset
.
Bike feel can be softened by increasing the Pedal speed map end
and Pedalec positive motoring torque
ramp values from their default values, 64 RPM and 200 ms respectively. Conversely, bike feel can be sensitive by decreasing these values.
Pedal sense delay
represents the number of PFS input pulses that must be observed before the pedals are deemed active. Increasing this increases the amount the pedals must rotate before assistance is provided and Pedalec positive motoring torque ramp begins. Setting this too low might make the system too sensitive.
Pedal speed map end
dictates the pedal rpm above which the pedal speed gain
, the pedal assist request, is 100%.
Pedal speed map offset
is the pedal-assist request when pedal rpm is zero, and pedals are active. Setting this above 0 gives you pedal-assist when at 0rpm, and setting this below 0 will require the pedal rpm to be greater than 0rpm before assistance is provided. The pedal-assist request is limited to between 0 and 100%. Note that if Pedal speed map offset
is set greater than 1, the pedal-assist request will be 0% when above the Pedal speed map end
.
Assist cut out distance
is used to calculate the time (pedalec_timeout_delay) until the Pedalec negative motoring torque ramp
begins based on the instantaneous vehicle speed
and the time since the last pedal pulse. However, two bounds apply: The Pedalec minimum timeout
is the minimum time before the negative ramp begins. The Pedalec maximum timeout
is the maximum time before the negative ramp begins
In the absence of a pedal torque signal, the vehicle torque and speed behaviour is controlled using Assist Level Configuration.
Configuration:
- Set
Pedal sensor type
as appropriate. - Enter your
Pedal speed sensor pulses per revolution
. Note: Quadrature pedal typesPedal speed sensor pulses per revolution
is the sum of both PFS/sine and Cruise/cosine pulses up to 6.026. 6.027 and higher it's the sum of PFS/Sine only. - Set
Control command source
to 2 / Pedal Sensor or 4 / throttle OR pedal sensor based on application. This step will enable your pedal sensor. - Set the
Torque sensor voltage source
. - Set the
Torque sensor offset
to the resting input voltage. - Set the
Torque sensor gain
using the actual sensitivity in Nm/V. - Ensure you do not have any faults, and test that when rotating the pedals in the forward direction, the motor spins up, and when no longer rotating or spinning the pedals backwards the motor coasts to a stop. If not see troubleshooting.
- Perform the Average pedal speed test to ensure the pedal sensor is set up correctly.
Tuning:
The average pedal torque
multiplied by the Pedalec power gain and the average pedal speed results in the average pedal speed gain before rate-limiting.
Pedalec torque symmetry
is used to average the pedal torque input for calculating the average pedal torque
. If set to:
-
0 / One cycle averages the torque over one full pedal rotation. This provides the smoothest response, as it averages the torque input over the longest time. This option is best for single-sided torque sensors.
-
1 / Half cycle averages torque over every half-pedal rotation.
-
2 / Quarter cycle averages torque over every quarter pedal rotation.
-
3 / Instantaneous, the pedal torque is not filtered and provides the instantaneous power output 1:1 to torque input. The feeling is similar to using a throttle.
Pedalec power gain
can be considered the master parameter that allows the simplest adjustment of the feel of torque sensor-based bikes. Increasing Pedalec power gain
will result in brisker arrival of the motor assist, whereas reducing it will soften the power delivery. Pedalec power gain
multiplies the applied pedal torque relative to 64Nm to determine the average pedal torque that equates to a torque assist request of up to 100%. When Pedalec power gain
is set to 1, we are setting full torque-assist request at 64Nm measured, when Pedalec power gain
is set to 2, we are setting full torque-assist request at 32Nm, and when set to 0.5, we are setting full torque-assist request at 128Nm, from the Torque sensor offset
plus the required Pedalec deadband torque
voltage.
Torque assist request [%] = 100 [%] * Average pedal torque [Nm] * Pedalec power gain / 64 [Nm]
Pedalec deadband torque
defines the amount of torque input, or noise input, that is needed before assistance is provided. For example, if you set the Torque sensor gain
to 32Nm/Volt, and the Pedalec deadband torque
to 10Nm. It will require the torque sensor voltage to climb 0.3125V (= 10Nm/(32Nm/Volt)) before providing assistance. Reducing this value will require less force before assistance is provided, but reducing too much may result in noise-induced jumpiness of the bike.
Pedalec initial torque
dictates the initial power commanded when you begin pedalling and can be used to offset the lack of measured torque on one leg of some torque sensors. It is recommended to start tuning the torque sensor with Pedalec initial torque
set to 0. Increasing this value increases the initial gain. The initial torque decays by half every 1 ms.
Pedalec positive motoring torque
and Pedalec negative motoring torque
ramps can also be adjusted.
The vehicle torque and speed behaviour is controlled using Assist Level Configuration.
With the axle torque sensor connected to Throttle/Analog input 1 on the controller:
- Set the
Control command source
to 0 / serial stream to prevent the motor from accidentally engaging while setting up the torque sensor. - Enable the 'eBike flag bit 10' under
communications configuration vector
. - Poll
throttle voltage
and apply load to the torque sensor to verify the throttle voltage is wired correctly and responding to changes in torque input - Set the
Pedal sensor type
to 5 / Axle torque - Set gains
Axle torque sensor 1
,Axle torque sensor 2
andAxle torque sensor 3
- Set the
Pedalec power gain
to 1 for 1:1 power gain relative to measured torque to start testing with. - Set the
Control command source
to Pedal sensor or throttle or pedal sensor, as appropriate. - Check if the torque output of the sensor configured and is working properly. Add a small amount of resistance to the motored wheel either using a bike trainer or the brakes and then pedal in the forward direction at as constant a cadence as possible. Observe that the
average pedal torque
increases/decreases with the addition/subtracting of resistance provided by the brake.
Torque sensor fine-tuning of feel and adjustment parameters are explained in the Torque Sensor Tuning section.
Basic Setup/Configuration:
- Set the
Pedal sensor type
to 9 - Dyname torque sensor. - Set the
Torque sensor voltage source
to your input source. - Set the
Torque sensor offset
to the resting sensor voltage. - Set the
Torque Sensor Voltage Filter
bits. This sets the amount of time the torque sensor signal is averaged over. Higher value = More filtering, but slower response. Lower values = less filter, faster response. Valid range of 0-15. Averaged time is equal to 2^value in milliseconds. ForTorque Sensor Voltage Filter
= 7 bits, this is 2^7 = 128ms, thereabout 1/8th of a second. - Set the
Torque sensor gain
to calculate the torque. - Set the
Pedalec deadband torque
, below which filtered calculated torque is ignored. This can help reduce sensitivity to moving the pedals, or standing on them for example. At 28 Nm/V, a 10Nm threshold is 10 Nm / 28Nm/V = 0.35V deadband threshold effectively.
Optional settings:
- Enable the
Features bit 9 rolling start enable
. If so, torque will be disabled below theRolling start speed
, preventing system from applying torque even with a sensitive/small deadband while the vehicle is stationary or at very low speeds. For example, you might set this to 3 km/h. No torque will be provided below 3km/h. - Follow-up optional: Configure the
Dyname rolling start ignore torque
as a torque threshold above which will tell the controller to bypass the rolling start. You might say if you see 14Nm (0.5V aboveTorque sensor offset
), even if below 3km/h, provide motor assistance.
Faults/Protections
Static/stuck torque signal fault
- Set the
Throttle deadband threshold
to prevent static voltage faults from triggering or self-clearing unless more than the deadband above/below theTorque sensor offset
parameter - Set the
Torque sensor static voltage fault threshold
parameter to determine the change in voltage that will reset the static voltage fault timer Otherwise, you can just set theTorque sensor static voltage fault threshold
to a negative value, and it will disable the static faults - Set the
Torque sensor static voltage fault time
to determine the time period over which a constant voltage within the above threshold will trip a fault
Average pedal speed test
To check if the pedal output is configured and is working properly. Operating the pedals in the forward direction and examining the value of the average pedal speed
parameter. If the value is positive when pedalling forward and negative when pedalling backwards, the wiring is correct. If the average pedal speed
values are reversed, then the wires connected to the PFS/Digital input 2 and Cruise/Digital input 1 inputs need to be reversed. If the average pedal speed
value is erratic at a constant pedal cadence then there is likely an issue with the wiring.
Troubleshooting
I have no motor assist when pedalling
Is the pedal sensor wired to the correct input? Power (5V or 12V) and GND and:
- PFS/Digital input 2 for single output sensors
- PFS/Digital input 2 (Sine) and Cruise/Digital input 1 (Cosine) for dual output sensors
Are the input signal bits changing with pedal speed?
- Check that
digital inputs bit 3
Pedal First input changes from 0 to 1 in PC BACDoor® and back, or from Disabled to Enabled and back in BACDoor® mobile for single output sensors. - Check that
digital inputs bit 3
Pedal First input &digital inputs bit 4
Cruise both change from 0 to 1 in PC BACDoor® and back, or from Disabled to Enabled and back in BACDoor® mobile independently for dual output sensors.
What is the pedal cadence signal voltage? Scope the sensor signals and note the high and low voltage values. Compare the values against the input specifications listed in Connector Interface as your sensor may not be supported. For example, we have seen digital output voltages of 1.3V and 3.7V, the digital "Low" threshold for a BAC 855 is 4V and thus the bit never changes and the controller never sees pedal speed.
Are the Rated motor power (Race mode PAS power)
and Rated motor power (Street mode PAS power)
, if using alternate power mode, filled in with the motors rated power for pedals. These must be filled in for the pedals to command motor assistance when in their respective power mode.
Brake and cutout enabled
For example, eBike flags bit 1
Cutout enabled prevents the motor from engaging, this is generally coupled with eBike flags bit 0
Brake enabled. This means the brake is enabled and is causing the motor to cutout. Solutions include:
- Disconnect your brakes, they may be pulling the brake voltage out of range.
- Set the
Cutoff brake sensor source
to out of range if not already to stop reading the external brake sensor source and clear the two eBike flags (cutout and brake). - Poll the chosen
Cutoff brake sensor source
voltage, ensure it is above theAnalogue brake full voltage
value. If for example, your voltage source is 3.5V and the analogue brake full voltage is 4V, the cutout will be enabled.
My motor engages when pedalling backwards, but not forwards
Our controller may be interpreting the forward pedal cadence signal as if the pedals are rotating in the reverse direction and thus not providing any motor assist. Switch your Pedal sensor type to reverse type or from reverse type to standard type. For example, switch from single Hall (0) to single hall reverse (6).
8.4 - Ebike flag not set in communications configuration vector
Enable communications configuration vector bit 10
Enable Ebike to enable Pedal sensors.