Important Question Processor In the Loop Application using C2000 Embedded Coder
11 views (last 30 days)
Show older comments
burak caykenari on 22 Sep 2020
Answered: Aditya Padmanabha on 18 Oct 2021
I want to make PIL implementation using Matlab C2000 embedded coder
I successfully read EPWM value duty cycle(cmpa and time counter value ) according to this value I generated PWM on simulation beside on the Launchpad pin using EPWM. No problem here.
But I realized that there is no any input of the ADC block . According to PIL application voltage is getting from the voltage divider of plant circuit like a buck converter etc. But ADC block only accept the value via pin of the launchpad or microcontrollers.
For this reason I didn’t get the voltage value from the voltage divider circuit and insert it to ADC block. I want to implement this condition . I don’t want modeling a ADC block using matlab blocks , I want to use C2000 ADC block in order to analyze as if real value getting from voltage divider and adc makes sample,hold,quantization processes like a real application.
This is successfully done by PLECS like following figures;
You could see the simulation values(sensed values) enter the ADC block.
The inside of the adc block as follows;
this is an ADC type the way i want it to use my matlab PIL application(processor in the loop) . But as I mentioned above
The ADC block does not have no inputs in MATLAB like an ADC block have inputs as in the PLECS.
I don’t want to use PLECS because of the PIL modeling and out file creating difficulties(need to design some codes using code composer studio)
Compared to PLECS, Matlab out file generation and interface more simpler.
1-Do you have any works on this topic?
2-Are there any methods you can suggest?
3- Will there be an improvement in this issue in the matlab c2000 embedded coder infrastructure in the coming years?
Venkatesh Chilapur on 1 Oct 2020
Here are list of examples that makes use of the SOC blockset that help one simulate the ADC, ePWM, IPC blocks...
- Get Started with SoC Blocks on MCUs: https://www.mathworks.com/help/soc/ug/get-started-with-soc-blocks-on-mcus.html
- Integrate MCU Scheduling and Peripherals in Motor Control Application: https://www.mathworks.com/help/soc/ug/integrate-mcu-scheduling-and-peripherals-in-motion-control.html
Aditya Padmanabha on 18 Oct 2021
Answer posted in comments https://www.mathworks.com/matlabcentral/answers/597754-important-question-processor-in-the-loop-application-using-c2000-embedded-coder#comment_1021210
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!