Hi @Cuong,
Thanks for the detailed questions on your Buck converter setup — really good thinking on your part to question this. Let me go through everything clearly.
FIRST DOES SIMULTANEOUS ADC SAMPLING FORCE BOTH LOOPS TO RUN AT THE SAME RATE
No it does not. This is the most important thing to understand. The ADC sampling rate and the control loop execution rate are two completely separate things.
Your two ADC blocks (Voltage Vout_FB and Current I_FB) are both triggered by the same ePWM event, which just means fresh data for both signals is available every switching cycle. It does not mean you are forced to act on that data every cycle. The voltage loop is perfectly free to read a new Vout sample every cycle but only compute a new Iref every 10 cycles, for example. The data simply waits in memory until the voltage loop runs again. This is completely standard practice.
So simultaneous sampling does not contradict the 5–10x slower outer loop principle at all — in fact, it is the recommended approach. You always want the freshest possible data going into your controllers, regardless of how often each controller executes.
SECOND THE REAL PROBLEM IN YOUR CURRENT DIAGRAM
Looking at your Simulink model carefully, the issue is not the ADC — it is the single CLA_TASK block driving the entire model. Right now, both your Voltage PI and your Current PI sit inside that one task, which means they both execute every single PWM cycle at exactly the same rate. That is what is actually violating the cascade control principle, not the ADC setup.
The [Enable] signals you already have in the diagram are PWM output enable/disable signals — they are not doing anything to slow down the voltage loop execution, in case you were wondering about those.
THIRD THREE WAYS TO FIX THIS
Here are three practical options, ordered from simplest to most architecturally complete:
Option 1 — Software Decimation Counter (Simplest, no restructuring needed)
Add a counter inside your Voltage PI subsystem. The counter increments every CLA task execution, and the Voltage PI only computes a new Iref when the counter reaches your decimation target (e.g., every 10 cycles). Between updates, Iref simply holds its last value — this is called Zero-Order Hold behaviour and it is exactly what you want. The Current PI keeps running every cycle tracking that slowly changing Iref at full speed.
In C code this looks like:
static uint16_t volt_counter = 0;
static float32 Iref = 0.0f;
volt_counter++;
if (volt_counter >= 10) {
volt_counter = 0;
Iref = VoltagePIController(Vref, Vfb);
}
DutyCycle_PU = CurrentPIController(Iref, ILfb);
Option 2 — Split Voltage PI to CPU ISR (Cleanest architecture)
Move the Voltage PI subsystem out of the CLA task entirely and put it under a CPU timer interrupt running at the slower rate. The CLA handles the fast current loop every PWM cycle, the CPU handles the slow voltage loop at 1/10th the rate. Both ADCs still sample every cycle — nothing changes there. This is the cleanest approach because it uses the F2837x hardware exactly as TI intended: CLA for hard real-time fast tasks, CPU for supervisory slower tasks.
In Simulink this means placing the Voltage PI under a Hardware Interrupt block configured to a CPU timer, separate from the CLA_TASK.
Option 3 — Rate Transition Block in Simulink (Best for simulation fidelity)
Set the Voltage PI subsystem sample time to N times your switching period, set the Current PI to the base switching period, then insert a Rate Transition block on the Iref signal line between the two. Enable "Ensure data integrity during data transfer" in the Rate Transition block parameters. In your model Configuration Parameters, go to Solver and enable "Treat each discrete rate as a separate task" — this schedules both loops as genuinely separate tasks in the generated code.
You can verify this is set up correctly by right-clicking the canvas, going to Sample Time Display, and selecting Colors. Your two PI subsystems should appear in two different colours, confirming they are running at different rates.
OFFICIAL MATHWORKS REFERENCE
MathWorks actually has an official reference model for exactly your situation. It is called f28379D_DCDC_Buck_CLA.slx and it implements Average Current Mode Control on the F28379D using the CLA. I strongly recommend opening it and comparing its CLA task partitioning against your own diagram — it will make the recommended architecture immediately clear.
You can find it by running this in MATLAB:
openExample('c2b/DCDCBuckConverterExample','supportingFile','f28379D_DCDC_Buck_CLA.slx')
QUICK SUMMARY
* Simultaneous ADC sampling does NOT force the same loop execution rate — this is fine
* Your real issue is both PI controllers sharing one CLA_TASK running at the same rate
* The [Enable] tags in your diagram are PWM enable signals, not loop rate control
* Recommended fix: start with the decimation counter approach (Option 1) as it requires the least restructuring
* For a cleaner long-term architecture: move Voltage PI to a CPU ISR (Option 2)
* Check the official MathWorks f28379D_DCDC_Buck_CLA.slx reference model
Hope this clears everything up.