Hi Ron,

> -----Original Message-----
> From: R C [mailto:cjv...@gmail.com]
> Sent: May-24-20 4:15 PM
> To: emc-users@lists.sourceforge.net
> Subject: Re: [Emc-users] Encoder HAL programming.
> 
> Hello,
> 
> 
> I have been following this thread.� I wrote some code that runs on an
> RPI that can read a quadrature encoder, I have a few of them, with
> different resolutions.
> 
> I also have a few encoders that came with some stepper motors I got my
> hands on, still have to play with those to see what it is they exactly do.
> 
> 
> I saw this thread about "HAL programming", I don't know much about
> linux-cnc/HAL, if anything, but is there some "general" interface so one
> could 'feed' linux cnc
> 
> data from an encoder?
> 
> 
> I started� playing/messing with these things, because it seems that
> linux-cnc has a hard time keeping up with these encoders and there's not
> a whole lot I could find
> 
> about how to make a spindle encoder work with linux cnc

Just use this link and start at the beginning of the document.  
http://linuxcnc.org/docs/html/examples/spindle.html#_spindle_feedback

The examples are for the parallel port and are limited to about 100 PPR.  
That's because if the base thread is 50,000 ns (20kHz) then to detect the 
rising edges the encoder speed must not exceed half that.  

So imagine you have a 1000 line encoder on the spindle.  If you are only 
looking for speed then max is 10,000 Hz.  Divided by 100PPR and you get 10 RPS. 
 Multiply by 60 to get minute and it's 600 RPM.   So you can't detect spindle 
speed faster than 600 RPM.  And with tolerances probably 500 RPM is a better 
top end.

With the 100 PPR you can see 5000 RPM.

Now switch over to an Ethernet based board like the MESA 7i92H and the counting 
is done in hardware.  I'm pretty sure you can track quadrature with that and a 
2500 line encoder or 10,000 edges per rev.  A spindle turning 6000 RPM would 
create a pulse streak of 250kHz. Not a problem for the MESA hardware AFAIK.

A BeagleBone Black PRU interfacing to the hardware QEI would perform with that 
hi res encoder too.  But then you'd be running machinekit.  That hardware 
support isn't available on a Raspberry Pi.  So for your Pi purchase a MESA 
board.  

Best to post the question as to which version of LinuxCNC runs on a Pi3 or Pi4 
and which MESA Ethernet board works with that.
John
> 
> 
> Ron
> 



_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to