H-Bridge
H-bridge motor driver
Libraries:
Simscape /
Electrical /
Semiconductors & Converters /
Converters
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: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.
Model Thermal Effects
This block has one optional thermal port. To control the visibility of the thermal port, set the Modeling option parameter to either:
No thermal port
— The block does not contain a thermal port.Show thermal port
— The block contains one thermal conserving port.
When you expose the thermal port:
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.
Examples
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 toAlways enabled (suitable for linearization)
.In
Averaged
mode, and with theUnsmoothed 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.