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.
Sensor types
The firmware currently supports one sensor type:
A quadrature PAS sensor outputs two phase-shifted pulse trains, allowing the firmware to detect both cadence (speed of pedaling) and pedaling direction.
Control types
Configuration struct
Key parameters
Timing constants
Defined in app_pas.c:
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.
Wiring
Connect the PAS sensor to the expansion connector pins designated for quadrature input on your VESC hardware variant. The sensor requires:
- Signal A and Signal B pulse outputs (open-drain or push-pull, 3.3 V compatible)
- 5 V or 3.3 V supply
- Common ground
Do not connect a 5 V sensor output directly if your VESC hardware input pins are 3.3 V only. Use a resistor divider or level shifter.
Combining with ADC throttle
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.
Runtime API
app_pas_set_current_sub_scaling lets another module (such as a throttle override) reduce the PAS output current without modifying the stored configuration.