vedderb / bldc

The VESC motor control firmware
2.14k stars 1.34k forks source link

Feature request: support for one wire PAS #525

Closed AkbarRamzan closed 1 year ago

AkbarRamzan commented 2 years ago

Currently only quadrature sensors are supported but many (cheaper) PAS sensors use only a single wire. There are 2 signal types for one wire PAS: One pulse every time a magnet passes when pedalling forward, no signal when pedalling backwards One pulse of a certain width when pedalling forwards, a different width when pedalling backwards. Backwards pedalling can be used for regen. Ideally the servo pin should be the default as uart could be used for Bluetooth / display but ebikes are unlikely to use servo.

AkbarRamzan commented 2 years ago

image

AkbarRamzan commented 1 year ago

https://github.com/vedderb/bldc/pull/243#issuecomment-809470359 some code for PAS that may be useful.

AkbarRamzan commented 1 year ago

image I captured the signal generated when pedalling forwards using lisp at increasing RPM image It appears back-pedalling has <50% duty cycle so you can work out pedal direction that way. Back-pedalling for regen would be nice.

AkbarRamzan commented 1 year ago

I'm adding support through lisp/ QML and packages. Stay tuned

ReFeXe commented 1 year ago

How did you manage to implement this? Have varied width pas. when using code https://github.com/vedderb/bldc/pull/243#issuecomment-809470359 I get triggered both ways

ReFeXe commented 1 year ago

I'm adding support through lisp/ QML and packages. Stay tuned

I can't figure out how to adapt the above code

ReFeXe commented 1 year ago

I did it, though. https://github.com/ReFeXe/bldclcd3/blob/release_6_02/applications/app_pas.c