Simulation is essential in any engineering field. It is common to use tools like LTSpice or QSpice to simulate electronic circuits before they are built. Regarding the software developers, they execute unit tests in order to verify that the code works as they expected, but in the end, when they need to test the software together with the hardware, there are a few options. The most used is cosimulation, but usually, the tools to perform this kind of simulation are expensive. In addition, since in this case, we are executing two simulations simultaneously, software and hardware, the times required by these simulations are quite long. Also, in this case, even if we are simulating all together, the response of the system, simulating, for example, interfaces with other devices is impossible, because the simulation is not executed in real-time. Is here, in this case where hardware-in-the-loop simulations become the best option.
HIL devices are a kind of hardware accelerator for simulations. In addition, they can include a sort of digital and analog inputs and outputs that allow the device to be connected to the real control board. In the next image, you can find the basic structure of the board designed for this project. We can see an FPGA, where the simulation is executed, with two digital-to-analog converters that give us up to 16 analog outputs, and 12 digital inputs. This set of digital inputs and analog outputs is not trivial. This board is designed to simulate power electronic converters, so it will need digital inputs for the PWM signals, and analog outputs for the control of the power stage.
The device-under-test (DUT) in this case is integrated in the same board using sockets. This device admits as DUT:
- Arduino MKR/Portenta
- Raspberry PI Pico 1/2
- TI launchpad.
The FPGA used is a Spartan7 with the package FTGB196. This package allows us to use from 6k LUTs FPGA to 50k LUTs.
Let's make an analysis of the differents elements of the board.
Power SupplyOne of the most important parts of FPGA boards is the power supply. FPGAs are complex devices that need at least three different voltages for IO (3v3), Core (1V0) and internal peripherals (1V8). In this board I used the TLV62565 from TI to generate the three independent voltages.
The 3V3 power supply is also used for the analog side of the board.
Analog outputsAs I mentioned before, the board features two digital-to-analog converters (DAC) with 8-ch each. The DAC used is the AD5328 from Analog Devices.
Each analog output is buffered with an operation amplifier configured as follower. Also, a low-pass filter is added. This low-pass filter, besides limit the frequency band of the output, since it has a series resistor, also limits the current of the system to 3mA per channel.
The DAC reference is connected to voltage reference IC REF2030, a 3 volt reference from TI.
FPGAThe core of the system is the FPGA. The device I used in the schematic is the XC7S25 with the package FTGB196. This package is 1mm pitch, so it is easy to route with a 4-layer board.
The configuration of the start-up of the FPGA is made with this 6 resister, of which just three are connected to force the QSPI configuration.
The board includes a RP2040 as a platform manager. This microcontroller from Raspberry PI is excellent for this task because it can be connected to an SD card, and a USB so we can send and store models in the SD card. Also, the RP2040 is connected to the configuration pins of the FPGA, so it can configure the FPGA with the corresponding model.
As I mentioned before, the 1mm pith of the FTGB196 package allow us to route the board with just 4 layers. here you can find the routes below the FPGA.
In the next image you can see the sockets for the different DUTs admitted as well as the RJ45 connectors added for debugging.
Here you can see a 3D view of the board generated with KiCad.
Finally, the board with an Arduino MKR as a controller.
The Platform Board is open-source, so you can use the output files to manufacture your own in JLCPCB. You just need to compress the production_files
directory of the repository and upload it to JLCPCB.
Remember to change the Surface Finish to LeadFree HASL to make your board ROHS compliant.
In a few days, you will receive your board at home.
Comments
Please log in or sign up to comment.