Welcome! Log In Create A New Profile


Solution to endstop cross talk?

Posted by TheSerialHobbyist 
Solution to endstop cross talk?
July 09, 2014 10:31PM
Hey guys! So I just finished building my DIY TAZ, and it's printing well. But homing isn't working that well. The when homing, it often stops short of the endstops (on all axes). I suspect cross talk to be the issue, as I didn't do anything special with the wiring (like braiding).

I'm using RAMPS 1.4, basic mechanical endstops, and have it wired for normally open. Is there a simple solution to this? Ideally I don't want to have to redo all of the wiring, because that would be a pretty big job (everything is cable wrapped already). Is there any other way to fix the problem, or should I just take the time to redo the wiring and twist or braid it?

If that is the only way to do it, what is the ideal way to do the wiring to avoid cross talk?
Re: Solution to endstop cross talk?
July 10, 2014 09:46AM
First of all you should probably check that there really *is* 'cross talk' - perhaps by attaching one of the cheap chinese logic analyzers to your system.

Depending on your setup a pull up / pull down resistor around 10k might be able to supress the noise in your wires while still allow the end stops to be detected.
Do you have the internal pull ups of your board turned on? If not, they should be - but they're very high resistance, so they might not be enough.
Re: Solution to endstop cross talk?
July 10, 2014 11:21AM
I'll double check to make sure the internal pullups are on (I'm pretty sure they are).

I think I've got a logic analyzer laying around somewhere, so I'll see if I can find it.

As far as adding a resistor, I would think it would need to be a pull down resistor since it's wired for normally open and getting false triggers?
Re: Solution to endstop cross talk?
July 10, 2014 05:52PM
I am not sure if this helps. However cat 5e cable is very good at removing cross talk for anything high frequency. I am using it for my mechanical end stops. So far my printer homes just fine. However that is all I am doing at this point in the build. Just homing it to make myself feel better for lack of progress.

My Personal Blog. Build blog.

