Efficient Microcontroller Peripheral Modeling

Microcontrollers play an integral part in controlling modern power electronic systems. Often, for system level simulations, the peripheral modules are simplified to improve overall efficiency. In this report, efficient modeling of high fidelity peripheral models is discussed and the advantages of simulating power electronic systems with these models have been investigated in detail using PLECS.

When modeling power controls at the system level with a circuit simulator such as PLECS, the focus is typically on modeling the algorithms, while models for Micro Controller Unit (MCU) peripherals are often idealized to improve overall simulation efficiency and speed. In fact, frequently, the Analog-to-Digital (ADC) peripheral modules are modeled as simple sample-and-hold blocks, and basic pulse generators are used for generating Pulse Width Modulation (PWM) waveforms. These simplified models have inherent limitations in comparison to the functionality provided by the real peripheral modules. As a result, the fidelity of the system model is substantially reduced and effects that are critical to the power controls may be lost or inaccurately simulated. Furthermore, the limited functionality provided by basic peripheral models may be insufficient to model advanced modulation and sampling techniques.

For example, typical PWM modules provide the flexibility to trigger start of conversion (SOC) of the ADC module at different events. For systems with high current or voltage ripple, this provides engineers the ability to sample the ADC inputs at a desired instance of the PWM waveform. Both the PWM and ADC modules can be used to trigger the control interrupt as would be done in the real system. Additionally, with high fidelity peripheral models (HFPMs) engineers can verify the effect of their PWM and ADC configuration on the overall system. It is therefore desirable to utilize detailed peripheral models to more accurately reflect the complex functionality offered by an MCU to facilitate the implementation of sophisticated control strategies. However, it is critical that such peripheral models are implemented in the most efficient fashion to ensure that their impact on simulation time is minimal.

To further illustrate the advantages of HFPMs, a current-controlled buck converter was developed along with a Type 0 ePWM and a Type 2 ADC peripheral module from Texas Instruments. The proposed implementation enables an efficient integration of these models into a system level simulation without limiting the PWM resolution or the supported functionalities.

Requirements

PLECS Blockset

  • PLECS Blockset 3.5 or newer
  • MATLAB 7.5 (R2007b) newer

PLECS Standalone

  • PLECS Standalone 3.5 or newer

Download

The documentation in PDF format can be downloaded here. You can download the example models for PLECS Blockset here and for PLECS Standalone here.

Categories: