C
Facing what I can only assume are grounding problems.
This is the first time I am working with RS485.
There are basically about 20 MAX485 and arduino based RS485 devices on our bus and the Master is the PC which runs our custom software. Not once has there been a single issue in lab testing for more than a month.
First of all, the cable used on site is unshielded CAT5. This is because it was already put by the previous vendor before we entered the picture. Total length about 900m. Changing the cable is not an option at this stage.
All devices are connected in series, and there are no 'T' connections/star points.
All the devices have their own isolated SMPS and are not connected to the physical earth.
One of the CAT5 twisted pairs is used for RS485 and one of the pairs is used for connecting the Grounds.
All RS485 Grounds are connected together and this wire finally is connected to the Ground terminal of the 485 to 232 converter connected to the PC. It probably gets connected to Physical Earth through the PC.
Here's what is happening:
The exact same system is working perfectly fine in another building here for more than 15 days and still is.
Completed testing the cabling for building 2 yesterday. The complete system was working excellently for more than 24 hours on the PC and I had already booked a ticket home.
Suddenly communication completely stopped, some devices were not responding at all and others were responding very slowly with various time outs.
I removed the RS485 wires from the PC and put them into my Laptop through a 485 to USB converter and everything was perfect and all devices were responding instantly. I was happy that none of the devices were damaged and concluded that the RS485 to RS232 converter was probably broken.
I connected the 485 to USB converter to the PC expecting it to work perfectly but there was no response. I disconnected the ground wire from the USB to 485 converter and it started working OK, but not excellent. Terminal software shows that there is continuous noise on the RS485 bus with the byte 255 being received by the PC every few seconds. Though communication has started, but the byte 255 is occurring every few seconds. This will result in timeouts every now and then but the communication will at least take place. The packets which get corrupted by the 255 should get thrown away by our protocol and the data again requested by the Master. Thus even though there shouldn't be any overall errors in the system, this doesn't seem to be a very reliable, robust and trustworthy RS485 network.
I can only imagine that the entire communication is extremely clean on the Laptop due to the lack of physical earth. I am almost certain that the same garbage will occur even on the Laptop when the 3 pin charger is connected. Will confirm this tomorrow.
The reason for me to believe this is that I was experiencing minor shocks when touching the RS485 lines which were connected to the Laptop as well as the main RS485 bus a few days back. Removing the Laptop charger stopped the shocks.
I also think that the PC will also have crystal clear communication if its earthing is disconnected, although this is just a hypothetical scenario due to the major risk of electric shock if this is done.
All in all, what do you make of this? System that runs perfectly on a Laptop and not so perfectly on a PC? I am reluctant to leave the site knowing that even though the system looks like it works but weird unexplained things are happening under the hood.
This is the first time I am working with RS485.
There are basically about 20 MAX485 and arduino based RS485 devices on our bus and the Master is the PC which runs our custom software. Not once has there been a single issue in lab testing for more than a month.
First of all, the cable used on site is unshielded CAT5. This is because it was already put by the previous vendor before we entered the picture. Total length about 900m. Changing the cable is not an option at this stage.
All devices are connected in series, and there are no 'T' connections/star points.
All the devices have their own isolated SMPS and are not connected to the physical earth.
One of the CAT5 twisted pairs is used for RS485 and one of the pairs is used for connecting the Grounds.
All RS485 Grounds are connected together and this wire finally is connected to the Ground terminal of the 485 to 232 converter connected to the PC. It probably gets connected to Physical Earth through the PC.
Here's what is happening:
The exact same system is working perfectly fine in another building here for more than 15 days and still is.
Completed testing the cabling for building 2 yesterday. The complete system was working excellently for more than 24 hours on the PC and I had already booked a ticket home.
Suddenly communication completely stopped, some devices were not responding at all and others were responding very slowly with various time outs.
I removed the RS485 wires from the PC and put them into my Laptop through a 485 to USB converter and everything was perfect and all devices were responding instantly. I was happy that none of the devices were damaged and concluded that the RS485 to RS232 converter was probably broken.
I connected the 485 to USB converter to the PC expecting it to work perfectly but there was no response. I disconnected the ground wire from the USB to 485 converter and it started working OK, but not excellent. Terminal software shows that there is continuous noise on the RS485 bus with the byte 255 being received by the PC every few seconds. Though communication has started, but the byte 255 is occurring every few seconds. This will result in timeouts every now and then but the communication will at least take place. The packets which get corrupted by the 255 should get thrown away by our protocol and the data again requested by the Master. Thus even though there shouldn't be any overall errors in the system, this doesn't seem to be a very reliable, robust and trustworthy RS485 network.
I can only imagine that the entire communication is extremely clean on the Laptop due to the lack of physical earth. I am almost certain that the same garbage will occur even on the Laptop when the 3 pin charger is connected. Will confirm this tomorrow.
The reason for me to believe this is that I was experiencing minor shocks when touching the RS485 lines which were connected to the Laptop as well as the main RS485 bus a few days back. Removing the Laptop charger stopped the shocks.
I also think that the PC will also have crystal clear communication if its earthing is disconnected, although this is just a hypothetical scenario due to the major risk of electric shock if this is done.
All in all, what do you make of this? System that runs perfectly on a Laptop and not so perfectly on a PC? I am reluctant to leave the site knowing that even though the system looks like it works but weird unexplained things are happening under the hood.