Is it possible to generate a PWM signal in a real-time model with a pulse width resolution smaller than the fixed time step of the model?

조회 수: 14 (최근 30일)
Hello,
I am developing a simulink real-time model that should output several PWM signals to control a series of servo motors. Since this is a real-time model, I have to use a fixed time step when executing the model and this is where I have encountered a problem. I need the PWM signal to have a resolution of about 10 microseconds. I have found that the only way to achieve this resolution is to likewise set the time step of the model to 10 microseconds. Unfortunately, running the model with this time step requires way to much processing power and is overloading my CPU.
Is there any way I can run my real-time simulink model with a more reasonable time step (0.01 to 0.001 second) and still generate a PWM signal with the pulses having a resolution of 10 microseconds?
Thanks!

채택된 답변

Dimitri MANKOV
Dimitri MANKOV 2022년 8월 12일
Hi Findlay,
Absolutely, this is possible, though you would probably not use the CPU of your target machine for this purpose. If you're using Simulink Real-Time, then you probably have Speedgoat hardware as well.
Speedgoat offers FPGA-based solutions for applications where a faster sampling frequency and signal post-processing are required, such as PWM generation and capture, quadrature encoding/decoding, protocols like I2C, SPI, etc. I highly encourage you to have a look at the code modules offered by Speedgoat for their FPGAs.
An alternative would be to use one of Speedgoat's Programmable FPGAs with HDL Coder to deploy your own algorithms to it.
I hope this is helpful!
Dimitri

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Hardware-in-the-Loop Simulation with Simulink Real-Time에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by