Page 1 of 1

Noise hunting

Posted: Sun May 29, 2022 6:31 am
by MadTooler
My gantry router has intermittent, random, seemingly impossible to repeat, but at this point totally expected noise issues feeding into the encoders. While I had identified several red flags in the wiring and setup, and mostly rectified them years ago with pretty darn good results, the remaining items have apparently grown more effective at wrecking my chances at stable operation.

It is not my intent to start this thread in the direction of what is wrong with my specific machine, besides my interference, but to cover some tools and methods of hunting down the culprits so they can properly be snuffed out. There are those trial and elimination methods that work where your noise is repeatable, as was my major grounding issues with prior finds, but when the apparent noise happens unpredictably, what tools will help?

The symptoms I have need some method to monitor for noise and/or record several areas of concern for anywhere from within 30 seconds to several hours before a major encoder jump of 200 ticks+ throws the position off. If it was repeatable, I could connect my oscilloscope and sample a lot of areas of the machine in short order. Since that is not the case, I am wondering what other tools could be applied for both the quick observations and potential multi-hour monitoring of many areas (and voltage since it could also be from facility line voltage) to at least narrow down real problems.

Any secret weapons to suggest?

Re: Noise hunting

Posted: Sun May 29, 2022 5:15 pm
by TomKerekes
What kind of encoders and system do you have? Differential encoders connected to Kanalog?

Shielded cable? Connected to Kanalog GND at the Kanalog end only?

It would be unusual to have a sudden jump of more than 200 counts. Unless there is a cable problem. If the encoder wiring runs through a rolling loop and moves/flexes sometimes a cable can have a momentary broken connection where the encoder suddenly stops counting which results in a loss of position. For this you might write a C Program to monitor velocity and if it suddenly drops to zero at a rate that would be physically impossible trigger an error.

Sometimes with a broken/disconnected A/B signal the encoder can surprisingly still appear to work but only marginally. It usually only works because of parasitic capacitance between the signals. Its a good idea to use a scope or voltmeter to determine that the complementary + and - signals are in fact complementary (when one is high the other is low) and at proper voltage levels (either < 0.4V or > 2.4V).

Noise spikes on the encoder A/B signals often don't cause a problem as they result in a count in one direction followed by a count in the opposite direction which doesn't result in any loss of position. However if a noise spike occurs at the same time as the other signal is transitioning then the direction may not be properly determined resulting in a loss of position of one or several counts.

KFLOP has a digital filter on the A/B encoder inputs to remove spikes. The inputs are sampled at 16.67MHz and if any signal transition is not maintained for N samples it is ignored. Where N can be from 1 to 255. Setting the filter to too high of a value will reduce the maximum count rate. By default the value is 7 which causes transitions less than:

7 / 16.67MHz = 0.42us

to be ignored. At KFLOP's maximum quadrature count rate of 1 million counts/second each signal transition lasts for 2us. The value can be changed with a C instruction:

FPGAW(ENC_NOISE_FILTER_ADD) = XXXX;


KFLOP accumulates encoder counts of up to +/- 127 counts every 90us. To exceed a change of 127 counts in 90us the rate would need to be:

127/90us = 1.41 million counts/sec.

If this rate is exceeded a gain/loss of 256 counts would occur.

Re: Noise hunting

Posted: Sun May 29, 2022 6:05 pm
by MadTooler
Tom, thank you for all the notes. As always, I very much appreciate your high level of support.

Since I have numerous contenders for source of noise with the older portion of my system wiring and components (built around 1994) and the subpar electric service at my location, my intent here was to look into diagnostic tools and techniques for finding rogue problems that could be in one of many places. Your tip on the possible broken A/B signal and the testing of may be spot on with what is wrong with my system, except my most offending Y axis does not have any moving wires. I planned on a separate thread to go into my mess specifically, to keep this one more potentially useful to others, but I could spill my specifics here if you prefer. Let me know what you prefer, and I will tell all.

Thanks again.

Re: Noise hunting

Posted: Wed Jun 01, 2022 6:34 pm
by MadTooler
I tried using my tone/wire tracer to detect noise. It works pretty good as a rough indicator. It is part of an old "fox and hound" set by Triplett.
They still make a newer version. I did not use the tone generator "fox", only the "hound" receiver as shown, since the tone is the noise in then lines. It does give me some answers and some items to further test with my scope. Lots of ringing through my encoder lines when the brushed servos are enabled.
IMG_20220529_191002070.jpg
IMG_20220529_190954732.jpg
I think some more refined tools may be some "sniffer" near field probes for oscilloscope or spectrum analyzer. I do not have an analyzer. I need to look further to see which probes are best suited and if I can make use of them with my sampling type Rigol DS1054Z scope.

I started a thread on CNCzone a long time ago as I was doing my initial retrofit and tunings over the years. Some of my earlier noise issues are mentioned there. For my machine issues, do you prefer I state them in this thread, in a new thread in Dynomotion forum, or continue the older thread on CNCzone?

