Menu

Can GRAMPC be implemented on STM32F427VIT6?

WenChao Xu
2023-04-10
2023-04-11
  • WenChao Xu

    WenChao Xu - 2023-04-10

    Hello everyone!

    I want to deploy the code generated by GRAMPC to the physical object with STM32F427VIT6 as the control chip. Is it possible to implement it? Also, I wonder if GRAMPC can describe a hybrid model, i.e. an ideal first-principles model plus a residual model described by a neural network?

    Thanks.
    Best regards,
    WenChao Xu.

     
  • Andreas Völz

    Andreas Völz - 2023-04-11

    Dear WenChao Xu,

    I think we have no experience with this specific chip, but GRAMPC had been implemented and tested on a Renesas RH850/P1M microcontroller which seems to have similar performance (CPU frequency of 160 MHz, 2 MB program flash and 128 kB RAM), see the journal paper in Optimization&Engineering.

    GRAMPC does not use code generation, but is a standalone program/library written in pure C code with no external dependencies. Therefore, if you have a C compiler for this chip available, then it should be possible to use GRAMPC. Note that GRAMPC supports single-precision floating point numbers and can work without dynamic memory allocation (see the topic fixed size in the manual).

    Regarding the hybrid model: GRAMPC requires the problem functions as well as their partial derivatives implemented in C code. If you can evaluate your neural network and its derivatives (analytical, algorithmic, numerical...) in C code, then you can use it in GRAMPC. We already used GRAMPC in combination with Gaussian process models and it worked as expected. If you program in C, then you can pass all neural network related data via the void-pointer userparam to the problem functions. If you program in C++, you can add the neural network as member variables to the class and access it in all problem functions.

    Best regards,
    Andreas Völz

     
    • WenChao Xu

      WenChao Xu - 2023-04-11

      Dear Andreas Völz,

      Thank you for your reply! Yep, I'm trying to test it on a real object for the first time. I'm going to take a look at the case you mentioned. thanks a lot for your help!

      Best regards,
      WenChao Xu.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.