Main Content

H-Bridge

H-bridge motor driver

  • Library:
  • Simscape / Electrical / Semiconductors & Converters / Converters

  • H-Bridge block

Description

The H-Bridge block represents an H-bridge motor driver. The block has the following two Simulation mode options:

  • PWM — The H-Bridge block output is a controlled voltage that depends on the input signal at the PWM port. If the input signal has a value greater than the Enable threshold voltage parameter value, the H-Bridge block output is on and has a value equal to the value of the Output voltage amplitude parameter. If it has a value less than the Enable threshold voltage parameter value, the block maintains the load circuit using one of the following three Freewheeling mode options:

    • Via one semiconductor switch and one freewheeling diode

    • Via two freewheeling diodes

    • Via two semiconductor switches and one freewheeling diode

    The first and third options are sometimes referred to as synchronous operation.

    The signal at the REV port determines the polarity of the output. If the value of the signal at the REV port is less than the value of the Reverse threshold voltage parameter, the output has positive polarity; otherwise, it has negative polarity.

  • Averaged — This mode has two Load current characteristics options:

    • Smoothed

    • Unsmoothed or discontinuous

    The Smoothed option assumes that the current is practically continuous due to load inductance. In this case, the H-Bridge block output is:

    VOVPWMAPWMIOUTRON

    where:

    • VO is the value of the Output voltage amplitude parameter.

    • VPWM is the value of the voltage at the PWM port.

    • APWM is the value of the PWM signal amplitude parameter.

    • IOUT is the value of the output current.

    • RON is the Bridge on resistance parameter.

    The current will be smooth if the PWM frequency is large enough. Synchronous operation where freewheeling is via a bridge arm back to the supply also helps smooth the current. For cases where the current is not smooth, or possibly discontinuous (that is, it goes to zero between PWM cycles), use the Unsmoothed or discontinuous option. For this option, you must also provide values for the Total load series resistance, Total load series inductance, and PWM frequency. During simulation, the block uses these values to calculate a more accurate value for H-bridge output voltage that achieves the same average current as would be present if simulating in PWM mode.

Set the Simulation mode parameter to Averaged to speed up simulations when driving the H-Bridge block with a Controlled PWM Voltage block. You must also set the Simulation mode parameter of the Controlled PWM Voltage block to Averaged mode. This applies the average of the demanded PWM voltage to the motor. The accuracy of the Averaged mode simulation results relies on the validity of your assumption about the load current. If you specify that the current is Unsmoothed or discontinuous, then the accuracy also depends on the values you provide for load resistance and inductance being representative. This mode also makes some simplifying assumptions about the underlying equations for the case when current is discontinuous. For typical motor and bridge parameters, accuracy should be within a few percent. To verify Averaged mode accuracy, run the simulation using the PWM mode and compare the results to those obtained from using the Averaged mode.

Braking mode is invoked when the voltage presented at the BRK port is larger than the Braking threshold voltage. Regardless of whether in PWM or Averaged mode, when in braking mode the H-bridge is modeled by a series combination of two resistances R1 and R2 where:

  • R1 is the resistance of a single bridge arm, that is, half the value of the Total bridge on resistance parameter.

  • R2 is the resistance of a single bridge arm in parallel with a diode resistance, that is, R1 · Rd / ( R1 + Rd ), where Rd is the diode resistance.

External Power Supply

To model the demands placed on the DC supply, you can choose to expose the power supply ports of the H-Bridge block by setting the Power supply parameter to External. If the power supply ports are exposed, then only PWM simulation mode is supported.

Note

If the Power supply parameter is set to External, the block is able to figure out the load-side voltage offset by referencing to the supply rail voltages. However, if the supply rail connections are not exposed, you must add an Electrical Reference block on the load side.

Thermal Port

The block has an optional thermal port, hidden by default. To expose the thermal port, right-click the block in your model, and then from the context menu select Simscape > Block choices > Show thermal port. This action displays the thermal port H on the block icon, and adds the Temperature Dependence and Thermal Port parameters. These parameters are described further on this reference page.

