Re: [Emc-users] FERROR MIN_FERROR value?

2020-05-25 Thread Gene Heskett
On Monday 25 May 2020 18:33:29 Jon Elson wrote:

> On 05/25/2020 02:50 PM, N wrote:
> > Do anyone here have any suggestion for FERROR and MIN_FERROR values?
>
> It depends on your "user units", as well as the general
> accuracy and speed of the machine.
> FERROR is a multiplier to velocity in user units/second that
> is added to MIN_FERROR.
> MIN_FERROR is the allowable following error with the machine
> not moving.
>
> On a servo system, you should have Halscope graph the
> following error and find out what
> your actual errors are, and then set MIN_FERROR
> accordingly.  Then, set FERROR to
> accommodate larger error at rapid traverse speed.
>
> There's no one good value for everybody.
>
> Jon

Perhaps this might be a good time to discuss/develop a recommended good 
practice procedure to be applied to a machine w/o PID's as there's none 
in the pi running the sheldon, and none in the D5215MW running the 6040.  

Can you recommend a procedure that Just Works, where the machine is 
expected to follow what the TP actually outputs, with a tolerance 
setting profile that its capable of staying inside of?

Without PID's, where do we get a following error that we can see on the 
halscope?  Or do I need to put PID's in before this makes sense?  Or do 
I make a sub2 out of a sum2 just to develop the error signal?  
Eventually that would use up the cpu cycles saved by not using the 
PID's.  And it all, to me, adds up to more give between the TP and what 
the machine does, allowing more error than w/o the PID.

Seems to me there should be some "rules of thumb" to apply here.


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


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] FERROR MIN_FERROR value?

2020-05-25 Thread Jon Elson

On 05/25/2020 02:50 PM, N wrote:

Do anyone here have any suggestion for FERROR and MIN_FERROR values?



It depends on your "user units", as well as the general 
accuracy and speed of the machine.
FERROR is a multiplier to velocity in user units/second that 
is added to MIN_FERROR.
MIN_FERROR is the allowable following error with the machine 
not moving.


On a servo system, you should have Halscope graph the 
following error and find out what
your actual errors are, and then set MIN_FERROR 
accordingly.  Then, set FERROR to

accommodate larger error at rapid traverse speed.

There's no one good value for everybody.

Jon


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread R C

never done anything with those, and have a few RPIs lying around

On 5/25/20 1:27 PM, andy pugh wrote:

On Mon, 25 May 2020 at 20:15, R C  wrote:


I am actually trying to see how much I can push it by using a rpi for
that, that's about the same price.

An Arduino is possibly a better choice. You can get Nanos for about £5.




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


[Emc-users] FERROR MIN_FERROR value?

2020-05-25 Thread N
Do anyone here have any suggestion for FERROR and MIN_FERROR values?


Regards Nicklas Karlsson


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread andy pugh
On Mon, 25 May 2020 at 20:15, R C  wrote:

> I am actually trying to see how much I can push it by using a rpi for
> that, that's about the same price.

An Arduino is possibly a better choice. You can get Nanos for about £5.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread John
Yes but it is another level of development. 

Sent from John's iPhone 4S

On 2020-05-25, at 12:07 PM, Jon Elson  wrote:

> On 05/25/2020 11:01 AM, R C wrote:
>> In the video I posted earlier (it's a year old)... the guy using that chip 
>> says it cost  him $40,  he showed it on line for about $28.
>> 
>> (and that's just for the LS7366R by itself.)
> This just doesn't make sense anymore.  You can take a bottom of the line FPGA 
> and put 4, 8 or maybe even dozens of quadrature counters in it, with digital 
> filtering, latch on index and other features. The Spartan 3A chips I use are 
> just over $10 each.
> 
> Jon
> 
> 
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


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


Re: [Emc-users] post plumb, was unhomeing

2020-05-25 Thread Gene Heskett
On Sunday 24 May 2020 18:15:44 Gene Heskett wrote:

> On Sunday 24 May 2020 13:41:07 Gene Heskett wrote:
> > On Sunday 24 May 2020 12:51:23 andy pugh wrote:
> > > On Sun, 24 May 2020 at 17:28, Gene Heskett 
> >
> > wrote:
> > > > 'twouldn't be the first time an IDC cable was iffy
> > >
> > > ...
> > >
> > > > I hate trying to solder that stuff
> > >
> > > Soldering IDC seems to be missing the point?
> > >
> > > You can use individual crimps in housings. I have used Harwin M20
> > > series. They don't do a 13+13 but you can put them in side-by-side
> > > and even glue them together.
> > > https://www.mouser.com/ProductDetail/Harwin/M20-1070900?qs=Jph8NoU
> > >xI fV sJjhtgmLy%252BQ%3D%3D (plus a 4x4 to fill the header)
> > > You also need the terminals (gold plated)
> > > https://www.mouser.com/ProductDetail/Harwin/M20-1180042?qs=pYcASEc
> > >TD E4 r0B52MhViPw%3D%3D
> > >
> > > I use my smallest W-crimper and that has always worked OK. The
> > > factory tool is a bit too spendy.
> > > https://www.mouser.com/ProductDetail/Harwin/Z20-320?qs=sGAEpiMZZMt
> > >yU 1c DF2RqUOtOPkfvlC0EbGCz9sNUj2Q%3D
> >
> > A bit?  What is your definition of a lot? ;-)
> >
> > > I am not sure that those URLs will work outside my session, but
> > > you can find them by part number, the M20-.. part of the URL.
> >
> > Works fine here.
> >
> > That would nicely handle the 26 pin header on p2, but what about the
> > BBLB amp blue molded db25 on the other end?  I'll pull this one off
> > and run both ends back thru my vice, its probably 3 years since that
> > one last felt the squeeze. I'll put an extra shim in the center for
> > extra pressure in the center of the connectors.  If that doesn't fix
> > it, I've probably got enough cable to make 10 more of them.
> > Connectors are in short stock though.  That particular SainSmart bob
> > has a good reputation in these here parts.  I must have a 6 pack of
> > them in service. Many others have been removed for various reasons.
> > Often for slow opto's, screwing up a pwm, so I now have a house
> > rule, don't use anything with opto's in the outputs anymore.
>
> I made room enough to move the G0704, and using my new hoist I set the
> BS-1 back off of the table, then picked up on the table enough to
> wrestle the 450 lb mill out about 90 degrees, then found the 3/8" cap
> screws in the back of the post were apparently lock-tighted or
> gawdawfull tight as it took a 6 foot piece of 3/4 conduit for a
> cheater on the allen wrench to move any of those 4 bolts. I'd estimate
> I was lifting well over 100 lbs 4 feet away from the bolt before any
> of them moved. Even with the bolts all loose, I can only shake the top
> of the post about 1/16", so the bolts fit the bolt holes very
> precisely. I don't have a cylindrical square so I think I'll scan a
> square i've trusted for a long time, and see if I can retighten it
> with at least the same but opposite error on each side, get the bottom
> bolts to hold it there, then scan the front and back and maybe add a
> layer of reynolds wrap as shim to plumb the in-out lean, all
> referenceing the table.  That ought to be better than it was.

Since I don't have one of those $188 cylindrical squares, I thought I'd 
play with an original die cast Swanson Speed square that I've had since 
forever. Stood it up on its flat face on the mills table and measured 
the post, which was out of range for one of those .0001 dials in just an 
inch of vertical travel, post leaning left.

Got out a 4+ foot piece of 3/4 sq steel tubing and used that as a cheater 
bar on a good 3/8 allen wrench and still had to bounce on the end of it 
to get the bolts loose.  Pushed the post to the right as far as the 
loose bolts would let it, and snugged them up enough to recheck, still 
off about 5 thou in 4", turned square around, still off 5 thou in the 
same direction. zeroed dial at bottom, got 5.5 thou with the square 
either way, so that 30 yo diecast Swanson is good.  Loosen bolts 
slightly, beat on post with a dead blow till I had about 2 thou the 
other direction.  Rezeroed it all, about half a thou in 5.5" of vertical 
travel. Put about 100 lbs on the end of the cheater tightening things as 
I'd call that "good enough for the girls I go with."  And a hell of a 
lot closer than it was at 9 o-clock this morning.

Didn't check in/out tilt, probably should have but I'm beat and trying to 
figure out how to get it back into its home position w/o screwing up my 
back like I did putting it there 4.5 years ago.

Thanks folks.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


___
Emc-users mailing list
Emc-users@lists.sourceforge.net

Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread R C
that's what I thought too, it's pretty expensive. (probably low 
production runs etc., obsolete?).



I am actually trying to see how much I can push it by using a rpi for 
that, that's about the same price.



Ron


On 5/25/20 1:07 PM, Jon Elson wrote:

On 05/25/2020 11:01 AM, R C wrote:
In the video I posted earlier (it's a year old)... the guy using that 
chip says it cost  him $40,  he showed it on line for about $28.


(and that's just for the LS7366R by itself.)


This just doesn't make sense anymore.  You can take a bottom of the 
line FPGA and put 4, 8 or maybe even dozens of quadrature counters in 
it, with digital filtering, latch on index and other features. The 
Spartan 3A chips I use are just over $10 each.


Jon


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



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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread Jon Elson

On 05/25/2020 11:01 AM, R C wrote:
In the video I posted earlier (it's a year old)... the guy 
using that chip says it cost  him $40,  he showed it on 
line for about $28.


(and that's just for the LS7366R by itself.)


This just doesn't make sense anymore.  You can take a bottom 
of the line FPGA and put 4, 8 or maybe even dozens of 
quadrature counters in it, with digital filtering, latch on 
index and other features. The Spartan 3A chips I use are 
just over $10 each.


Jon


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread John Dammeyer
> -Original Message-
> From: andy pugh [mailto:bodge...@gmail.com]
> On Mon, 25 May 2020 at 10:42, Chris Albertson  
> wrote:
> 
> > Ideally you have just one thin cable going from controller to the machine.
> >  If you like those chips just glue on on each encoder and turn then encoder
> > into a serial interfaced device.  Or use a serial buss so 6 encoders can
> > share one cable.
> 
> There are elements of this to the STMBL servo drive, in that it uses
> the STM32 to count encoder (and resolver and SSI) encoders then
> reports back to LinuxCNC using the Mesa smart-serial protocol.
> This is a neat choice, as Smart-Serial is self-configuring. Plug in
> the device and all the appropriate HAL pins appear as if by magic.
> 
> Smart-serial is still one cable per node, though. It's a star topology.
> 
> But if it will work for you, then the smart-serial STMBL code for
> STM32 is there on the STMBL Github.
> 

There are two options for distributed.  Either CAN bus or EtherCAT.   For 
closed loop motor control CAN bus just isn't fast enough although the new 
CAN-FD has possibilities.  EtherCAT is seeing more use in industry.  All those 
solutions are generally more expensive than LinuxMESA for a 
home/small_shop/hobby system.

And that you can get full 3 or 4 Axis CNC systems with LCD displays from China 
for under $300US for basic CNC operations (internally they have 32 bit ARM 
processors I believe) the reality is one has to now look at the market.

The days of replacing the FANUC or whatever industrial controller on the 
surplus mill with only a PC c/w parallel port are over. For those systems I'm 
seeing either MACH4 with Ethernet type Smooth Stepper or LinuxMESA.Most 
users of Linux do not recommend LinuxCNC with a parallel port.  Some users are 
experimenting quite successfully with Raspberry Pi LinuxMESA.

And the BeagleBone with MachineKit is somewhat dead because MachineKit itself 
is somewhat dead end.

Certainly Andy is right.  The STM32 as used on our STMBL drives is a good 
solution for motor control and what Rene and company have done with the STMBL 
drive is really quite good.  

I happen to have the Microchip ICD-4 for programming and debugging code.  And 
lots of other Microchip stuff so I am pulled in that direction rather than text 
based make files and terminal interfaces for all debugging.  And it's where my 
work is.  My clients refuse to use Linux for development so it's a no brainer 
that I'm using MPLAB-X etc.

Meanwhile, I've still not completely figured out how LinuxCNC decides how 
far/fast it should move the Z axis based on the items read back from the 
quadrature encoder.  Or how starting G95 will, I'm told, result in the Z axis 
tracking the spindle as it's rocked back and forth by hand.

John Dammeyer







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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread John Dammeyer

> > be a good idea.  There are also devices from the same manufacturer
> > that can change quadrature into up/down pulses streams to use regular
> > counters inside the Pi.
> 
> But quadrature has one huge advantage over regular counters, you get both
> speed AND  direction from every edge that goes by.
> > John
> >
Gene, 
The small devices take quadrature and change it into pulse/dir or count up  and 
count down signals.  So if you have a processor that has 32 bit counters but 
doesn't have QEI modules those chips can do that for you.  Both speed and 
direction.

For example the PIC32MX795 I've ported my ELS project to doesn't have a QEI 
module. But does have some counters.  From the data sheet overview.

Timers/Output Compare/Input Capture
• Five General Purpose Timers:
- Five 16-bit and up to two 32-bit Timers/Counters
• Five Output Compare (OC) modules
• Five Input Capture (IC) modules
• Real-Time Clock and Calendar (RTCC) module

So for a standalone controller that has CAN bus, Ethernet and USB but needs QEI 
the smaller translation chip is one option.   
Or alternatively:
https://www.microchip.com/wwwproducts/en/PIC32MK1024MCF100

Is PIC32 with up to 4 CAN us channels, 6 QEI, 2 USB but no Ethernet.  This 
device can also do PWM and is designed for closed loop motor control.  

And it's always possible to add an external Ethernet controller like this one 
for EtherCAT
https://www.microchip.com/wwwproducts/en/LAN9252

or 
https://www.microchip.com/wwwproducts/en/ENC424J600

for just simple 10/100 Mbps Ethernet.

John




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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread R C
interesting, so how easy would it be to use a board/device like this in 
linux-cnc?


if those are just a few $$$  it would be fun to mess with.

On 5/25/20 3:39 AM, Chris Albertson wrote:

Yes, you can buy a hardware Quadrature chip.  But any modern
microcontroller like the STM32 will have hardware quadrature decoders.
The larger versions of the chip will have multiple quadrature decoders.
The chip will also have SPI.   These things cost under $1 or about $3 if
you want it on PCB ready to use.   If you buy the chip you need to design a
PCB.   I buy the microcontroller already on a PCB and in a usable form for
$3.

I like to place these not on some kind of large PCB near the main processor
but rather near the sensor.  This reduces the bulk of wire.   You can stick
the littlle computers where ever they are needed and then  snake one
(say) CANbus
cable around to connect each of them to power and data.

If you try to build a cape that does everything you find that you can't.
By "everything" I mean works with a PC, with a Pi4 and with a BBB and
connects steppers and servos and VFDs and linear scales. It is best to
just put a CAN bus or whatever on the main computer and nothing else.
  This is 100% "future proof" because every part can be swapped out.

These little boards have become by "go to" universal interface board.  They
cost $3 and have hardware pulse, PWM and quadrature support in hardware and
can talk over SPI I2C or USB.  They are small and cheap enough that you can
place them where ever they are needed.
ebay.com/itm/STM32F103C8T6...


THe other design option is to use an FPGA.  That is what Mesa does and they
can put any reasonable number of counters and generaters in one FPGA but
then you have to route a ton of wires all back to that one chip.

Ideally you have just one thin cable going from controller to the machine.
  If you like those chips just glue on on each encoder and turn then encoder
into a serial interfaced device.  Or use a serial buss so 6 encoders can
share one cable.



On Mon, May 25, 2020 at 12:38 AM John Dammeyer 
wrote:


BTW,  Check out
https://lsicsi.com/datasheets/LS7366R.pdf
This device is interfaced via SPI and has a 32 bit quadrature counter
module.  If you go in the direction of Raspberry Pi with LinuxCNC a device
like this can provide the spindle information.  So if someone was thinking
of building a CNC cape for a Pi a device like this would be a good idea.
There are also devices from the same manufacturer that can change
quadrature into up/down pulses streams to use regular counters inside the
Pi.

John



-Original Message-
From: R C [mailto:cjv...@gmail.com]
Sent: May-24-20 6:01 PM
To: linuxcnc-users-list
Subject: Re: [Emc-users] Encoder HAL programming.


On 5/24/20 6:29 PM, andy pugh wrote:

On Mon, 25 May 2020 at 00:17, R C  wrote:


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.

Is this something different to the normal LinuxCNC software encoder
that reads GPIO?
Is there some dedicated encoder counter hardware on the Pi?


Oh I am not running linux cnc on an rpi, I run it on a server "class"
machine.�� I was just curious about how these encoders work, and why
they didn't

work that well with my linux-cnc setup using a db25 BOB with the 2
benchtops I have.


So I decided to use an RPI (because it is easy to use GPIO pins to read
signals) and write some code to read these� encoder signals.



So I guess my answer is yes,� it is different from, what linux-cnc
running on a pi does (I would be surprised if it was similar)


I setup an RPI, hooked up a 2 line LCD display to it to display rpms,
wrote some interrupt driven code that reads the encoder and displays it
on the LCD. The idea is, I want

to try and see if I can read the encoder and then send signals back to
linux-cnc that it 'could handle".


So I have a 60ppr encoder,� 60 has a lot of dividers.� 2, 3, 4, 5, 6,
10, and 12� So if I can "transfer" a pulse with a consistent delay
exactly when the actual n-th pulse

comes in, I could turn a 60ppr� encoder into a 30, 20, 15, 12, 10, 6 or
5 ppr encoder by just skipping pulses,� while raising some GPIO pins,
that I connect to the BOB, when

I read a different set of GPIO pins directly from the encoder.



But as I said earlier,� I don't know a lot about the linux-cnc's
internals, and HAL, but it is something I am playing with to see if it
could work.


Ron



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



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







Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread R C
In the video I posted earlier (it's a year old)...  the guy using that 
chip says it cost  him $40,  he showed it on line for about $28.


(and that's just for the LS7366R by itself.)


https://www.youtube.com/watch?v=RLCPKa9SoF0

On 5/25/20 2:31 AM, Gene Heskett wrote:

On Monday 25 May 2020 03:35:05 John Dammeyer wrote:


BTW,  Check out
https://lsicsi.com/datasheets/LS7366R.pdf

Is cute, but the only thing it can do better than a mesa 7i90, is work at
5 volts. Both are s32 counters, but the mesa needs >3.3 volt
protections. What is its per unit cost?

And its the protections that run the price of a complete 7i90 solution
out of sight. But you also get a total of 72 i/o lines so you generally
can do a complete system for a multiaxis machine on just one of them.


This device is interfaced via SPI and has a 32 bit quadrature counter
module.  If you go in the direction of Raspberry Pi with LinuxCNC a
device like this can provide the spindle information.  So if someone
was thinking of building a CNC cape for a Pi a device like this would
be a good idea.  There are also devices from the same manufacturer
that can change quadrature into up/down pulses streams to use regular
counters inside the Pi.

But quadrature has one huge advantage over regular counters, you get both
speed AND  direction from every edge that goes by.

John


-Original Message-
From: R C [mailto:cjv...@gmail.com]
Sent: May-24-20 6:01 PM
To: linuxcnc-users-list
Subject: Re: [Emc-users] Encoder HAL programming.

On 5/24/20 6:29 PM, andy pugh wrote:

On Mon, 25 May 2020 at 00:17, R C  wrote:

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.

Is this something different to the normal LinuxCNC software
encoder that reads GPIO?
Is there some dedicated encoder counter hardware on the Pi?

Oh I am not running linux cnc on an rpi, I run it on a server
"class" machine.�� I was just curious about how these encoders work,
and why they didn't

work that well with my linux-cnc setup using a db25 BOB with the 2
benchtops I have.


So I decided to use an RPI (because it is easy to use GPIO pins to
read signals) and write some code to read these� encoder signals.



So I guess my answer is yes,� it is different from, what linux-cnc
running on a pi does (I would be surprised if it was similar)


I setup an RPI, hooked up a 2 line LCD display to it to display
rpms, wrote some interrupt driven code that reads the encoder and
displays it on the LCD. The idea is, I want

to try and see if I can read the encoder and then send signals back
to linux-cnc that it 'could handle".


So I have a 60ppr encoder,� 60 has a lot of dividers.� 2, 3, 4, 5,
6, 10, and 12� So if I can "transfer" a pulse with a consistent
delay exactly when the actual n-th pulse

comes in, I could turn a 60ppr� encoder into a 30, 20, 15, 12, 10, 6
or 5 ppr encoder by just skipping pulses,� while raising some GPIO
pins, that I connect to the BOB, when

I read a different set of GPIO pins directly from the encoder.



But as I said earlier,� I don't know a lot about the linux-cnc's
internals, and HAL, but it is something I am playing with to see if
it could work.


Ron



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

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


Cheers, Gene Heskett



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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread R C
I actually saw a youtube video where someone was using this chip.  I 
believe he said it was like $28, and you'd still need something to read/run


it with. (also,  not running linux cnc on the pi,  the little raspberry 
pi project has nothing to do with my linux cnc machine, I just did that 
to read


the quadrature encoder.


Here's the video I found a while back: 
https://www.youtube.com/watch?v=RLCPKa9SoF0



Ron

On 5/25/20 1:35 AM, John Dammeyer wrote:

BTW,  Check out
https://lsicsi.com/datasheets/LS7366R.pdf
This device is interfaced via SPI and has a 32 bit quadrature counter module.  
If you go in the direction of Raspberry Pi with LinuxCNC a device like this can 
provide the spindle information.  So if someone was thinking of building a CNC 
cape for a Pi a device like this would be a good idea.  There are also devices 
from the same manufacturer that can change quadrature into up/down pulses 
streams to use regular counters inside the Pi.

John



-Original Message-
From: R C [mailto:cjv...@gmail.com]
Sent: May-24-20 6:01 PM
To: linuxcnc-users-list
Subject: Re: [Emc-users] Encoder HAL programming.


On 5/24/20 6:29 PM, andy pugh wrote:

On Mon, 25 May 2020 at 00:17, R C  wrote:


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.

Is this something different to the normal LinuxCNC software encoder
that reads GPIO?
Is there some dedicated encoder counter hardware on the Pi?


Oh I am not running linux cnc on an rpi, I run it on a server "class"
machine.�� I was just curious about how these encoders work, and why
they didn't

work that well with my linux-cnc setup using a db25 BOB with the 2
benchtops I have.


So I decided to use an RPI (because it is easy to use GPIO pins to read
signals) and write some code to read these� encoder signals.



So I guess my answer is yes,� it is different from, what linux-cnc
running on a pi does (I would be surprised if it was similar)


I setup an RPI, hooked up a 2 line LCD display to it to display rpms,
wrote some interrupt driven code that reads the encoder and displays it
on the LCD. The idea is, I want

to try and see if I can read the encoder and then send signals back to
linux-cnc that it 'could handle".


So I have a 60ppr encoder,� 60 has a lot of dividers.� 2, 3, 4, 5, 6,
10, and 12� So if I can "transfer" a pulse with a consistent delay
exactly when the actual n-th pulse

comes in, I could turn a 60ppr� encoder into a 30, 20, 15, 12, 10, 6 or
5 ppr encoder by just skipping pulses,� while raising some GPIO pins,
that I connect to the BOB, when

I read a different set of GPIO pins directly from the encoder.



But as I said earlier,� I don't know a lot about the linux-cnc's
internals, and HAL, but it is something I am playing with to see if it
could work.


Ron



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



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



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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread Gene Heskett
On Monday 25 May 2020 06:50:16 andy pugh wrote:

> On Mon, 25 May 2020 at 10:42, Chris Albertson 
 wrote:
> > Ideally you have just one thin cable going from controller to the
> > machine. If you like those chips just glue on on each encoder and
> > turn then encoder into a serial interfaced device.  Or use a serial
> > buss so 6 encoders can share one cable.
>
> There are elements of this to the STMBL servo drive, in that it uses
> the STM32 to count encoder (and resolver and SSI) encoders then
> reports back to LinuxCNC using the Mesa smart-serial protocol.
> This is a neat choice, as Smart-Serial is self-configuring. Plug in
> the device and all the appropriate HAL pins appear as if by magic.
>
> Smart-serial is still one cable per node, though. It's a star
> topology.

When using that as I am with a 5i25-7i76 pairing, I assume each device 
then occupies a pair of conductors back to the hosting card? I've seen 
hints of a 2nd SS channel in the firmwares for the 5i25 where two 
daughtercards were involved but so far I am using a common bob on the p2 
plug and haven't run out of i/o. Yet...

How then does one go about expanding that to 4, or even 6 channels?

> But if it will work for you, then the smart-serial STMBL code for
> STM32 is there on the STMBL Github.

Thank you Andy.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread andy pugh
On Mon, 25 May 2020 at 10:42, Chris Albertson  wrote:

> Ideally you have just one thin cable going from controller to the machine.
>  If you like those chips just glue on on each encoder and turn then encoder
> into a serial interfaced device.  Or use a serial buss so 6 encoders can
> share one cable.

There are elements of this to the STMBL servo drive, in that it uses
the STM32 to count encoder (and resolver and SSI) encoders then
reports back to LinuxCNC using the Mesa smart-serial protocol.
This is a neat choice, as Smart-Serial is self-configuring. Plug in
the device and all the appropriate HAL pins appear as if by magic.

Smart-serial is still one cable per node, though. It's a star topology.

But if it will work for you, then the smart-serial STMBL code for
STM32 is there on the STMBL Github.

-- 
atp
"A motorcycle is a bicycle with a pandemonium attachment and is
designed for the especial use of mechanical geniuses, daredevils and
lunatics."
— George Fitch, Atlanta Constitution Newspaper, 1912


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread Chris Albertson
Yes, you can buy a hardware Quadrature chip.  But any modern
microcontroller like the STM32 will have hardware quadrature decoders.
The larger versions of the chip will have multiple quadrature decoders.
The chip will also have SPI.   These things cost under $1 or about $3 if
you want it on PCB ready to use.   If you buy the chip you need to design a
PCB.   I buy the microcontroller already on a PCB and in a usable form for
$3.

I like to place these not on some kind of large PCB near the main processor
but rather near the sensor.  This reduces the bulk of wire.   You can stick
the littlle computers where ever they are needed and then  snake one
(say) CANbus
cable around to connect each of them to power and data.

If you try to build a cape that does everything you find that you can't.
By "everything" I mean works with a PC, with a Pi4 and with a BBB and
connects steppers and servos and VFDs and linear scales. It is best to
just put a CAN bus or whatever on the main computer and nothing else.
 This is 100% "future proof" because every part can be swapped out.

These little boards have become by "go to" universal interface board.  They
cost $3 and have hardware pulse, PWM and quadrature support in hardware and
can talk over SPI I2C or USB.  They are small and cheap enough that you can
place them where ever they are needed.
ebay.com/itm/STM32F103C8T6...


THe other design option is to use an FPGA.  That is what Mesa does and they
can put any reasonable number of counters and generaters in one FPGA but
then you have to route a ton of wires all back to that one chip.

Ideally you have just one thin cable going from controller to the machine.
 If you like those chips just glue on on each encoder and turn then encoder
into a serial interfaced device.  Or use a serial buss so 6 encoders can
share one cable.



On Mon, May 25, 2020 at 12:38 AM John Dammeyer 
wrote:

> BTW,  Check out
> https://lsicsi.com/datasheets/LS7366R.pdf
> This device is interfaced via SPI and has a 32 bit quadrature counter
> module.  If you go in the direction of Raspberry Pi with LinuxCNC a device
> like this can provide the spindle information.  So if someone was thinking
> of building a CNC cape for a Pi a device like this would be a good idea.
> There are also devices from the same manufacturer that can change
> quadrature into up/down pulses streams to use regular counters inside the
> Pi.
>
> John
>
>
> > -Original Message-
> > From: R C [mailto:cjv...@gmail.com]
> > Sent: May-24-20 6:01 PM
> > To: linuxcnc-users-list
> > Subject: Re: [Emc-users] Encoder HAL programming.
> >
> >
> > On 5/24/20 6:29 PM, andy pugh wrote:
> > > On Mon, 25 May 2020 at 00:17, R C  wrote:
> > >
> > >> 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.
> > > Is this something different to the normal LinuxCNC software encoder
> > > that reads GPIO?
> > > Is there some dedicated encoder counter hardware on the Pi?
> > >
> >
> > Oh I am not running linux cnc on an rpi, I run it on a server "class"
> > machine.�� I was just curious about how these encoders work, and why
> > they didn't
> >
> > work that well with my linux-cnc setup using a db25 BOB with the 2
> > benchtops I have.
> >
> >
> > So I decided to use an RPI (because it is easy to use GPIO pins to read
> > signals) and write some code to read these� encoder signals.
> >
> >
> >
> > So I guess my answer is yes,� it is different from, what linux-cnc
> > running on a pi does (I would be surprised if it was similar)
> >
> >
> > I setup an RPI, hooked up a 2 line LCD display to it to display rpms,
> > wrote some interrupt driven code that reads the encoder and displays it
> > on the LCD. The idea is, I want
> >
> > to try and see if I can read the encoder and then send signals back to
> > linux-cnc that it 'could handle".
> >
> >
> > So I have a 60ppr encoder,� 60 has a lot of dividers.� 2, 3, 4, 5, 6,
> > 10, and 12� So if I can "transfer" a pulse with a consistent delay
> > exactly when the actual n-th pulse
> >
> > comes in, I could turn a 60ppr� encoder into a 30, 20, 15, 12, 10, 6 or
> > 5 ppr encoder by just skipping pulses,� while raising some GPIO pins,
> > that I connect to the BOB, when
> >
> > I read a different set of GPIO pins directly from the encoder.
> >
> >
> >
> > But as I said earlier,� I don't know a lot about the linux-cnc's
> > internals, and HAL, but it is something I am playing with to see if it
> > could work.
> >
> >
> > Ron
> >
> >
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
>
>
> ___
> Emc-users 

Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread Gene Heskett
On Monday 25 May 2020 03:35:05 John Dammeyer wrote:

> BTW,  Check out
> https://lsicsi.com/datasheets/LS7366R.pdf
> This device is interfaced via SPI and has a 32 bit quadrature counter
> module.  If you go in the direction of Raspberry Pi with LinuxCNC a
> device like this can provide the spindle information.  So if someone
> was thinking of building a CNC cape for a Pi a device like this would
> be a good idea.  There are also devices from the same manufacturer
> that can change quadrature into up/down pulses streams to use regular
> counters inside the Pi.
>
> John
>
> > -Original Message-
> > From: R C [mailto:cjv...@gmail.com]
> > Sent: May-24-20 6:01 PM
> > To: linuxcnc-users-list
> > Subject: Re: [Emc-users] Encoder HAL programming.
> >
> > On 5/24/20 6:29 PM, andy pugh wrote:
> > > On Mon, 25 May 2020 at 00:17, R C  wrote:
> > >> 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.
> > >
> > > Is this something different to the normal LinuxCNC software
> > > encoder that reads GPIO?
> > > Is there some dedicated encoder counter hardware on the Pi?
> >
> > Oh I am not running linux cnc on an rpi, I run it on a server
> > "class" machine.�� I was just curious about how these encoders work,
> > and why they didn't
> >
> > work that well with my linux-cnc setup using a db25 BOB with the 2
> > benchtops I have.
> >
> >
> > So I decided to use an RPI (because it is easy to use GPIO pins to
> > read signals) and write some code to read these� encoder signals.
> >
> >
> >
> > So I guess my answer is yes,� it is different from, what linux-cnc
> > running on a pi does (I would be surprised if it was similar)
> >
> >
> > I setup an RPI, hooked up a 2 line LCD display to it to display
> > rpms, wrote some interrupt driven code that reads the encoder and
> > displays it on the LCD. The idea is, I want
> >
> > to try and see if I can read the encoder and then send signals back
> > to linux-cnc that it 'could handle".
> >
> >
> > So I have a 60ppr encoder,� 60 has a lot of dividers.� 2, 3, 4, 5,
> > 6, 10, and 12� So if I can "transfer" a pulse with a consistent
> > delay exactly when the actual n-th pulse
> >
> > comes in, I could turn a 60ppr� encoder into a 30, 20, 15, 12, 10, 6
> > or 5 ppr encoder by just skipping pulses,� while raising some GPIO
> > pins, that I connect to the BOB, when
> >
> > I read a different set of GPIO pins directly from the encoder.
> >
> >
> >
> > But as I said earlier,� I don't know a lot about the linux-cnc's
> > internals, and HAL, but it is something I am playing with to see if
> > it could work.
> >
> >
> > Ron
> >
> >
> >
> > ___
> > Emc-users mailing list
> > Emc-users@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/emc-users
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users


Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 


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


Re: [Emc-users] Encoder HAL programming.

2020-05-25 Thread John Dammeyer
BTW,  Check out 
https://lsicsi.com/datasheets/LS7366R.pdf
This device is interfaced via SPI and has a 32 bit quadrature counter module.  
If you go in the direction of Raspberry Pi with LinuxCNC a device like this can 
provide the spindle information.  So if someone was thinking of building a CNC 
cape for a Pi a device like this would be a good idea.  There are also devices 
from the same manufacturer that can change quadrature into up/down pulses 
streams to use regular counters inside the Pi.

John


> -Original Message-
> From: R C [mailto:cjv...@gmail.com]
> Sent: May-24-20 6:01 PM
> To: linuxcnc-users-list
> Subject: Re: [Emc-users] Encoder HAL programming.
> 
> 
> On 5/24/20 6:29 PM, andy pugh wrote:
> > On Mon, 25 May 2020 at 00:17, R C  wrote:
> >
> >> 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.
> > Is this something different to the normal LinuxCNC software encoder
> > that reads GPIO?
> > Is there some dedicated encoder counter hardware on the Pi?
> >
> 
> Oh I am not running linux cnc on an rpi, I run it on a server "class"
> machine.�� I was just curious about how these encoders work, and why
> they didn't
> 
> work that well with my linux-cnc setup using a db25 BOB with the 2
> benchtops I have.
> 
> 
> So I decided to use an RPI (because it is easy to use GPIO pins to read
> signals) and write some code to read these� encoder signals.
> 
> 
> 
> So I guess my answer is yes,� it is different from, what linux-cnc
> running on a pi does (I would be surprised if it was similar)
> 
> 
> I setup an RPI, hooked up a 2 line LCD display to it to display rpms,
> wrote some interrupt driven code that reads the encoder and displays it
> on the LCD. The idea is, I want
> 
> to try and see if I can read the encoder and then send signals back to
> linux-cnc that it 'could handle".
> 
> 
> So I have a 60ppr encoder,� 60 has a lot of dividers.� 2, 3, 4, 5, 6,
> 10, and 12� So if I can "transfer" a pulse with a consistent delay
> exactly when the actual n-th pulse
> 
> comes in, I could turn a 60ppr� encoder into a 30, 20, 15, 12, 10, 6 or
> 5 ppr encoder by just skipping pulses,� while raising some GPIO pins,
> that I connect to the BOB, when
> 
> I read a different set of GPIO pins directly from the encoder.
> 
> 
> 
> But as I said earlier,� I don't know a lot about the linux-cnc's
> internals, and HAL, but it is something I am playing with to see if it
> could work.
> 
> 
> Ron
> 
> 
> 
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users



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