Re: Noise hunting

Posted: Wed Jun 01, 2022 7:40 pm
by TomKerekes
Lots of ringing through my encoder lines when the brushed servos are enabled.
I wouldn't expect motor noise to show up as ringing. I'd expect narrow spikes. Kanalog's inputs are only terminated with 470 ohm resistors. The termination should really be around 120 Ohms for least reflections/ringing. You might try adding parallel termination (from + to -). We didn't put low termination because of concerns some encoders may not have sufficient drive and Users may want to daisy chain inputs.

We'd prefer using our forum. Its up to you whether to start other threads. I think the goal should be if a User has some specific issue they can find related info easily.

Re: Noise hunting

Posted: Wed Jun 01, 2022 9:31 pm
by MadTooler
Alright, I will keep it all here in this thread. I prefer using your forum as well.

For reference, this is the cnczone thread I started prior with my initial system spec's noted : https://www.cnczone.com/forums/dynomoti ... ables.html

I have made a few changes to the system since that thread, but not much on the areas of biggest offense.
TomKerekes wrote:
Wed Jun 01, 2022 7:40 pm
I wouldn't expect motor noise to show up as ringing. I'd expect narrow spikes. Kanalog's inputs are only terminated with 470 ohm resistors. The termination should really be around 120 Ohms for least reflections/ringing. You might try adding parallel termination (from + to -). We didn't put low termination because of concerns some encoders may not have sufficient drive and Users may want to daisy chain inputs.
I am currently using the differential encoder inputs through the SnapAmp. I have a scale connected to Kanalog. The ringing I noted is what I can hear with my hound wire tracer when the motor is enabled for the entire length of the encoder lines, but not with the scale line. Looking at it through the scope years ago showed a lot of noise, but under 0.5v on the encoder lines at that time. I will try to measure it again today and see if it has gotten worse. It sounds like Kanalog may be a better choice for encoder inputs?

BTW, my motors have a single connector at the encoder for both motor and encoder. The motor wires pass through next to the encoder wires to get to the motor. That, and trying to earth ground the motor housing, seems to be a bit of my noise issue. Not sure how much I can do about that.

There are four contactors in my system. I noticed three make a much more audible humming than I remembered. The field from them is much more significant than simply the line voltage noise (my hound picks up noise about 12" away when they are on). They are not chattering, but it seems like they are a problem and are sending extra noise to my solid state relay board. The three noisier contactors are in a separate panel that does a good job of shielding except for the lines coming out of it. Separate note, the whole damn machine screams with noise on both the scope and my wire tracing hound when my 8' florescent lights are on, even when is is unplugged. Big ole whiny antenna!

More issues than these for sure. This is now the start of a rewire, new line filters, possible UPS I keep thinking I should have, new cable carriers that are not jam packed, and a few other time consuming tasks that are unavoidable if I want to sleep before running 13hour long gcode on unobtanium material during this blissful never ending supply chain hell. That's why I was looking for some hints on hunting throughout my system for noise since I believe I need to do a major overhaul and do not want to miss anything.

Re: Noise hunting

Posted: Thu Jun 02, 2022 4:40 pm
by TomKerekes
Yes Kanalog may be the better choice for the encoder inputs away from the motor noise. Otherwise SnapAmp doesn't have any termination at all so you might add 120 ohm termination.

Re: Noise hunting

Posted: Thu Jun 02, 2022 10:19 pm
by MadTooler
My original build uses Snapamp encoder inputs to keep the Kanalog free in case I wanted to add scales or any other wacky features. I don't think that is going to be a reality for this machine so moving them to Kanalog sounds like the thing to do.

For my better understanding...

120 ohm termination meaning resistor from A and A- and another between B and B- at Snapamp but no additional termination needed if I use Kanalog?

Considering that using Snapamp inputs allows the wiring to exit the opposite end of the board as the motor power, and that encoder inputs at Kanalog are directly under the motor power...
If 120 ohm termination was added to the differential inputs to Snapamp, would it then be as suitable as Kanalog, or would Kanalog still be better isolated from motor noise?

Re: Noise hunting

Posted: Thu Jun 02, 2022 11:31 pm
by TomKerekes
120 ohm termination meaning resistor from A and A- and another between B and B- at Snapamp
correct
but no additional termination needed if I use Kanalog?
Well again Kanalog only has 470 Ohm termination which should be far better than none, but ideally I think the termination should be around 120 ohms so paralleling around 160 Ohms would do this.
Considering that using Snapamp inputs allows the wiring to exit the opposite end of the board as the motor power, and that encoder inputs at Kanalog are directly under the motor power...
If 120 ohm termination was added to the differential inputs to Snapamp, would it then be as suitable as Kanalog, or would Kanalog still be better isolated from motor noise?
Noise is complicated so hard to say. My bet would be that Kanalog would be better.