Arduino OPTA: how do we cook it?
Arduino is a name that everyone knows by now, it is a company, an all-Italian pride, which has revolutionized the world of DIY (Do It Yourself) with its UNO open-source microcontroller board, so famous that, as often happens, it confused with the manufacturer itself.
After becoming the company associated with DIY par excellence (for the record together with Raspberry), Arduino, for some time now, has decided to expand its field of interests with the PRO line, made up of boards and accessories designed for a professional use. They have a different manufacturing process and are equipped with high-performance ST processors.
The last born is OPTA, a micro-PLC, developed in collaboration with Finder, which contains Portenta H7, the princess of the PRO line.
On the official website it is presented as “The secure, easy-to-use micro-PLC with Industrial IoT capabilities, supporting Arduino programming experience and PLC standard languages.”
We therefore expect a control system with an IoT vocation. This is a common trend today among manufacturers who understand that connectivity is an enabler for the automation of the future.
Ok, the ingredients are all there: high performance hardware, consolidated experience on mbed, the well-known realtime operating system for microcontrollers, an industrial production and an industrial design; but the question that we industrial automation technicians ask ourselves is: what kind of fish is it? Which pond shall we take him to swim in? But above all, can we trust it?
Let's start by saying that there are never too many PLCs, technological competition is essential for product improvement and price leveling. Furthermore, I don't think Arduino wants to worry the big names in industrial automation, it simply says: starting today I'm here too, and therefore we, since we don't trust colored brochures, let's go see what game is taking hold.
OPTA is not the firstborn, Portenta Machine Control has been available for some time, it has the same hardware but richer I/O interface. It is very similar to an axis control card and can be mounted on a DIN rail too.
OPTA however is the first micro-PLC, pardon the pun, which resembles a PLC as we are used to seeing them. Here we see a Siemens LOGO 8 next to it, at the bottom instead I have inserted a Portenta H7 card.
The form-factor is that of an IP20 programmable relay, but, it is much more, it certainly does not have an innovative shape, but this probably helps to consider it a "member of the family".
The feeling is excellent, Finder has a long experience in the electromechanical components sector, it appears compact and robust, even the screws of the terminal blocks slide immediately well, and the LEDs are clearly visible. In addition to the CE declaration, it also has the certifications we expect from this type of product: ENEC, and is cULus Listed. In addition, for accessing the Cloud (WIFI model), it complies with the X.509 standard.
There are three versions of the product: LITE, 485 and WIFI. All are equipped with:
- 4 x 250 VAC / 10 A relays
- 8 x configurable digital or analog 0..10V inputs
- USB-C programming port
- Ethernet port on RJ45.
The 485 model, as the name explains, is equipped with an RS485 port; the WIFI model, in addition to the RS485 port, also has a WIFI and Bluetooth BLE module.
The three modules can be purchased directly from the official Arduino store for €122, €134, and €161, respectively.
This is the product link where you can find all the details, I prefer to dwell on other aspects.
So far everything we've seen, including the price, is quite in line with the competition, but an expert eye notices the first differences starting from the declared specifications.
Generally, associated with the micro-PLC, in addition to the electrical and interface characteristics, we sometimes find the maximum number of program steps, I have never read anything about the internal architecture or the host operating system.
For OPTA instead there is a detailed list of internal characteristics:
- MCU: STM32H747XI Dual ARM? Cortex?
- 1MB SDRAM
- 2MB Flash Memory
- 16 MB QSPI Flash
While not an open-source product, this makes us understand a lot about the vocation of this object.
The first article is very interesting, this MCU (Micro Controller Unit), produced by ST, is currently the top of the range, belongs to the High-Performance line, contains two completely independent cores also programmed separately.
I used it not too long ago and it has proven to be really strong.
In OPTA, the main core, Cortex M7 works at 480Mhz, the second core, often called coprocessor, has a frequency of 240Mhz.
Thanks to the new production processes, ST has managed to insert an infinite number of peripherals such as ADC, CAN, Ethernet, JPEG codec, DSP, hardware timers and much more, and on board there are Flash, RAM and Cache memories.
Its use is recommended for real-time applications with high performance, in the datasheet there is a hint of wearable, but with these consumptions I would be a bit cautious, for that use the L line is preferable.
As with all advanced ST chips, you must "choose" which peripherals to use via the internal matrix-bus, ultimately there just aren't enough pins to have everything exposed at once.
OPTA therefore has a respectable engine, the operating system is not declared, but since it contains Portenta H7 I have no doubts that it is mbed, a very performing and stable realtime OS.
Target
OPTA is a micro-PLC, so its typical use is that of small applications, however, thanks to the connectivity created with already existing base libraries, the possibility of using sketches in C++ and the firepower, in my opinion it is possible to manage even small applications but with a high degree of complexity.
Its competitors, for the same price, generally offer fewer options. Different speech for LOGO 8 by Siemens, which does not allow the same flexibility, but fits into the gigantic ecosystem of Total Integrated Automation, and in some cases, this can make the difference.
Return on the possibility of being able to manage C++ code; it is certainly not a common practice, but the on-board processor contains DSP instructions and a Floating Point Unit, programming it at a low level, it can allow the management of slope detection, filters, integral and derivative calculations for an accurate analysis of the analog signal, a lot things I’ve done in the past in ST (Structured Text), but the host CPU was a S71516, so let's talk about another world.
Think of them as things I don't need today, but they're there and "maybe I'll need them tomorrow."
Expansions
OPTA can manage Modbus communication, both TCP and RTU (for the 485 model). For a micro-PLC this is more than enough, but knowing the internal characteristics, the question arises: could it also manage a more "demanding" fieldbus, such as Ethernet/IP or even Ethercat?
The answer is up to Arduino, and will depend on its commercial choices, but from a strictly technical point of view, I think it's possible.
A deterministic fieldbus, such as Ethercat, even if on the master side, requires a dedicated communication processor. It is not credible to manage communication in a simple thread (even if realtime) or worse, in the main loop.
Here we have an MCU with two completely independent cores available, I would dedicate the M4 core to communication, given that its bus-matrix shows ethernet management with dedicated DMA; I would use The M7 core, on the other hand, for PLC runtime because it is faster, and has more RAM available.
On the right side there is a port called "Port for communication and connection of auxiliary modules", expansion modules will probably be presented in the future. That would be a great thing, but to date there is no more precise information on this.
Development System
OPTA can be programmed in two ways: using Arduino IDE or using Arduino PLC IDE. The first tool is the classic one used for all Arduino boards, it is essentially DIY-oriented, programming takes place via C++ by writing "sketches" to compile and load.
In my opinion, the former is not the most suitable "main" tool, because OPTA is not a general-purpose board but an object with a well-defined connotation, i.e., a PLC, so the natural way to proceed should be through a dedicated IEC61131-3 programming tool.
There is a sore point: today the Arduino PLC IDE is not yet able to manage OPTA, it will be soon, maybe when you read this article the version containing OPTA will have already been released; in this case also skip the paragraph "What I didn't like", because in my opinion it's the only drawback now.
However, PLC IDE works well with Portenta Machine Control and since the two objects share much of the hardware/software architecture, we can safely make an extrapolation.
Arduino PLC IDE is an integrated system that allows programs to be edited, compiled, downloaded, and debugged online. Even the management of decentralized peripherals, in this case via Modbus, takes place internally in graphical mode.
It is fully compliant with the IEC61131-3 standard and above all it is very simple and intuitive. We find all the things we expect, where they should be.
At the top are the toolbars and menus, on the left the hierarchical tree of the project, in the center the editor area, on the right the library manager and the catalog, and finally at the bottom the messages area and the symbol browse.
All already seen and therefore very reassuring.
The ladder editor, like all tools of this type, has its own way of managing contacts and their concatenation, don't expect TIA Portal, but all in all it's quite functional and you learn quickly.
As mentioned, there is also a built-in sketch editor for some C/C++ code.
A notable feature, present only in the most famous systems, is the management of libraries, this allows you to engineer the code and recover the reuse of functions. In my opinion it's not a trivial matter, with the frequent use of an object, having the possibility to isolate tested parts of code is fundamental. Furthermore, the system library is very rich, it also contains string management.
Two other very interesting features are the ability to make hot changes and advanced monitoring of signals using the oscilloscope.
With PLC IDE, therefore, it is possible to manage the entire life cycle of a project, from hardware configuration to monitor/debug.
Arduino PLC IDE is free, but to download the programs on the PLC, a lifetime license is required, which must be linked to the target device. However, its cost is very low, we are talking, to date, of €16.
What I didn't like
The double identity of PLC and DIY system is very interesting but today Arduino IDE is the only possible development tool. The connection with Arduino PLC IDE should have been available already in the product launch phase. The risk is that of scaring the "classic" audience, i.e., the control programmer who:
- Turns on the PLC.
- Launch the development system.
- Expect (today, 2023) the PLC to be recognized immediately.
- Writes its control program and downloads it to the CPU.
Second, it is good to have web pages dedicated to OPTA, however there are still too many interconnected links pointing to documentation shared with other objects.
I would see a few things (less is more), but all in the same place:
- Installation manual
- Programming manual
- Application Notes to be enriched in the future.
This, to a control programmer, would give the sensation of being faced with an immediately manageable product, because it conforms to one's habits. Makers thrive on communities and forums, professionals in the sector are not used to it, the few necessary things must be available all together to be downloaded and used in contexts without the Internet.
To be honest, very often, even the big Players come up with products that seem to be made by people who have never been in production, so we can forgive Arduino for this juvenile mistake, but it has to fill this gap quickly, and in my opinion I will have no problem doing it , all in all they are small things, it would be a shame to dismiss the main user for which this object is intended, because it is really interesting.
Conclusions
For those who already have a weakness for Arduino, OPTA is fantastic, it is the link between DIY and control programming, it is an object that can tackle complex problems or be used as a simple micro-PLC.
For those who are wary of seeing the word Arduino associated with an industrial context, I can only say that the pro line objects are "another thing", both for their design and for the components used: the ST processors are the top of the range, and we find them in prestigious applications such as Tesla, professional drone systems and even in electric scooters.
One last tip…
If you are an expert in the STM32 family and want to have some fun, I advise you only to avoid going too low playing with the bootloaders. The processor has its own default bootloader which in case of problems can be activated with a double click on the reset switch, however OPTA does not expose the JTAG connector, this means that in case of a "serious brick" it is not possible to connect a STLINK-V3 external programmer/debugger to reload everything, so the risk is having to send it for assistance. So be careful to stay within the Arduino IDE perimeter with the official mbed version.