vedderb / bldc

The VESC motor control firmware
2.1k stars 1.32k forks source link

Updated VESC_IF()->get_ppm() to now respect pulse_center #581

Closed NicoAleman closed 1 year ago

NicoAleman commented 1 year ago

Returned value is now mapped with respect to pulse_center, rather than just pulse_start and pulse_end linearly mapped.

The current implementation does not map the PPM servo val around the configured pulse_center, just pulse_start and pulse_end, leaving the possibility (and likelihood) of it centering on a non-zero value at neutral. This PR modifies the original function, but if there are cases that may require this linear mapping start to end, maybe this should be a separate function? Should be simple to implement either way.