主要内容

DCDC Controller Parameters

R2026b

Compute controller parameters for DC-DC nonisolated converter voltage regulation

Since R2026b

  • DCDC Converter Controller block icon.

Libraries:
Power Converter Control with Motor Control Blockset / Control / DC-DC Non-Isolated

Description

Add-On Required: This feature requires the Power Converter Control with Motor Control Blockset add-on.

The DCDC Controller Parameters block computes discrete-time controller parameters for a DC-DC non-isolated converter voltage control loop. Use this block to generate the parameters needed to regulate output voltage for buck, boost, or buck-boost converter topologies.

The block computes parameters for two controller types.

  • PI Controller — Proportional-integral controller, which is suitable for most converter designs and provides straightforward gain tuning.

    Kp+Kis

  • Type-2 Compensator — Select if you need tighter control bandwidth or improved phase margin, particularly for converters with LC output filters that exhibit high-Q resonance. To shape the frequency response around the resonance, the Type-2 compensator adds an additional zero and pole to the loop.

    K(T1s+1)s(T2s+1)

The block provides three source modes for specifying converter parameters.

  • Compute from dialog parameters — Enter converter component values and operating conditions directly in the block parameters.

  • Compute from Input Ports — Supply the values through input signals, which is useful for gain scheduling or hardware-in-the-loop workflows where parameters change at runtime.

  • Custom Inputs — Bypass automatic gain computation and specify the controller gains directly through input ports.

To compute the gains, the block models how the converter output voltage responds to changes in duty cycle. To keep the loop stable, the block selects a crossover frequency (the frequency that sets how fast the controller responds) at a fraction of the switching frequency and below the natural resonance of the output filter. To achieve the target phase margin at that crossover frequency, the block sets the controller parameters.

The block outputs a controller parameters bus on the CtrlParams port. To close the voltage control loop, connect this port to the CtrlParams input of the DCDC Voltage Controller block.

The block supports DC-DC converters parameterized as shown in this table.

Converter TypeTopology
Buck

Boost

Buck-Boost

Examples

Ports

Output

expand all

Controller parameters for the voltage control loop, output as a bus. Connect this port to the CtrlParams input of the DCDC Voltage Controller block. The bus contains the following fields:

  • Kp — proportional gain of the controller

  • KiTs — integral gain multiplied by the sample time, used internally by the PI controller to implement the discrete integrator

  • KTs — compensator gain multiplied by the sample time, used by the Type 2 compensator

  • T1 — first time constant of the Type 2 compensator in seconds, placing a zero to boost phase margin

  • T2 — second time constant of the Type 2 compensator in seconds, placing a pole to attenuate high-frequency noise

  • InvT2 — reciprocal of T2, used internally by the compensator to compute the pole coefficient

  • Ts — controller sample time in seconds

  • CtrlType — numeric code identifying the controller type:

    • 1 — PI Controller

    • 2 — Type 2 Compensator

Data Types: bus

Input

expand all

Inductance of the converter power stage in henries, specified as a positive scalar. The block uses this value to model the inductor dynamics in the plant transfer function and compute controller gains appropriate for the converter LC filter. Set this to match the physical inductor value in your DC-DC converter power stage.

Dependencies

To enable this port, set Source to Compute from Input Ports.

Data Types: double | single

Capacitance of the converter output filter in farads, specified as a positive scalar. The block uses this value together with the inductance to determine the resonant frequency of the LC output filter, which influences the crossover frequency and phase margin of the designed controller. Set this to match the output filter capacitor in your DC-DC converter.

Dependencies

To enable this port, set Source to Compute from Input Ports.

Data Types: double | single

Rated output voltage in volts, specified as a positive scalar. The block uses this value as the operating point for linearizing the converter plant model. Set this to the nominal output voltage at which you want the controller gains optimized.

Dependencies

To enable this port, set Source to Compute from Input Ports.

Data Types: double | single

Rated output current in amperes, specified as a positive scalar. The block uses this value to define the nominal load condition for the plant model linearization. To ensure the gains are valid at full load, set this to the maximum continuous load current of your converter.

Dependencies

To enable this port, set Source to Compute from Input Ports.

Data Types: double | single

Rated input voltage in volts, specified as a positive scalar. The block uses this value together with the rated output voltage to compute the operating point duty cycle, which affects the small-signal plant gain. Set this to the nominal input supply voltage of your converter.

Dependencies

To enable this port, set Source to Compute from Input Ports.

Data Types: double | single

Controller sample time in seconds, specified as a positive scalar. The block uses this value to discretize the computed controller gains using the Tustin (bilinear) method. Set this to match the PWM switching period of your converter to synchronize the digital controller update rate with the switching frequency.

Dependencies

To enable this port, set Source to Compute from Input Ports.

Data Types: double | single

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Select PI for a proportional-integral controller. The PI controller is straightforward to tune and suitable for most DC-DC converter voltage loops. It provides zero steady-state error and adequate phase margin for converters with moderate LC filter resonance.

Select Type2 Compensator for a controller with one additional zero and one additional pole compared to a PI controller. The Type-2 compensator gives you independent control of the zero and pole frequencies, which lets you achieve tighter crossover bandwidth and improved phase margin for converters with high-Q LC output filter resonance. Use this option if a standard PI controller does not provide enough phase margin at the desired crossover frequency.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: CtrlType
Values: "PI" (default) | "Type2 Compensator"

Example: set_param(gcb,"CtrlType","Type2 Compensator")

Specify the source of controller parameter computation.

Select Compute from dialog parameters to enter the converter topology, component values, and operating conditions directly in the block dialog box. The block computes the controller gains automatically from these values.

