One of the aims of the HAPIWEC project is to provide the user with the ability to visually create a controller structure and have that structure coded into a digital controller in a remote location with the push of a button. Recent advances in cloud computing have made this possible without much difficulty. Let’s see why.
Simulink Embedded Coder generates readable, compact, and fast C and C++ code for embedded processors, for Simulink models, MATLAB functions, and Stateflow charts. It supports a wide variety of Simulink add-on products, including the Control System Toolbox. We use this to create executable code for the Broadcom BCM2711 SoC processor, which is used in the HAPiWEC project as a communications and real-time controller system for the high-level controller of the OSPREY prototype. Using Simulink Embedded Coder, a local user can quickly deploy a control program on the SoC connected locally to the user’s PC. However, this would mean that a remote user seeking to deploy a control system would need to gain remote access to the PC connected to the SoC using a remote desktop application. Although this would work as a crude option to enable remote connectivity for users, the HAPiWEC team decided to look for a more elegant solution, one that does not require a local PC or a remote connection to it to program, execute, and monitor the control system in a remote laboratory.
Simulink Online was launched in 2021, amid the Covid-19 pandemic. This cloud-based version of Simulink allowed users to create and simulate models in their web browser. The online version of Simulink includes most of the standard toolboxes of its desktop counterpart, notably the Simulink Embedded Coder toolbox. With the proper configuration and using the Wi-Fi module of our SoC system, we paired our local Broadcom BCM2711 SoC processor with an online Simulink session using the internet. In this way, when a user a controller designed in Simulink online, the executable is transmitted and launched in our local target. It is as if the user’s PC had always been connected to the local controller! However, this solution is not complete since it provides only one-way communication to the experiment, from the remote user to the SoC. If we want to monitor the controller’s performance during execution and command setpoint changes, bidirectional communication between the user and the SoC is needed.
During execution, the control program produces real-time data that can be used to monitor the performance of the controller and other digital processes within the control system. This includes the inputs, signal processing, controller output, and the states or flags of the program. Trying to provide a remote user with all this information in real time over the internet requires specialized communication protocols designed for the hardware and communication platforms used in the project. These are not within the expertise of our group, nor within the remit of our project. Nevertheless, the HAPiWEC team has found an efficient and cost-free solution to enable bidirectional communication between the user and the experiment during the test. This solution involves using “data snapshots” that are sent to the user once per second. These snapshots can contain either a single data point that can be visualized in a meter or an array of several contiguous data points that can be plotted. By selecting the amount of contiguous data to be sent in the snapshot and the “trigger” to capture this data, the user can judge the performance of any digital system within the controller at a refresh rate of 1 second. Furthermore, the user has several channels (up to 8) to visualize and plot different data, and 8 single data point inputs to visualize values of status flags. To get the data, it will be as easy as adding a digital probe to the user’s Simulink model from the HAPiWEC Simulink library. The digital probes are small Simulink subroutines that use the MQTT communication protocol to send data across the internet via an MQTT broker. The HAPiWEC project has selected a reliable (and free!) MQTT broker for this purpose.
Finally, the remote user will be provided with a graphical user interface where the data can be visualized. The graphical user interface contains all the code to receive the MQTT data from the internet, and this will be usable without any configuration from the user. The only requirement is that the user has a stable internet connection. The graphical user interface is also capable of sending data to the experiment (for example, a setpoint change or a trigger level for data capture). This data will arrive at the experiment via the “user input” blocks from the HAPiWEC library that the user can add to their Simulink programs.
The participants of the OCEAN2023 conference in Limerick had the chance to test the beta version of our bidirectional communication solution for remote experiments. If you were among those who tried it, chances are you won a FloWave rubber duck.