Go Down

Topic: Serial Freezing in a high voltage and noisy environment (Read 202 times) previous topic - next topic

dandaman147

I am using this RS232 shield to communicate with a device that can be extremely noisy. I have tacked on a couple leads to the Tx and Rx pins of the DB-9 connector and used my oscilloscope to measure the noise levels seen here.. I have since implemented multiple ferrite cores with multiple windings of the cable through the cores. This does reduce the noise, but it is still present at some level.
The real issue here is that my serial communication freezes at inconsistent times although it does appear to be correlated with a larger voltage present in the object that the Arduino is speaking with. Because the freezing does not happen at a specific time in the program sequence and does seem to be correlated with the device, I believe the problem may lie elsewhere.

Other important notes:
  • When the serial freezes, the usb must be disconnected from the computer and reconnected. If not, the IDE will claim that it cannot find a device through the specified COM port.
  • The program must be re-uploaded after every serial freeze.
  • The device being communicated too operates at extremely high voltages (20kV+) and will occasionally experience arcing.

Questions: Is it possible that arcing could result in the noise is spiking so high that the Arduino is going into some sort of protection mode? What other causes could result in this behavior?

Sidenote: I will be attempting to record the RS232 noise levels during an arc at some point today and will update my post with that finding when it is obtained.

MarkT

Arcing is never good.  What frequency range is the noise and what baud rate are you using - put
another way might low-pass filtering help?
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Paul_KD7HB

Noise is the reason RS-232 was designed for up to +- 25 volts. What is the quiescent voltage on your transmit lines?

Paul

SSP1987

So I have made an automated TIG welding setup using Arduino, GRBL, & GRBL panel. I use the GRBL panel to send G code to Arduino via USB. The G code moves the slide to the desired location while welding is carried out.
I am experiencing problems similar to what dandaman147 is facing.

Whenever I start the arc using HF start, I get a message on the PC saying:
 " Fatal error on write to GRBL. A device attached to the system is not functioning" .
The GRBL panel crashes.
I have to remove the USB, disconnect the GRBL panel, then reattach the USB again & connect to GRBL panel again to send the G code. 
Why does this happen & what would be the solution?

Any help regarding this is highly appreciated.

dandaman147

So I have made an automated TIG welding setup using Arduino, GRBL, & GRBL panel. I use the GRBL panel to send G code to Arduino via USB. The G code moves the slide to the desired location while welding is carried out.
I am experiencing problems similar to what dandaman147 is facing.

Whenever I start the arc using HF start, I get a message on the PC saying:
 " Fatal error on write to GRBL. A device attached to the system is not functioning" .
The GRBL panel crashes.
I have to remove the USB, disconnect the GRBL panel, then reattach the USB again & connect to GRBL panel again to send the G code. 
Why does this happen & what would be the solution?

Any help regarding this is highly appreciated.

I did try some things yesterday and I noticed that completely switching away from the Arduino's serial monitor really helped. I am currently using Tera Term and I have only gotten one freeze in half a day of testing. The freeze I did get was associated with the Arduino itself freezing whereas before, only the serial connection between the Arduino and my computer would freeze while other functions would continue to work correctly. To add to that, when the freeze occurred, I was able to press the reset on the Arduino and have it come back correctly without needing to disconnect and reconnect the USB.

dandaman147

Arcing is never good.  What frequency range is the noise and what baud rate are you using - put
another way might low-pass filtering help?
The baud rate of the noisy connection is 38400 and the baud rate of the PC connection is currently 115200 although I was getting similar freezing issues at 9600. As I mentioned above, switching off of the Arduino serial monitor and to Tera Term has all but eliminated my freezing issues that require disconnecting, reconnecting, and re-uploading the code.

The noise I am experiencing is much higher frequency than the baud rate so a lowpass filter would indeed help, although I would rather look for other means to solve this problem only because implementing a proper lowpass filter would require me to essentially create a brand new custom RS232 shield. I do have that in my back pocket as a last resort and will go down that road if I must.

horace

when controlling motors, heaters, etc and in noisy environments I use opto isolators to isolate the microcontroller from the system being controlled
also filters and capacitors on power supply lines

MorganS

It seems more likely that the problem is between the Arduino and the computer, not the serial side. USB is sensitive to some disturbances and if it thinks you've unplugged the device then it is difficult to make it reconnect without actually unplugging.

Does it make a difference if you use a laptop running on battery with no connection to the mains?

I would focus on keeping the noise out of the Arduino (optocouplers, shielded box) and keeping the USB cable short so that the Arduino is electrically "close" to the computer.

Also look at using TVS diodes to clip the top off the worst noise spikes at the point where they enter your shielded box.
"The problem is in the code you didn't post."

SSP1987

I tested with the laptop running only on battery. So far it has worked for an hour without anything crashing.  :)
Now to test it in the long run......
Thanks MorganS .

SSP1987

Strange as it may sound, I have also observed that whenever it rains I never face this problem, whether I use a PC or laptop.
Would this be an earthing issue?

Go Up