Servers by jDrones

Using hardware Quadrature Encoder Counter instead of software count


(Anup) #1

Hi,

We are trying to use the built-in eQEP module of the BeagleBone Blue instead of the software based counter in the default Ardupilot code. We are able to read the “current” count at any moment of time, we don’t need the interrupts at every toggle of the pins, etc. But, the software seems to be using the time in between every successive toggles inside the EKF, which keeps rejecting it after a bit, because the reading happens a little too late.

Any recommendations on how to bypass that in the presence of a hardware eQEP module. Any Ardurover platform already using hardware quadrature encoder counter?

Regards,
Anup


(ppoirier) #2

@adroit_91
The BeagleBone Blue QEP is not yet implemented on the ArduPilot.
Your logic is correct : In order to get the enoder signal processed it need to be fused within the EKF with the same method as all the other sensors.

The solution is to write a new WheelEncoder_TYPE_QUADRATURE for the BBBlue that is using the QEP and reports these values:
https://github.com/ArduPilot/ardupilot/blob/master/libraries/AP_WheelEncoder/AP_WheelEncoder.h#L43


(Anup) #3

Thanks for the pointers.

Problem is, that the current implementation totally relies on every single GPIO toggle to generate interrupt, while the QEP allows me to occasionally read the current state on demand. I can provide “distance”, but not distance_count. Nor can I provide total_count. Error_count, if at all useful, I can still get from the eQEP interrupt registers. Last reading ms also doesn’t make same sense because we are reading on demand, rather than handling every single interrupt on the GPIO.

Is there no other Ardurover platform where there is hardware similar to eQEP?

Regards,
Anup


(ppoirier) #4

This is why we need a new driver class for the QEP.
I am not aware of any other implementation within ArduPilot.


(Michael Mc Millan) #5

google the term:
quadrature encoder buffer
I had seen them before, but not understood why.