I have a Single phase Inverter designed in simulink. The code starts as soon as the microcontroller gets powered up, Is there a option to trigger the whole thing after some GPIO trigger ?
So the flow will be, The microcontroller will wait after power up, as soon as the Gpio trigger the sine wave generation starts.
Adding the whole thing into a Sub-System and trigger it with a gpio is not working.

댓글 수: 6

Harsh Nahata
Harsh Nahata 2023년 9월 29일
Now, i put the Sine wave function to a Sub-system, and added a Function Call block,and triggering it with a GPIO Rising Edge interrupt. So far its working , there is no sine wave Pulses when microcntroller starts.
But the system works momentarily whenever there's a Rising edge interrupt on that GPIO pin.Then its stops, and the ePWM blocks output a Fixed duty cycle based on last received CMPA value.
Harsh Nahata
Harsh Nahata 2023년 9월 30일
I have added the model also for better understanding.
Gowtham
Gowtham 2023년 10월 4일
Hello Harsh,
I kindly recommend reaching out to MATLAB support to resolve the issue.
Harsh Nahata
Harsh Nahata 2023년 10월 5일
So Now i can start the Sinwave generation on a full bridge by using a Hardware GPIO Interrupt. So i just a wrote a basic funtion with some sin & gain blocks to generate 50HZ sine wave. Here's the how its designed.
  1. So the hardware Interrupt block trigger a constant to enable signal.
2.
That enable signal calls a Sine wave generation function & ePWM blocks of C2000 Processors.
3.
And here is the Sinewave generation block.
4. And here is the final result. As soon as the Rising edge(GPIO) interrupt (Yellow) hits the Microcontroller, The sine wave (50Hz Green) starts. Blue - PWM pulses for Mosfet.
5. But here is the catch or the issue i am facing.
As we can see ferom below picture the PWM pulses starts after around 30uS of the Hardware rising edge interrupt.
6.
But in another statup, we can see that it starting after 130uS later.
So my question is "How to make it uniform" ? So im every startup it starts after same time ?
Sayan
Sayan 2023년 10월 31일
Is not the varying time of starting the sinosoidal PWM due to the different values of reference sinosoidal signal at the time of interrupt ?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 C2000 Microcontroller Blockset에 대해 자세히 알아보기

질문:

2023년 9월 28일

댓글:

2023년 10월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by