The Buck Topology Power Conversion Middleware provides a solid solution to design power convertors easily.
The Power Conversion Middleware consists of the device-agnostic top-level API source code, the power conversion library source code, and the solution personality. The solution personality:
Assume the power converter instance is named in the ModusToolbox™ Device Configurator as 'myPwrConv':
Then, the simplest way to use myPwrConv is to use generated myPwrConv API:
The whole control loop including the regulator is generated by the personality. The control loop consists of:
To use the pre- or/and post-process callbacks, the callback itself should be declared in the application level, enable the corresponding feature in the PCC Controller tab:
and the callback name should be passed into the Device Configurator GUI:
To make these callbacks faster, they can be declared as inline functions in header file - in this case the header file name should be also passed into the Device Configurator GUI, as shown above.
And then in the myHeader.h:
In the Custom Control Loop mode:
To optimize the control loop timing, some ADC measurements can be performed not in the control loop ADC sequencer group, but in the separate scheduled ADC group (configurable in the PCC ADC tab):
which is being periodically triggered by the myPwrConv_scheduled_adc_trigger function. When the scheduled ADC group measurement is done - it rises interrupt which calls the scheduled user callback, which name also should be passed into the Device Configurator GUI:
And implemented in the application code:
Voltage control modulation mode - the simple PWM, where the pulse width is directly controlled by the 3P3Z regulator (in Infineon Control Loop mode). Supports both high resolution and regular resolution TCPWM modes (configurable in the PCC)
Peak-Current control mode is the advanced modulation method which consists of two loops:
The PwrConv middleware provides a simple ramp generator - the myPwrConv_ramp function to be called by a periodical event (e.g. some timer ISR/callback, the timing is important to be determined and stable):
The ramp generator updates the mtb_stc_pwrconv_ctx_t::ref value to always move towards the target value (see myPwrConv_set_target), using the calculated ramp step based on the Ramp update period and Ramp slope parameters configurable in the PCC:
The multiple interleaved conversion phases allows to divide a total power between multiple parallel power circuits (switches, inductors) for better heat dissipation, reliability, and power density of the converter. Also, in terms of EMC the multi-phasing method lowers magnitude and spreads the spectrum of both the electromagnetic emissions and the voltage/current ripples on power lines. The PwrConv Buck topology allow up to 4 phases (in both VCM and PCCM modes) controlled by the same FW regulator (configurable in the PCC)
The DMA HW blocks can be used to reduce the Control Loop ISR timing.
There is a possibility to arrange a DMA transfer from the ADC result register to RAM cell for each Control Loop ADC channel separately depending whether this channel data will be used in the Control Loop FW (callbacks) or for Hardware Protection only. This feature reduces the Control Loop execution by a number of CPU cycles needed to get data from the peripheral register.
The data transfer from mtb_stc_pwrconv_ctx_t::mod to the modulator (PWM/DAC) peripheral registers, this is primarily reasonable to use with Multi-Phase and PCCM modes, where to update more than one peripheral modulator register.
For high PWM switching frequencies and heavy control loops, when there might be not enough time to execute the control loop code within a single PWM period, the Control Loop Frequency Divider can be used, which is a HW counter for ADC (or DMA) triggers and produces Control Loop interrupt requests once per 2..5 PWM cycles.
For example, the PCC configuration:
Then interrupt shall appear on each 3rd PWM cycle:
For multiple instances with the same Control Loop periods, they may be started simultaneously with a specified control loop phase shift, to avoid the control loop ISR execution overlapping. In this case, use the 'Control loop phase shift' parameter:
in conjunction with a generated pwrconv_start() function (common for all the instances) instead of regular instance-based [instance_name]_start() functions:
For the Control Loop Frequency Divider usage, this phase shift value is distributed between the PWM initial counter and the Divider initial counter values, so that the entire Control Loop period is taking into account. For example, for two instances, with the same Fsw and Control Loop divider is 3, and the second 'Control loop phase shift' is Tctrl/2, the phase shift is 1.5 PWM cycle, so the fractional part (0.5) belongs to the PWM itself, and the integer part (1.0) belongs to the Divider initial value:
The ADC Limit Crossing Detection HW blocks are involved to perform the automatic HW protection of the power converter configurable for each ADC channel in the PCC:
Then, when the appropriate protection block is enabled and the measured voltage crosses the ADC Limit Crossing Detection threshold, the power converter PWM(s) (including blanking for PCCM and all multiphase phases) are killed by HW trigger signal from ADC. At the same time, a protection interrupt occurs, the converter is disabled by FW, and the fault callback is called, so the fault event can be processed by application FW:
| Version | Changes | Reason for Change |
|---|---|---|
| 2.1 | Title and Overview wording is updated in the documentation | Topology-specific clarification. |
| All the generated code is under the guard #if defined(COMPONENT_MW_MTB_PWRCONV) | Multi-project applications support. | |
| 2.0 | New features are added: Control Loop Frequency Divider, DMA usage, Hardware Protection | New features support. |
| Updated mtb_stc_pwrconv_t structure: avoid device-specific API call in the device-agnostic MW top-level API | Architecture improvement. | |
| Fixed the synchronous starting implementation: PCCM DAC output is enabled before starting | Defect fixing. | |
| The myPwrConv_set_target interface is changed for Infineon Control Loop mode: the 'targ' parameter's type from uint32_t (in millivolts) to float32_t (in volts). For Custom Control Loop mode it is uint32_t in counts | User friendliness improvement. | |
| For Custom Control Loop mode myPwrConv_mod_upd should be called to update the modulator value | Flexibility improvement. | |
| 1.0 | Initial version. |