Controller in the Loop

Controller in the loop (CIL) refers to a setup in which the implementation of a control algorithm is tested with a plant model that is implemented on the UltraZohm. This is useful to make sure that implemented algorithms work as intended before testing on real hardware. There are multiple possibilities to implement on-chip CIL on the UltraZohm are shown in the following.

Figure made with TikZ

Fig. 26 Plant model in PS, Control algorithm in PL

Implementing the plant model in the PS and the control algorithm in the PL 1 is depicted in Fig. Fig. Fig. 26. This approach offers easy implementation of discretized plant models in C code. However, the sample time is limited to the range of kilohertz. The PS has to handle the interrupt, read from PL registers, and write back to them, resulting in an overhead of approximately \(1 \mu s\) 2. Furthermore, the calculation time of the plant model increases for more complex or multiple plant models. Thus, this approach is favorable if the plant model is simple or the required sampling frequency does not exceed \(f_s=100 kHz\).

Figure made with TikZ

Fig. 27 Plant in PS, Control algorithm in PL

Fig. Fig. 27 shows the scheme that is recommended, which implements the plant model in the PL. Moving the plant model to the PL allows for higher sampling frequencies, frees the processor from calculating the model, and enables the emulation of more complex as well as multiple parallel plant models. Implementing IP-Cores on the FPGA is generally thought of as more challenging compared to writing code for the CPU. This is mitigated by using aMATLAB HDL Coder, allowing easy integration into the UltraZohm FPGA design.

Figure made with TikZ

Fig. 28 Control algorithm in PS and PL, Plant model in PL

Simulating the plant model in the PL can also be used for control algorithms which are mapped to the PS as well as the PL to improve the usable computational performance, as shown in Fig. Fig. 28.

Implemented PL Plant models

The following IP-Cores are intended to be used for CIL:

Sources

1
    1. Bin Khalid and E. Liegmann and P. Karamanakos and R. {Kennel, High-Level Synthesis of a Long Horizon Model Predictive Control Algorithm for an FPGA, PCIM, 2020

2
  1. Wendel and A. Geiger and E. Liegmann et al., UltraZohm - A powerful real-time computation platform for MPC and multi-level inverters, PRECEDE, 2019