I designed a board with a microcontroller (Atmega328), 3 relays and a RS485 transceiver. The relays control SMPS LED drivers (Meanwell LPF series). The system consists of 10 boards, each one controlling 3 drivers, for a total of 30 drivers. These boards are the slaves, while a PC running linux, with a USB-RS485 dongle, acts as the master.
I don't have any problems with comms (Modbus RTU at 9600bps) as long as the power supplies are disconnected or the relays are turned off. Immediately after SMPSs are powered on, noise appears on the bus (and stays), completely killing communications. The noise is seen as a huge amount of random data on the python script manning the communications. If I disconnect the drivers, comms are reestablished. If only a few drivers are powered on (less than 10), no problems are observed. Connecting more and more drivers begins to add noise. Between 10-15 SMPSs the bus becomes unreliable, more than 15 drivers, bus becomes unusable.
I implemented this design (same board, but with HLG series drivers) in other installations, with up to 60 drivers, with no problems. I can't find in the driver's datasheet any substantial differences.
My questions are:
Can a faulty/very unregulated electrical grid be the culprit of this behavior? (this control system is implemented in farms, where a poor quality electrical grid is common)
Does Total Harmonic Distortion play a role in this?
The bus connects to the dongle using only A and B, the third connection (shield) is not used. Should the GND plane of all boards be connected to this pin?
Any ideas on how to solve the problem? (without changing the LED drivers, not even sure if this solves the problem)