I am conducting a NI-RT hardware in the loop experiment using MATLAB/Simulink and Carsim、Keil、Veristand. The controller is STM32H7R7L8HxH and the compilation software is Keil. My workflow is as follows: I use MATLAB/Simulink’s acados to generate an NMPC solver. The solver is integrated as an S function in the Simulink model, and NMPC is constructed as a mex file through Legacy Code Tool and wrapper files. The controller code is generated through Simulink Coder and the C file generated by acados (from c_generated_comode) is added to the Keil software for compilation.
I first compiled the source code in acados to obtain the ARM versions of libacados. a, libhpipm. a, and libblasfeo. a static libraries, and then added them to Keil for compilation. However, BLASFEO did not specifically optimize the ARM Cortex-M7 for STM32H7R7L8HxH, so I can only use the generic BLASFEO_TARGET=GENEIC.
There is no problem with PC simulation, and the solving time is also very low. However, for the analysis of hardware in the loop results, the control system solution severely timed out and mainly focused on the “QP backend”: inlier method iteration and KKT/Riccati solution.
My nmpc is set to: ocp. solver_options. qp_stolver=
get_optional(p,‘qp_solver’,‘PARTIAL_CONDENSING_HPIPM’);
My question is:
I have read a lot of information that in PC simulation, BLASFEO has X86 optimization, but it is not available on the controller board. Is this possibly a problem that leads to time-consuming solutions?
Is there any other method to optimize and accelerate the solution?
Or are these configurations fine and need to be modified to address the parameter configuration issue of STM32H7R7L8HxH in the corresponding Keil software?
I would greatly appreciate it if anyone could provide assistance!