Hi jack2,
The C2000 code generation uses a rate-monotonic scheduler in which only a single ISR is used to trigger the scheduler. In PLECS, this is referred to as the Base Task (or Default Task).
All other tasks must execute at an integer multiple of the Base Task rate. Internally, the scheduler maintains counters to determine when slower tasks should run, which is why the task periods must be integer multiples of the Base Task period.
The next question is how and when this ISR should be triggered. In power electronics applications, this is typically handled by a PWM, ADC, or timer peripheral. In PLECS, this is configured using a Control Task Trigger component.
Since only one ISR is used per CPU, only a single Control Task Trigger is allowed per CPU.
Based on your model, the controller is currently configured as follows:
- The PWM peripheral triggers an ADC start-of-conversion event at every overflow and underflow event.
- The ADC then converts all channels associated with that ADC module (for example, ADC channels 0–2 on ADC A in your model).
- Once all conversions are complete and the latest results are available for the controller, the ADC peripheral triggers the ISR.
- This occurs because the ADC peripheral Task port is connected to the Control Task Trigger block.
To run two converters, you need to decide how the control tasks should be synchronized.
Option 1: Control tasks synchronized to each converter’s PWM
If each converter’s control task must be triggered relative to its own PWM timing, then you will need a dual-core processor and should place each converter’s control algorithm on a separate CPU core.
This allows each core to have its own ISR trigger and enables each controller to execute at the desired point within its respective switching cycle.
For an example of this approach, please see the C2000 On-Board Charger demo model.
Option 2: Single ISR with multiple tasks
If precise synchronization to each converter’s PWM is not required (for example, if you are implementing voltage control with heavily filtered feedback signals), then a single ISR can be used.
In this case, you can utilize:
- multitasking, and
- the Task Frame component
to specify the execution rate of the second converter’s control algorithm relative to the Base Task.
Hope this helps!