Digital Power Starter Kit 3 Firmware
dsPIC33C Buck Converter Voltage Mode Control Example

Public functions of the Power Converter Control driver. More...

+ Collaboration diagram for Functions:

Functions

volatile uint16_t v_loop_Initialize (volatile struct NPNZ16b_s *controller)
 Initializes controller coefficient arrays and normalization factors. More...
 
void v_loop_Reset (volatile struct NPNZ16b_s *controller)
 Prototype of the Assembly routine '_v_loop_Reset' clearing the NPNZ16b controller output and error histories. More...
 
void v_loop_Precharge (volatile struct NPNZ16b_s *controller, volatile fractional ctrl_input, volatile fractional ctrl_output)
 Prototype of the Assembly routine '_v_loop_Precharge' loading user-defined values into the NPNZ16b controller output and error histories. More...
 
void v_loop_Update (volatile struct NPNZ16b_s *controller)
 Prototype of the Assembly feedback control loop routine helping to call the v_loop controller from C-code. More...
 
void v_loop_PTermUpdate (volatile struct NPNZ16b_s *controller)
 Prototype of the alternate Assembly P-Term control loop helping to call the v_loop P-Term controller from C-code. More...
 

Detailed Description

Public functions of the Power Converter Control driver.

This is the detailed description of public API functions of the Power Converter Control driver listing all available public functions of each individual feedback loop object.

Function Documentation

◆ v_loop_Initialize()

volatile uint16_t v_loop_Initialize ( volatile struct NPNZ16b_s controller)

Initializes controller coefficient arrays and normalization factors.

Parameters
controllerPointer to NPNZ Controller Data Object of type struct NPNZ16b_s

This function needs to be called from user code at startup once to initialize coefficient arrays and number normalization settings of the v_loop controller object.

Attention
This routine DOES NOT initialize the complete controller object. User-defined settings such as pointers to the control reference, source and target registers, output minima and maxima and further, design-dependent settings, need to be specified in user code.

Definition at line 107 of file v_loop.c.

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

◆ v_loop_Precharge()

void v_loop_Precharge ( volatile struct NPNZ16b_s controller,
volatile fractional  ctrl_input,
volatile fractional  ctrl_output 
)

Prototype of the Assembly routine '_v_loop_Precharge' loading user-defined values into the NPNZ16b controller output and error histories.

Parameters
controllerPointer to NPNZ16b data object of type struct NPNZ16b_s*
ctrl_inputuser-defined, constant error history value of type fractional
ctrl_outputuser-defined, constant control output history value of type fractional

This function loads user-defined values into NPNZ16b controller output and error histories where the parameters ctrl_input and ctrl_output will written to the entire delay line of the filter emulating a pre-existing steady state operation under the user defined conditions.

+ Here is the caller graph for this function:

◆ v_loop_PTermUpdate()

void v_loop_PTermUpdate ( volatile struct NPNZ16b_s controller)

Prototype of the alternate Assembly P-Term control loop helping to call the v_loop P-Term controller from C-code.

Parameters
controllerPointer to NPNZ16b data object of type struct NPNZ16b_s*

This function has been added as extension function supporting the development process, introducing an alternative control loop able to replace the conventional compensation feedback loop with a simple P-Term controller, allowing users to perform measurements of the plant transfer function. To use this function, users may replace the default compensation feedback loop function call v_loop_Update by v_loop_PTermUpdate to perform the measurement.

This additional controller seamlessly fits into the controller data interface by using the same NPNZ16b_s data structure and does not need additional configuration or initialization.

Attention
THIS CONTROLLER IS USED FOR MEASUREMENTS OF THE PLANT TRANSFER FUNCTION ONLY. THIS LOOP IS BY DEFAULT UNSTABLE AND ONLY WORKS UNDER STABLE TEST CONDITIONS. DO NOT USE THIS CONTROLLER TYPE FOR NORMAL OPERATION

◆ v_loop_Reset()

void v_loop_Reset ( volatile struct NPNZ16b_s controller)

Prototype of the Assembly routine '_v_loop_Reset' clearing the NPNZ16b controller output and error histories.

Parameters
controllerPointer to NPNZ16b data object of type struct NPNZ16b_s*

This Assembly function clears the NPNZ16b controller output and error histories by settings all elements of the delay lines to zero. This resets the controller to ist default state. This function should be called every time before the control loop is started from a disabled, unbiased output.

Note
Use function 'v_loop_Precharge' to start the feedback loop controller when the output is pre-biased.
+ Here is the caller graph for this function:

◆ v_loop_Update()

void v_loop_Update ( volatile struct NPNZ16b_s controller)

Prototype of the Assembly feedback control loop routine helping to call the v_loop controller from C-code.

Parameters
controllerPointer to NPNZ16b data object of type struct NPNZ16b_s*

This function is the main controller function which must be called at the control frequency from the control interrupt service routine. It calculates the most recent control error and processes it in the compensation filter computation after which the new result is written to the control output target. Runtime control is provided through the NPNZ16b data object status & control word.

Note
Available control options depend on the controller feature configuration. Please refer to the user guide for more detailed information.
+ Here is the caller graph for this function: