High speed encoder input capability of BBB?

Hi TJF! It’s been a few months since my last post, just curious if you have the QEP features ready in libpruio?

Here is a simple project which might help you with “where to go from here”:

https://www.hackster.io/Greg-R/pru-pid-motor-speed-controller-with-beaglebone-green-ccb805?ref=search&ref_id=remoteproc&offset=1

This project uses one of the Encoder modules which the PRU accesses via its OCP master.
The PRU has its own encoder, but it has only one pin wired out, and in this project that pin is used in PWM mode.
The encoder function must be quadrature (2 wires), so even if the PWM was not being used it would have to use an external encoder.

The project uses RemoteProc which you have already encountered in the Labs.
RemoteProc will take care of loading the firmwares as well as provide a simple two-way communications channel between the PRUs and user-space.
The most expensive component (besides the Beaglebone) is the motor-encoder which you can get from eBay for about $20.

At the very least you can look at the C code for the PRU firmware and you can see how the external Quadrature Encoder module is accessed from the PRU.

Regards,
Greg

Hi beezerlm!

Greg - Thanks for the link I will check it out.

TJF - I should probably wait for the docs because I will probably need them. My project is finished for now, but it’s running in a windows environment so it has some limitations on what it can do. I would rather wait until the docs are ready to avoid any unnecessary hurdles if you know what I mean. Thanks for the quick reply!

OK, I just got my BBB so I gotta talk a bit out of my butt (having not done this yet myself).

What you need to do is get it “interrupt driven”. However you do it.

I’m thinking there is a GPIO pin that has this capability (and realistically accessible via the OS in whatever dev environment you use). The form it would take is a callback kinda looking function (like int_countencoder() ). All the function does is super-fast adjust its accumulators and save the absolute position of your encoder in a way accessible at the application level. In other words you just call a high-level function getposition() and it gives you the number you need.

Another way to do is to do the same thing with a PIC or an Arduino where it does an interrupt driven function and then allows you to scan the absolute position via a serial or USB connection. I would do it in assembly language as well (like with a PIC16Fx), crystal-controlled, and tight so there’s no chance of loosing any pulses. Maybe just have it update the host at maybe 10 to 100 hz, so you have the absolute position in real time.

Have you tried it on the 4.9.x kernel yet?

I've been unable to get the tiqep kernel driver in 4.9.5-ti-r16 to
work so far. I'm curious if eQEP would still work with your method.

thanks,
drew

Hi beezerlm!

I tried to answer your EMail, but got an error message:

550 <your.emailaddress.here> Account Inactive

Here's the text I tried to sent:

AFAIR the QEP docu is done, but the preparation/installing is still work
in progress.

I uploaded the beta source at

Just check it out, your feedback is much appreciated.

Regards

Please input PlcEdit on the Google Play and you can program plc on your
phone,the PlcEdit is at
https://play.google.com/store/apps/details?id=com.xingyu.app
<https://www.youtube.com/redirect?stzid=Ugz-sg2HDmm1hWoPSl14AaABAg.8ti9IJ9kadV9-l9PwhwQ7V&q=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.xingyu.app&event=comments&redir_token=a4vcDwHAWG2yBzErrqkdW_as_S98MTU3MDQ4MjczOEAxNTcwMzk2MzM4>
.