How to use the two feedback loop in C2000 Embedded coder in Simulink
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi all,
I'm using the Ti LAUNCHXL-28069M to run the PMSM motor using the SPI absolute encoder.
I used the "mcb_pmsm_foc_qep_f28069LaunchPad" example and modified it to do the position control of the motor as shown below.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1220162/image.png)
Serial comunication interface(SCI - A) and interrupt is used for the communication and interrupt is used for Serial RX and TX.(priority is 40 and 60).
The issue is that if I add one feedback loop for position control or speed control, it's working but if I used both feedback loops, Serial Receive values(PosRef_PU) does not enter (it keeps showing 0) and motor does not work.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1220167/image.png)
This is position control block
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1220172/image.png)
This is velocity control block.
I don't know why the controller does not work if I use the two closed loop control.
Could anyone please help me about this issue?
Sincerely,
1 Commento
MathWorks Motor Control Blockset Team
il 12 Set 2023
How fast you are running your SPI for reading position sensors? Ensure your ADC interrupt loop is not overrunning (consumes more than your interrupt time). Try to profile the execution time of interrupt loop and ensure sufficient eexcution time is left for speed controller and position controller.
If you find you are overrunning, limit your SPI read to low speed tasks (where you are not foreseeing major postion change).
Risposte (0)
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!