The stepper skipping steps and the encoders not working at high speed is
the same issue.   The bottleneck is the parallel port.   The software only
"looks" at the port at a finite rate.  If stuff happens faster than that it
is not noticed and falls into the "bucket of missing bits"

On Wed, May 6, 2020 at 5:04 AM Dan Henderson <luvtof...@gmail.com> wrote:

> A lot of great input here. I’m not sure I fully understand all of the
> talking points around kHz and PPR and RPM vs optocoupler speed and parallel
> port timing.
>
> I also have 3 stepper motors in xyz that are being controlled via the same
> BOB parallel port combo. They appear to be working okay with the exception
> of maxing out at 1” ips jog speed before they lose steps. That seems slow
> to me. They are nema 23 425 oz-in with DMQ542 drivers rated up to 80v. I’m
> only supplying them 36v.
>
> But back to the original concern with the spindle motor rpm fluctuation
> with encoder feedback. Without the encoder configured in the HAL the
> spindle speed is more consistent but not 100% steady. I can drop the PPR on
> the encoder from 200 down to 48. I’m not sure if this would significantly
> improve the situation at the expense of lower resolution.
>
> I believe Gene gave me some items to look at in Halscope. I’m going to
> attempt to pull this up now and see if I can draw any conclusions as to
> where the fluctuation is occurring.
>
> Thanks for all the input!
>
> On Wed, May 6, 2020 at 3:44 AM John Dammeyer <jo...@autoartisans.com>
> wrote:
>
> > 1000 PPR encoder turning 300 RPS (18000 RPM) will produce 300,000 Hz
> > output.  At 10000 RPM it's 167 RPS or 167Khz.
> >
> > I've been reading through the LinuxCNC source code for the last hour or
> > two.  If one was just using a parallel port and not sophisticated
> external
> > hardware the hal_parport.c code looks like it reads the input at the
> > base_period rate; say 25kHz => 40 uS.
> >
> > If you figure a standard mill running max 3000 RPM (50 RPS) then a you
> > probably need to look at the spindle encoder at least twice per encoder
> > period.  At 25kHz we're seeing a ParPort task run time of 40 uS.  So I'd
> > guess the max pulse size from the spindle encoder has to be at least 80
> > uS.
> >
> > The spindle at 50 RPS uses up 20mS.  Divide that by the 80uS implies the
> > largest usable encoder is 250 lines.
> >
> > Have I got that right?  I've not found the spindle support code yet.
> Only
> > the HAL install code.
> >
> > John
> >
> >
> > > -----Original Message-----
> > > From: andrew beck [mailto:andrewbeck0...@gmail.com]
> > > Sent: May-06-20 12:31 AM
> > > To: Enhanced Machine Controller (EMC)
> > > Subject: Re: [Emc-users] Fluctuating RPM using CUI ATM 10 encoder
> > >
> > > John while we are on this subject got a quick question.  Just want to
> > check
> > > my maths.
> > >
> > > My encoder card on vfd max count rate is 300Khz.  Max rpm is 10000rpm
> > >
> > > So a 1000 ppr encoder should give me 18000 rpm at 300khz.  I just need
> > > 10000 rpm so that should be well within spec
> > >
> > > Regards
> > >
> > > Andrew
> > >
> > > On Wed, May 6, 2020, 6:45 PM John Dammeyer <jo...@autoartisans.com>
> > wrote:
> > >
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Nicklas Karlsson [mailto:nicklas.karlsso...@gmail.com]
> > > > > Sent: May-05-20 9:13 PM
> > > > > To: Enhanced Machine Controller (EMC)
> > > > > Subject: Re: [Emc-users] Fluctuating RPM using CUI ATM 10 encoder
> > > > >
> > > > > > Do you have a dual trace 'scope?  Spin the spindle and look at
> the
> > > > input
> > > > > > and output of the opto-isolator.  See if there really is a lag.
> >  If
> > > > you
> > > > > > have a new scope would you have it capture the screen and post
> it.
> > > >  I'm
> > > > > > really skeptical that those isolators are THAT bad.
> > > > > >
> > > > > > Here is the datasheet for the opto.
> > > > > > https://www.mouser.com/datasheet/2/143/EL817-G-26528.pdf
> > > > > > They claim an 18 uS rise and fall time.    A 1KHz square wave
> will
> > > > have a
> > > > > > 1000 uS period and a 500 uS pulse width at 2 KHz the pulse width
> is
> > > > still
> > > > > > more than 10X the raise time of the opto.    But maybe the opto
> is
> > a
> > > > fake
> > > > > > counterfeit part with very poor performance.
> > > > >
> > > > > Opto couplers are rather slow. With a high resolution encoder
> > frequency
> > > > could be maybe up to a few hundred kHz,
> > > > > 2000*period/revolution*3600rpm=120000period/second=120kHz, 200PPR
> > will
> > > > be 12kHz at 3600rpm, 1/(2*18�s) = about 27778Hz =
> > > > > about a little bit below 28kHz if mad no misstake.
> > > > >
> > > >
> > > > I think your math is out.  Most of the hi res encoders are running
> 2500
> > > > lines per rev.  Many are less.    But we're only looking at one
> encoder
> > > > channel and that works out to twice the number of edges but the
> actual
> > > > frequency is still lines per rev per second.
> > > >
> > > > So how many revs per second is that?    You have to divide RPM by 60
> to
> > > > get revs per second so 3600 RPM is 60 RPS.
> > > >
> > > > Now you have 60 * 2500 Hz = 150kHz.  Still way too high for that
> > > > opto-isolator.
> > > >
> > > > Now if you do like Sam did for his hex milling you update the
> encoder.
> > > > But initially he was milling with about 60 teeth and Linux is more
> than
> > > > fine for that when power tapping etc.  So 60 * 60 is 3600 Hz and the
> > opto
> > > > would be fine for that.    Even 200 lines at 60 rps  (3600 RPM) is
> > 12,000
> > > > hz.
> > > >
> > > > Don't understand how you got 27778Hz
> > > >
> > > > John
> > > >
> > > > >
> > > > > _______________________________________________
> > > > > 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
> >
> >
> >
> > _______________________________________________
> > 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
>


-- 

Chris Albertson
Redondo Beach, California

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

Reply via email to