Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread Chris Albertson
On Sun, Oct 28, 2018 at 10:59 AM Peter C. Wallace  wrote:

> On Sun, 28 Oct 2018, Chris Albertson wrote:
>
> > Date: Sun, 28 Oct 2018 10:41:14 -0700
> > From: Chris Albertson 
> > Reply-To: "Enhanced Machine Controller (EMC)"
> > 
> > To: "Enhanced Machine Controller (EMC)"  >
> > Subject: Re: [Emc-users] 5I25-7i76 encoder output
> >
> > On Sun, Oct 28, 2018 at 5:15 AM andy pugh  wrote:
> >
>
> The Mesa Encoder uses both methods combined = delta_counts/delta_time, so
> for
> example if you have 7 counts between servo thread times, the velocity will
> be
> calculated as 7/(time from first to last edge of those 7 counts)
> This is optimum for most uses.
>

Yes, that woud work well.  So many times they effecivly divide by the
sample period and don't actualy measure the actual times of the edges.
This gives them a the kind of  jitter in RPM that was reprted.So how
does it work?   There must be a micro or nano second counter on the FPGA
that gets sampled.



-- 

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread andy pugh
On Sun, 28 Oct 2018 at 17:43, Chris Albertson  wrote:

> Then perhpas this is the wrong method.

An important point here, that I thought I had addressed, is that it
doesn't really matter.

-- 
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, 1916


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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread Peter C. Wallace

On Sun, 28 Oct 2018, Chris Albertson wrote:


Date: Sun, 28 Oct 2018 10:41:14 -0700
From: Chris Albertson 
Reply-To: "Enhanced Machine Controller (EMC)"

To: "Enhanced Machine Controller (EMC)" 
Subject: Re: [Emc-users] 5I25-7i76 encoder output

On Sun, Oct 28, 2018 at 5:15 AM andy pugh  wrote:


On Sun, 28 Oct 2018 at 07:17, Chris Albertson 
wrote:


Or switch to the other method.   Rather then count "ticks" you count the
microseconds between the ticks.


The Mesa encoder counter already does this.



Then perhpas this is the wrong method.  There are two ways to go and which
to pick depends on the encoder and how fast it spins.   If you are counting
microseconds then just maybe that's the wrong way to go for a high
reasolution sensor that is spinning fast.   For a high resoultion sens toy
can coubtstincks per sample period.You'd like to have at least 100
ticks per period.

Perhaps there are not enough microseconds betwen pulses.   You'd like to
have at least 100 timer counts
--



The Mesa Encoder uses both methods combined = delta_counts/delta_time, so for 
example if you have 7 counts between servo thread times, the velocity will be 
calculated as 7/(time from first to last edge of those 7 counts)

This is optimum for most uses.

Some fancier systems automatically compensate for quadrature phase errors and 
duty cycle variations.






Chris Albertson
Redondo Beach, California

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



Peter Wallace
Mesa Electronics

(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.



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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread Chris Albertson
On Sun, Oct 28, 2018 at 5:15 AM andy pugh  wrote:

> On Sun, 28 Oct 2018 at 07:17, Chris Albertson 
> wrote:
>
> > Or switch to the other method.   Rather then count "ticks" you count the
> > microseconds between the ticks.
>
> The Mesa encoder counter already does this.
>

Then perhpas this is the wrong method.  There are two ways to go and which
to pick depends on the encoder and how fast it spins.   If you are counting
microseconds then just maybe that's the wrong way to go for a high
reasolution sensor that is spinning fast.   For a high resoultion sens toy
can coubtstincks per sample period.You'd like to have at least 100
ticks per period.

Perhaps there are not enough microseconds betwen pulses.   You'd like to
have at least 100 timer counts
-- 

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread Peter C. Wallace

On Sat, 27 Oct 2018, Alan Condit wrote:


Date: Sat, 27 Oct 2018 18:46:59 -0700
From: Alan Condit 
Reply-To: "Enhanced Machine Controller (EMC)"

To: "Emc-users@lists.sourceforge.net" 
Subject: [Emc-users] 5I25-7i76 encoder output

I have a homemade encoder on my lathe spindle. I am feeding the encoder 
outputs into the encoder spindle inputs on the 7I76. The reported rpm seems 
to be fluctuating wildly. I want to look at the signals to see if the width 
of the signals is about the same for the index on time and for channel A and 
B on and off times. Is it possible to look at the encoder signals with hal 
scope? Or do I need to drag my oscilloscope out to the shop. I don??t see 
the pins in the hal file.

Am I even thinking about this correctly?


Duty cycle (deviation from 50 %) and quadrature errors (deviations from 90 
degree phase difference between A and B) on low resolution encoders will add 
considerable noise to encoder velocity estimation.


This is because with a low resolution encoder you will typically have 0 to 1 
counts occuring per servo thread. Velocity estimation is done by dividing the
counts per servo thread by the time between the counts, so any duty cycle 
or quadrature error will cause a large error in the measured time between 
pulses if you only have 1 count.


This is not a serious problem on high resolution encoders since they will 
typically have many counts per servo thread period (and any individual 
quadrature cycle timing errors get divided by the number of counts)




Because of this, its usually neccesary to low pass filter the velocity signals 
from low resolution encoders



You can monitor the A,B signals with halscope but only at fairly low speeds
due to the low sample rate of the inputs


The signals to look at are:


hm2_.0.encoder.NN.input-a
hm2_.0.encoder.NN.input-b
hm2_.0.encoder.NN.input-index

Where  is teh FOGA card name and NN is the encoder number

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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread andy pugh
On Sun, 28 Oct 2018 at 07:17, Chris Albertson  wrote:

> Or switch to the other method.   Rather then count "ticks" you count the
> microseconds between the ticks.

The Mesa encoder counter already does this.

It may be that the home-made encoder does actually have some angular
noise, so the measured speed does change.
Typically this doesn't matter for spindle-synch moves, which track the
measured position, not the velocity.
So just lowpass the spindle speed before displaying it, and forget about it.

-- 
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, 1916


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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread Chris Albertson
> ,
> that I was able to run the P-Gain from 3 on up to the 20-40 area.
> Spindle speed control is so accurate that until the chirp of the current
> limit of the pwm-servo I'm driving that motor to around the 2 hp mark
> with, I have no clue that its working that hard. So I would highly
> recommend a higher resolution encoder.
>

Or switch to the other method.   Rather then count "ticks" you count the
microseconds between the ticks.  What you do is sample a counter with the
"tick"  Doing it this way you can measure the RPM of a one line enconder on
slow shaft.

>
> --

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-28 Thread Chris Albertson
I've seen this too.  non-constant RPM when you know the rotating mass has
enough inertia that the RPM can change so fast.

What I found is that the resolution of measuring the encoder is low and
what I see is quantization noise.This means I'm not sampling with
enough bits.  You are sampling to fast and getting killed by the statistics
of small numbers.

There are two ways to read and encoder:
1) each "tick" samples a fast running clock and you measure the period and
2) each tick increments a counter and periodically sample the count.

