Configure pedal assist for e-bikes using a cadence or torque sensor.
The PAS (Pedal Assist System) application is designed for e-bikes. It reads a crank rotation sensor and scales motor current proportionally to pedaling cadence or torque, providing assistance that feels natural under pedaling effort.
A quadrature PAS sensor outputs two phase-shifted pulse trains, allowing the firmware to detect both cadence (speed of pedaling) and pedaling direction.
If no sensor pulses arrive within PEDAL_INPUT_TIMEOUT (0.2 s), the pedal RPM reading is treated as zero. If cadence is absent for longer than MAX_MS_WITHOUT_CADENCE_OR_TORQUE (5 s), motor output stops entirely.
Select APP_ADC_PAS to run both the ADC throttle application and PAS simultaneously. In this mode the ADC throttle acts as an override: if the rider applies the throttle lever, ADC output takes precedence over pedal assist.
app_pas_set_current_sub_scaling lets another module (such as a throttle override) reduce the PAS output current without modifying the stored configuration.