Digital Power Starter Kit 3 Firmware  DM330017-3, Rev.3.0
dsPIC33C Buck Converter Peak Current Mode Control Example

Private functions of the application layer of the power control task. More...

+ Collaboration diagram for Private Functions:

Functions

volatile uint16_t appPowerSupply_ConverterObjectInitialize (void)
 This function initializes the buck converter device driver instance. More...
 
volatile uint16_t appPowerSupply_ControllerInitialize (void)
 This function initializes the control system feedback loop objects. More...
 
volatile uint16_t appPowerSupply_PeripheralsInitialize (void)
 This function is used to load peripheral configuration templates from the power controller device driver. More...
 
volatile uint16_t appPowerSupply_DataCapture (void)
 Captures runtime data not captured automatically by other firmware modules. More...
 

Detailed Description

Private functions of the application layer of the power control task.

The private functions of the power control application layer are used to configure the generic power controller device driver defined in dev_buck_typedef.h as well as to provide additional functions required by the specific hardware design.

Function Documentation

◆ appPowerSupply_ControllerInitialize()

volatile uint16_t appPowerSupply_ControllerInitialize ( void  )

This function initializes the control system feedback loop objects.

Returns
0=failure
1=success

This function allows the user to set up and initialize the loop configuration. This includes the following setup.

  • Initialize Default Loop Configuration
  • Set Controller Object of Voltage Loop
  • Configure Voltage Loop Controller Object
  • Configure controller input/output ports
  • Data Input/Output Limit Configuration
  • ADC Trigger Control Configuration
  • Data Provider Configuration
  • Cascaded Function Configuration
  • Initialize Advanced Control Settings
  • Custom Advanced Control Settings

Definition at line 255 of file app_power_config.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ appPowerSupply_ConverterObjectInitialize()

volatile uint16_t appPowerSupply_ConverterObjectInitialize ( void  )

This function initializes the buck converter device driver instance.

Returns
unsigned integer (0=failure, 1=success)

This function initialize the buck converter object status, reset the buck state machine, set reference values, clear the runtime data, initialize the switch node, and setup the feedback channels and start-up settings.

Definition at line 33 of file app_power_config.c.

+ Here is the caller graph for this function:

◆ appPowerSupply_DataCapture()

volatile uint16_t appPowerSupply_DataCapture ( void  )

Captures runtime data not captured automatically by other firmware modules.

Returns
unsigned integer (0=failure, 1=success)

Function appPowerSupply_DataCapture is used to capture runtime data from ADC inputs which are not used for direct control of the power supply but are required for fault management, system monitoring and/or communication.

Note
In peak current mode control the inductor current triggers a hardware comparator truncating the duty cycle asynchronously from the CPU time-base. This makes it impossible to track the average current using a ADC. Hence, an alternative way is chosen to track the converter output current by monitoring the peak current set by the feedback loop instead. A simple offset correction is used to estimate the average current by subtracting half of the inductor ripple current from the peak current value.

This method is not precise and refers to the nominal ripple current at specific input and output voltage. An improved implementation requires continuous monitoring of VIN and VOUT and the calculation of the current slew rate in each condition together with the most recent on-time. In this implementation, however, the simple estimation was considered 'good enough' to output the inductor current value on the LC display of the board.

Definition at line 263 of file app_power_control.c.

+ Here is the caller graph for this function:

◆ appPowerSupply_PeripheralsInitialize()

volatile uint16_t appPowerSupply_PeripheralsInitialize ( void  )

This function is used to load peripheral configuration templates from the power controller device driver.

Returns
0=failure
1=success

This function hand over the peripheral configuration to the buck converter driver

Definition at line 397 of file app_power_config.c.

+ Here is the call graph for this function:
+ Here is the caller graph for this function: