So today was pretty frustrating.

So today was pretty frustrating. I thought I had everything working well yesterday except for some strength in the structure which I fixed.
However today I kept having my arduino crash when the spindle was running. Seemed like if I had the gnd pin of arduino connected to the common ground with the stepper motors, even though the machine wasn’t moving, simply running the spindle (totally separate electronics) was enough to crash the arduino.

This wasn’t happening to me yesterday, and nothing had changed in the electronics. However I’m wondering what my next step is and thinking it’s time to take the electronics out of the card board cat food box and put them in a PC case.
Thinking it will offer some measure of protection from the em interference.

I know I have to have the arduino connected to a common ground point with the drivers. I’ve been adding capacitors between step/gnd etc which is helping with noise elsewhere, but in this case I’m not sure where I’d connect the capacitor to in order to filter on this common ground line.

As always any advice is appreciated. Will a proper care help?

How is your ground and earth wired?

The fact I’m not sure I understand the question is probably a bad sign :-). Everything on this circuit is either powered from a 24v DC supply or, in the case of the arduino from the USB of my laptop. The gnd of everything connected to the 24v supply and the gnd from arduino are all connected at one point on a strip board. The 24v supply is earthed via the plug. And my understanding is that such supplies have gnd connected to earth.

I thought you had your machine working the other day?

+Paul Frederick me too. Hence the frustration.

Have you tried robing some ferrites from some USB cables and using them on your stepper motor cables? Some just snap right off. More a long your design, you could try useing metal washers and loop the cables thru them on each end to reduce noise.

btw, I wish you’d take more high res still pics of your setup, than n maybe document where you get some of your parts. Besides the cat food box I mean…;p

I still say that you need to optically isolate your control lines if you want a reliable system. It is the only thing that worked for me.

I am late to the overall thread, so forgive me if this is repetitive questioning regarding your build…but, what spindle are you running and how is IT wired? The reason I ask is because I was just reading a thread earlier about a spindle throwing off a lot of EMF noise and causing trouble on the electronics/control side. After some various attempts to crudely shield the spindle motor, the ultimate answer (in that case) was to replace the spindle AC power cable with a SHORTER, 3-prong version. That thought is the basis of my question regarding your spindle setup/wiring…

@Craig_The_Fabricator the spindle has a heavy gauge, shielded 4 core cable. The shield is connected to the earth at the vfd end. It is definitely the spindle throwing off the noise. So possible to do something about that. However I was coming to the conclusion that there will always be sources of noise, and protecting the electronics to be robust against it was a better option.

@Paul_Frederick @Mat_Helm previously I was seeing evidence of noise in jitters on the axis motors. Particularity when the spindle started or stopped. After adding some capacitors to step/dir and across the power lines I was getting really good reliable operation. But now I see the arduino itself crash when the spindle starts. Which I think is specifically due to noise picking up on the ground wire that connects arduino to common ground. With this wire disconnected the arduino doesn’t react to the spindle starting.

@Daniel_Would
You’re going to have to figure out some way to decouple your Arduino from that noise. Do you have an input filter capacitor on your Arduino power? That with perhaps an inductor might clear things up for you.

http://www.murata.com/products/emicon_fun/2011/03/emc_en28.html

@Paul_Frederick at the moment the arduino is powered by the USB cable, so no other filters there. Not sure if it would help to power it separately since it will still need to be connected to USB. I was wondering about a capacitor between ground and 5v pins on arduino as to whether that would do anything. There is nothing else connected to those power out pins on the arduino.

+Paul Frederick also, that’s a handy link. Might try an inducter on the ground line. I have also ordered a cheap PC case to house things in. Hopefully a combination of capacitors, inductors and being in a Faraday cage will all yield good results.

@Paul_Frederick so I started looking at the d213 opto-isolator break out board ( http://www.amazon.co.uk/gp/aw/d/B00B300P1U/ref=redir_mdp_mobile). If I’m reading it right, I just need one of these for each driver. Wire the gnd from arduino plus step/dir to one side. Then +5v/gnd that comes out the driver and the outs to the step/dir inputs on the driver. Rince repeat for each driver. And at that point I no longer need arduino to share a ground with the motor drivers. Thus isolating it and hopefully avoiding this issue…

@Daniel_Would
I’d like to see a schematic of exactly what that thing is, but from what I’m seeing of it it doesn’t look too promising to me really. I’ll get back to you in a bit let me make something here first though.

Noise is a common problem. I had this problem, too. But with a robot-project. You need a voltage regualator with seperate 5v for your arduinoboard and 24v for your motor-cycle. The voltage-regulator should smooth the noise out.

@Daniel_Would OK this is exactly what you need

You run your step, and direction from your Arduino into the top, then connect your motor drives to the bottom. You could even run your Arduino off the on board regulator like @Jan_Przybilla suggested you do. It has plenty of current to handle that along with itself. I’d have to add a different connector so you could tap regulated voltage off the board though.

Let me know if you want me to route the board, or if you’d like the Eagle file. If this thing is really going to be stand alone I should probably add another filter capacitor to the regulator too.

@Paul_Frederick wow, thanks!. I now need to wrap my head around that schematic. I’m determined to learn enough to actually understand what is going on… One of these days I should probably try learning a little eagle cad.

@Daniel_Would
I’ll make another graphic and explain it.

  1. Signal input. This can be high, or low.
  2. LED When signal input is low LED illuminates and triggers photo transistor to go high.
  3. Schmitt trigger inverter input. Normally held low, when photo transistor is active it becomes high.
  4. Schmitt trigger inverter output. This outputs the opposite of what 3 is input. The Schmitt trigger also squares up the signal the optocoupler outputs so the signal has sharp transitions from low, to high.

The optocoupler inverts its input, then the inverter inverts its input giving a net positive logic output. If a high signal is at 1 there is a high output at 4. But there is no electrical connection between 1, and 4. This fact blocks noise dead in its tracks.

It should also be noted that it takes about 12 milliamperes of current to trigger the LED in the optocoupler. So a little noise is not even going to make a blip happen. A few nanoamperes can trigger a logic gate though. Signal noise can add up to that.

@Paul_Frederick thanks for the breakdown. As I understand the description that is essentially what is on those d213 breakout boards. Some resistors on the input pins, an inventor on the output to flip it so high in=high out. Not sure what the relative comparison of actual components is like.