cancel
Showing results for 
Search instead for 
Did you mean: 

How do I configure STM32-L476RG and use the Timer(Encoder Mode/PWM) in Matlab-Simulink?

MArvi.1
Associate II

Hi all,

I am trying to program and control a Reaction Wheel Inverted Pendulum in real-time with a STM32-L476RG board and a SimpleFOCShield using Simulink. But first, I wanted to see whether I can read the incoming encoder values in Simulink through the STM32-L476RG. I have installed the STM32 Support Packages, but it doesn't really fulfill my needs. For example, I want to read the values of an encoder or generate PWM with STM32 in Simulink, there are no blocks for the Timer, which has the encoder mode function. And I can't upload/connect the configuration of the pins from STM32CubeMX for the board I am using. I am quite new to STM32, so I am wondering if there are solutions/alternatives/suggestions to this?

Thank you very much.

0693W00000QKXrvQAH.png 

0693W00000QKXs0QAH.png

3 REPLIES 3

Simulink & Matlab are independent 3rd-party products - nothing to do with ST.

Also not widely used here, I suspect.

You really need to go to Mathworks support for help with their products:

https://uk.mathworks.com/support.html

"it doesn't really fulfill my needs"

So is there really any benefit in using it over the "normal" microcontroller development tools?

It's always going to be the problem with these "canned" solutions - when you want to do stuff that's a bit off their idea of the "usual" application...

MArvi.1
Associate II

Okay thank you for your answer.

vchilapu
Associate II

The Simulink Coder Support Package for STM32 is based on the ARM mbed. Since mbed does not have support for the Encoder, MATLAB/Simulink doesn't have a block for the same either. You can try connecting with MathWorks paid consulting for the same.