Bar Logo 3.8/7.6 kw Totem pole Demonstration Application (Part-No. (not specified))
 
Content
     
Loading...
Searching...
No Matches

Generated by the Microchip Digital Compensator Design Tool (DCDT). More...

#include <xc.h>
#include <stdint.h>
+ Include dependency graph for smps_control.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  SMPS_3P3Z_T
 
struct  SMPS_2P2Z_T
 
struct  SMPS_PID_T
 
struct  SMPS_Controller_Options_T
 
struct  XFT_SMPS_2P2Z_T
 

Functions

void SMPS_Controller3P3ZInitialize (SMPS_3P3Z_T *controllerData)
 
void SMPS_Controller3P3ZUpdate (SMPS_3P3Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
 
void SMPS_Controller2P2ZUpdate_HW_Accel (void)
 
void SMPS_Controller3P3ZUpdate_HW_Accel (void)
 
void SMPS_Controller4P4ZUpdate_HW_Accel (void)
 
void SMPS_ControllerPIDUpdate_HW_Accel (void)
 
void SMPS_Controller2P2ZInitialize (SMPS_2P2Z_T *controllerData)
 
void SMPS_Controller2P2ZUpdate (SMPS_2P2Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
 
void SMPS_ControllerPIDInitialize (SMPS_PID_T *controllerData)
 
void SMPS_ControllerPIDUpdate (SMPS_PID_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
 
void XFT_SMPS_Controller2P2ZUpdate (SMPS_2P2Z_T *controllerData, volatile uint16_t *controllerInputRegister, int16_t reference, volatile uint16_t *controllerOutputRegister)
 

Detailed Description

SMPS Control (Compensator) library interface header file.

Power Controller SMPS Control File

Definition in file smps_control.h.

Function Documentation

◆ SMPS_Controller2P2ZInitialize()

void SMPS_Controller2P2ZInitialize ( SMPS_2P2Z_T * controllerData)

Function: void SMPS_2P2ZInitialize(void)

Summary: This function clears the SMPS_2P2Z_T data structure arrays

Description: This function clears the SMPS_2P2Z_T data history structure arrays. It's recommended to clear the error-history and controller-history arrays before 2P2Z controller implementation.

Conditions: None. Input: SMPS_2P2Z_T* - This parameter is a pointer to a SMPS_2P2Z_T type structure Return: void Example: SMPS_2P2Z_T controller2P2Z; SMPS_Controller2P2ZUpdateInitialize(&controller2P2Z);

+ Here is the caller graph for this function:

◆ SMPS_Controller2P2ZUpdate()

void SMPS_Controller2P2ZUpdate ( SMPS_2P2Z_T * controllerData,
volatile uint16_t * controllerInputRegister,
int16_t reference,
volatile uint16_t * controllerOutputRegister )

Function: \ \

void SMPS_Controller2P2ZUpdate(SMPS_2P2Z_T* controllerData, volatile uint16_t* controllerInputRegister, int16_t reference, volatile uint16_t* controllerOutputRegister);

Summary: This function calls the SMPS_Controller2P2ZUpdate controller

Description: This function updates the 2P2Z controller and can be called as soon as the coefficients have been loaded into their arrays.

Conditions: Before the controller can be used, it has to be initialized. The data structure has to be filled by copying the pointers to the coefficient, error and controller history arrays to the structure and the physical clamping limits of the output value. In the function call pointers to the Input source register, reference value, and pointer to the output register need to be called. Input: SMPS_2P2Z_T * controllerData - This parameter is a pointer to a SMPS_2P2Z_T type structure

uint16_t* controllerInputRegister - This parameter is a pointer to the \input source register or variable being tracked by the 2P2Z (e.g. ADCBUF0).

int16_t reference - This parameter is a signed integer value that will be used by the controller as the feedback reference or set-point.

uint16_t* controllerOutputRegister - This parameter is a pointer to the Control loop target register of the calculated result(e.g. PDC1). Return: void Example: int16_t controlReference; SMPS_2P2Z_T controller2P2Z; SMPS_Controller2P2ZUpdate(&controller2P2Z,&ADCBUF0,controlReference,&PDC1)

+ Here is the caller graph for this function:

◆ SMPS_Controller2P2ZUpdate_HW_Accel()

void SMPS_Controller2P2ZUpdate_HW_Accel ( void )

Function: void SMPS_Controller2P2ZUpdate_HW_Accel( void );

Summary: This function calls the 2-Pole, 2-Zero compensator/controller.

Description: This function updates the duty cycle register (PDCx) once every function call. There are three options via the structure SMPS_Controller_Options_T which allows the user to select whether the trigger update is enabled. The options are as follows:

  1. No trigger option is selected.
  2. Trigger On-Time is selected:

    Trigger Register = PDCx/2 + Delay

  3. Trigger Off-Time is selected:

    Trigger Register = PDCx + (PTPER - PDCx)/2 + Delay

It's recommended to clear the error-history and controller-history arrays before 2P2Z controller implementation.

Conditions: For use with the new 'dsPIC33EPGS' parts that have the Alternate Working (Alt-W) register context features.

Input: None. Return: Void.

◆ SMPS_Controller3P3ZInitialize()

void SMPS_Controller3P3ZInitialize ( SMPS_3P3Z_T * controllerData)

Function: void SMPS_3P3ZInitialize( SMPS_3P3Z_T *controller_data )

Summary: This function clears the SMPS_3P3Z_T data history structure arrays

Description: This function clears the SMPS_3P3Z_T data history structure arrays. It's recommended to clear the error-history and controller-history arrays before 3P3Z controller implementation. Conditions: None. Input: SMPS_3P3Z_T * - This parameter is a pointer to a SMPS_3P3Z_T type structure Return: Void. Example: SMPS_3P3Z_T controller3P3Z; SMPS_3P3ZInitialize(&controller3P3Z);

◆ SMPS_Controller3P3ZUpdate()

void SMPS_Controller3P3ZUpdate ( SMPS_3P3Z_T * controllerData,
volatile uint16_t * controllerInputRegister,
int16_t reference,
volatile uint16_t * controllerOutputRegister )

Function: \ \

void SMPS_Controller3P3ZUpdate(SMPS_3P3Z_T* controllerData, volatile uint16_t* controllerInputRegister, int16_t reference, volatile uint16_t* controllerOutputRegister);

Summary: This function calls the SMPS_Controller3P3ZUpdate controller

Description: This function updates the 3P3Z controller and can be called as soon as the coefficients have been loaded into their arrays.

Conditions: Before the controller can be used, it has to be initialized. The data structure has to be filled by copying the pointers to the coefficient, error and controller history arrays to the structure and the physical clamping limits of the output value. In the function call pointers to the Input source register, reference value, and pointer to the output register need to be called.

Input: SMPS_3P3Z_T * controllerData - This parameter is a pointer to a SMPS_3P3Z_T type structure

uint16_t* controllerInputRegister - This parameter is a pointer to the \input source register or variable being tracked by the 3P3Z (e.g. ADCBUF0).

int16_t reference - This parameter is a signed integer value that will be used by the controller as the feedback reference or set-point.

uint16_t* controllerOutputRegister - This parameter is a pointer to the Control loop target register of the calculated result(e.g. PDC1). Return: void Example: int16_t controlReference; SMPS_3P3Z_T controller3P3Z; SMPS_Controller3P3ZUpdate(&controller3P3Z,&ADCBUF0,controlReference,&PDC1)

◆ SMPS_Controller3P3ZUpdate_HW_Accel()

void SMPS_Controller3P3ZUpdate_HW_Accel ( void )

Function: void SMPS_Controller3P3ZUpdate_HW_Accel( void );

Summary: This function calls the 3-Pole, 3-Zero compensator/controller.

Description: This function updates the duty cycle register (PDCx) once every function call. There are three options via the structure SMPS_Controller_Options_T which allows the user to select whether the trigger update is enabled. The options are as follows:

  1. No trigger option is selected.
  2. Trigger On-Time is selected:

    Trigger Register = PDCx/2 + Delay

  3. Trigger Off-Time is selected:

    Trigger Register = PDCx + (PTPER - PDCx)/2 + Delay

It's recommended to clear the error-history and controller-history arrays before the calling the 3P23 compensator/controller.

Conditions: For use with the new 'dsPIC33EPGS' parts that have the Alternate Working (Alt-W) register context features.

Input: None. Return: Void.

◆ SMPS_Controller4P4ZUpdate_HW_Accel()

void SMPS_Controller4P4ZUpdate_HW_Accel ( void )

Function: void SMPS_Controller4P4ZUpdate_HW_Accel( void );

Summary: This function calls the 4-Pole, 4-Zero compensator/controller.

Description: This function updates the duty cycle register (PDCx) once every function call. There are three options via the structure SMPS_Controller_Options_T which allows the user to select whether the trigger update is enabled. The options are as follows:

  1. No trigger option is selected.
  2. Trigger On-Time is selected:

    Trigger Register = PDCx/2 + Delay

  3. Trigger Off-Time is selected:

    Trigger Register = PDCx + (PTPER - PDCx)/2 + Delay

It's recommended to clear the error-history and controller-history arrays before the calling the 4P4P compensator/controller.

Conditions: For use with the new 'dsPIC33EPGS' parts that have the Alternate Working (Alt-W) register context features.

Input: None. Return: Void.

◆ SMPS_ControllerPIDInitialize()

void SMPS_ControllerPIDInitialize ( SMPS_PID_T * controllerData)

Function: void SMPS_PIDInitialize( SMPS_PID_T *controller_data )

Summary: This function clears the SMPS_PID_T data structure arrays

Description: This function clears the SMPS_PID_T data history structure arrays. It's recommended to clear the error-history and controller-history arrays before PID controller implementation.

Conditions: None. Input: SMPS_PID_T* - This parameter is a pointer to a SMPS_PID_T type structure Return: void Example: SMPS_PID_T controllerPID; SMPS_ControllerPIDUpdateInitialize(&controllerPID);

◆ SMPS_ControllerPIDUpdate()

void SMPS_ControllerPIDUpdate ( SMPS_PID_T * controllerData,
volatile uint16_t * controllerInputRegister,
int16_t reference,
volatile uint16_t * controllerOutputRegister )

Function: \ \

void SMPS_ControllerPIDUpdate(SMPS_PID_T* controllerData, volatile uint16_t* controllerInputRegister, int16_t reference, volatile uint16_t* controllerOutputRegister);

Summary: This function calls the SMPS_ControllerPIDUpdate controller

Description: This function updates the PID controller and can be called as soon as the coefficients have been loaded into their arrays.

Conditions: Before the controller can be used, it has to be initialized. The data structure has to be filled by copying the pointers to the coefficient, error and controller history arrays to the structure and the physical clamping limits of the output value. In the function call pointers to the Input source register, reference value, and pointer to the output register need to be called.

Input: SMPS_PID_T * controllerData - This parameter is a pointer to a SMPS_PID_T type structure

uint16_t* controllerInputRegister - This parameter is a pointer to the \input source register or variable being tracked by the PID (e.g. ADCBUF0).

int16_t reference - This parameter is a signed integer value that will be used by the controller as the feedback reference or set-point.

uint16_t* controllerOutputRegister - This parameter is a pointer to the Control loop target register of the calculated result(e.g. PDC1). Return: void Example: int16_t controlReference; SMPS_PID_T controllerPID; SMPS_ControllerPIDUpdate(&controllerPID,&ADCBUF0,controlReference,&PDC1)

◆ SMPS_ControllerPIDUpdate_HW_Accel()

void SMPS_ControllerPIDUpdate_HW_Accel ( void )

Function: void SMPS_ControllerPIDUpdate_HW_Accel( void );

Summary: This function calls the PID compensator/controller.

Description: This function updates the duty cycle register (PDCx) once every function call. There are three options via the structure SMPS_Controller_Options_T which allows the user to select whether the trigger update is enabled. The options are as follows:

  1. No trigger option is selected.
  2. Trigger On-Time is selected:

    Trigger Register = PDCx/2 + Delay

  3. Trigger Off-Time is selected:

    Trigger Register = PDCx + (PTPER - PDCx)/2 + Delay

It's recommended to clear the error-history and controller-history arrays before the calling the PID compensator/controller.

Conditions: For use with the new 'dsPIC33EPGS' parts that have the Alternate Working (Alt-W) register context features.

Input: None. Return: Void.

◆ XFT_SMPS_Controller2P2ZUpdate()

void XFT_SMPS_Controller2P2ZUpdate ( SMPS_2P2Z_T * controllerData,
volatile uint16_t * controllerInputRegister,
int16_t reference,
volatile uint16_t * controllerOutputRegister )
+ Here is the caller graph for this function: