Jump to content

Control of Master Brick via existing RS485 connection


oe8bck
 Share

Recommended Posts

Hi,

 

I found some topics regarding connection to external MODBUS devices from the RED brick, but I have a little bit different setup.

 

Currently I have a frequency inverter controlled via MODBUS and a Python module. I also have a Master Brick with a stepper motor and its Python module. There is a Python program accessing both modules and it works well as long as I do not connect the AC motor to the system. So stepper control wors, inverter control without motor works, but starting the motor resets the Master Brick.

 

So there is somewhere a coupling from the motor to the Tinkerboard system. I did a lot of tries to lower this coupling from the power supply side and also with some ferrite beads on the cables. It is improved now a little bit, but still not functional.  :o

 

The last thing that comes into my mind in order to reduce coupling is the USB interface. I know from other projects that the ICs used there are very susceptible with respect to EMC. The MODBUS interface with its physical layer RS485 is much more robust.  :-\

 

So I would like to replace the USB connection with a MODBUS interface. Is there a way to do it?

BRICKD<->PC<->MODBUS<->RS485 Extension<->Master Brick

To make it a little bit mor "thrilling", there is a timing constraint given by the customer. He wants a demonstration by mid of next week, so there is not time to order additional hardware. Any ideas are highly welcome!

 

KR,

Christof

Link to comment
Share on other sites

The RS485 Extension is meant to only connect to another RS485 Extension to connect two or more stacks of Bricks. It is not meant to be integrated with other Modbus devices.

 

Using a RED Brick and an RS485 Extension to talk to other Modbus devices might be technically possible, but is not officially supported and there is no ready made software for this scenario.

 

What you do with an RS485 Extension is this:

 

PC <---USB---> Master Brick + RS485 Extension <========> RS485 Extension + Master Brick + other Bricks and Bricklets

 

But back to your original problem. Can you describe in more details how all the parts are inter connected and how power is supplied to the different parts of the system?

Link to comment
Share on other sites

Hi and thanks for the quick answer!

 

I know that it's not officially supported, but I thought that someone already patched the brickd in a way that it is using the serial line interface which is RS485.

 

The connection is quite straight-forward I think.

AC Mains -> inverter ------------------------------> AC motor (1 phase)

              |-----------------<-> RS485 interface

                                          |

    |-> laptop power supply -> laptop <-> USB

                                    |<-> USB <-> Stepper Brick <-> Stepper

    |-> switching power supply --------------------------->|

So there is a loop with the stepper switching power supply an in this loop (really physically in between) is the 1-phase AC motor.

 

As I said I would like to improve the power supply connection and think that RS485 is a better way to connect the Stepper Brick than USB.

 

KR,

Christof

Link to comment
Share on other sites

The special Brick Daemon version for the RED Brick can use an RS485 Extension as Modbus master to talk to another stack of Bricks. But this is highly RED Brick specific. The recent forum thread about RED Brick and RS485 Extension was about stopping Brick Daemon on the RED Brick from using the RS485 Extension to talk to another stack of Bricks. The goal in that thread was to use an RS485 Extension on a RED Brick to talk to some generic Modbus device, without having Brick Daemon involved. So this is something different.

 

Also don't jump to conclusion. Replacing the USB connection to the Stepper Brick with an RS485 connection might not help at all, because the actual problem might be totally different from what you currently think it is.

 

For example, did you try to run your laptop/Brick setup disconnected from AC mains? Try running your laptop from its battery and disconnect the switching power supply from the Stepper Brick. Now check if you can still reset the Stepper Brick by starting the AC motor.

 

Another thing to try: connect the Stepper Brick to a second laptop/PC (if available) to check if the single laptop as a central connection point has an effect on this.

 

Also, what about physical proximity? Does the Stepper Brick have to be near to the AC motor? Or can it be placed further way? Does it make a difference?

 

Do you route your power and USB cabels in parallel? Can you route them differently?

 

Does the AC motor have the required filters/snubbers/etc installed, if necessary/recommended for that type of motor?

 

Did you try to power the Stepper Brick differently? For example with a Step-Down Power Supply (assuming you have one at hand), or with an active USB hub instead of the USB port on your labtop?

Link to comment
Share on other sites

Hi,

 

Well, thanks to confirm what I thought about the forum posts I read. My question for RS485 is a little bit different.

 

Regarding the EMC, I already tried what you suggested, the situation improved, but is still not acceptable. I inserted with a Raspberry with a brickd which is connected via Ethernet to the Laptop. Did not help. Maybe I'll try it with WLAN, but this is not an option for the demonstration. I also seperated it physically without the AC motor in the loop. This is the option that really helped, but there is still a reset if the motor is powering on orf off. Also a powered USB bridge was not chenaging the reset behaviour. I will also insert some shielding, the cases as well as the lines with proper shielding, not conenctied on both sides but only on one side. I think this will also improve the situation a little bit.

 

I did not try to disconnect the stepper supply, that might give a hint. One of the things I will try next as you suggested is a battery to de-couple supplies. But the very first thing I'll do is to apply an AC snubber filter, I got the delivery today.

 

I am looking forward that the AC-line snubber filter solves the problem, but if not my very last idea is the RS485 line. I orderer yesterday a Master Brick with RS485 Extension and it's on delivery today, so I think I'll get it on Monday, as it has not to cross the Atlantic :-)

 

KR,

Christof

Link to comment
Share on other sites

When you say "powered USB bridge", do you mean just a powered USB hub or a proper USB isolator?

 

So you didn't yet fully separate the AC motor part from the Stepper Brick part? You always had some kind of electrical connection between the two parts and tried to apply filters or different means of tethered communication to solve the issue?

 

Assuming this is some kind of EMC issue, I think you should figure out next if the issue is related to the electrical connection between the two parts or if just physical proximity is already enough to trigger the issue.

Link to comment
Share on other sites

Hi, thanks for the quick and helpfull answerts!

 

Well, as I got the AC snubber filter for the AC-line of the inverter and also attached some ferrites on the signal and supply lines. I did not remove the Raspberry, I just did some separation and re-routing of the cables, so that there is only the ethernet cable "closing the loop". I also replaced the 12V supply of the stepper with another one, both are switching power supplies. Now the Stepper Brick does not reset any more.  :D

 

So now the system is working in principal, but there is still flaw in the stepper function. If the AC motor is running, the stepping is not smooth, it's "stuttering". If I unplug the AC motor and leave everything else as it was, the stepper works smoothly. I think I will look at VPP with an Oszi to see what's going on there. I would also like to have a look at the current through VPP, but I cannot find R17...

 

BTW:

I used a simple "Powered USB Hub" without any special isolation.

 

KR,

Christof

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...