Select Compute from Input Ports to supply the converter parameters through Simulink input ports instead of the dialog box. This option adds input ports for inductance, capacitance, rated voltages, rated current, and sample time. Use this option for gain scheduling or hardware-in-the-loop scenarios where converter parameters change at runtime.

Select Custom Inputs to bypass automatic gain computation and provide the controller gains directly. This option adds input ports for the gain values and exposes the gain parameters in the dialog box for manual specification.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: CtrlCalType
Values: "Compute from dialog parameters" (default) | "Compute from Input Ports" | "Custom Inputs"

Example: set_param(gcb,"CtrlCalType","Compute from Input Ports")

Select Buck for a step-downconverter where the output voltage is lower than the input voltage. The buck topology is the most common choice for point-of-load DC-DC regulators. Use this option if your application requires VOut less than Vin.

Select Boost for a step-upconverter where the output voltage is higher than the input voltage. Use this option if your application requires VOut greater than Vin, such as when driving a bus from a lower-voltage battery source.

Select Buck-Boost for a converter that can produce an output voltage either above or below the input voltage, or when the output polarity is inverted relative to the input. Use this option for wide input-range applications or if VOut is less or greater than Vin.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: ConvType
Values: "Buck" (default) | "Boost" | "Buck-Boost"

Example: set_param(gcb,"ConvType","Boost")

Inductance of the converter power stage in henries, specified as a positive scalar. The block uses this value to model the inductor dynamics in the small-signal plant transfer function for automatic gain computation. Set this to match the physical inductor value in your DC-DC converter power stage.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: L
Values: "0.0037" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"L","0.005")

Capacitance of the converter output filter in farads, specified as a positive scalar. The block uses this value together with the inductance to determine the LC resonant frequency of the output filter, which directly influences the computed controller crossover frequency and gain. Set this to match the output filter capacitor value in your DC-DC converter.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: C
Values: "1e-5" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"C","2e-5")

Sample time for gain computation in seconds, specified as a positive scalar. The block uses this value to discretize the controller gains computed from the dialog box parameters using the Tustin method. Set this to match the PWM switching period of your DC-DC converter to synchronize the digital controller update rate with the switching frequency.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Ts
Values: "50e-6" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Ts","100e-6")

Rated output voltage of the converter in volts, specified as a positive scalar. The block uses this value as the operating point for linearizing the plant model and computing controller gains. Set this to the nominal output voltage at which the converter is designed to regulate.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Vout
Values: "6" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Vout","12")

Rated output current of the converter in amperes, specified as a positive scalar. The block uses this value to define the nominal load resistance for the plant model linearization, which affects the computed loop gain. To ensure the gains provide stable operation at full load, set this to the maximum continuous load current of your converter.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Iout
Values: "2" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Iout","5")

Rated input voltage of the converter in volts, specified as a positive scalar. The block uses this value together with the rated output voltage to determine the operating point duty cycle, which scales the small-signal plant gain for controller design. Set this to the nominal input supply voltage of your converter.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Vin
Values: "12" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Vin","24")

Proportional gain of the PI controller, specified as a positive scalar. The block uses this value to scale the instantaneous voltage error. Increasing this value improves transient response speed but can cause oscillation or instability if set too high. Use this parameter to directly set the proportional action if you want full manual control over the gains.

Dependencies

This parameter is visible when Source is set to Custom Inputs and Controller Type is set to PI.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Kp
Values: "0.1" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Kp","0.2")

Integral gain of the PI controller, specified as a positive scalar. The block uses this value to scale the accumulated voltage error, which drives the steady-state error to zero. Increasing this value eliminates steady-state error faster but can cause overshoot or instability if set too high.

Dependencies

This parameter is visible when Source is set to Custom Inputs and Controller Type is set to PI.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Ki
Values: "10" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Ki","20")

Gain of the Type 2 compensator, specified as a positive scalar. The block uses this value to set the overall loop gain at the crossover frequency. Increasing this value raises the loop gain at all frequencies, which can speed up the transient response but reduces phase margin. To meet your bandwidth and stability requirements, tune this value with the time constants T1 and T2.

Dependencies

This parameter is visible when Source is set to Custom Inputs and Controller Type is set to Type2 Compensator.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: K
Values: "10" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"K","15")

First time constant of the Type 2 compensator in seconds, specified as a positive scalar. The block uses this value to place a zero in the compensator transfer function that boosts the phase angle near the desired crossover frequency. To maximize phase margin, set T1 to cancel the dominant pole of the converter plant. For an LC output filter, this is typically approximately equal to the square root of L times C.

Dependencies

This parameter is visible when Source is set to Custom Inputs and Controller Type is set to Type2 Compensator.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: T1
Values: "1e-3" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"T1","2e-3")

Second time constant of the Type 2 compensator in seconds, specified as a positive scalar. The block uses this value to place a high-frequency pole in the compensator transfer function that attenuates switching noise above the crossover frequency. Set T2 smaller than T1 to roll off gain above the crossover frequency. A value of T2 equal to approximately T1 divided by 10 is a common starting point.

Dependencies

This parameter is visible when Source is set to Custom Inputs and Controller Type is set to Type2 Compensator.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: T2
Values: "1e-4" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"T2","2e-4")

Controller sample time in seconds, specified as a positive scalar. The block uses this value to determine the discrete update rate of the voltage control loop when you specify gains directly using Custom Inputs. Set this to value to 10 times of switching period.

Programmatic Use

To set the block parameter value programmatically, use the set_param function.

Parameter: Tsc
Values: "50e-6" (default) | positive scalar in quotes
Data Types: char | string

Example: set_param(gcb,"Tsc","100e-6")

Extended Capabilities

expand all

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced in R2026b