ABB Inverter(slave) + MAX485 + Arduino(master) : 0xE0 (ModbusMaster invalid response slave ID exception)

Well, ideally you would remove the resistor, but since that requires solder work, perhaps it's easier to connect idle biasing resistors between 5V and Data A and between Ground and Data B as shown in the Example RS-485 Network Diagram here:
Thanks for the reply. I also noticed that the TX led on the arduino does not keep flashing while the code is executed. Only the RX LED is flashing.
 
Hi,
I did the procedure you indicated and also connected the inverter's GND to the MAX485 and Arduino. I was not successful, I can only get data only if I use the USB / RS485 adapter and use Modbus Poll but with Arduino I can't. The last alternative really is to include the resistors in the circuit.
It is very possible that your communication issue is due to the termination resistors without using biasing resistors. Try adding biasing resistors and see if you still have issues.

So that I understand the results of your test, please confirm the following.

There were 3 steps to my procedure:
1. Test Modbus Poll communications with the inverter using the following connection:
PC (running Modbus Poll) <-> USB/RS-485 Adapter <-> Inverter

2. Test Arduino communications to the Modbus Tools Simulator using the following connection:
PC (running Modbus Tools Simulator) <-> USB/RS-485 Adapter <-> Inverter (Powered Off) <-> MAX485 <-> Arduino

3. Test Arduino communications to the inverter using the following connection:
PC (no software running) <-> USB/RS-485 Adapter <-> Inverter (Powered On) <-> MAX485 <-> Arduino

Step 1 was successful, correct? Were both steps 2 and 3 unsuccessful?

If step 2 is unsuccessful, try it again but this time removing the inverter from the wiring, so the connection is as follows, we'll call this step 2a:
2a. PC (running Modbus Tools Simulator) <-> USB/RS-485 Adapter <-> MAX485 <-> Arduino
 
If step 2 is unsuccessful, try it again but this time removing the inverter from the wiring, so the connection is as follows, we'll call this step 2a:
2a. PC (running Modbus Tools Simulator) <-> USB/RS-485 Adapter <-> MAX485 <-> Arduino
Thanks for the answer!

Actually, I performed the 3 steps without turning off the inverter.

I had already tested this connection to test the arduino code, using Modbus Slave to simulate the inverter, the communication was successful.
 
I just took a look at what I believe is the manual for the inverter you're using
https://seasolargroup.com/wp-content/uploads/2018/07/EN_PRO-33_0-TL_PM_B_A5_2015-06-18.pdf

It appears that the inverter may have a switch to enable biasing on the network (in addition to a termination resistor enable switch).

View attachment 760

Instead of adding resistors, you can try turning this switch on the inverter to ON.
I'm sorry I didn't make myself clear. I was referring to S1:1 in this post. From the name, "BIAS_ENA", I suspect when this switch is in the ON position, the inverter connects biasing resistors to the RS-485 + and - lines.

Sorry, I still don't understand ... the resistor activated by switch S1 in the inverter replaces the 120 ohm resistor connected to the Fieldbus controller (in the image, 64 in the manual). OK?

View attachment 761
This image in the manual is actually incorrect. The "Inverter n" should show "S1:2 ON" instead of "S1:2 OFF" because when using termination resistors, they should be placed at both ends of the daisy-chain. They show an explicit 120 ohm termination resistor on the "Fieldbus controller" because it is assumed that the "Fieldbus controller" does not have a termination switch (or similar) built in.

And to nit-pick this diagram further, the cable shielding connections are actually incorrect too, even though it does correctly state, "Only ground one end of the cable shield." The cable shielding needs to be continuous, so it should be daisy chained at "Inverter 1" and "Inverter 2", not connected to ground, and then only connected to ground at "Inverter n" (or connected to ground at the "Fieldbus controller" instead of at "Inverter n").

These are better examples of proper RS-485 wiring, taken from http://www.bobtech.ro/get?download=21:rs485-wiring-guidelines

1607364687062.png

1607364779971.png
 
I'm sorry I didn't make myself clear. I was referring to S1:1 in this post. From the name, "BIAS_ENA", I suspect when this switch is in the ON position, the inverter connects biasing resistors to the RS-485 + and - lines.
I asked for more explanations to the support as the manual is not evident. I hope you respond quickly
 
This image in the manual is actually incorrect. The "Inverter n" should show "S1:2 ON" instead of "S1:2 OFF" because when using termination resistors, they should be placed at both ends of the daisy-chain. They show an explicit 120 ohm termination resistor on the "Fieldbus controller" because it is assumed that the "Fieldbus controller" does not have a termination switch (or similar) built in.

Thanks for the reply. I find it strange that even without the terminating resistor the communication works with the USB / RS485 converter, but not with the MAX485
 
I find it strange that even without the terminating resistor the communication works with the USB / RS485 converter, but not with the MAX485
Your USB/RS-485 converter likely uses a different RS-485 transceiver and has its own open-circuit biasing resistors that raise the idle voltage enough for the inverter to communicate with it. It's possible this biasing is enough to make your Arduino be able to communicate with the inverter when you have all of the equipment daisy-chained together. This is one of the things I was trying to determine by having you perform the 3-step procedure I posted previously.