When the thermal port is visible:

  • The heat generated by the bridge on-resistance and freewheeling diodes is added to the thermal port. The thermal port has an associated thermal mass and initial temperature that you can set from the Thermal Port parameters.

  • The bridge on-resistance and freewheeling diode resistance become functions of temperature. You can define the values for these resistances and the second measurement temperature from the Temperature Dependence parameters. Resistance is assumed to vary linearly between the two measurement temperatures. Extrapolation is used for temperatures outside of this range, except for when simulating in averaged mode with discontinuous load current characteristics.

Assumptions and Limitations

  • If you are linearizing your model, set the Simulation mode parameter to Averaged and ensure that you have specified the operating point correctly. You can only linearize the H-Bridge block for duty cycles that are greater than zero and less than the PWM signal amplitude. If you need to linearize around zero duty cycle, and if your controller always uses regenerative braking mode, set the Regenerative braking parameter to Always enabled (suitable for linearization).

  • In Averaged mode, and with the Unsmoothed or discontinuous choice for Load current characteristics, you must provide representative values for load inductance and resistance. If driving a DC Motor, then the resistance is the armature resistance, and the inductance is the sum of the armature inductance plus series smoothing inductor (if present). For a Universal Motor, total resistance is the sum of the armature and field windings, and total inductance is the sum of armature and field inductances plus any series smoothing inductance. For a Shunt Motor, MathWorks recommends that you draw a Thévenin equivalent circuit to determine appropriate values.

  • No forward voltage is modeled for the freewheeling diodes. They are approximated as ideal resistances when forward biased, with resistance equal to the Freewheeling diode on resistance parameter value.

  • If the supply rail connections are exposed, only the PWM simulation mode is supported.

Ports

Conserving

expand all

Electrical conserving port associated with the positive load connection.

Electrical conserving port associated with the negative load connection.

Electrical conserving port associated with the positive electrical supply connection.

Dependencies

This port is visible only when you select External for the Power supply parameter.

Electrical conserving port associated with the negative electrical supply connection.

Dependencies

This port is visible only when you select External for the Power supply parameter.

Electrical conserving port associated with the pulse-width modulated signal. The voltage is defined relative to the REF port.

Electrical conserving port associated with the floating zero volt reference.

Electrical conserving port associated with the voltage that controls when to reverse the polarity of the H-Bridge block output. The voltage is defined relative to the REF port.

Electrical conserving port associated with the voltage that controls when to short circuit the H-Bridge block output. The voltage is defined relative to the REF port.

Thermal port. For more information, see Thermal Port.

Parameters

expand all

Simulation Mode & Load Assumptions

Select one of the following options for the type of power supply:

  • Internal — The power supply ports are internal and not visible. This is the default option.

  • External — The power supply ports are exposed.

Select one of the following options for the type of output voltage:

  • PWM — The output voltage is a pulse-width modulated signal. This is the default option.

  • Averaged — The output voltage is a constant whose value is equal to the average value of the PWM signal.

Select one of the following options for the type of H-bridge dissipation circuit:

  • Via one semiconductor switch and one freewheeling diode — In this mode, the block controls the load by maintaining one high-side bridge arm permanently on and using the PWM signal to modulate the corresponding low-side bridge arm. This means that the block uses only one of the freewheeling diodes in completing the dissipation circuit when the bridge turns off. This option is the default.

  • Via two freewheeling diodes — In this mode, all bridge arms are off during the bridge off-state. This means that the block dissipates the load current across the power supply by two freewheeling diodes.

  • Via two semiconductor switches and one freewheeling diode — In this mode, the block controls the load by maintaining one high-side bridge arm permanently on and using the PWM signal to toggle between enabling the corresponding low-side bridge arm and the opposite high-side bridge arm. This means that the block uses a freewheeling diode in parallel with a bridge arm, plus another series bridge arm, to complete the dissipation circuit when the bridge turns off.

Dependencies

This parameter is visible only when you select PWM for the Simulation mode parameter, or when you select Averaged for the Simulation mode parameter and Unsmoothed or discontinuous for the Load current characteristics parameter.