Modicum V1 sold on e-bay user jaguarking11
Re: Solution to endstop cross talk?
July 10, 2014 08:25PM
I was actually thinking about using cat5 if I had to rewire them (which I think I'll go ahead and do). I sure wish I had thought about that when I did the wiring the first time! It's going to be a pain to redo it all...
Re: Solution to endstop cross talk?
July 11, 2014 01:00AM
I just went ahead and pulled apart the wiring and used a drill to quickly twist each pair of endstop wires (didn't bother with the stepper wires). It seems to be working fine now, even with the endstop wires running in the same bundle as the stepper wires (and all wires are unshielded). It seems twisting really is a useful technique!
Re: Solution to endstop cross talk?
July 11, 2014 02:16AM
Unshielded twisted pair
I read that you should use clockwise and counter-clockwise twisting between pairs, and different twist ratios between pairs within a common sheath.
Re: Solution to endstop cross talk?
July 11, 2014 07:31AM
Good opportunity to enhance the wiki a bit: [www.reprap.org]

Generation 7 Electronics Teacup Firmware RepRap DIY
Re: Solution to endstop cross talk?
July 11, 2014 08:46AM
Having your signal wires in a different sheath from the motor wires can help since the motors are a big source of spikes. In theory, twisting the motor wires could help also. If you do twist the motor wires together, it will work best if the pair used for each phase of the stepper motor windings is done together as a pair. That will improve the motor functionality for each phase. But unless you have very long wires or very large motor currents, that isn't much of a factor.

Also, keep in mind the motor wires are 'high current', so the air flow around them helps in cooling the wires, but if you use heavier gauge wire, that's not important. This only becomes a factor with high current motors and lighter weight wires combine with long print times, so most people can ignore it.

Edited 1 time(s). Last edit at 07/11/2014 09:17AM by Learner.
Re: Solution to endstop cross talk?
July 12, 2014 07:15PM
As A2 and Learner have sort of mentioned, if you're going to twist wires, you should:
1. Twist your motor wires (per coil) as well as your endstop wires.
2. Twist the endstop wires the opposite direction to your motor wires.

This should reduce interference between the motors and endstops. Also, by twisting the motor wires "per coil" you keep the motor twisted pairs 'balanced".

Unless someone can explain it simpler, I suggest we add this text to the wiki page.
Re: Solution to endstop cross talk?
July 13, 2014 08:15AM
I would add that using "normally closed" contacts, while not improving interference behavior, is safer. In case a wire get broken (could happen at soldering point, for example), the axis should simply stop. In case of using "normally open", the axis moving parts will just bump into the frame or other parts.
Re: Solution to endstop cross talk?
July 13, 2014 08:52AM
I suggest we add this text to the wiki page.

Who's "we"? It's YOU. smiling smiley

That said, I don't think twisting direction or the number of wires twisted at a time makes much of an electrical difference as long as you twist or braid at all. I'd lean more towards keeping instructions simple and/or discussing these differences on a dedicated page.

Generation 7 Electronics Teacup Firmware RepRap DIY
Re: Solution to endstop cross talk?
July 13, 2014 11:09AM
Twisting wires work for cross-talk between them, if both would be signals at a higher rate it might work, like in ethernet cables. Tho in ethernet its not only for that, also for debugging, so a tester can see a wire is broken, and by measuring the interference it receives back from its pair and kowing the coupling then the tester can deduct exactly at how many meters forward that wire is interrupted. So in an application where that wire is not easily accessible, user would know exactly where to start digging.

But in case of our endstops we dont have a frequency to speak of. And we have only one signal and the other is simply ground, so why bother twisting them. I suppose normally it is not the case of signal affects the gnd because "gnd is gnd" and would just sink that. And ofc its not the other way around either, so even if gnd might raise a tiny bit, it would be far from enough to affect the signal, and again no frequency to speak of.

So i suppose the issues come from interference with cables from motor, or heaters with pid, these would be basic radio emitters, so imo is different case. If you do twist in this scenario, you basically increase the length of wires and probably increase your "antenna" length and increase the "receiving capability". At least that is what i would expect.

Imho to reduce or eliminate interference from steppers and heaters, can not avoid shielded cables. So again imho, ned to use shielded cables and have the shield at ground, at the "motherboard" end only (not at both ends!). So shield should not create a gnd loop. Also shield should not be used for signal coz that would defeat the purpose. So at motherboard end you have 3 connections, shield, gnd and signal, and at the other end only gnd and signal for endstop. What shield does it makes a "faraday cage" around its internal wires, and takes all interference, and internal wires can not receive interference from outside. This is solution in my opinion.

One "attempt" to minimize you "antenna" length and hence its "exposure" would be to use only one logic pin for all endstops and have the endstops wired in series. Because i think this simply minimizes the wire total length, just for that. But need an firmware to be aware of this, and basically each time it homes to know to back away like 1mm untill that endstop is not triggered, and only then to check for other endstops, one at a turn. This is how most traditional cnc use this, probably because back in the day when were used interfaces like lpt port and logic pins came at a premium. Currently i think most reprap firmware dont know to use them like this, which is a pitty. At least i think marlin does not work like this, it just homes and remains in a position where that endstop remains "triggered" i dont know if it an be set to "back away" from that. Other attempt to minimize would be just make the endstop cabling to be as far away from motors and heaters. Again all the above etc, just my opinion.
Re: Solution to endstop cross talk?
July 14, 2014 06:38AM
But in case of our endstops we dont have a frequency to speak of.

Not the endstop its self, but other cablings in this area, like stepper motor wiring. "Antennas" do not only send, but also receive signals.

Generation 7 Electronics Teacup Firmware RepRap DIY
Re: Solution to endstop cross talk?
July 14, 2014 07:01AM
Yes, i think by "cable cross-talk", per se i might understand something bit different, basically for me that means the wires inside the cable interfere with each other. We would need a freqency first for that to happen, and some more signals than just one. This is what i tried to make explicit that i dont think it is the case.

For the other kind of interference, the emitters are the pid heaters, stepper motors and cables, and it could be the mains wires themselves if the psu consumes enough. The "antenna" would be the signal wires. Tho idd the "antenna" thingy is not a proper comparison from my part.

To be fair the most susceptible part i would expect to be the thermistor signal, because that has a resistance to its end, but again it has that cap which can work a little. While the endstop in comparison if its wired correctly, it makes a short to ground and that makes the signal also gnd for the time endstop is not triggered, and then that signal line is not "moveable". So the "antenna" comparison doesnt work well in that case. But if the endstop is set its set up the other way, like with the signal wire floating for normal un-triggered, then the endstop signal like would be a lot like a real antenna. So who has endstop problems, it could be because it has them set up for 5v = normal (un-triggered)? Coz else i dont see an interference to raise local gnd with like 4v.
Re: Solution to endstop cross talk?
July 14, 2014 11:42AM
As for noise, it doesn't matter if the switch is NO or NC. Voltage induced in the wires by the electromagnetic field generated elsewhere, will be able as well to "rise the ground" or "drop the supply", as the seizing circuit has some relatively high impedance.
Twisting the pairs is always a good measure to deal with such electromagnetic disturbance. It equally makes sense for "emitter", motor wires in our case, or "receiver", which is the endstop circuit. You either "scramble" (I mean the components generated by different wires, will have different directions, so the vector sum is less than the algebraic sum) the electromagnetic field generated by the currents in the motor circuit (which is pretty intense and has lots of hamonics), or you reduce the vector sum of the voltage induced in the endstop circuit by that field.
The issue is with short transients, repeated or not, that could trigger false stops. That's why the endstop circuit is normally containing a capacitor, as a low-pass filter. When all this measures are missing, there is just an invitation to problems.
Re: Solution to endstop cross talk?
July 14, 2014 02:14PM
If the switch is short circuit, it sinks the signal to ground. Its harder in this situation to change the signal because the signal is the "local" gnd. Its hard to change the ground value - at least it should be.

If the switch is normally open, it is connected only to the gpio pin, and left *floating* at the other end. It has a 5v supply but through a very weak pullup. In this situation its much easier to pick up noise from outside. Thats what i meant, again imo.
Sorry, only registered users may post in this forum.

Click here to login