If you use the wrong method you get the variable RPM problem   You want to
get at least 100 counts per sample using whatever method.


On Sat, Oct 27, 2018 at 6:47 PM Alan Condit  wrote:

> I have a homemade encoder on my lathe spindle. I am feeding the encoder
> outputs into the encoder spindle inputs on the 7I76. The reported rpm seems
> to be fluctuating wildly. I want to look at the signals to see if the width
> of the signals is about the same for the index on time and for channel A
> and B on and off times. Is it possible to look at the encoder signals with
> hal scope? Or do I need to drag my oscilloscope out to the shop. I don’t
> see the pins in the hal file.
>
> Am I even thinking about this correctly?
>
> Alan
>
> ___
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users
>


-- 

Chris Albertson
Redondo Beach, California

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


Re: [Emc-users] 5I25-7i76 encoder output

2018-10-27 Thread Gene Heskett
On Saturday 27 October 2018 21:46:59 Alan Condit wrote:

> I have a homemade encoder on my lathe spindle. I am feeding the
> encoder outputs into the encoder spindle inputs on the 7I76. The
> reported rpm seems to be fluctuating wildly. I want to look at the
> signals to see if the width of the signals is about the same for the
> index on time and for channel A and B on and off times. Is it possible
> to look at the encoder signals with hal scope? Or do I need to drag my
> oscilloscope out to the shop. I don’t see the pins in the hal file.
>
> Am I even thinking about this correctly?
>
> Alan
>
You will have to drag it out Alan, the halscope is simply not fast 
enough. And look at the bobs output.

And home-made I've done, but you have to resort to hal tricks , or at 
least I have if the encoders resolution is greater than 2 degrees a 
passing edge. I was plumb amazed that with a 1000 line encoder on the 
tail end of the motor shaft, with scales in the 7000 to 14000 range, 
that I was able to run the P-Gain from 3 on up to the 20-40 area. 
Spindle speed control is so accurate that until the chirp of the current 
limit of the pwm-servo I'm driving that motor to around the 2 hp mark 
with, I have no clue that its working that hard. So I would highly 
recommend a higher resolution encoder.

The encoder I bought on ebay for about a $20 bill turned out to have 
differential outputs that I had to use a couple rs485 boards $1 each 
these daysto make it a single ended signal, which meant I had to bypass 
the opto's on the bob to get a clean signal into a 5i25 card. Otherwise 
it was way too fast to get a usable signal into the 5i25.

-- 
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)
Genes Web page 


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


[Emc-users] 5I25-7i76 encoder output

2018-10-27 Thread Alan Condit
I have a homemade encoder on my lathe spindle. I am feeding the encoder outputs 
into the encoder spindle inputs on the 7I76. The reported rpm seems to be 
fluctuating wildly. I want to look at the signals to see if the width of the 
signals is about the same for the index on time and for channel A and B on and 
off times. Is it possible to look at the encoder signals with hal scope? Or do 
I need to drag my oscilloscope out to the shop. I don’t see the pins in the hal 
file.

Am I even thinking about this correctly?

Alan

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