PLC controller with dual processors?

Hello, I'm toying around with some ideals on designing and building my own PLC controller. A lot of things I have been looking into seem one processor doing so many tasks can be a little to much for a single processor. I was thinking of using a Co processor. first processor to handle the tasked while the second processor handle all the smaller things like Ethernet, leds, and other things.

I wanted to get the opinion on the community to see what everyone thinks?

Joseph

It depends on which processor You go for.

Double processor gives You 4 times the trouble.

Please give us a more detailed specification of timing, frequency etc.

@Railroader I myself is not having any trouble. I had to recently change out a few plc controllers that failed for one way or another. One i came accross that was heavely modify to do more then it should. It haves a atmel atmega328p that doing over 20 things but originally design to do only 6 things. But not sure why it really failed. Soon to test it out.

Had a lot of bodge wires to it. I can't get my hands on it now until wednesday mytime. But just got me thinking of the past to where I was thinking of building my own. Just slightly different with two processors one for the heavy lifting and the other for small things.

You use 2 (or more) processors when you come to a point in a design when you know you need to separate different activities on to different processors in order to solve a specific problem you have. Even then you make really sure there's no way to accomplish the same thing on one processor. Look to a more powerful processor before considering adding another one. Experience will teach you when 2 processors are really needed, but if you have to ask in a vague, general sense then you don't need 2 processors, at least not yet.

I will give you a specific example:
My heating controller runs on a PIC. I wanted internet connectivity, which the PIC cannot give me, so I added an ESP8266. In terms of processing power the ESP8266 is more than capable of running my heating and connecting to the internet, so that raises the question of 'why keep the PIC?'. The answer is that while the ESP8266 has more than adequate processing power it is very restrictive on ports and external connections generally, so I needed something to do that. The PIC provides that.

@PerryBebbington You have some great points there. This plc controller is controlling 10 lights in a office, plus ac/heating and 3 temperature. That was it's original function. Now the modify to control over 50 lights, Two ac/heating system, 7 temperature sensors ad now vents for opening and closing them. Way overkill for that single controller. But the owner wanted everything on one system. Top it all off it has ethernet for remote, Leds, and alarm speakers incase something happens.

If they have nothing in common, no interact

If You draw a logic block diagram showing what the task is, it would help us.

@Railroader actually they can interact with each other either through serial, i2c or SPI.

Try a Mega. 50+ I/O there.

That sounds perfectly doable on one processor. Just choose one that has the ports and other interfaces that you need. Only if you are really sure such a device does not exist should you consider a second processor.

@Railroader Well these plc controllers are prebuilt. I can' put a mega into that box. Going to change it soon. For now they have a temporary system holding them over.

@PerryBebbington I know one processor is more then enough. This is just got me curious to see if keeping everything to one or having a dual processor would help or not.

Go for a suitable box?

Lots of information is missing and You receive time wasting guesses.

@Railroader might be but never wasting time. Getting opinions and feedback from the community for me is never a waste. I learn a lot here and hope in return.

But as for my question. I know each person is different. I was just curious if using a dual processor for a plc controller would help to split tasks off so a single processor wouldn’t get jammed up. Or keeping a single processor would be just fine as well.

Depends on what your PLC is doing.

If the main loop stretches out beyond 10 milliseconds then switch debouncing takes a long time and therefore the user interface feels sluggish. Even more annoying is a user interface with variable latency, sometimes quick, sometimes slow. The same applies to the display of information. Consistency is the key to a good user experience.

If you have to deal with large amounts of data that arrives in bursts at random times then a second processor may be essential so that other time sensitive tasks can carry on regardless.

By today's standard the ancient 16Mhz 328 is really slow. Unless you are doing something unusual or are using poorly written libraries then a more modern microcontroller can probably do everything and have CPU time to spare.

The Arduino ESP already has double cores...
One to do wifi, the other to do the main work...
You can make the other core do more.
And it has a system in place that can do the synchronization of tasks...
If you want to reinvent this all: have fun!

@josephchrzempiec
if I were you I would just change the AVR with an ESP32 development board. If you run out of ports, use SPI or I2C Portexpanders.

--> Use one Microcontroller.

When you need wired Ethernet - there is also an ESP32 + Ethernet. Here I have a short summary:
https://werner.rothschopf.net/microcontroller/202401_esp32_wt32_eth01_en.htm

@build_1971 @noiasca i can’t change the board from the case. It is heat spot welded to the case. I’m on Wednesday going to take a look at it better and see what is wrong with it.

The "correct" way to answer this question of whether or not a single processor (or a combination of processors) can perform everything that is required of it is to perform a Schedulability Analysis of your project. One of the most common (and easiest) methods is Rate Monotonic Analysis.

Rate-monotonic scheduling - Wikipedia