On Thu, 1 Jan 2015, John Alexander Stewart wrote:

> Date: Thu, 1 Jan 2015 11:16:02 -0500
> From: John Alexander Stewart <ivatt...@gmail.com>
> Reply-To: "Enhanced Machine Controller (EMC)"
>     <emc-users@lists.sourceforge.net>
> To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net>
> Subject: Re: [Emc-users] Possibly dumb question - 7i76 encoder for spindle
>     speed feedback
> 
> Ok - I had an issue with the encoder scale - setting it to a fraction seems
> to have helped.
>
> It seems like I'm having lots of noise, though. Halscope on
> hm2_5i25.encoder.00.input-a gives me a nice smooth signal, but reading a
> spindle setting under about 500rpm gives me a reading of approx 500rpm or
> more.
>
> Pushing it through a limit2 seems to have smoothed the faster velocities.
>
> Above, say, 800 rpm, the system tracks quite well; up to the max of
> 2250rpm. I can easily tell if the machine is in low or high gear, but only
> when running at a requested speed of above 800 rpm.
>
> I'm going to put the 6n138 on a small bit of pc board to reduce the long
> leads, and see if that reduces the noise somewhat.
>
> I am confused, though, that Halscope gives me a perfect signal, but the
> encoder output is haywire. I guess I'm used to old-school scopes, either
> digital or analog screens and with real probes and stuff.

It may be that you are double triggering because of noise
either in the high or low states or on edges

Halscope is limited in its ability to see this because
of its low (servo thread rate in this case) sampling rate


One option for fixing noise problems is lowering the bandwidth of the encoder 
input filter.

The default encoder sampling rate on a 5I25 is 33.33 MHz so with filtering 
enabled (15 count filter) the minimum detectable pulse width is 450 nS,
probably too fast for fuzzy/slow hardware like Optocouplers

Im pretty sure that 2.6 has the encoder sample frequency setting available, so
setting

setp hm2_5i25.0.encoder.sample-frequency 500000

(set encoder sample frequency to 500 KHz)

for example, would now make the encoder input filter reject any
pulses of less than 30 usec in duration


>
> On Tue, Dec 30, 2014 at 10:38 PM, Peter C. Wallace <p...@mesanet.com> wrote:
>
>> On Tue, 30 Dec 2014, John Alexander Stewart wrote:
>>
>>> Date: Tue, 30 Dec 2014 21:45:14 -0500
>>> From: John Alexander Stewart <ivatt...@gmail.com>
>>> Reply-To: "Enhanced Machine Controller (EMC)"
>>>     <emc-users@lists.sourceforge.net>
>>> To: "Enhanced Machine Controller (EMC)" <emc-users@lists.sourceforge.net
>>>
>>> Subject: [Emc-users] Possibly dumb question - 7i76 encoder for spindle
>> speed
>>>     feedback
>>>
>>> Hi all;
>>>
>>> I'm back working on my mill with spindle tachometer, to utilize Andy
>> Pugh's
>>> automatic spindle speed selector example code.
>>>
>>> I have, from the spindle sensor, input going to a 6N138 optoisolator's
>>> input. Ground and voltage source tied to machine. It sources enough
>> current
>>> to drive the input quite well. (originally sent to the input of an Amtel
>>> processor in the LED spindle speed display)
>>>
>>> Output of 6N138, with +5v, ground, to the 7i76 ENCA+ and surrounding
>>> connectors on the 7i76.
>>>
>>> Looking with Halscope gives me a pretty good signal on
>>> hm2_5i25.0.encoder.00.input-a. Running at 1,000 rpm gives me 14 "square"
>>> teeth, running at 500 rpm gives me 7, and running at 300rpm gives me 4.
>>> (not that the counts mean much, except that the reading tracks spindle
>>> speed linearly)
>>>
>>> The 7i76 jumper is set for TTL input. ONLY the ENCA+ input pin has
>> anything
>>> connected, the IDX, ENCB+/- and ENCA- are all left floating.
>>>
>>> The issue I have is that the velocity never seems to do much other than
>>> just futz around between 6 and 40, no matter what the spindle speed.
>>>
>>> Here's my ini code:
>>>
>>>    setp hm2_5i25.0.encoder.00.counter-mode  1
>>>    setp hm2_5i25.0.encoder.00.filter 1
>>>    setp hm2_5i25.0.encoder.00.index-invert 0
>>>    setp hm2_5i25.0.encoder.00.index-mask 0
>>>    setp hm2_5i25.0.encoder.00.index-mask-invert 0
>>>    setp hm2_5i25.0.encoder.00.latch-enable 0
>>>    setp hm2_5i25.0.encoder.00.scale -16
>>>    setp hm2_5i25.0.encoder.00.vel-timeout 1.0
>>>
>>> Should I tie the other encoder lines high/low or to somewhere?
>> (especially
>>> the index pulse)
>>>
>>> Anybody with some advice?
>>>
>>> Thank you - John A. Stewart.
>>
>> If the inputs are jumpered for TTL levels you must leave the -inputs
>> unconnected. The + inputs have 2K pullups to 5V so will be in a high state
>> if
>> left open. I forget the 7I76 encoder polarity but you may need to ground
>> the
>> ENCB+ input to get the count direction correct (ENCB is the direction
>> input in
>> count = COUNT/DIR mode )
>>
>>
>>
>>
>>>
>> ------------------------------------------------------------------------------
>>> Dive into the World of Parallel Programming! The Go Parallel Website,
>>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>>> hub for all things parallel software development, from weekly thought
>>> leadership blogs to news, videos, case studies, tutorials and more. Take
>> a
>>> look and join the conversation now. http://goparallel.sourceforge.net
>>> _______________________________________________
>>> 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.
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming! The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net
>> _______________________________________________
>> Emc-users mailing list
>> Emc-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/emc-users
>>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming! The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net
> _______________________________________________
> 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.


------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to