cancel
Showing results for 
Search instead for 
Did you mean: 

STM32-MAT/TARGET External Mode - Slow update rates

MKain
Associate

Hi,

I´m trying to involve STM32 MCU´s within a rapid prototyping process using Simulink and have some problems regarding the external mode. I used code geneation and external mode with PLC´s and Simulink Desktop Real-Time so far and like the workflow very much.

First of all my setup:

  • Matlab/Simulink R2018b
  • CubeMX 5.6 
  • µVision V5.22
  • STM32-MAT/Target 5.6
  • STM32F3Dicovery Board

Basically, the entire toolchain (modelling, build, generate code, compile, flash, run) works fine and observing digital and analog inputs in external mode seems to behave as expected at first glance. But the problems raise when I tried to implement a closed loop control (aggressive PI controller + RC-Lowpass approx. 50ms time constant) running at 1ms sampling rate. Without external mode the control performs nicely, but when I connect Simulink the system output starts oscillating. For testing purposes, I tried to only show one digital on a Simulink-Scope with sufficient heap size and approx. 1MBaud serial communication speed.

From my point of view, this is caused by the implementation of the external mode by the STM32-MAT/Target. As far as I reconstruced the communication is based on UART_Transmit_IT, but after the transmit a while loop polls until a flag is set within the UART interput handler.

Perhaps I´ve misunderstood something, even if I worked through the HandsOn-PDF quite often.

Has anyone experience with external mode in fast closed loop applications and successfully logged signals?

Probably I´m facing a limitation of the external mode implementation or there is some workaround?

Thanks in andvance!

Best regards

Manuel

0 REPLIES 0