Functions of the second library layer. More...
Functions | |
volatile uint16_t | State_Initialize (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function resets the counters and conditional flag bits. More... | |
volatile uint16_t | State_Reset (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function resets the buck control operation by re-initiating the control mode, references and status bits. More... | |
volatile uint16_t | State_Standby (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function waits until all start-up conditions are met. More... | |
volatile uint16_t | State_RampUp (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function ramps up the voltage/input to its nominal value. More... | |
volatile uint16_t | State_Online (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function tunes the controller reference to the new user control reference level. More... | |
volatile uint16_t | State_Error (volatile struct BUCK_CONVERTER_s *buckInstance) |
If this function is called, the state machine is reset to INITIALIZE (URL=State_Initialize). More... | |
volatile uint16_t | SubState_PowerOnDelay (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function delays the startup until the Power-on Delay has expired. More... | |
volatile uint16_t | SubState_PrepareVRampUp (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function calculate and pre-charge PWM outputs with ideal duty cycle. More... | |
volatile uint16_t | SubState_VRampUp (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function ramps up the output voltage to its nominal regulation point. More... | |
volatile uint16_t | SubState_IRampUp (volatile struct BUCK_CONVERTER_s *buckInstance) |
This function is for the average current mode control where the output current is ramped up to nominal current. More... | |
volatile uint16_t | SubState_PowerGoodDelay (volatile struct BUCK_CONVERTER_s *buckInstance) |
In this function, a counter is incremented until the power good delay has expired. More... | |
Functions of the second library layer.
This is the detailed description of functions of the state machine of the buck converter device driver library.
uint16_t State_Error | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
If this function is called, the state machine is reset to INITIALIZE (URL=State_Initialize).
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
This function is a default anchor in case task list index #0 is ever called. This is the equivalent of a switch case "default".
Definition at line 363 of file dev_buck_opstates.c.
uint16_t State_Initialize | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function resets the counters and conditional flag bits.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
If the controller has not been run yet, the POWER ON and POWER GOOD delay counters are reset and all conditional flag bits are cleared. Status of power source, ADC and current sensor calibration have to be set during runtime by system check routines.
Definition at line 54 of file dev_buck_opstates.c.
uint16_t State_Online | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function tunes the controller reference to the new user control reference level.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
After soft-start and when state POWER_GOOD_DELAY has expired, the converter enters normal operation.
During normal operation the state machine scans the user reference setting. Once a change between the user reference setting and the most recent controller reference has been detected, the state machine will tune the controller reference to the new user control reference level in incremental steps, applying the same ramp slope as during soft-start.
While ramping the output voltage up or down, the BUSY bit will be set and any new changes to the reference will be ignored until the ramp up/down is complete.
Definition at line 315 of file dev_buck_opstates.c.
uint16_t State_RampUp | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function ramps up the voltage/input to its nominal value.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
After a successful state machine Standby, the state machine executes the RAMPUP mode. In this mode, the voltage/current ramps up to the nominal value.
Definition at line 225 of file dev_buck_opstates.c.
uint16_t State_Reset | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function resets the buck control operation by re-initiating the control mode, references and status bits.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
After successful initialization or after an externally triggered state machine reset, the state machine returns to this RESET mode, re-initiating control mode, references and status bits before switching further into STANDBY mode.
Definition at line 104 of file dev_buck_opstates.c.
uint16_t State_Standby | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function waits until all start-up conditions are met.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
After a successful state machine reset, the state machine waits in
STANDBY mode until all conditional flag bits are set/cleared allowing
the converter to run.
Definition at line 159 of file dev_buck_opstates.c.
uint16_t SubState_IRampUp | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function is for the average current mode control where the output current is ramped up to nominal current.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
This phase of the soft-start ramp is only executed in average current mode and will only take effect when the declared current limit is hit before the nominal voltage regulation point. In this case the outer voltage loop will clamp the current reference value and the state will be switched to IRampUp, where the clamping value of the voltage loop output is ramped up to the declared maximum current reference value. This additional state allows powering up the power converter against highly capacitive loads preventing overshoots caused by down-stream capacitor inrush currents or when the converter is used as battery charger, where this state will tune into the constant current charging mode.
Definition at line 313 of file dev_buck_substates.c.
uint16_t SubState_PowerGoodDelay | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
In this function, a counter is incremented until the power good delay has expired.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
In this phase of the soft-start procedure a counter is incremented until the power good delay has expired before the soft-start process is marked as COMPLETED. If option for driving a user-defined general purpose output (PG output) is enabled in proprietary user code, this pin will be set automatically.
Definition at line 363 of file dev_buck_substates.c.
uint16_t SubState_PowerOnDelay | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function delays the startup until the Power-on Delay has expired.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
After the converter has been cleared to get started, the power-on delay counter is incremented until the defined power-on delay period has expired.
Definition at line 50 of file dev_buck_substates.c.
uint16_t SubState_PrepareVRampUp | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function calculate and pre-charge PWM outputs with ideal duty cycle.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
After the POWER ON DELAY has expired, the ramp up starting point is determined
by measuring the input and output voltage and calculates the ideal duty ratio of the PWM. This value is then programmed into the PWM module duty cycle register and is also used to pre-charge the control loop output history. In addition the measured output voltage also set as reference to ensure the loop starts without jerks and jumps.
When voltage mode control is enabled, the voltage loop control history is charged, when average current mode control is enabled, the current loop control history is charged.
Definition at line 95 of file dev_buck_substates.c.
uint16_t SubState_VRampUp | ( | volatile struct BUCK_CONVERTER_s * | buckInstance | ) |
This function ramps up the output voltage to its nominal regulation point.
buckInstance | Pointer to a Buck Converter data object of type struct BUCK_CONVERTER_s |
This is the essential step in which the output voltage is ramped up by incrementing the outer control loop reference. In voltage mode the output
voltage will ramp up to the nominal regulation point. In average current mode the inner loop will limit the voltage as soon as the current reference limit is hit and the output is switched to constant current mode.
Definition at line 230 of file dev_buck_substates.c.