Arduino serial suddenly disconnects from PC, Arduino does not reset

Hi,
I'm having some weird connection problem with my arduino board.

I have an arduino uno connected to some robotic machine in my company , and to an xp workstation via USB serial.
The human operator controls the machine by sending commands through the USB serial to the arduino , thus controlling the machine.

This setup has worked for about a week, and the arduino was communicating with the workstation without a problem.

Now , at random times , between 5 minutes to a few hours of work the aruino will disconnect the serial port and would prevent from communicating with it.
I won't be able to reconnect to the arduino until i unplug the usb and replug it, or restart the computer.

I have seen this happen even using putty sending the serial commands , and have tried switching to a new arduino board with same results.
The serial port suddenly disconnects.

I know the arduino itself is not being reset because the problem sometimes happens that the serial connection is disrupted while the arduino is doing some work with the machine.
Even though the serial is disconnected, the machine does come to the right place meaning the arduino is still holding it's data and not being reset (counters, etc).

If someone would like to know some more of my setup:
Custom application (written in VB.net) -> (USB serial) -> Arduino ->(OutputPin 9,11 , InputPin A5 ) -> Schneider Electric PLC -> AC powered motor (controlling a 30 feet circular storage drawers)

Pins 9,11 sends commands from arduino to the PLC telling it to move motor up/down (respectively) , analog ping A5 reads a sensor value which tells the arduino when it has reached a drawer. ( and then decide whether to continue to next drawer or stop, etc)

Please help !
We have just moved this solution to production and this problem started only after a week's work....

thanks,
avi

Could easily be a problem with the host computer side of things... Having said that perhaps the Arduino sketch is running out of RAM and overwriting stuff?

Thanks MarkT for the reply !

We have though about the host causing the issue and have prepared a new host as standby for the next time the problem will happen. (even though it's a brand new pc)

Thanks for the RAM idea, don't know why it did not occur to me to check this...

I've added some memory tests of the stack and heap
(using Arduino Playground - AvailableMemory #2nd method,and #3rd)
Results seems steady to me :
heap(1295) and stack values(2295) on method 2 ,
or steady 994 on method 3.

I'm logging the values to serial and see if they change during a hang...

Off the top , are there any other things that are common to this type of problem that come to mind ?

Thanks
Avi

Thanks for the RAM idea, don't know why it did not occur to me to check this...

It was also a hint to post your code. If the problem is on the Arduino side, it is probably not hardware related, leaving only software.

Hi aviasd,
I'm having the same problem in my company, I trying to make an interface between Arduino and Visual Basic, I want to receive information from a cutting machine the company has. The idea is to display the amount of hits the die of the machine is making during its process, so I'm receiving 24V each time the die goes down and cut a piece of wire; so we made a counter on Visual Basic:
Every time we have 24V, the program will count +1 and it will show the amount of counts the machine makes.
Everything works correctly, but at a certain time the program gets freeze and the PC doesn't find the Arduino COM port; I need to reconnect the usb cable again and upload the program to the Arduino.

I don't know what it could be happening.
If anyone have possible solutions, please tell me.
I would be very thankful.

Vis bas is probably not the best solution.

Also 24V might be an issue too unless you are voltage dividing it to the Arduino.

You may also want to move past XP as the OS which will give you a bit more lee way on the IDE and libs.

You could maybe also reduce the buffer overhead by batch counting unless every single piece count is crucial.

I used a batch method on a multi cut shear with options for different batch counts that was very reliable.
See HERE but bear in mind that was some time ago when my skills were very limited in Arduino (my first month of owning one)

My production version used a 24V prox switch on a voltage divider and a small SSR to activate a 24 V red strobe for the operator

Hi,
How have you got the Arduino connected to the VSD?

Do you have isolation, or is the gnd and logic output connected directly to the terminals of the VSD?

Although VSD have good filtering, there may be noise getting back the the PC causing the USB link to drop out.

Can you post a circuit diagram of how you have the Arduino connected please?

Thanks.. Tom... :slight_smile:

Good call TomGeorge

Routing of serial / ethernet cables can be an issue in industrial situations unless proper shielding is employed.

RFI and EM etc can also be an issue with Arduinos themselves.
I put my batch counter (arduino) inside its own metal box to fix a small issue with a nearby welder.