Termination resistors are only necessary when using high baud rates and long cable lengths. They are not necessary in lab environments such as yours. Applying termination resistors without strong enough idle biasing resistors can essentially short out the RS-485 bus. The termination resistors can cause the idle bus voltage (the differential voltage between the + and - signals when no devices are transmitting) to drop below 200mV, which is in the undefined range for RS-485 transceivers, such as the MAX485. This can cause devices to be unable to communicate (you typically see the RX LED solid on at all times, if the device has such an indicator LED). In practice, RS-485 transceivers typically will work at lower voltages than 200mV, but they are not guaranteed to work. Therefore you may find that when using two of the same device (that use the same RS-485 transceiver), one works while the other does not, when your RS-485 idle bus voltage is below 200mV.

There are RS-485 transceivers available that have a "fail-safe" feature that guarantees correct operation, even down to 0V differential voltage. Your USB/RS-485 adapter may use a RS-485 transceiver that has this feature.

On your inverter, do you have S1:2 in the ON or OFF position?
 
Termination resistors are only necessary when using high baud rates and long cable lengths. They are not necessary in lab environments such as yours. Applying termination resistors without strong enough idle biasing resistors can essentially short out the RS-485 bus.
Thank you for responding! Yes, the RS485 network is short in length as it is only for study.
So there is no need to use terminating resistors in this case, okay?
However, in the future I intend to connect another 5 inverters to the RS485 network. All the inverters are close and I think the maximum network length would be around 15 meters. Is there still no need for terminating resistors?

The manual states that S1 and S2 are off. I'm still waiting for more information from ABB support, but they still haven't answered me.
 
As for when termination is required, here is a general guideline:

Baud RateMaximum Length Without Termination
9600 and belowTermination not required
19,2002,800ft (850m)
38,4001,400ft (425m)
57,600940ft (285m)
76,800700ft (210m)
115,200470ft (140m)

