I still believe the real problem is a very very high impedance circuit that easily can capture electrostatic interference that occasionally is high enough to cross the threshold of a logic 1 simulating an extra index pulse.
My favourite reference book for learning about this is: Electromagnetic Compatibility Engineering but Henry W. Ott publishd by Wiley. (c) 2009 ISBN 978-0-470-18930-6 https://www.google.com/search?client=firefox-b-d&q=ISBN+978-0-470-18930-6 Spend 6 months treating this as a EE course and you will learn what you need from systems down to PC board design. One could use a resistor divider circuit with the existing hardware once you know what the voltage level of the PushPull High is. If it's say 11V from the encoder powered at 12V for example then 11V/0.01mA is 1100 Ohms. The CMOS threshold on the level translator was 4.5V I believe so 1100 Ohms - 450 Ohms = 650 Ohms. One might even try 620 Ohm and 470 Ohm as those are both standard 5% resistor values. Therefore replace the 1K resistor with the encoder index output connected to a 620 ohm and 470 Ohm in series to ground. Tap off that junction so the CMOS level translator sees the value across the 450 Ohm and ground which should change between 4.5V and likely 0V or very close to that. Now you have a low resistance circuit (although high frequency impedance might still be large) depending on capacitance and inductance of the cable. I still prefer the HCPL2631 approach but this is an experiment to try. The point is to make the electrostatically coupled electrical noise floating around find the easiest path to ground resulting in the lowest impressed voltage on the wire. John Dammeyer > -----Original Message----- > From: Chris Albertson [mailto:albertson.ch...@gmail.com] > Sent: October-11-21 11:07 AM > To: phodg...@uk22.net; Enhanced Machine Controller (EMC) > Subject: Re: [Emc-users] Fwd: Rogue Index Pulses > > One HUGE problem I see is that the halscope does not show the actual > encoder pulses. The encoder has THREE outputs and each is a 50% duty > cycle square wave and the A and B waves are 90 degrees out of phase. > Halscope is not showing the encoder output. I suspect it is showing > highly processed version of the encoder data and I suspect the processing > is wrong. Can you make it show the actual input signals? > > Old analog scopes are dirt cheap. Even good ones made by HP or Tektronix > are on eBay for around $100 > > The way to debug this is to take it apart and verify the parts all work > then connect some of them together and verify the assembly works and > continue until the entire system is assembled. This is how > professional engineers work. In my experience building the full up system > then applying power rarely works except in very simple systems. Test each > part independently and then again after assembly each assembly step > > So for example, I'd place the encoder with a DC motor (or chuck it in a > drill) and look at its output. Then attach the level converter and look > again. Then put the encoder on the real spindle and look again. Make one > change at a time and test. Having a real scope means you don't need to > have a computer to test. > > At this point we don't know where the error is. The encoder itself could > be the problem. But I doubt that. May gues in now a software/config > issue. I would keep that gues until I was able to see the raw encoder > data. > > > > On Mon, Oct 11, 2021 at 2:19 AM Peter Hodgson <peterjohnhodg...@gmail.com> > wrote: > > > Hi Chris, > > > > I've added the encoder part number to the schmeatic and also added > > datasheets and 'Halscope' screen shot to the webpage: > > > > > > https://www.purbrookengineering.com/index.php?option=com_content&view=article&id=11 > > > > I don't have an oscilliscope so am relying on Halscope at the moment. > > > > Thanks, > > > > Pete > > > > > > On 11/10/2021 02:58, Chris Albertson wrote: > > > sorry there was no part number on the encoder. I figured it was the > > generic > > > Omron clone that is 5 to 12 volts. But there are two kinds that other > > is > > > 12 to 24. volts. See in the link below > > > https://www.ia.omron.com/products/family/486/specification.html > > > > > > Is the encoder "open collector" or voltage output. If open colector > > pull > > > the outputs up to 5 volts. > > > > > > Placing an encoder part number of the schematic would help. > > > > > > Can you post a picture of "ghost pulses", if using an analog scope just > > use > > > you phone camera, most digitalscopes can save the scree to USB drive. > > > Noise like this is best eliminated at the source > > > > > > > > > On Sun, Oct 10, 2021 at 1:04 PM Peter Hodgson < > > peterjohnhodg...@gmail.com> > > > wrote: > > > > > >> Hi Chris, > > >> > > >> The encoder datasheet gives a voltage range of 10-30vdc so I don�t think > > >> direct connection with 5vdc would be an option. > > >> > > >> Would a direct connection via voltage dividers eliminate the �ghost > > >> pulses� being picked up by the Pico board? > > >> > > >> The encoder won�t be running above 3,000 rpm. > > >> > > >> Pete > > >> > > >>> On 10 Oct 2021, at 19:00, Chris Albertson <albertson.ch...@gmail.com> > > >> wrote: > > >>> ?Is your math right? Yes, I get 83 KHz for a 500 line encoder at > > 10,000 > > >>> RPM. Yes that is < 1% of the isolator's rated speed (of 10 MHz) > > >>> > > >>> But the schematic had an RC low pass filter in the encoder output that > > >>> would have prevented the system from working above about 1000 RPM. I > > see > > >>> this is gone now. > > >>> > > >>> But why are these isolators even needed? Why not simply operate the > > >>> encoder at 5 volts? > > >>> > > >>> Or if you must run the encoder at 12 volts, you can do level > > translation > > >>> with a resistor voltage divider. > > >>> > > >>> There is nothing yo isolate. The entire system runs on a common ground > > >> and > > >>> there is no high power devices in the schematic and I assume the entire > > >>> system is in one building with no long (100 meter) cables > > >>> > > >>> If you are worried about accidents blowing up the controller, use > > diodes > > >> to > > >>> shunt any transients. But really there are no inductive loads > > >>> > > >>> > > >>> > > >>> > > >>> > > >>> On Sun, Oct 10, 2021 at 10:25 AM John Dammeyer <jo...@autoartisans.com > > > > > >>> wrote: > > >>> > > >>>>> From: Gene Heskett [mailto:ghesk...@shentel.net] > > >>>> > > >>>> > > >>>>> If the opto's are fast enough, you should be > > >>>>> fixed. A 500 ppr encoder s/b fine. A 1024 or 1000 requires a faster > > >>>>> opto. > > >>>>> > > >>>> HI Gene, > > >>>> Comparing the cheap far east BoB optos with the HCPL2621 is apples and > > >>>> oranges. > > >>>> > > >>>> A 2500 line encoder still only creates 2500 pulses. The quadrature > > just > > >>>> looks at two lines and 2 edges for 10,000 edges. But the max speed of > > >> his > > >>>> encoder is 10,000 RPM which in RPS is 166.7 and would result in 417kHz > > >>>> which is 4% of the opto max 10 Mbps capabilities if the encoder was > > >> 2500 > > >>>> line. > > >>>> > > >>>> But his is 500 line so at 166.7 RPS is 83kHz which is 0.8% of opto > > >>>> capabilities. > > >>>> > > >>>> > > >>>> John > > >>>> > > >>>> > > >>>> > > >>>> > > >>>> _______________________________________________ > > >>>> 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 > > >> > > >> _______________________________________________ > > >> 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 _______________________________________________ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users