Select one of the following options for the type of H-bridge dissipation circuit:

  • Depends on REV flag and current sign — This option is the default.

  • Always enabled (suitable for linearization) — This option can be used when the controller always sets the REV flag to ensure regenerative braking. It is useful if you need to linearize the model for control purposes, to ensure that the H-Bridge is linearizable around zero duty cycle demand.

Dependencies

This parameter is visible only when you select Averaged for the Simulation mode parameter.

Select one of the following options for the type of load current:

  • Smoothed — Assumes that the current is practically continuous due to load inductance. This option is the default.

  • Unsmoothed or discontinuous — Use this option for cases where the current is not smooth, or possibly discontinuous (that is, it goes to zero between PWM cycles). For this option, you must also provide values for the Total load series resistance, Total load series inductance, and PWM frequency parameters. During simulation, the block uses these values to calculate a more accurate value for H-bridge output voltage that achieves the same average current as would be present if simulating in PWM mode.

Dependencies

This parameter is only visible when you select Averaged for the Simulation mode parameter.

The total load series resistance seen by the H-bridge.

Dependencies

This parameter is only visible when you select Averaged for the Simulation mode parameter and Unsmoothed or discontinuous for the Load current characteristics parameter.

The total load series inductance seen by the H-bridge. As well as motor inductance, you should include any series inductance added external to the motor to smooth current.

Dependencies

This parameter is only visible when you select Averaged for the Simulation mode parameter and Unsmoothed or discontinuous for the Load current characteristics parameter.

The PWM frequency at which the H-bridge is driven. For consistency, this should be the same value as the PWM frequency specified by the Controlled PWM Voltage block driving the H-Bridge block.

Dependencies

This parameter is only visible when you select Averaged for the Simulation mode parameter and Unsmoothed or discontinuous for the Load current characteristics parameter.

The conductance of the reverse-biased freewheeling diode.

Dependencies

This parameter is visible only when you select External for the Power supply parameter or Averaged for the Simulation mode parameter and Depends on REV flag and current sign for the Regenerative braking parameter.

Input Thresholds

Threshold above which the voltage at the PWM port must rise to enable the H-Bridge block output.

Dependencies

This parameter is used only when Simulation mode, a Simulation Mode & Load Assumptions parameter, is set to PWM.

The amplitude of the signal at the PWM input.

Dependencies

The H-Bridge block uses this parameter only when the Simulation mode parameter on the Simulation Mode & Load Assumptions tab is set to Averaged.

When the voltage at the REV port is greater than this threshold, the output polarity becomes negative.

When the voltage at the BRK port is greater than this threshold, the H-Bridge block output terminals are short-circuited via the following series of devices:

  • One bridge arm

  • One bridge arm in parallel with a conducting freewheeling diode

Bridge Parameters

The amplitude of the voltage across the H-Bridge block output ports when the output is on.

Dependencies

This parameter is visible only when you select Internal for the Power supply parameter.

The total effective resistance of the two semiconductor switches that connect the load to the two power rails when the voltage at the PWM port is greater than the value of the Enable threshold voltage parameter on the Input Thresholds tab.

The total resistance in the freewheeling diodes that dissipate the current that flows through the motor when the voltage at the PWM port is less than the value of the Enable threshold voltage parameter on the Input Thresholds tab.

The temperature for which the resistance values on the Bridge Parameters tab are specified.

Dependencies

This parameter is visible only for blocks with exposed thermal port. For more information, see Thermal Port.

Temperature Dependence

The total effective resistance of the two semiconductor switches that connect the load to the two power rails (as described in the Total bridge on resistance parameter definition), quoted at the Second measurement temperature.

The total resistance in the freewheeling diodes that dissipate the current that flows through the motor (as described in the Total bridge on resistance parameter definition), quoted at the Second measurement temperature.

The temperature for which for which the resistance values on the Temperature Dependence tab are specified.

Thermal Port

Thermal mass associated with the thermal port H. It represents the energy required to raise the temperature of the thermal port by one degree. The default value is 100 J/K.

The temperature of the thermal port at the start of simulation.

Compatibility Considerations

expand all

Behavior changed in R2019b

Behavior changed in R2019b

Extended Capabilities

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

See Also

Introduced in R2008a