The recommendations in the table above assume bits are sampled in the middle of each bit time, 3 round trips are required for reflections to dampen out, and the RS-485 cable has a worst-case propagation velocity of 66% the speed of light (typical values are between 66% and 75% and should be stated in the cable's datasheet). At baud rates of 9600 and below, the maximum length before termination is required is greater than 4,000ft, which is the maximum allowable cable length for RS-485 networks.

In general, you can use the following equation:
L < 0.66C / 12B
Where L is the cable length, C is the speed of light, and B is the Baud Rate.
 
As I said before, I think that the termination without idle biasing is what's causing your communication issue between the Arduino/MAX485 and the inverter.

Here are two ways to resolve your issue. In either case, you need to connect A, B, and GND from your MAX485 board to the inverter's Data +, Data -, and GND terminals (i.e. X1:1, X1:2, and X1:3 or X2:1, X2:2, and X2:3), respectively.

1. Remove R7 from your MAX485 board. Set S1:1 and S1:2 both to the OFF position on the inverter.

2. On the MAX485 board, add one resistor between A and VCC and add another resistor between B and GND. The resistors should be the same value and can have a value of 470, 560, or 680 ohms. On the inverter, set S1:1 to the OFF position and set S1:2 to the ON position.
 
As I said before, I think that the termination without idle biasing is what's causing your communication issue between the Arduino/MAX485 and the inverter.

Here are two ways to resolve your issue. In either case, you need to connect A, B, and GND from your MAX485 board to the inverter's Data +, Data -, and GND terminals (i.e. X1:1, X1:2, and X1:3 or X2:1, X2:2, and X2:3), respectively.

1. Remove R7 from your MAX485 board. Set S1:1 and S1:2 both to the OFF position on the inverter.

2. On the MAX485 board, add one resistor between A and VCC and add another resistor between B and GND. The resistors should be the same value and can have a value of 470, 560, or 680 ohms. On the inverter, set S1:1 to the OFF position and set S1:2 to the ON position.
Hello, thanks for replying!

I still haven't gotten feedback from ABB support but I ran some tests. So I don't know where the keys S1 and S2 are currently in.

For testing, I used the second option you indicated and inserted 470 ohm resistors between VCC and A and between GND and B. It didn't work. I set up the circuit as the following figure. Is it an error in the assembly of the circuit?

I am using the X2 bus because X1 is not available.
I am no longer receiving 0xE0 (ID error) now I only get 0xE2 (timeout error)


1608041964269.png
 
You have your 470 ohm resistors connected incorrectly. Your schematic shows one resistor between B and VCC and the other between A and GND. Please review my previous instructions:
2. On the MAX485 board, add one resistor between A and VCC and add another resistor between B and GND.
Regarding your comment on S1 and S2:
I still haven't gotten feedback from ABB support but I ran some tests. So I don't know where the keys S1 and S2 are currently in.
I don't understand why you need a response from ABB support. Don't you have the inverter in front of you? Remove the inverter cover and look at S1 and S2 on the inverter's control board, what positions are they in?
 
You have your 470 ohm resistors connected incorrectly. Your schematic shows one resistor between B and VCC and the other between A and GND. Please review my previous instructions:


Regarding your comment on S1 and S2:

I don't understand why you need a response from ABB support. Don't you have the inverter in front of you? Remove the inverter cover and look at S1 and S2 on the inverter's control board, what positions are they in?
Hello. Thanks for responding! I removed the 120 ohm resistor from the RS485 / TTL converter and it didn't work.

So I took a second module and connected the resistor terminals so the current would pass through a new path. This worked in a few moments but then I lost the connection for good. This makes me believe that there must be some bad contact in the converter module. I replaced the module with another one and I couldn't get any more connections.

Do you know if I use only the CI MAX485 and connect directly to the arduino I could have a positive result?

Help me please
 
As a general troubleshooting recommendation, only change one thing at a time and test the results. When you change multiple things at once, it's impossible to know what effect each change had on the system.

I removed the 120 ohm resistor from the RS485 / TTL converter and it didn't work.
OK, did you set S1:1 and S1:2 both to the OFF position on the inverter, as instructed? Do you have all 3 wiring connections made (+, -, and GND), as instructed?

So I took a second module and connected the resistor terminals so the current would pass through a new path.
I don't understand what you mean by this. Can you please explain the exact connections you made.

This worked in a few moments but then I lost the connection for good. This makes me believe that there must be some bad contact in the converter module. I replaced the module with another one and I couldn't get any more connections.
So you did have successful communications between your Arduino and the inverter and could read values for a few moments? I doubt there's a bad contact with the MAX485 board, especially since after replacing the MAX485 board, you have the same issue. It's possible you may have damaged the inverter's RS-485 circuitry or the Arduino/MAX485 board. Please verify that the inverter is still successfully working using your computer, Modbus Poll, and USB/RS-485 adapter. Please also verify that the Arduino/MAX485 board are still successfully working using your computer, Modbus Simulator, and USB/RS-485 adapter.

Do you know if I use only the CI MAX485 and connect directly to the arduino I could have a positive result?
I don't know what you're asking here. Please explain in better detail.
 
Sorry. I will punctuate my steps to be more detailed:

1- I removed the 120ohm resistor from the RS485 / TTL converter module and kept the S1 and S2 switches OFF. Then I tested with the same code and connections with Arduino A in D +, B in D- and GND in GND. There was no success.

2- I used another RS485 / TTL converter module that still had a 120ohm resistor and with a jumper wire I connected the two ends of the resistor (orange wire in figure 1 below). This worked but not continuously, it alternated between connected and not connected. The only thing I could think of is that some module connection is in bad contact.

1608146822295.png



Since then I have not been able to get communication to work again. Is the problem with the RS485 / TTL modules? If I use only the MAX485 CI (Figure 2) connected to the Arduino could it solve?
1608147160979.png
 
1- I removed the 120ohm resistor from the RS485 / TTL converter module and kept the S1 and S2 switches OFF. Then I tested with the same code and connections with Arduino A in D +, B in D- and GND in GND. There was no success.
Thank you for the additional information. You should be able to achieve successful communications with this setup. Are you receiving an error when doing this? If so, what error? If not, what makes you believe communications is not successful? Please detail what you mean by, "There was no success."

2- I used another RS485 / TTL converter module that still had a 120ohm resistor and with a jumper wire I connected the two ends of the resistor (orange wire in figure 1 below). This worked but not continuously, it alternated between connected and not connected. The only thing I could think of is that some module connection is in bad contact.
I don't understand what you're trying to do by placing a jumper wire across the ends of R7. This shorts A and B together. Luckily, according to the datasheet, the MAX485 driver's are short-circuit current limited and it has thermal shutdown circuitry, otherwise you would have damaged the MAX485. There is no possible way this could have resulted in successful communication. Your indication of "connected" or "not connected" must not be reliable and is not providing you with the actual status of the RS-485 communication.

Since then I have not been able to get communication to work again. Is the problem with the RS485 / TTL modules? If I use only the MAX485 CI (Figure 2) connected to the Arduino could it solve?
In order to identify where the problem lies, please follow my previous recommendation:
Please verify that the inverter is still successfully working using your computer, Modbus Poll, and USB/RS-485 adapter. Please also verify that the Arduino/MAX485 board are still successfully working using your computer, Modbus Simulator, and USB/RS-485 adapter.

Regarding connecting a MAX485 transceiver directly to your Arduino using a breadboard, you could certainly give this a try, but I doubt you will see any difference versus the MAX485 board that you've removed R7 from (assuming that board has not been damaged). If you do try this, you will need to have a pull-up resistor on the RO signal, since that output from the MAX485 is high impedance when RE is high. You may be able to simply enable an internal pull-up on the Arduino's RX pin in code:
https://www.arduino.cc/en/Tutorial/DigitalInputPullup
 
Top