As far as I know, PRU micro-code is using sampling for counting.
I have validate up to 100 kHz, with a PRU period of 2.5uS.
So you have 4 samples per pulse period, which is enough, but not fully satisfying if you need to master the jitter. See http://blog.f1oat.org/2016/04/10/adding-velocity-estimation-in-hal_pru_generic-encoder/
The fix I have done on MK code is for frequency measurement.
I am using PRU based encoder for MPG, so without strong constraints.

6000 rpm is exactly the upper limit I have with my ECMO-120P lathe.
With my 1024 ppr spindle encoder, the pulse rate is above 100 kHz.
Possible with PRU, but close to the limit in regards to the overall performance. I do not know if PRU micro-code can sustain 2.5uS period when increasing the number of encoders/pwms it is processing.
This is why I am using BBB eQEP instead of PRU for spindle.
I do not have specs in mind, but I guess eQEP is capable of more than 1 MHz, as soon as the lowpass filter of the input is well designed.

Frederic
http://cnc.f1oat.org

On 2017-10-15 06:24, John Dammeyer wrote:
Hi Jon,
With respect to high speed encoder interface using the PRU on the Beagle I
may have misunderstood the comment from Charles from the second link below.
I'm thinking a 6000 RPM spindle with a 1000 line encoder detecting in
quadrature.  That's tracking 24KHz which has a period of 41.667uS so I guess
the PRU can probably count that as long as it isn't doing to many other
things in that same 10uS interrupt.

Here's what I've found so far to a posting I did back in 2015.
https://groups.google.com/forum/#!searchin/machinekit/Beaglebone$20machineki
t$20lathe$20spindle%7Csort:relevance/machinekit/6klZrJH_2ZA/kDVr-6LgFgAJ

1. A reply from Jeff Pollard on which pins on the Xylotex 26 pin header to
use for the QEP along with instructions to not use the "A HOME/LIMIT" switch
on the DB-25 for homing and instead remove a filter capacitor so the index
pulse can be read.  How to configure the Xylotex .ini file is not explained.

Past that the other link from 15JUN15:
https://groups.google.com/forum/#!searchin/machinekit/Beaglebone$20machineki
t$20lathe$20spindle%7Csort:relevance/machinekit/OvkMCwhhpjY/O0y1sl8y8OcJ

1. A comment from Charles which is what has led me to think the QEP for
spindle isn't possible on the Beagle yet.  But that was more than 2 years
ago.

"You can implement slow user-interface style encoder inputs on the ARM
in the servo thread (1 mS period) using the software encoder input and
GPIO pins.

The PRU encoders will run at the PRU period (10 uS by default) and
must use direct PRU input pins.

The hardware encoders obviously need to use the specific pins for the
channel(s) used.

If you need more higher performance encoders, it's possible to
dedicate one of the PRUs to do just encoder inputs, but that software
has yet to be written (pull requests greatly appreciated!).  :)
Charles Steinkuehler"




-----Original Message-----
From: Jon Elson [mailto:el...@pico-systems.com]
Sent: October-14-17 7:55 PM
To: Enhanced Machine Controller (EMC)
Subject: Re: [Emc-users] MachineKit on the BeagleBone Black

On 10/14/2017 03:14 PM, John Dammeyer wrote:
I'll see if I can find that link.  From what I remember it's specific
PRU
code for the Beagle that needs to be written for the Lathe part and that
was
never done.


But, there is NO specific PRU code for a lathe.  What you
need are steps (assuming a step/dir motor interface),
some digital I/O to control the spindle, and at least one
encoder counter with direction.  The generic PRU code
built by Charles Steinkuehler can provide this, if the hal
command line asks it to do so.

Once you have a spindle encoder, you can do lathe threading
operation.

Now, one other item might be an analog output to control
spindle speed.  You can always integrate a PWM output, which
the PRU can provide, to get this.

Jon


----------------------------------------------------------------------------
--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to